#K3701. Smallest Possible Maximum

    ID: 25881 Type: Default 1000ms 256MiB

Smallest Possible Maximum

Smallest Possible Maximum

You are given a sequence of integers. You are allowed to perform an operation any number of times which may change some elements of the sequence, but it turns out that no matter how you operate, the smallest possible maximum value you can achieve is the original maximum among the elements.

Your task is to determine this smallest possible maximum integer.

Note: Although the problem statement mentions an operation, analysis shows that the answer for each test case is simply the maximum element of the sequence.

Input: The input begins with an integer T (number of test cases). For each test case: the first line contains an integer N (the number of elements), and the second line contains N space‐separated integers representing the sequence.

Output: For each test case, output a single line containing the smallest possible maximum integer (which is the maximum element in the sequence).

The mathematical formulation is as follows:

[ \text{Answer} = \max{B_1, B_2, \dots, B_N} ]

inputFormat

The input consists of multiple test cases. The first line contains an integer \(T\) (\(1 \le T \le 10\)). Each test case is described as follows:

  • The first line contains an integer \(N\) (\(1 \le N \le 10^5\)).
  • The second line contains \(N\) space-separated integers \(B_1, B_2, \dots, B_N\) (\(1 \le B_i \le 10^9\)).

outputFormat

For each test case, print a single line with one integer — the smallest possible maximum that can be achieved, which is equal to \(\max\{B_1, B_2, \dots, B_N\}\).

## sample
2
1
1
1
100
1

100

</p>