Geometric Progression
Easy Accuracy: 11.8% Submissions: 529 Points: 2

Given a Geometric Progression with first term as 1, common ratio as 2 and a number N. Find out the sum of all the terms of this geometric progression if there are total 2N terms in GP.

Note: Since the answer can be very large, print the answer modulo 109+7

Input:
First line of input consist of a single integer T denoting the total number of test case. Then T test cases follow. Each line of test case contains a single integer N,as described in the problem statement.

Output:
For each test case, print a single line containing the required answer.

Constraints:
1<=T<=100
1<=N<=10^18

Example:
Input:
2
1
3

Output:
3
255

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.