for N in range(int(input())):a,b,c=map(int,input().split())if(a==1):print(int(b+c))elif(a==2):print(int(b-c))elif(a==3):print(int(b*c))else:print(int(b/c))
print不用加int,除法用//就好了
for N in range(int(input())):a,b,c=map(int,input().split())if(a==1):print(b+c)elif(a==2):print(b-c)elif(a==3):print(b*c)else:print(b/c)
print不用加int,除法用//就好了
import sys for i in sys.stdin:print(eval(i.replace("/","//")))