ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1981. Parallel and Perpendicular

I 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= =
Posted by randomru 20 Oct 2013 10:36
n=4
n=5
n=6
Re: I need help= =
Posted by Smilodon_am [Obninsk INPE] 22 Oct 2013 14:13
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= =
Posted by Smilodon_am [Obninsk INPE] 25 Oct 2013 13:15
answers for tests:
n = 4
ans: 0 2
n = 5
ans: 0 0
n = 6
ans: 6 9
n = 7
ans: 14 0