Codeforces Beta Round 18 (Div. 2 Only)


A. Triangle
time limit per test: 2 seconds
memory limit per test: 64 megabytes
input: standard input
output: standard output

Examples
Input
0 0 2 0 0 1
Output
RIGHT
Input
2 3 4 5 6 6
Output
NEITHER
Input
-1 0 2 0 0 1
Output
ALMOST
----------------------------------------------------------------------------------------------------
B. Platforms
time limit per test: 2 seconds
memory limit per test: 64 megabytes
input: standard input
output: standard output

Examples
Input
2 2 5 3
Output
4
Input
5 4 11 8
Output
20
----------------------------------------------------------------------------------------------------
C. Stripe
time limit per test: 2 seconds
memory limit per test: 64 megabytes
input: standard input
output: standard output

Examples
Input
9
1 5 -6 7 9 -16 0 -2 2
Output
3
Input
3
1 1 1
Output
0
Input
2
0 0
Output
1
----------------------------------------------------------------------------------------------------
D. Seller Bob
time limit per test: 2 seconds
memory limit per test: 128 megabytes
input: standard input
output: standard output

Examples
Input
7
win 10
win 5
win 3
sell 5
sell 3
win 10
sell 10
Output
1056
Input
3
win 5
sell 6
sell 4
Output
0
----------------------------------------------------------------------------------------------------
E. Flag 2
time limit per test: 2 seconds
memory limit per test: 128 megabytes
input: standard input
output: standard output

Examples
Input
3 4
aaaa
bbbb
cccc
Output
6
abab
baba
acac
Input
3 3
aba
aba
zzz
Output
4
aba
bab
zbz
----------------------------------------------------------------------------------------------------
