CF1760A.Medium Number

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Medium Number

Given three distinct integers aa, bb, and cc, find the medium number between all of them.

The medium number is the number that is neither the minimum nor the maximum of the given three numbers.

For example, the median of 5,2,65,2,6 is 55, since the minimum is 22 and the maximum is 66.

Input

The first line contains a single integer tt (1t68401 \leq t \leq 6840) — the number of test cases.

The description of each test case consists of three distinct integers aa, bb, cc (1a,b,c201 \leq a, b, c \leq 20).

Output

For each test case, output a single integer — the medium number of the three numbers.

Samples

9
5 2 6
14 3 4
20 2 1
1 2 3
11 19 12
10 8 20
6 20 3
4 1 3
19 8 4
5
4
2
2
12
10
6
3
8

在线编程 IDE

建议全屏模式获得最佳体验