Codeforces Round 190 (Div. 2)


A. Ciel and Dancing
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 1
Output
2
1 1
2 1
Input
2 2
Output
3
1 1
1 2
2 2
----------------------------------------------------------------------------------------------------
B. Ciel and Flowers
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 6 9
Output
6
Input
4 4 4
Output
4
Input
0 0 0
Output
0
----------------------------------------------------------------------------------------------------
C. Ciel and Robot
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 2
RU
Output
Yes
Input
1 2
RU
Output
No
Input
-1 1000000000
LRRLU
Output
Yes
Input
0 0
D
Output
Yes
----------------------------------------------------------------------------------------------------
D. Ciel and Duel
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 3
ATK 2000
DEF 1700
2500
2500
2500
Output
3000
Input
3 4
ATK 10
ATK 100
ATK 1000
1
11
101
1001
Output
992
Input
2 4
DEF 0
ATK 0
0
0
1
1
Output
1
----------------------------------------------------------------------------------------------------
E. Ciel the Commander
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1 2
1 3
1 4
Output
A B B B
Input
10
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
Output
D C B A D C B D C D
----------------------------------------------------------------------------------------------------
