Logo
(追記) (追記ここまで)

34595번 - Stapler 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 2048 MB38242466.667%

문제

Alice is selling a new model of game console in the toy store. When selling a new console, Alice uses a stapler to attach the receipt to the box.

However, the stapler pierces the box at two points, causing damage along the entire line segment between those two points. If any part of this segment (including its endpoints) overlaps with the console’s screen (including its boundary), it will be damaged and Alice must compensate for the console.

Fortunately, a laser reveals the exact position of the screen inside the box. The game console’s screen is a rectangle with sides parallel to the coordinate axes. Its bottom-left corner is at $(x_l , y_l)$ and its top-right corner is at $(x_r, y_r)$.

Alice plans to staple the box at the points $(x_1, y_1)$ and $(x_2, y_2)$. Please help her determine whether the stapler will damage the screen. If it will, stop her immediately.

입력

Each test contains multiple test cases. The first line contains the number of test cases $t$. The description of the test cases follows.

The first line of each test case contains four integers $x_l,ドル $y_l,ドル $x_r,ドル $y_r,ドル representing the coordinates of the bottom-left and top-right corners of the screen.

The second line of each test case contains four integers $x_1,ドル $y_1,ドル $x_2,ドル $y_2,ドル representing the coordinates of the expected stapler penetration positions.

출력

For each test case, print STOP on a line if Alice will damage the screen, and print OK otherwise.

제한

  • 1ドル ≤ t ≤ 10^4
  • The area of the screen is greater than 0ドル$.
  • The length of the stapler is greater than 0ドル$.
  • All coordinates are integers with absolute value at most 10ドル^4$.

예제 입력 1

3
0 0 5 5
0 10 10 0
0 0 5 5
6 6 6 7
0 0 5 5
1 1 2 2

예제 출력 1

STOP
OK
STOP

노트

출처

ICPC > Regionals > Asia Pacific > Taiwan > Taiwan Online Programming Contest > TOPC 2025 L번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /