Codeforces Round 183 (Div. 2)


A. Pythagorean Theorem II
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
Output
1
Input
74
Output
35
----------------------------------------------------------------------------------------------------
B. Calendar
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1900:01:01
2038:12:31
Output
50768
Input
1996:03:09
1991:11:12
Output
1579
----------------------------------------------------------------------------------------------------
C. Lucky Permutation Triple
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
Output
1 4 3 2 0
1 0 2 4 3
2 4 0 1 3
Input
2
Output
-1
----------------------------------------------------------------------------------------------------
D. Rectangle Puzzle II
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
9 9 5 5 2 1
Output
1 3 9 7
Input
100 100 52 50 46 56
Output
17 8 86 92
----------------------------------------------------------------------------------------------------
E. Minimum Modular
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7 0
0 2 3 6 7 12 18
Output
13
Input
7 1
0 2 3 6 7 12 18
Output
7
----------------------------------------------------------------------------------------------------
