Codeforces Round 434 (Div. 2, based on Technocup 2018 Elimination Round 1)


A. k-rounding
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
375 4
Output
30000
Input
10000 1
Output
10000
Input
38101 0
Output
38101
Input
123456789 8
Output
12345678900000000
----------------------------------------------------------------------------------------------------
B. Which floor?
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10 3
6 2
2 1
7 3
Output
4
Input
8 4
3 1
6 2
5 2
2 1
Output
-1
----------------------------------------------------------------------------------------------------
C. Did you mean...
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
hellno
Output
hell no 
Input
abacaba
Output
abacaba 
Input
asdfasdf
Output
asd fasd f 
----------------------------------------------------------------------------------------------------
D. Polycarp's phone book
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
123456789
100000000
100123456
Output
9
000
01
Input
4
123456789
193456789
134567819
934567891
Output
2
193
81
91
----------------------------------------------------------------------------------------------------
E. Tests Renumeration
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
01 0
2 1
2extra 0
3 1
99 0
Output
4
move 3 1
move 01 5
move 2extra 4
move 99 3
Input
2
1 0
2 1
Output
3
move 1 3
move 2 1
move 3 2
Input
5
1 0
11 1
111 0
1111 1
11111 0
Output
5
move 1 5
move 11 1
move 1111 2
move 111 4
move 11111 3
----------------------------------------------------------------------------------------------------
F. Wizard's Tour
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 5
1 2
3 2
2 4
3 4
4 1
Output
2
1 4 2
4 3 2
Input
5 8
5 3
1 2
4 5
5 1
2 5
4 3
1 4
3 2
Output
4
1 4 5
2 3 4
1 5 3
5 2 1
----------------------------------------------------------------------------------------------------
