#K49502. Maximizing Performer Pairs
Maximizing Performer Pairs
Maximizing Performer Pairs
You are given two non-negative integers, (G) and (P), representing the number of guitars and pianos respectively. A performer pair consists of one guitar and one piano. Your task is to compute the maximum number of pairs that can be formed, which is mathematically given by (\min(G, P)).
For example, if there are 10 guitars and 15 pianos, you can form 10 pairs since there are only 10 guitars available. Similarly, with 12 guitars and 6 pianos, you can form 6 pairs. Your solution should read the input from standard input (stdin) and output the results to standard output (stdout).
inputFormat
The first line of the input contains an integer (T) denoting the number of test cases. Each of the following (T) lines contains two space-separated integers (G) and (P), where (G) is the number of guitars and (P) is the number of pianos.
outputFormat
For each test case, print the maximum number of pairs that can be formed on a new line. Each output should be the value of (\min(G, P)).## sample
3
10 15
5 5
12 6
10
5
6
</p>