PGR01  Progressions
Charan is good at Mathematics and he loves the concept of progressions. He was assigned a task to calculate the
nth term in the given series. As he is good at mathematics he calculates the answer but as the series was too large he decided to write a program to solve that problem. Help Mr.Charan in solving the problem.
Given series is t1=1,t2=9,t3=45,t4=189,t5=729.....
Here, tn=nth term in the series.
Input
First line represents the number of test cases.
Next t lines represent the n value.
1<=tn<10^18
Output
Output the corresponding value of the nth term
Example
Input: 1
10 Output: 373977
hide comments
aditya_rev:
20160908 07:06:03
ez.. first go :) 

DIWAKAR BHARDWAJ:
20150114 11:39:58
easy but tricky got ac at 1st attempt 

Raj Kumar Chauhan:
20140807 12:57:44
can anyone tell me how to get solution of questions? 

pandu ranga rao:
20140727 11:04:57
Sir @Bala Sai Charan can u please provide submit link for the above problem.... Thanq

Added by:  Bala sai charan 
Date:  20140727 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Resource:  Simple Math 