Codeforces Round 233 (Div. 2)


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

Examples
Input
17 5 2
Output
<< 3 4 (5) 6 7 >> 
Input
6 5 2
Output
<< 3 4 (5) 6 
Input
6 1 2
Output
(1) 2 3 >> 
Input
6 2 2
Output
1 (2) 3 4 >>
Input
9 6 3
Output
<< 3 4 5 (6) 7 8 9
Input
10 6 3
Output
<< 3 4 5 (6) 7 8 9 >>
Input
8 5 4
Output
1 2 3 4 (5) 6 7 8 
----------------------------------------------------------------------------------------------------
B. Red and Blue Balls
time limit per test: 0.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
RBR
Output
2
Input
4
RBBR
Output
6
Input
5
RBBRR
Output
6
----------------------------------------------------------------------------------------------------
C. Cards
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 3
Output
-1
xoxox
Input
4 0
Output
16
oooo
Input
0 4
Output
-16
xxxx
----------------------------------------------------------------------------------------------------
D. Painting The Wall
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 2
2 3
4 1
Output
11.7669491886
Input
2 2
1 1
1 2
Output
2.0000000000
Input
1 1
1 1
Output
0.0000000000
----------------------------------------------------------------------------------------------------
E. Tree and Array
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

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