Sunday, July 31, 2016

TCS Code Vita Season-5 Round-1 set-2 Program-5

Problem : Even Sum
A number is even if it is divisible by 2, but in this case a number is even if the active bits (1s in its binary representation) of a given number are 2. So your task is to find the sum of first N even numbers. 
Input Format:

First line of the input contains an integer T denoting the number of test cases.

Each of the next T lines contains a single integer N. 
Output Format:

For each test case, print a single integer denoting sum of first N even numbers mod 1000000007. 
Constraints:
1.    0 < N <=10^5
Example:
Example Number
Sample Input
Sample Output
1

1
2

2

2
15
25

315
666







Contact Form

Name

Email *

Message *