Please give me correct outputs for the following inputs. Thanks in advance.
Code: Select all
4
5
6
50
100
99
98
10
Moderator: Board moderators
Code: Select all
4
5
6
50
100
99
98
10
Code: Select all
30 70 100 900 354 9646
55 170 225 3150 979 49646
91 350 441 8820 2275 192206
42925 1582700 1625625 2071046250 65666665 2642590973960
338350 25164150 25502500 128762122500 2050333330 650375455916670
328350 24174150 24502500 121262872500 1950333330 600370555916670
318549 23213652 23532201 114131174850 1854273729 553762629630672
385 2640 3025 163350 25333 9125292
Code: Select all
1 0 1 0 1 0
Code: Select all
0
Code: Select all
0
4
5
6
7
8
9
10
Code: Select all
0 0 0 0 0 0
30 70 100 900 354 9646
55 170 225 3150 979 49646
91 350 441 8820 2275 192206
140 644 784 21168 4676 609980
204 1092 1296 45360 8772 1670844
285 1740 2025 89100 15333 4085292
385 2640 3025 163350 25333 9125292
Code: Select all
#include <stdio.h>
#include <math.h>
int main()
{
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
#endif
double n;
while(scanf("%lf",&n) != EOF)
{
printf("%.0lf %.0lf %.0lf %.0lf %.0lf %.0lf\n",
n*(n+1)*(2*n+1)/6,pow(n*(n+1)/2,2.0)-n*(n+1)*(2*n+1)/6,
pow(n*(n+1)/2,2.0),pow(n*(n+1)/2,3.0)-pow(n*(n+1)/2,2.0),
n*(n+1)*(2*n+1)*(3*n*n+3*n-1)/30,pow(n*(n+1)/2,4.0)-n*(n+1)*(2*n+1)*(3*n*n+3*n-1)/30);
}
return 0;
}