Created
October 24, 2022 07:22
-
-
Save Tokiyomi/f21d5bddec890a4be9877a1e6155e484 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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