#Lutece1075. Can you answer these queries?
Can you answer these queries?
Migrated from Lutece 1075 Can you answer these queries?
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
You are given two functions and , and these two functions will defined as:
and for , $F(n) = G(n - 1) + G(n - 2), G(n) = F(n - 1) + F(n - 2)$.
A query is defined as follows:
Query() = , here .
Given queries, your program must output the results of these queries.
Input
The first line of the input file contains the integer .
lines follow, where line contains numbers , , , and ( and ).
Output
Your program should output the results of the queries, one query per line.
Samples
4
0 1 0 1 0
0 1 0 1 1
0 1 0 1 3
0 1 0 1 4
0
1
4
9
Resources
Fish