QOJ.ac

QOJ

時間限制: 1 s 記憶體限制: 2048 MB 總分: 100

#14441. 冰壶

统计

冰壶是一项冬季运动。两支队伍的队员轮流将各自颜色(红色或黄色)的八个“冰壶”滑向冰道,试图让冰壶尽可能靠近“圆心”(button)。冰道长 138 英尺,宽 14 英尺。换算成英寸,即 $1,656 \times 168$。圆心位于距离末端 12 英尺处,且位于中心线上,距离两侧各 7 英尺。其位置坐标为 $(144, 84)$(单位:英寸)。

每场比赛共有十局。在每一局中,两队轮流将冰壶滑向冰道,试图让自己的冰壶比对方的冰壶更靠近圆心(或者将对方的冰壶撞离圆心)。每一局中,拥有最靠近圆心之冰壶的队伍得分。该队每有一个比对方所有冰壶都更靠近圆心的冰壶,即可获得一分。冰壶完全滑出冰道是有可能的。

给定十局比赛后每一局冰壶的位置(单位:英寸),并假设圆心位于 $(144, 84)$,请计算比赛的最终得分。

输入格式

输入包含恰好 20 行,分为 10 组。每组包含两行,分别表示该局中红色冰壶的位置和黄色冰壶的位置。

每行以一个整数 $n$ ($0 \le n \le 8$) 开头,表示留在冰道上的冰壶数量,随后是 $n$ 个有序整数对 $x$ ($0 \le x \le 1,656$) 和 $y$ ($0 \le y \le 168$),表示留在冰道上的每个冰壶的位置(单位:英寸)。保证同一局中没有两个冰壶距离圆心的距离相等。

输出格式

在一行中输出两个整数,分别表示红队的总分和黄队的总分。

样例

输入 1

7 1627 63 1506 128 338 123 1035 64 1350 11 275 74 560 53
8 1500 32 1015 96 524 160 1578 160 28 112 1383 147 165 10 1334 167
8 385 75 807 141 903 91 1589 8 1091 68 398 24 1366 95 351 123
6 1003 68 560 149 147 117 779 12 595 166 1176 30
7 755 114 195 131 418 54 902 53 292 136 178 42 495 153
7 1226 109 1111 44 1282 91 624 30 1220 79 357 151 232 140
8 894 81 1519 65 1442 84 1157 3 952 150 1252 158 1005 67 1104 21
4 505 33 608 37 40 75 782 158
2 1002 167 826 9
1 301 138
3 81 85 1156 29 1261 125
6 1266 88 1570 157 1179 126 605 128 1375 14 972 57
8 840 85 327 118 1527 22 964 139 1347 110 1607 68 794 92 1577 6
8 253 129 1256 25 50 67 77 112 1195 84 1473 73 105 153 1410 167
4 358 2 1310 51 950 80 814 58
6 57 142 439 5 329 155 144 155 868 114 410 72
2 862 92 379 116
7 102 88 372 22 1236 53 1608 75 425 47 1574 154 1607 7
4 1150 83 1047 112 725 46 498 166
3 363 35 1014 138 911 53

输出 1

3 18

Figure 1. Curling rink layout

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.