CF2199B Two Towers
不知道为什么只能用kotlin提交,第一次尝试写
fun main() = Scanner(System.`in`).run {
val n = nextLine().toInt()
repeat(n) {
val a = nextInt()
val b = nextInt()
val c = nextInt()
val d = nextInt()
var cnt = c + d - a - b
if (maxOf(a, b) < minOf(c, d)) {
cnt -= minOf(c, d) - maxOf(a, b)
}
println(cnt)
}
close()
}

浙公网安备 33010602011771号