Unknown Language Round 3


A. Carpeting the Room
time limit per test: 2 seconds
memory limit per test: 64 megabytes
input: standard input
output: standard output

Examples
Input
10 4 6
Output
YES
Input
10 2 5
Output
NO
----------------------------------------------------------------------------------------------------
B. Friendly Numbers
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1,3,6,12
Output
FRIENDS
Input
3
1,2,9
Output
NOT FRIENDS
----------------------------------------------------------------------------------------------------
C. A+B
time limit per test: 2 seconds
memory limit per test: 64 megabytes
input: standard input
output: standard output

Examples
Input
2
3
Output
5
Input
1390
2011
Output
3401
Input
12345
54321
Output
66666
----------------------------------------------------------------------------------------------------
D. World of Mouth
time limit per test: 5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
100
Codeforces
MMIODPC
Output
Yes
Input
5
MMIOD
CF
Output
No
----------------------------------------------------------------------------------------------------
E. Lamps in a Line
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
off off
2
1 2
Output
on off 
Input
3
off off on
6
1 1 1 1 2 2
Output
off off on 
----------------------------------------------------------------------------------------------------
F. Polynom
time limit per test: 2 seconds
memory limit per test: 64 megabytes
input: standard input
output: standard output

Examples
Input
2
-1
1
Output
X^2-1
Input
2
1
1
Output
X^2+2*X+1
----------------------------------------------------------------------------------------------------
G. Name the album
time limit per test: 2 seconds
memory limit per test: 64 megabytes
input: standard input
output: standard output

Examples
Input
3
eyesonme 2008
anewdayhascome 2002
oneheart 2003
2
oneheart
bienbien
Output
bienbien
Input
2
nasimevasl 2003
basetareha 2006
2
nasimevasl
basetareha
Output
nasimevasl
----------------------------------------------------------------------------------------------------
H. Battleship
time limit per test: 2 seconds
memory limit per test: 64 megabytes
input: standard input
output: standard output

Examples
Input
2
****000000
0000000000
***00***00
0000000000
00000000**
000**00000
00000000**
000*000000
00000*00*0
0*00000000
****000000
0000000000
***00***00
0000000000
00000000**
000**00000
00000000**
0000*00000
00000*00*0
0*00000000
Output
YES
NO
----------------------------------------------------------------------------------------------------
I. Rotation
time limit per test: 2 seconds
memory limit per test: 64 megabytes
input: standard input
output: standard output

Examples
Input
90
1 1
Output
-1.00000000 1.00000000
Input
180
1 1390
Output
-1.00000000 -1390.00000000
----------------------------------------------------------------------------------------------------
J. Interval Coloring
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
[1,2)
(3,4]
Output
1
Input
3
[1,3]
[2,6]
(5,7)
Output
2
----------------------------------------------------------------------------------------------------
