#abc304a. A - First Player
A - First Player
Score : points
问题描述
有个人,编号为,按照顺时针顺序围坐在一张圆桌周围。特别地,编号为的人与编号为的人在顺时针方向相邻。
对于每个,编号为的人拥有一个名字和一个年龄。这里,没有两个人的名字或年龄相同。
从最年轻的人开始,按顺时针顺序输出所有个人按照座位位置排列的名字。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
There are people numbered , sitting in this clockwise order around a round table. In particular, person is sitting next to person in the clockwise direction.
For each , person has a name and an age . Here, no two people have the same name or the same age.
Starting from the youngest person, print the names of all people in the order of their seating positions in clockwise order.
Constraints
- is an integer.
- is a string of length between and , consisting of lowercase English letters.
- is an integer.
Input
The input is given from Standard Input in the following format:
Output
Print lines. For each , the -th line should contain the name of the person sitting in the -th position clockwise from the youngest person.
Sample Input 1
5
alice 31
bob 41
carol 5
dave 92
ellen 65
Sample Output 1
carol
dave
ellen
alice
bob
The youngest person is person . Therefore, starting from person , print the names in the clockwise order of their seating positions: person , person , person , person , and person .
Sample Input 2
2
takahashi 1000000000
aoki 999999999
Sample Output 2
aoki
takahashi
update @ 2024/3/10 08:32:56