FAST2 - Fast Sum of two to an exponent

题意翻译

$T$ 组数据,每组数据给定一个整数 $n$,请求出下列式子的值。 $$\left(\sum\limits_{i=0}^n 2^i\right)\bmod M$$ 其中 $M=1298074214633706835075030044377087$。 数据范围:$0\leqslant n\leqslant 500$。时间限制为 $\bf 100ms$。 Translated by Eason_AC

题目描述

There is people that really like to do silly thinks, one of them is sum the numbers from 2^0 to 2^n, task is actually really simple, just do a ultra fast sum of term 2^0 to 2^n

输入输出格式

输入格式


the first line starts with a number, T, wich is the number of test cases, T lines will follow each line contains a number "n" that is the nth term of the sum from 2^0 to 2^n 0<=n<=500

输出格式


Output the sum from 2^0 to 2^n MODULO 1298074214633706835075030044377087

输入输出样例

输入样例 #1

3\n0\n1\n2\n\n

输出样例 #1

1\n3\n7 \n\nExtra: TLE is equal to 0.15s\n