#include <stdio.h>
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <sstream>
#include <set>
#include <map>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <string>
using namespace std;
#define MOD 1000000007ll
#define ll long long
int D;
int a[111];
int main() {
scanf("%d",&D);
for(int i=0;i<D;++i) scanf("%d",a+i);
ll cur = 0, x = 1, tot = 1;
ll level = 1;
printf("1\n");
for(int i=1;i<D;++i) {
cur = (max(0ll,x-1)*(i+1) % MOD + a[i] + tot) % MOD;
printf("%I64d\n",cur);
x = max(0ll,x-1)*(i+1) + a[i];
level = (level * (i+1)) % MOD;
tot = (tot + level) % MOD;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1672 KB |
Output is correct |
2 |
Correct |
0 ms |
1672 KB |
Output is correct |
3 |
Incorrect |
0 ms |
1672 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |