8VC Venture Cup 2017 - Elimination Round


A. PolandBall and Hypothesis
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
Output
1
Input
4
Output
2
----------------------------------------------------------------------------------------------------
B. PolandBall and Game
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 1
polandball
is
a
cool
character
nope
Output
YES
Input
2 2
kremowka
wadowicka
kremowka
wiedenska
Output
YES
Input
1 2
a
a
b
Output
NO
----------------------------------------------------------------------------------------------------
C. PolandBall and Forest
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
2 1 5 3 3
Output
2
Input
1
1
Output
1
----------------------------------------------------------------------------------------------------
D. PolandBall and Polygon
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 2
Output
2 3 5 8 11 
Input
10 3
Output
2 3 4 6 9 12 16 21 26 31 
----------------------------------------------------------------------------------------------------
E. PolandBall and White-Red graph
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 1
Output
-1
Input
5 2
Output
4
1 2
2 3
3 4
4 5
----------------------------------------------------------------------------------------------------
F. PolandBall and Gifts
time limit per test: 1.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 2
3 4 1 5 2
Output
2 4
Input
10 1
2 3 4 5 6 7 8 9 10 1
Output
2 2
----------------------------------------------------------------------------------------------------
G. PolandBall and Many Other Balls
time limit per test: 6 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 3
Output
5 5 1 
Input
1 1
Output
1 
Input
5 10
Output
9 25 25 9 1 0 0 0 0 0 
----------------------------------------------------------------------------------------------------
