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

22281번 - Forest for the Trees 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB30222071.429%

문제

You are playing hide-and-go-seek in a forest with Belle. The forest has one tree at each of the positive integer lattice points. That is, there is a tree at every point $(x,y)$ where $x$ and $y$ are both positive integers. You may consider each tree as a point. A logging company has cut down all of the trees in some axis-aligned rectangle, including those on the boundary of the rectangle.

You are standing at $(0,0)$ and Belle is standing at $(x_b,y_b)$. You can see Belle if and only if there is no tree blocking your line of sight to Belle. If there is a tree at $(x_b,y_b),ドル Belle will make it easier for you to find her by standing on the side of the tree facing your location.

For example, suppose that Belle is standing at $(2,6)$. If the trees in the rectangle with corners at $(1,1)$ and $(5,4)$ are cut down (blue rectangle in figure), then you can see Belle. However, if the rectangle was at $(3,5)$ and $(5,7)$ (red rectangle in figure), then the tree at $(1,3)$ would be in the way.

Given the rectangle and Belle's location, can you see her?

입력

The first line of input contains two integer $x_b$ and $y_b$ (1ドル \leq x_b,y_b \leq 10^{12}$), which are the coordinates that Belle is standing on.

The second line of input contains four integers $x_1,ドル $y_1,ドル $x_2$ and $y_2$ (1ドル \leq x_1 \leq x_2 \leq 10^{12}$ and 1ドル \leq y_1 \leq y_2 \leq 10^{12}$), which specify two opposite corners of the rectangle at $(x_1, y_1)$ and $(x_2, y_2)$.

출력

If you can see Belle, display Yes.

Otherwise, display No and the coordinates of the closest tree that is blocking your view.

제한

예제 입력 1

2 6
1 1 5 4

예제 출력 1

Yes

예제 입력 2

2 6
3 5 5 7

예제 출력 2

No
1 3

예제 입력 3

830844890448 39710592053
821266 42860 402207107926 423171345006

예제 출력 3

No
402207964848 19223704203

힌트

출처

ICPC > Regionals > North America > Rocky Mountain Regional > 2018 Rocky Mountain Regional Contest C번

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

출처

대학교 대회

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

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