| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 2048 MB | 32 | 13 | 12 | 44.444% |
After a long day of programming challenges, you decide to relax with your friends by playing darts. The only problem is that none of your friends (nor the author) have any clue how scoring works! Rather than try to learn, you simply devise your own rules. The rules you come up with are as follows:
For example, if your darts land in wedges 1ドル,ドル 10ドル,ドル and 7ドル$ on your turn, you would calculate the sum around the dart board from wedge 1ドル$ through wedge 10ドル$ (1ドル + 18 +たす 4 +たす 13 +たす 6 +たす 10 =わ 52$), the sum around the dart board from wedge 10ドル$ through wedge 7ドル$ (10ドル + 15 +たす 2 +たす 17 +たす 3 +たす 19 +たす 7 =わ 73$) and the sum around the dart board from wedge 7ドル$ through wedge 1ドル$ (7ドル + 16 +たす 8 +たす 11 +たす 14 +たす 9 +たす 12 +たす 5 +たす 20 +たす 1 =わ 103$). The sum around the dart board from wedge 7ドル$ through wedge 1ドル$ is the largest sum, so your score would be 103ドル$ points.
The order of the wedges on the dartboard, starting from the top and going clockwise, is 20ドル,ドル 1ドル,ドル 18ドル,ドル 4ドル,ドル 13ドル,ドル 6ドル,ドル 10ドル,ドル 15ドル,ドル 2ドル,ドル 17ドル,ドル 3ドル,ドル 19ドル,ドル 7ドル,ドル 16ドル,ドル 8ドル,ドル 11ドル,ドル 14ドル,ドル 9ドル,ドル 12ドル,ドル 5ドル$.
The first line contains a single integer $N,ドル representing the number of players.
The subsequent $N$ lines each contain three (3ドル$) space-separated integers $w_1,ドル $w_2,ドル and $w_3$ (in that order). Each $w_i$ represents the wedge number that the $i^\text{th}$ dart for that player landed in.
The output should contain $N$ lines. Each line should contain the score for the corresponding player, in the same order in which they appear in the input.
3 1 4 8 5 17 11 9 9 2
120 111 115
School > CS@Mines > CS@Mines HSPC 2019 D번