Codeforces Beta Round 39


A. Find Color
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
-2 1
Output
white
Input
2 1
Output
black
Input
4 3
Output
black
----------------------------------------------------------------------------------------------------
B. Repaintings
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 3
1
Output
4
Input
3 3
2
Output
1
Input
1 1
1
Output
1
----------------------------------------------------------------------------------------------------
C. Berland Square
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 0 1 1
Output
4
Input
1 0 1 2
Output
3
Input
3 3 4 7
Output
17
----------------------------------------------------------------------------------------------------
D. Interesting Sequence
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
Output
YES
1
1
0
Input
3
Output
NO
Input
13
Output
YES
1
2
0
Input
1729
Output
YES
1
4
1
156
----------------------------------------------------------------------------------------------------
E. Number Table
time limit per test: 2 seconds
memory limit per test: 216 megabytes
input: standard input
output: standard output

Examples
Input
2 2
0
100
Output
2
Input
2 2
1
1 1 -1
100
Output
1
----------------------------------------------------------------------------------------------------
