1188 - SCU-H

Time Limit : 1 Second

Memory Limit : 128 MB

Submission: 108

Solved: 17

Description
Give you two polygons,
Can you tell me if they have any common area?
Input
Input contains multiple cases, in each case,
first line, two integers n( 1 <= n < 15 ) and m( 1 <= m < 15 ),
which describe the number of points of the two polygons.
Then comes n+m lines,each line contains two real numbers,
the coordinate of a point in 2D.
The first n lines describe the first polygon,
the next m lines describe the second polygon.
The two polygon are all described in counterclocks wise.
Output
If the two polygons have any common area,
output "YES" in a single line,
else output "NO".
sample input
9 9
0.000 70.00
10 45.0
21 70
33 45
46 70
60 45
75 70
75 100
0 100
0 0
75 0.0
75 55
65 30
54 55
42.000000 30
29 55
15 30
0 55
sample output
YES
hint
source
SCUPC
© 2015 HUST ACMICPC TEAM. All Right Reserved.