You will be given two positive numbers M and N. Your task is to print the greatest common divisor of Fib(M) and Fib(N) where Fib(x) means the xth Fibonacci numbers defined as:
Fib(0) = 0
Fib(1) = 1
for n > 1, Fib(n) = Fib(n-1) + Fib(n-2)
The first line of input contains a single integer T denoting the number of test cases. Then T test cases follow. Each test case consists of exactly one line. This line consists of two space separated positive integers N and M.
Corresponding to each test case, in a new line, print the value of gcd( Fib(M), Fib(N) ) modulo 100.
1 ≤ T ≤ 1000
1 ≤ M, N ≤ 1000
Fib(3) = 2 and Fib(6) = 8
GCD(2,8)%100 = 2
Fib(7) = 13 and Fib(8) = 21
GCD(13,21)%100 = 1
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.