Codeforces Round 566 (Div. 2)


A. Filling Shapes
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
Output
4
Input
1
Output
0
----------------------------------------------------------------------------------------------------
B. Plus from Picture
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 6
......
..*...
.****.
..*...
..*...
Output
YES
Input
3 5
..*..
****.
.*...
Output
NO
Input
7 7
.......
...*...
..****.
...*...
...*...
.......
.*.....
Output
NO
Input
5 6
..**..
..**..
******
..**..
..**..
Output
NO
Input
3 7
.*...*.
***.***
.*...*.
Output
NO
Input
5 10
..........
..*.......
.*.******.
..*.......
..........
Output
NO
----------------------------------------------------------------------------------------------------
C. Beautiful Lyrics
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
14
wow
this
is
the
first
mcdics
codeforces
round
hooray
i
am
proud
about
that
Output
3
about proud
hooray round
wow first
this is
i that
mcdics am
Input
7
arsijo
suggested
the
idea
for
this
problem
Output
0
Input
4
same
same
same
differ
Output
1
same differ
same same
----------------------------------------------------------------------------------------------------
D. Complete Mirror
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
1 2
2 3
3 4
4 5
3 6
6 7
Output
3
Input
6
1 3
2 3
3 4
4 5
4 6
Output
-1
----------------------------------------------------------------------------------------------------
E. Product Oriented Recurrence
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 1 2 5 3
Output
72900
Input
17 97 41 37 11
Output
317451037
----------------------------------------------------------------------------------------------------
F. Maximum Sine
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
0 3 1 3
17 86 389 995
Output
1
55
----------------------------------------------------------------------------------------------------
