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

34786번 - Fractal Painting 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB138861.538%

문제

A fractal painting consists of an infinite number of line segments. The first segment, called A, connects points $(0, 0)$ and $(x_0, y_0)$.

The next two segments B and C connect $(x_0, y_0)$ to $(x_1, y_1)$ and $(x_0, y_0)$ to $(x_2, y_2),ドル respectively.

The rest of the painting is defined recursively. We draw two segments D and E from $(x_1, y_1)$ so that the segments B, D, E are similar to the segments A, B, C. Here, similar segments mean that they can be matched point-to-point by performing translating, rotating, and scaling on the original segments.

Similarly, we draw segments F and G from $(x_2, y_2)$ so that the segments C, F, G are similar to the segments A, B, C.

This procedure continues indefinitely.

Find out whether it is possible to find a rectangle (of any size) that contains the entire fractal painting.

입력

The first line of input contains a single integer $T$ $(1 \le T \le 10^4),ドル representing the number of test cases. Each of the next $T$ lines describes a single test case. Each test case consists of a single line with six integers $x_0,ドル $y_0,ドル $x_1,ドル $y_1,ドル $x_2,ドル and $y_2$ in order. All coordinates are between $-10^4$ and 10ドル^4,ドル inclusive. It is guaranteed that $(0, 0),ドル $(x_0, y_0),ドル $(x_1, y_1),ドル and $(x_2, y_2)$ are all distinct points.

출력

For every test case, output YES if the entire fractal painting can fit in some rectangular frame. Output NO if there is no such rectangle.

제한

예제 입력 1

3
1 3 -1 3 3 4
1 1 67 0 0 67
67 67 1 0 0 1

예제 출력 1

YES
NO
YES

노트

출처

ICPC > Regionals > North America > Pacific Northwest Regional > 2025 ICPC Pacific Northwest Regional > Division 1 E번

ICPC > Regionals > North America > Pacific Northwest Regional > 2025 ICPC Pacific Northwest Regional > Division 2 H번

  • 문제를 만든 사람: Jaehyun Park
(追記) (追記ここまで)

출처

대학교 대회

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

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