Codeforces Round 140 (Div. 2)


A. Where do I Turn?
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
0 0
0 1
1 1
Output
RIGHT
Input
-1 -1
-3 -3
-4 -4
Output
TOWARDS
Input
-4 -6
-3 -7
-2 -6
Output
LEFT
----------------------------------------------------------------------------------------------------
B. Effective Approach
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
1 2
1
1
Output
1 2
Input
2
2 1
1
1
Output
2 1
Input
3
3 1 2
3
1 2 3
Output
6 6
----------------------------------------------------------------------------------------------------
C. Flying Saucer Segments
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 10
Output
2
Input
3 8
Output
2
----------------------------------------------------------------------------------------------------
D. Naughty Stone Piles
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
2 3 4 1 1
2
2 3
Output
9 8 
----------------------------------------------------------------------------------------------------
E. Anniversary
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10 1 8 2
Output
3
Input
10 1 8 3
Output
1
----------------------------------------------------------------------------------------------------
