380. Synchronised Alpinism
Time limit per test: 0.25
Memory limit: 262144
The progress does not stand! An institute of Sport Experiments (SE) is preparing new surprises for future Olympic Games.
There is no doubt that you are familiar with synchronised swimming. But do you know anything about synchronised boxing or synchronised basketball?
In this problem we will consider only synchronised alpinism. It is a team competition, each team consists of two members.
Initially one of them stands at the east side of the mountain and other — at the west side. Their aim is to meet at some point as fast as possible.
There is also one additional difficulty: at any moment of time they have to be at the same height.
Unfortunatly, SE's synchronised alpinism experimental contest was unsuccessful. No team managed to fulfill the task, so it was impossible to determine a winner!
Now SE is interested, is it really impossible to meet on the mountain under above restrictions or the teams just have to train harder. Try to help SE!
Here we will assume that mountain is flat figure, and its border is a polyline, with a peaks at points (1, y1
The first line of the input file consists one integer number n
The second line contains integer numbers y1
Points (1, y1
) and (n
) are initial positions of alpinists.
It is guaranteed that y1
=0 and y1
do not exceed
by absolute value.
If it is possible for the alpinists to meet, output "
", otherwise output "
" (quotes for clarity).
0 3 1 5 2 4 0