#include <iostream>
using namespace std;
long long g[101];
long long sum[101];
long long in[101];
int main(void){
int n;
int i, j;
g[1] = 1;
sum[1] = 1;
for(i=2; i<=100; i++){
g[i] = (g[i-1] * i) % 1000000007;
sum[i] = (sum[i-1] + g[i]) % 1000000007;
}
cin >>n;
for(i=1; i<=n; i++)
cin >>in[i];
cout <<1<<endl;
for(i=2; i<=n; i++){
cout << (( ( (in[i-1]-1)*i)%1000000007) + in[i] + sum[i-1] ) % 1000000007 <<endl;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
1676 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |