結果
| 問題 |
No.1423 Triangle of Multiples
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-12-07 01:46:13 |
| 言語 | Kotlin (2.1.0) |
| 結果 |
AC
|
| 実行時間 | 446 ms / 2,000 ms |
| コード長 | 1,202 bytes |
| コンパイル時間 | 11,961 ms |
| コンパイル使用メモリ | 438,428 KB |
| 実行使用メモリ | 72,148 KB |
| 最終ジャッジ日時 | 2024-10-13 17:34:08 |
| 合計ジャッジ時間 | 13,583 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 4 |
ソースコード
import java.io.InputStream
import java.io.PrintWriter
import java.util.*
import kotlin.math.*
fun PrintWriter.solve() = with(FastScanner(System.`in`)) {
val t = nextInt()
for (_i in 0 until t) {
val a = nextInt()
val b = nextInt()
val c = nextInt()
val k1 = abs(a - b) / c + 1
if (c * k1 < a + b) {
println("$a $b ${c * k1}")
continue
}
val k2 = abs(b - c) / a + 1
if (a * k2 < b + c) {
println("${a * k2} $b $c")
continue
}
val k3 = abs(c - a) / b + 1
if (b * k3 < c + a) {
println("$a ${b * k3} $c")
continue
}
}
}
fun main() {
val writer = PrintWriter(System.out, false)
writer.solve()
writer.flush()
}
class FastScanner(s: InputStream) {
private var st = StringTokenizer("")
private val br = s.bufferedReader()
fun next(): String {
while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())
return st.nextToken()
}
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextLine() = br.readLine()
fun nextDouble() = next().toDouble()
}