Codeforces Round 431 (Div. 1)


A. From Y to Y
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
12
Output
abababab
Input
3
Output
codeforces
----------------------------------------------------------------------------------------------------
B. Rooter's Song
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
8 10 8
1 1 10
1 4 13
1 7 1
1 8 2
2 2 0
2 5 14
2 6 0
2 6 1
Output
4 8
10 5
8 8
10 6
10 2
1 8
7 8
10 6
Input
3 2 3
1 1 2
2 1 1
1 1 5
Output
1 3
2 1
1 3
----------------------------------------------------------------------------------------------------
C. Goodbye Souvenir
time limit per test: 6 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7 6
1 2 3 1 3 2 1
2 3 7
2 1 3
1 7 2
1 3 2
2 1 6
2 5 7
Output
5
0
7
1
Input
7 5
1 3 2 1 4 2 3
1 1 4
2 2 3
1 1 7
2 4 5
1 1 7
Output
0
0
----------------------------------------------------------------------------------------------------
D. Shake It!
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 2
Output
6
Input
4 4
Output
3
Input
7 3
Output
1196
Input
31 8
Output
64921457
----------------------------------------------------------------------------------------------------
E. Days of Floral Colours
time limit per test: 7 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
Output
24
Input
4
Output
4
Input
7
Output
1316
Input
15
Output
3436404
----------------------------------------------------------------------------------------------------
