Swimming

Roger is participating in a programming competition at his university in
Barcelona. However, summer is approaching and Roger would much rather go
to the beach with his friends than sit in front of a computer all day.
Instead of trying to solve the problems, Roger starts thinking about
what he will do at the beach when the competition ends.

The first thing Roger will do when he arrives at the beach is go
swimming. The beach is divided into several areas, and Roger prefers to
swim in an area with few other people. Which area should Roger go to?

Input

An integer 1 ≤ N ≤ 1000 denoting the number of test cases. For each test
case, an integer 1 ≤ A ≤ 10000 denoting the number of areas on the
beach, followed by A integers K₁, …, K_(A) denoting the number of people
in each area.

Output

For each test case, a single line with an integer representing the area
with the fewest people. In case of ties, output the smallest such
integer.

Problem information

Author: Anders Jonsson

Generation: 2026-01-25T21:46:41.758Z

© Jutge.org, 2006–2026.
https://jutge.org
