Codeforces Round 188 (Div. 1)


A. Perfect Pair
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 2 5
Output
2
Input
-1 4 15
Output
4
Input
0 -1 5
Output
-1
----------------------------------------------------------------------------------------------------
B. Ants
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 3
0 1
0 0
0 -1
Output
0
1
0
Input
6 5
0 -2
0 -1
0 0
0 1
0 2
Output
0
1
2
1
0
----------------------------------------------------------------------------------------------------
C. Balance
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 10 1
1 9
5 5
1 2
Output
1
2 1 4
Input
2 10 0
5 2
4 2
Output
NO
Input
2 10 0
4 2
4 2
Output
0
----------------------------------------------------------------------------------------------------
D. Game with Powers
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
Output
Vasya
Input
2
Output
Petya
Input
8
Output
Petya
----------------------------------------------------------------------------------------------------
E. Princess and Her Shadow
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
0 0 1 0 1
0 1
Output
LLUR
Input
5 0 3 0 8
2 -1
2 0
2 1
3 -1
4 1
4 0
3 1
4 -1
Output
-1
Input
3 2 1 1 3
0 1
1 0
0 0
Output
DLL
----------------------------------------------------------------------------------------------------
