Educational Codeforces Round 12


A. Buses Between Cities
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10 30
10 35
05:20
Output
5
Input
60 120
24 100
13:00
Output
9
----------------------------------------------------------------------------------------------------
B. Shopping
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 2 5
3 4 1 2 5
1 5
3 1
Output
14
----------------------------------------------------------------------------------------------------
C. Simple Strings
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
aab
Output
bab
Input
caaab
Output
cabab
Input
zscoder
Output
zscoder
----------------------------------------------------------------------------------------------------
D. Simple Subset
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
2 3
Output
2
3 2
Input
2
2 2
Output
1
2
Input
3
2 1 1
Output
3
1 1 2
Input
2
83 14
Output
2
14 83
----------------------------------------------------------------------------------------------------
E. Beautiful Subarrays
time limit per test: 3 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
3 1
1 2 3
Output
5
Input
3 2
1 2 3
Output
3
Input
3 3
1 2 3
Output
2
----------------------------------------------------------------------------------------------------
F. Four Divisors
time limit per test: 10 seconds
memory limit per test: 768 megabytes
input: standard input
output: standard output

Examples
Input
10
Output
3
Input
20
Output
5
----------------------------------------------------------------------------------------------------
