Even Fibonacci Numbers Sum
##### Submissions: 6803   Accuracy: 30.07%   Difficulty: Easy   Marks: 2

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).

Input:
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.

Output:
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.

Constraints:
1 <= T <= 100
1 <= N <= 106

Example:
Input:

2
8
400

Output:
10
188

#### ** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Sujnesh Mishra
Author: sujnesh

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.