問題一覧 > 通常問題

No.3163 [Cherry 7th Tune N] Draft

レベル : / AI推定難易度 : 77 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 115
作問者 : 👑 Kazun / テスター : Taka
お気に入りにしたユーザー ProblemId : 10268 / 自分の提出
問題文最終更新日: 2025-05-20 00:15:22
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 468 Desire for Approval ~Ash blown by the draft leads to the door to a new beginning~ (順位表) の他の問題:

Problem Visual

▶ Open to reveal the problem visual

Introduction

The ashes stirred up by the draft lead on to the door to a new beginning...

Problem Statement

There are $5$ monoliths (pillars made of a single rock). The heights of the monoliths are $A, B, C, D, E$.

Among these $5$ monoliths, let $X$ be the height of the tallest monolith and $Y$ be the height of the shortest monolith. Find the difference $(X - Y)$.

Solve $T$ test cases.

Constraints

  • $1 \leq T \leq 100$.
  • Constraints for each test case:
    • $1 \leq A \leq 10^9$.
    • $1 \leq B \leq 10^9$.
    • $1 \leq C \leq 10^9$.
    • $1 \leq D \leq 10^9$.
    • $1 \leq E \leq 10^9$.
  • All input values are integers.

Input

The input is given from standard input in the following format.

$T$
${\rm Testcase}_1$
$\vdots$
${\rm Testcase}_T$

Each test case is in the following format.

$A$ $B$ $C$ $D$ $E$

Output

The output consists of $T$ lines. On the $t~(1 \leq t \leq T)$-th line, print the answer to the $t$-th test case as an integer on $1$ line.

Do not forget the newline at the end.

Sample

Sample 1
Input
3
158 172 161 159 154
1000 1000 5000 5000 5000
46 46 46 46 46
Output
18
4000
0

  • [Test case $1$] The heights of the $5$ monoliths are $158, 172, 161, 159, 154$, so $X = 172, Y = 154$. Therefore, $X-Y = 172-154=18$.
  • [Test case $2$] $A, B, C, D, E$ are not necessarily distinct.
  • [Test case $3$] It is possible that $A = B = C = D = E$. In that case, $X, Y$ are both $A (= B = C = D = E)$, so $X - Y = A - A = 0$.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。