-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCBANK.cpp
51 lines (51 loc) · 1.26 KB
/
CBANK.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include<bits/stdc++.h>
#define REP(i,n) for(int (i)=0;i<(int)(n);++(i))
#define REPIT(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
#define PB push_back
#define FT first
#define SD second
#define ZERO(x) memset(x,0,sizeof(x))
#define NEG(x) memset(x,-1,sizeof(x))
#define RI(x) scanf("%d",&(x))
#define RII(x,y) scanf("%d%d",&(x),&(y))
#define RIII(x,y,z) scanf("%d%d%d",&(x),&(y),&(z))
#define OIII(x,y,z) printf("%d %d %d\n",(x),(y),(z))
#define OII(x,y) printf("%d %d\n",(x),(y))
#define OI(x) printf("%d\n",(x))
#define OL(x) cout<<(x)<<endl
#define OLL(x,y) cout<<(x)<<" "<<(y)<<endl
#define OLLL(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<endl
#define RS(s) scanf("%s",(s))
#define MP(x,y) make_pair((x),(y))
#define FIN(f) freopen(f,"r",stdin)
#define FOUT(f) freopen(f,"w",stdout)
typedef long long LL;
using namespace std;
typedef pair<int,int> PII;
const int MOD = 1e9+7;
const int maxn = 333;
const int INF = 1<<30;
const int logN = 18;
LL POW(LL x,int y) {
LL ret = 1;
while(y) {
if(y&1)ret = (ret*x)%MOD;
x = (x*x)%MOD;
y>>=1;
}
return ret;
}
int main(int argc, char const *argv[])
{
int t;
RI(t);
LL i6 = POW(6,MOD-2);
while(t--) {
LL n;
cin>>(n);
LL ans = ((n+1)*(n+2))%MOD;
ans = (ans*(n+3))%MOD;
ans = (ans*i6)%MOD;
OL(ans);
}
}