Educational Codeforces Round 68 (Rated for Div. 2)


A. Remove a Progression
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
3 1
4 2
69 6
Output
2
4
12
----------------------------------------------------------------------------------------------------
B. Yet Another Crosses Problem
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
9
5 5
..*..
..*..
*****
..*..
..*..
3 4
****
.*..
.*..
4 3
***
*..
*..
*..
5 5
*****
*.*.*
*****
..*.*
..***
1 4
****
5 5
.....
..*..
.***.
..*..
.....
5 3
...
.*.
.*.
***
.*.
3 3
.*.
*.*
.*.
4 4
*.**
....
*.**
*.**
Output
0
0
0
0
0
4
1
1
2
----------------------------------------------------------------------------------------------------
C. From S To T
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
ab
acxb
cax
a
aaaa
aaabbcc
a
aaaa
aabbcc
ab
baaa
aaaaa
Output
YES
YES
NO
NO
----------------------------------------------------------------------------------------------------
D. 1-2-K Game
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
0 3
3 3
3 4
4 4
Output
Bob
Alice
Bob
Alice
----------------------------------------------------------------------------------------------------
E. Count The Rectangles
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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

Examples
Input
3 5
2 2 2
Output
750000007
Input
3 5
2 1 2
Output
125000003
----------------------------------------------------------------------------------------------------
G. Another Meme Problem
time limit per test: 4 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
42
Output
150
Input
3141592653589793238462643383279
Output
459925407
----------------------------------------------------------------------------------------------------
