This is the solution of this problem in python:
M=list()
N=list()
O=int(input())
for i in range(0,O):
x,y=input().split()
M.append(x)
N.append(y)
for j in range(0,O):
a=int(M[j])
b=int(N[j])
if(b==0):
print("divisao impossivel")
else:
print("%.1f"%(a/b))
No comments