Given a number N find the sum of all the even valued terms in the fibonacci sequence less than or equal to N.
The first few terms of Fibonacci Numbers are, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233 ,… (Even numbers are highlighted).
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. The first line of each test case contains the integer N.
Print the sum of all the even valued terms in the fibonacci sequence less than or equal to given N. Print the answer for each test case in a new line.
1<= T <=100
1<= N <=1000000
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.