Codeforces Round 482 (Div. 2)


A. Pizza, Pizza, Pizza!!!
time limit per test: 1 second
memory limit per test: 128 megabytes
input: standard input
output: standard output

Examples
Input
3
Output
2
Input
4
Output
5
----------------------------------------------------------------------------------------------------
B. Treasure Hunt
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
Kuroo
Shiro
Katie
Output
Kuro
Input
7
treasurehunt
threefriends
hiCodeforces
Output
Shiro
Input
1
abcabc
cbabac
ababca
Output
Katie
Input
15
foPaErcvJ
mZaxowpbt
mkuOlaHRE
Output
Draw
----------------------------------------------------------------------------------------------------
C. Kuro and Walking Route
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 1 3
1 2
2 3
Output
5
Input
3 1 3
1 2
1 3
Output
4
----------------------------------------------------------------------------------------------------
D. Kuro and GCD and XOR and SUM
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
5
1 1
1 2
2 1 1 3
2 1 1 2
2 1 1 1
Output
2
1
-1
Input
10
1 9
2 9 9 22
2 3 3 18
1 25
2 9 9 20
2 25 25 14
1 20
2 26 26 3
1 14
2 20 20 9
Output
9
9
9
-1
-1
-1
----------------------------------------------------------------------------------------------------
E. Kuro and Topological Parity
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 1
-1 0 1
Output
6
Input
2 1
1 0
Output
1
Input
1 1
-1
Output
2
----------------------------------------------------------------------------------------------------
