#include <stdio.h>
long long D, d[101];
void input(void)
{
long long i;
scanf("%lld",&D);
for(i=1 ; i<=D ; i++)
scanf("%lld",&d[i]);
}
void process(void)
{
long long i, now=0, node=1, num1=0, num2=0;
for(i=1 ; i<=D ; i++)
{
now=num2+(now-num1)*i+d[i];
now%=1000000007;
printf("%lld\n",now);
node*=i;
node%=1000000007;
num1=num2+1;
num1%=1000000007;
num2+=node;
num2%=1000000007;
}
}
int main(void)
{
input();
process();
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1088 KB |
Output is correct |
2 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |