BSSPC '20 J5
James remember his days when he had just learned the fibonacci sequence. To refresh your memory, the fibonacci sequence is defined as:
Since he loves giving other coders challenge, he has given one to you! You challenge is to answer of James's questions, each question is asking you for the sum of all the fibonacci numbers in the range inclusive. Or written in sum notation is:
Since this number is quite big, output the answer.
The operator is built into all programming languages. It returns values such that returns the remainder left over after is divided by .
The first line of input contains , the number of questions James is going to ask you.
The next lines will contain two integers, , denoting the range of the summation.
For each question, output the sum.
For all subtasks:
Subtask 1 [25%]
Subtask 2 [25%]
Subtask 3 [50%]
No further constraints.
2 1 3 2 4
The first four fibonacci numbers are .
For the first query, the sum of the first three fibonaaci numbers are .
Similarly, the sum of the fiboannci numbers in the range is