Educational Codeforces Round 144 (Rated for Div. 2)


A. Typical Interview Problem
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
3
3
FFB
8
BFFBFFBF
3
BBB
Output
YES
YES
NO
----------------------------------------------------------------------------------------------------
B. Asterisk-Minor Template
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
aaab
zzzb
codeforces
atcoder
codeforces
tokitlx
aaaa
aaaaaa
abcd
abcd
c
f
Output
YES
*b
YES
*co*
NO
YES
a*a*a*a
YES
abcd
NO
----------------------------------------------------------------------------------------------------
C. Maximum Set
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4
3 11
13 37
1 22
4 100
Output
2 4
2 6
5 1
5 7
----------------------------------------------------------------------------------------------------
D. Maximum Subarray
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4
4 1 2
2 -1 2 3
2 2 3
-1 2
3 0 5
3 2 4
6 2 -8
4 -1 9 -3 7 -8
Output
5
7
0
44
----------------------------------------------------------------------------------------------------
E. Colored Subgraphs
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
4
1 2
2 3
3 4
5
1 2
1 3
1 4
1 5
3
1 3
3 2
7
3 2
2 5
7 5
3 1
1 6
1 4
Output
4
1
3
3
----------------------------------------------------------------------------------------------------
F. Strange Triples
time limit per test: 10 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 6 10
Output
7
Input
10 10 100
Output
29
Input
1 10 25
Output
0
Input
4242 6969 133333337
Output
19536
Input
94841 47471 581818184
Output
98715
----------------------------------------------------------------------------------------------------
