Write a program to find the remainder when an integer A is divided by an integer B.

-----Input-----

The first line contains an integer T, the total number of test cases. Then T lines follow, each line contains two Integers A and B. 

-----Output-----
For each test case, find the remainder when A is divided by  B, and display it in a new line.

-----Constraints-----
- 1 ≤ T ≤ 1000
- 1 ≤ A,B ≤ 10000

-----Example-----
Input
3 
1 2
100 200
40 15

Output
1
100
10

Difficulty: interview

Starter code:

Solutions:
number = int(input())
for i in range(number):
    x = list(map(int, input().split(' ')))
    print(x[0]%x[1])

t = int(input())

for x in range(0, t):
    a, b = input().split()
    rem = int(a) % int(b)
    print(int(rem), "\n")

t = int(input())

for x in range(0, t):
    a, b = input().split()
    rem = int(a) % int(b)
    print(int(rem), "\n")

x=int(input())
for _ in range(x):
    a,b=input().split()
    a=int(a)
    b=int(b)
    z=a%b
    print(z)


n=int(input())
for _ in range(n):
    a,b=[int(x) for x in input().split( )]
    print(a%b)

t = int(input())
mod = []
for i in range (0,t):
    a,b = input().split()
    c=int(a)%int(b)
    mod.append(c)
for i in mod:
    print(i)

t=int(input())
for i in range(t):
    a,b=input().split()
    a=int(a)
    b=int(b)
    ans=a%b
    print(ans)


t=int(input())
for i in range(0,t):
    x,y=map(int,input().split())
    c=x%y
    print(c)

n = int(input())
while n>0:
    x,y = map(int,input().strip().split())
    print(x%y)
    n = n-1

n= int (eval(input()))
for i in range (0,n):
    a,b=list(map(int,input().split()))
    r=a%b
    print(r)

n=int(input())
for i in range(n):
    a, b = map(int, input().split())
    c=a%b
    print(c)

#No template exists for this language. Erase this and please write full code.
n=int(input())
for i in range (n):
    a,b=map(int,input().split())
    c=a%b
    print(c)

for _ in range(int(input())):
    n,k=map(int,input().split())
    print(n%k)

n=int(input())
mylist=[]
while(n>0):
	a,b=list(map(int,input().split()))
	rem=a%b
	mylist.append(rem)
	n=n-1
for i in mylist:
	print(i)
	
		

		
		

	
	
		
		


# No template exists for this language. Erase this and please write full code.
t = int(input())
while t:
    t-=1
    n, m = map(int, input().split())
    print(n%m)

n= int(input())
for i in range(n):
    a,b= map(int,input().split())
    c=a%b
    print(c)

n = int(input())
i =1
while i<=n:
    (a,b) = [int(x)for x in input().split()]
    print(a%b)
    
    i+=1 


t=int(input())
for i in range(0,t):
    a,b=map(int,input().split(' '))
    print(a%b)

t=int(input())
for i in range(t):
    
    a,b=[int(x) for x in input().split()]
    c=a%b
    print(c)


for _ in range(int(input())):
    n,m=map(int,input().split())
    print(n%m)

t=int(input())

for i in range(t):
    (a,b)=map(int,input().split(' '))
    print(a%b)

t = int(input())
for i in range(t):
    c , d = input().split()
    a = int (c) 
    b = int (d)
    print(a%b)


n = int(input())
for i in range(n):
    (a, b) = map(int, input().split(" "))
    print(a % b)

n = int(input())
for i in range(n):
    (a, b) = map(int, input().split(" "))
    print(a % b)

t=int(input())
for i in range(t):
    a,b=map(int,input().split())
    print(a%b)