2284: W-LINE
Result | TIME Limit | MEMORY Limit | Run Times | AC Times | JUDGE |
---|---|---|---|---|---|
![]() | 3s | 8192K | 221 | 129 | Standard |
There are n W-LINEs in the plane(see the picture). Now i want to ask what's the maximal possible areas can these W-LINEs separate the plane.Suppose the middle part of W-LINE is big enough and the two ends can extend infinete.
Input
The input contains several test cases. For each test case it contains a positive integer n (0 <= n <= 50). The end of input is indicated by end-of-file.Ouput
For each test case, output K, here K is the maximal possible areas W-LINEs can separate the plane.Sample Input
1 2 10
Sample Output
2 19 731
Problem Source: sharang
This problem is used for contest: 43 153
#include<stdio.h>
int main()
{
int i,n;
int a[60]={1};
a[1]=2;
for(i=2;i<=55;i++) a[i]=a[i-1]+16*(i-1)+1;
while(scanf("%d",&n)==1)
{
printf("%d/n",a[n]);
}
return 0;
}