Fibonacci Sum in Range

3

1 votes
Problem

Write a program to print the sum of Fibonacci numbers in a given range. Assume the Fibonacci series starts as 0, 1, 1, 2, 3....

Input
An integer T, denoting the number of testcases, followed by T lines, each containing two integers L, R.

Output
Print the sum of all Fibonacci numbers between the Lth and Rth Fibonacci numbers. The Rth Fibonacci number is excluded from the sum.

Input Constraint

1 <= T <= 100
0 <= L, R < 100

Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?