Skip to content

Instantly share code, notes, and snippets.

@Tokiyomi
Created October 24, 2022 07:22
Show Gist options
  • Save Tokiyomi/f21d5bddec890a4be9877a1e6155e484 to your computer and use it in GitHub Desktop.
Save Tokiyomi/f21d5bddec890a4be9877a1e6155e484 to your computer and use it in GitHub Desktop.
// Main in Kotlin
fun main() {
val T:Int = readln().toInt(); // Read number of cases
for (t in 0..T-1) {
var N:Int = readln().toInt(); // Read N int
if (N == -1) {
break
}
// Generate our A set of powers of two
var A = powers_of_two(N)
// Print A set in terminal
println(A.joinToString(" "))
// Read B set from terminal
var B = readln().split(' ').map{ it.toLong() }
B = B.toMutableList()
// Solve case
var C = solve_sum(A,B)
println(C.joinToString(" "))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment