The input consists of:
• one line with two integers ww (1≤w≤10001≤w≤1000), the number of wells, and pp (1≤p≤10001≤p≤1000), the number of pipes;
• ww lines, the iith of which contains two integers xixi and yiyi (−10000≤x,y≤10000−10000≤x,y≤10000), the position of well number ii (the wells are numbered from 11 to ww);
• pp lines each with three integers ss (1≤s≤w1≤s≤w), the well at which the pipe starts, and xx and yy (−10000≤x,y≤10000−10000≤x,y≤10000), the position at which the pipe ends.
Each pipe will contain exactly one well, the one at which it starts. Any point shared by more than two pipes will be a well. Any two pipes share at most one common point. The common point of two pipes may be the endpoint of one or both of them. All pipes have positive length.
输入包括:
第一行两个整数w(1<=w<=1000)和p(1<=p<=1000),分别表示井的数量和管道的数量。
接下来w行,每行两个整数xi和yi(-10000<=x,y<=10000),表示i号井的位置(井从1到w编号)。
接下来p行,每行3个整数s(1<=s<=w)表示管道从s号井开始,x和y(-10000<=x,y<=10000)表示管道在位置为x,y的点结束。
每条管道都有一个井,就是它开始的那个。被两个或多个管道共享的点是一口井。任两条管道至多会有一个交点。两条管道的公共点可以是他们其中之一或两者的端点。所有管道的长度为正数。