No.571 Three Brothers (Part 2)
タグ : / 解いたユーザー数 384
作問者 :
nmnmnmnmnmnmnm
/ テスター :
Problem Statement
A, B, and C are three brothers.
The brothers' household has the following rules.
・The taller person is superior.
・If their heights are the same, the lighter person is superior.
Given the height and weight of each of A, B, and C, arrange them in order from most superior.
※No two different brothers among the three have both the same height and the same weight.
Input
$H_A$ $W_A$ $H_B$ $W_B$ $H_C$ $W_C$
$H_A$ and $W_A$ are A's height and weight, respectively. The values are always integers. $150 \le H_A \le 200$. $50 \le W_A \le 100$.
$H_B$ and $W_B$ are B's height and weight, respectively. The values are always integers. $150 \le H_B \le 200$. $50 \le W_B \le 100$.
$H_C$ and $W_C$ are C's height and weight, respectively. The values are always integers. $150 \le H_C \le 200$. $50 \le W_C \le 100$.
No two different brothers among the three have both the same height and the same weight.
Output
Output 'A' for A, 'B' for B, and 'C' for C on three lines from top to bottom, in order from most superior.
Also print a newline at the end of the last line.
Sample
Sample 1
Input
170 60 180 55 160 60
Output
B A C
B, the tallest, is the most superior.
A, the next tallest, is the second most superior.
C, the shortest, is third.
Sample 2
Input
190 80 170 60 170 50
Output
A C B
A, the tallest, is the most superior.
The next tallest are B and C, but C, who is lighter, is the second most superior.
B and C have the same height, but B, who is heavier, is third.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。