시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 512 MB 1 1 1 100.000%

문제

Of the seventeen enumerated laws of Soccer, Offside as described by Law 11 is perhaps the most contentious. In short, offside consists of two conditions: the offside position, and a state of play that turns the offside position into an offense. In an attempt to consistently enforce offside offenses (and generally ratchet down the poor sportsmanship of parents who consider themselves smarter than the referees, but too selfish to serve as referees themselves), your team has been contacted to implement the analysis algorithm for Offside Enforcement Technology, soon to be known as OET. This phase of OET will focus solely on the Offside Position, which may be stated as:

  • Any part of a player’s head, body, or feet (but not hands or arms) is in the opponents' side of the field (excluding the halfway line), AND
  • Any part of a player’s head, body, or feet (but not hands or arms) is closer to the opponents' goal line than BOTH the ball AND all but 1 opponent

For the purposes of OET, consider each player to be a single point, and determine if the offense is in an offside position. The field will be 100m × 80m, with the point (0,0) being the center of the halfway line, and the opponent’s goal line running from (50,-40) to (50,40).

입력

Each input will consist of a single test case. Note that your program may be run multiple times on different inputs. Each test case will have exactly 23 lines of input. Each line will contain two integers, x and y (-50 ≤ x ≤ 50, -40 ≤ y ≤ 40), which indicate the position of the ball or a player on the field in meters. The first line will indicate the position of the ball, then the next 11 will be the offense and the last 11 will be the defense. No two players will be in the same position.

출력

Output a single integer, 1 of the play is offside, and 0 if it is not.

예제 입력 1

9 4
-45 -40
-11 18
44 -16
36 -32
-29 -30
7 -33
47 27
5 -37
-11 18
-15 -6
-7 -1
1 22
-39 11
-9 -9
10 38
-43 -8
-16 -29
43 -27
2 -27
-4 -30
49 -15
-48 10

예제 출력 1

1

예제 입력 2

9 4
-45 -40
-11 18
44 -16
36 -32
-29 -30
7 -33
47 27
5 -37
-11 18
-15 -6
-7 -1
1 22
-39 11
-9 -9
10 38
-43 -8
-16 -29
48 -27
2 -27
-4 -30
49 -15
-48 10

예제 출력 2

0