Educational Codeforces Round 13


A. Johny Likes Numbers
time limit per test: 0.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 3
Output
6
Input
25 13
Output
26
Input
26 13
Output
39
----------------------------------------------------------------------------------------------------
B. The Same Calendar
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2016
Output
2044
Input
2000
Output
2028
Input
50501
Output
50507
----------------------------------------------------------------------------------------------------
C. Joty and Chocolate
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 2 3 12 15
Output
39
Input
20 2 3 3 5
Output
51
----------------------------------------------------------------------------------------------------
D. Iterated Linear Function
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 4 1 1
Output
7
Input
3 4 2 1
Output
25
Input
3 4 3 1
Output
79
----------------------------------------------------------------------------------------------------
E. Another Sith Tournament
time limit per test: 2.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
0.0 0.5 0.8
0.5 0.0 0.4
0.2 0.6 0.0
Output
0.680000000000000
----------------------------------------------------------------------------------------------------
F. Lena and Queries
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
3 1
1 2 3
3 1
1 -1 100
3 1
2 4
3 1
Output
EMPTY SET
5
99
5
----------------------------------------------------------------------------------------------------
