#K47817. Maximum Pairs
Maximum Pairs
Maximum Pairs
Given T test cases, each test case contains two non-negative integers A and B representing the number of items of type A and type B, respectively. Your task is to compute the maximum number of pairs that can be formed such that each pair consists of one item from type A and one item from type B.
The answer for each test case is given by the formula:
$$\text{pairs} = \min(A, B)$$
For example, if a test case has A = 2 and B = 3, the maximum number of pairs will be 2 because you cannot form more than 2 pairs without exhausting the items of type A.
inputFormat
The input is read from stdin and is formatted as follows:
- The first line contains an integer T, representing the number of test cases.
- The next T lines each contain two space-separated integers, A and B.
outputFormat
For each test case, output the maximum number of pairs that can be formed on a separate line to stdout.
## sample3
2 3
5 5
0 10
2
5
0
</p>