• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • YouClaw
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
HaibaraAi
博客园    首页    新随笔    联系   管理    订阅  订阅

TOJ Open Ural FU Championship 2013 A

 

1981. Parallel and Perpendicular

Time limit: 0.5 second
Memory limit: 64 MB
 
You are given a regular n-gon. Your task is to calculate two values: the number of its diagonals that are parallel to at least one of its other diagonals, and the number of its diagonals that are perpendicular to at least one of its diagonals. A diagonal is a segment connecting two non-adjacent polygon vertices.

Input

The only line contains an integer n (4 ≤ n ≤ 105).

Output

Output two required numbers.

Sample

inputoutput
4
0 2
Problem Author: Grigory Nazarov
 1 #pragma comment(linker, "/STACK:1024000000,1024000000")
 2 #include <map>
 3 #include <queue>
 4 #include <vector>
 5 #include <string>
 6 #include <cmath>
 7 #include <cstdio>
 8 #include <cstring>
 9 #include <cstdlib>
10 #include <iostream>
11 #include <algorithm>
12 using namespace std;
13 #define maxn 5005
14 #define ll long long
15 #define INF 0x7fffffff
16 #define eps 1e-8
17 ll n,m;
18 int main(){
19     while (~scanf("%I64d", &n)){
20         ll  x = 0, y = 0;
21         x = (n - 3)*n / 2;
22         if (n == 6)y = 6;
23         if (n == 5)x = 0, y = 0;
24         if (n <= 6){printf("%I64d %I64d\n", y, x); continue;}
25         if(n&1)printf("%I64d 0\n", x);
26         else printf("%I64d %I64d\n",x, x);
27     }
28     return 0;
29 }
View Code
posted @ 2013-10-22 13:49  HaibaraAi  阅读(101)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3