Hide and seek
In a playground, a group of kids is playing hide and seek. As the name suggests, the game is about kids hiding and seeking other kids. Each kid is either a hiding kid or a seeking kid. Hiding kids are kids that just try not to be found, while seeking kids are kids that try to find (hiding and seeking) kids.
As you may note, both hiding and seeking kids try not to be found, and for doing this they use some walls that there are in the playground. Each wall is represented by a line segment and each kid is represented by a point in the XY plane. Two kids see each other if and only if the line segment between them does not intersect any wall segment.
Your task is to calculate how many other kids each seeking kid can see. To simplify the problem, you may assume that walls do not intersect even at their endpoints. Moreover, no three points are collinear within the set formed by kids and endpoints of walls; this implies that kids are not inside walls, and that no two kids have the same location.
Input
The first line contains three integers S, K and W representing respectively the number of seeking kids, the total number of kids and the number of walls in the playground (1 ≤ S ≤ 10, 1 ≤ K, W ≤ 10_4 and S ≤ K). Each of the nextK lines describes a kid with two integers X and Y (-10^6 ≤ X, Y ≤ 10^6), indicating that the location of the kid in theXY plane is the point (X, Y); the first S of these lines describe seeking kids. Each of the next W lines describes a wall with four integers X_1, Y_1, X_2 and Y_2 (-10^6 ≤ X_1, Y_1, X_2, Y_2 ≤ 10^6), indicating that the two endpoints of the wall in the XY plane are (X_1, Y_1) and (X_2, Y_2). You may assume that wall segments do not intersect and no three points given in the input are collinear.
Output
Output S lines, each of them containing an integer. In the i-th line write the number of other kids the i-th seeking kid can see.