| Online MIPT programming contest | РУССКИЙ |
| <PREV Problem: | NEXT> |
< |
|---|
Time limit = 5 second(s)
Memory limit = 10
There are some stick on the plane. Their ends have integer coordinates. Two points A and B has integer coordinates and don't lie on a stick.Your program should determine whether there is continuous way from A to B not crossing sticks.

Input First two line contain coordinates of point A and point B. Next line contains number of sticks N. In the next N lines coordinates of stick ends are given. Each line contains four numbers x1, y1, x2, y2, separated with space.
Output YES or NO.
Input#10 0 10 0 1 2 2 2 -2 |
Output#1YES |
Input#20 0 10 0 4 -4 -4 4 -4 4 -4 4 4 4 4 -4 4 -4 4 -4 -4 |
Output#2NO |
Author:
Voroztsov Artem
26 march 2003
© acm.mipt DevGroup The page was generated in 350ms |