|
|
back to boardI need help= = Posted by vcvycy 20 Oct 2013 09:52 WA.. who can give some test cases?
#include<stdio.h> #include<stdlib.h> int main() { long long n,m; scanf("%I64d",&n); m=n*(n-3)/2; if (n % 2==1) printf("%I64d 0\n",m); if (n % 2==0) { if (n==4)printf("0 2\n"); else printf("%I64d %I64d\n",m,m); } system("pause"); return 0; } Edited by author 20.10.2013 09:53 Re: I need help= = n=4 n=5 n=6 Re: I need help= = I think that number of perpendicular diagonals for N-polygon is equal to 0 for every odd N. I don't say the same about parallel diagonals in regular N-polygon for odd N. Edited by author 24.10.2013 19:33 Re: I need help= = answers for tests: n = 4 ans: 0 2 n = 5 ans: 0 0 n = 6 ans: 6 9 n = 7 ans: 14 0 |
|
|