Sweep line algorithm
 
x
OK