Codeforces Round 180 (Div. 2)


A. Snow Footprints
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
9
..RRLL...
Output
3 4
Input
11
.RRRLLLLL..
Output
7 5
----------------------------------------------------------------------------------------------------
B. Sail
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 0 0 1 1
SESNW
Output
4
Input
10 5 3 3 6
NENSWESNEE
Output
-1
----------------------------------------------------------------------------------------------------
C. Parity Game
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
01011
0110
Output
YES
Input
0011
1110
Output
NO
----------------------------------------------------------------------------------------------------
D. Fish Weight
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 3 3
2 2 2
1 1 3
Output
YES
Input
4 7 9
5 2 7 3
3 5 2 7 3 8 7
Output
NO
----------------------------------------------------------------------------------------------------
E. Splitting the Uniqueness
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
12 5 8 3 11 9
Output
YES
6 2 6 0 2 4
6 3 2 3 9 5
----------------------------------------------------------------------------------------------------
