#CF2236A. 火车上的游戏 / A. Games on the Train

火车上的游戏 / A. Games on the Train

A. Games on the Train

Source: Codeforces 2236A
Contest: Codeforces Round 1103 (Div. 3)
Time limit: 1 second
Memory limit: 256 megabytes

Statement

Dabir, Egor, and Arseniy just got on the train and decided to play a game. Dabir has a backpack with an infinite number of cubes. He built nn towers from them, where the ii-th tower has height hih_i cubes.

Egor and Arseniy must choose an integer xix_i for each tower ii and increase its height by xix_i exactly once. For example, if hh = [1,3,2,21, 3, 2, 2], xx = [3,2,2,83, 2, 2, 8], then after increasing hh it will become [4,5,4,104, 5, 4, 10]. Their goal is to make the heights of all towers equal.

To make the game more interesting, Dabir wants to choose an integer kk and add a restriction: each xix_i must satisfy 1xik1 \le x_i \le k. Help him find the smallest kk for which it is possible to finish the game.

Input

The first line contains a single integer tt (1t1041 \le t \le 10^4) — the number of test cases.

Then tt test cases follow.

The first line of each test case contains a single integer nn (1n51 \le n \le 5).

The second line contains nn integers h1,h2,,hnh_1, h_2, \dots, h_n (1hi61 \le h_i \le 6).

Output

For each test case, output a single integer — the minimum value of kk such that it is possible to make all towers have equal height.

Examples

4
2
1 3
3
2 6 4
5
5 4 6 6 1
4
3 3 3 3
3
5
6
1