No.1423 Triangle of Multiples
タグ : / 解いたユーザー数 239
作問者 : 👑
lynmisakura
Problem Statement
You are given positive integers $A,B,C$. Find one triple of positive integers $x,y,z$ satisfying all of the following conditions.
- There exists a non-degenerate triangle whose $3$ side lengths are $x,y,z$. Here, a triangle is non-degenerate if its $3$ vertices do not lie on the same line.
- $x$ is a multiple of $A$
- $y$ is a multiple of $B$
- $z$ is a multiple of $C$
- $1\le x,y,z\le 10^{18}$
It can be proved that such $x,y,z$ always exist under the constraints of this problem.
You are given $T$ test cases; solve each of them.
Input
$T$
$\text{case}_1$
$\text{case}_2$
$\vdots$
$\text{case}_T$
Each case is given in the following format.
$A$ $B$ $C$
- All input values are integers
- $1\le T\le 3\times 10^4$
- $1\le A,B,C\le 10^6$
Output
Output $T$ lines. On the $i$-th line, output one triple $x,y,z$ satisfying the conditions for the $i$-th test case, separated by spaces.
If there are multiple answers, you may output any of them.
Note that extra trailing whitespace will result in WA.
Sample
Sample 1
Input
1 1 2 3
Output
3 4 6
The triangle with $3$ side lengths $3,4,6$ is non-degenerate. Any other output satisfying the conditions will also be accepted.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。