Codeforces Round 130 (Div. 2)


A. Dubstep
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
WUBWUBABCWUB
Output
ABC 
Input
WUBWEWUBAREWUBWUBTHEWUBCHAMPIONSWUBMYWUBFRIENDWUB
Output
WE ARE THE CHAMPIONS MY FRIEND 
----------------------------------------------------------------------------------------------------
B. Solitaire
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
2S 2S 2C 2C
Output
YES
Input
2
3S 2C
Output
NO
----------------------------------------------------------------------------------------------------
C. Police Station
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 4
1 2
2 4
1 3
3 4
Output
1.000000000000
Input
11 14
1 2
1 3
2 4
3 4
4 5
4 6
5 11
6 11
1 8
8 9
9 7
11 7
1 10
10 4
Output
1.714285714286
----------------------------------------------------------------------------------------------------
D. Prizes, Prizes, more Prizes
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
3 10 4
2 4 10 15 20
Output
1 1 1 0 0 
1
Input
4
10 4 39 2
3 5 10 11 12
Output
3 0 1 0 3 
0
----------------------------------------------------------------------------------------------------
E. Blood Cousins
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
0 1 1 0 4 4
7
1 1
1 2
2 1
2 2
4 1
5 1
6 1
Output
0 0 1 0 0 1 1 
----------------------------------------------------------------------------------------------------
