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

11188번 - Lifting Walls 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB76504563.380%

문제

The local building firm needs your help. They are building an apartment building where the walls are prefabricated and lifted in place using cranes. The building firm has located n possible locations for cranes, and needs to choose some of these so that the center of each wall can be reached by at least one crane. The cranes are quite expensive, so they want to use as few of them as possible. A crane can reach a wall if the wall’s center is at most a distance r away.

The house that is to be built is rectangular with a length l and width w.

Find the minimum number of cranes required to reach the center of all four walls.

Figure C.1: This example corresponds to sample input 1.

입력

The first line of input contains four space-separated positive integers l, w, n and r, all at most 30. l and w denote the length and width of the house, n denotes the number of possible crane locations, and r denotes the reaching distance of each crane.

This is followed by n lines, each containing two integers x and y (−100 ≤ x, y ≤ 100), denoting a possible location for a crane. The coordinate system has its origin in the center of the building and the x-coordinate along the length of the house. The walls thus have their centers at (x, y) = (−l/2, 0),(l/2, 0),(0, −w/2),(0, w/2).

출력

Output one integer, the minimum number of cranes required to reach all wall segments, or Impossible if not all wall segments can be reached.

제한

예제 입력 1

4 2 3 3
1 -2
4 0
-1 2

예제 출력 1

2

예제 입력 2

6 1 1 1
1 0

예제 출력 2

Impossible

힌트

출처

Contest > KTH Challenge > KTH Challenge 2012 C번

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

출처

대학교 대회

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

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