22846_Clockwise

2022-5-16 18:23| 发布者: Hocassian| 查看: 46| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-8950714264999-Problem List-采集的数据-后羿采集器.html

Pro.ID

22846

Title

Clockwise

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22846

AC

1

Submit

2

Ratio

50.00%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Saya have a long necklace with N beads, and she signs the beads from 1 to N. Then she fixes them to the wall to show N-1 vectors? vector i starts from bead i and end up with bead i+1.

    One day, Kudo comes to Saya's home, and she sees the beads on the wall. Kudo says it is not beautiful, and let Saya make it better.

    She says: "I think it will be better if it is clockwise rotation. It means that to any vector i ( i < N-1 ), it will have the same direction with vector i+1 after clockwise rotate T degrees, while 0 ≤ T < 180."

    It is hard for Saya to reset the beads' places, so she can only remove some beads. To saving the beads, although she agrees with Kudo's suggestion, she thinks counter-clockwise rotation is also acceptable. A counter-clockwise rotation means to any vector i ( i < N-1), it will have the same direction with vector i+1 after counter-clockwise rotate T degrees, while 0 < T ≤ 180.

    Saya starts to compute at least how many beads she should remove to make a clockwise rotation or a counter-clockwise rotation.

    Since the necklace is very-very long, can you help her to solve this problem?

    输入

    The input consists of several test cases.

    The first line of input in each test case contains one integer N ( 2 < N ≤ 300 ), which represents the number of beads.

    Each of the next N lines contains two integer x and y, represents the coordinate of the beads. You can assume that 0 < x, y < 10000.

    The last case is followed by a line containing one zero.

    输出

    Description

    Saya have a long necklace with N beads, and she signs the beads from 1 to N. Then she fixes them to the wall to show N-1 vectors? vector i starts from bead i and end up with bead i+1.

    One day, Kudo comes to Saya's home, and she sees the beads on the wall. Kudo says it is not beautiful, and let Saya make it better.

    She says: "I think it will be better if it is clockwise rotation. It means that to any vector i ( i < N-1 ), it will have the same direction with vector i+1 after clockwise rotate T degrees, while 0 ≤ T < 180."

    It is hard for Saya to reset the beads' places, so she can only remove some beads. To saving the beads, although she agrees with Kudo's suggestion, she thinks counter-clockwise rotation is also acceptable. A counter-clockwise rotation means to any vector i ( i < N-1), it will have the same direction with vector i+1 after counter-clockwise rotate T degrees, while 0 < T ≤ 180.

    Saya starts to compute at least how many beads she should remove to make a clockwise rotation or a counter-clockwise rotation.

    Since the necklace is very-very long, can you help her to solve this problem?

    Input

    The input consists of several test cases.

    The first line of input in each test case contains one integer N ( 2 < N ≤ 300 ), which represents the number of beads.

    Each of the next N lines contains two integer x and y, represents the coordinate of the beads. You can assume that 0 < x, y < 10000.

    The last case is followed by a line containing one zero.

    Output

    For each case, print your answer with the following format:

    If it is clockwise rotation without removing any beads, please print "C"; otherwise if it is counter-clockwise rotation without removing any beads, print "CC" instead; otherwise, suppose remove at least x beads to make a clockwise rotation and remove at least y beads to make a counter-clockwise rotation. If xy, print "Remove x bead(s), C", otherwise print "Remove x bead(s), CC" instead.

    Your output format should imitate the sample output. Print a blank line after each test case.

    Sample Input

    3
    1 1
    2 2
    3 3

    3
    1 1
    2 2
    1 1

    4
    1 1
    2 2
    3 3
    2 2

    0

    Sample Output

    C
    CC
    Remove 1 bead(s), C

    Source

    样例输入

    3
    1 1
    2 2
    3 3

    3
    1 1
    2 2
    1 1

    4
    1 1
    2 2
    3 3
    2 2

    0

    样例输出

    C
    CC
    Remove 1 bead(s), C

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部