Codeforces Beta Round 44 (Div. 2)


A. Triangular numbers
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
Output
YES
Input
2
Output
NO
Input
3
Output
YES
----------------------------------------------------------------------------------------------------
B. Coins
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
A>B
C<B
A>C
Output
CBA
Input
A<B
B>C
C>A
Output
ACB
----------------------------------------------------------------------------------------------------
C. Crossword
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
NOD
BAA
YARD
AIRWAY
NEWTON
BURN
Output
BAA...
U.I...
R.R...
NEWTON
..A..O
..YARD
Input
AAA
AAA
AAAAA
AAA
AAA
AAAAA
Output
AAA..
A.A..
AAAAA
..A.A
..AAA
Input
PTC
JYNYFDSGI
ZGPPC
IXEJNDOP
JJFS
SSXXQOFGJUZ
Output
JJFS....
Y..S....
N..X....
Y..X....
F..Q....
D..O....
S..F....
G..G....
IXEJNDOP
...U...T
...ZGPPC
----------------------------------------------------------------------------------------------------
D. Safe
time limit per test: 5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6 2
000000 2
010100 4
Output
6
Input
6 3
000000 2
010100 4
111100 0
Output
0
Input
6 3
000000 2
010100 4
111100 2
Output
1
----------------------------------------------------------------------------------------------------
E. Cannon
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 10
0.7853
0.3
3
5.0 5.0
4.0 2.4
6.0 1.9
Output
5.000000000 2.549499369
4.000000000 0.378324889
Input
2 10
0.7853
0.3
2
4.0 2.4
6.0 1.9
Output
10.204081436 0.000000000
4.000000000 0.378324889
----------------------------------------------------------------------------------------------------
