Kotlin Heroes: Practice 4


A. A+B (Trial Problem)
time limit per test: 2.0 s
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1 5
314 15
-99 99
123 987
Output
6
329
0
1110
----------------------------------------------------------------------------------------------------
B. Square?
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
2 3
3 1
3 2
1 3
3 3
1 3
Output
Yes
Yes
No
----------------------------------------------------------------------------------------------------
C. Sum of Round Numbers
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
5009
7
9876
10000
10
Output
2
5000 9
1
7 
4
800 70 6 9000 
1
10000 
1
10 
----------------------------------------------------------------------------------------------------
D. Alice, Bob and Candies
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
11
3 1 4 1 5 9 2 6 5 3 5
1
1000
3
1 1 1
13
1 2 3 4 5 6 7 8 9 10 11 12 13
2
2 1
6
1 1 1 1 1 1
7
1 1 1 1 1 1 1
Output
6 23 21
1 1000 0
2 1 2
6 45 46
2 2 1
3 4 2
4 4 3
----------------------------------------------------------------------------------------------------
E. Special Permutation
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
10
2
4
6
7
13
Output
9 6 10 8 4 7 3 1 5 2 
-1
3 1 4 2 
5 3 6 2 4 1 
5 1 3 6 2 4 7 
13 9 7 11 8 4 1 3 5 2 6 10 12 
----------------------------------------------------------------------------------------------------
