#P182. 【例30.3】 按要求计算输出

【例30.3】 按要求计算输出

Description

Input a positive integer N (1≤N≤100), representing that there will be N lines following, each containing three positive integers a, b, and c.

Input Format

The first line contains a positive integer N.
The next N lines each contain three positive integers a, b, and c.
(1≤b,c≤2147483647, 1≤a≤4).

Output Format

If a=1, output b+c;
If a=2, output b-c;
If a=3, output b×c;
If a=4, output b÷c.
Output the result as an integer.

Sample

4
1 2 3
2 2 3
3 2 3
4 2 3
5
-1
6
0