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

7649번 - Energy Collection 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB112233.333%

문제

You have been given a square grid with a number of non-overlapping energy cells on it. These energy cells are quite peculiar; they are all squares, and despite their differences in sizes, they all produce the exact same amount of energy. From this grid, you wish to collect as much energy as possible, using a special collector. This collector is also square, and must be placed onto the grid on top of the energy cells. The collector can be resized to whatever size you want, as long as it remains grid-aligned (i.e., the size must be integral). The collector will collect all of the energy from any energy cell it overlaps (that is, the intersection of the collector with the energy cell has positive area), but only if the energy cell is at least as large as the collector. Energy cells that are smaller than the collector cannot be collected at all, regardless of location. Find a location and size for the collector so as to maximize the amount of energy collected.

입력

The input consists of several test cases. The first line of each test case consists of a single integer N (1 ≤ N ≤ 1,000) denoting the number of energy cells. This is followed by N lines with 4 space-separated integers each describing the energy cell, x1, y1, x2, and y2, where (x1, y1) is the lower left corner of the cell and (x2, y2) is the upper right corner of the cell (−106 ≤ x1 < x2 ≤ 106 , −106 ≤ y1 < y2 ≤ 106 , x2 − x1 = y2 − y1). Input is followed by a single line with N = 0, which should not be processed.

출력

For each test case, print out a single line with 4 space-separated integers describing the location of the collector, x1, y1, x2, and y2, where (x1, y1) is the lower left corner of the collector and (x2, y2) is the upper right corner of the collector. Any collector that collects the maximum possible amount of energy will be judged correct.

제한

예제 입력 1

5
3 3 4 4
0 0 3 3
0 4 3 7
4 0 7 3
4 4 7 7
0

예제 출력 1

2 2 5 5

힌트

출처

University > Stanford Local ACM Programming Contest > SLPC 2010 Round Two E번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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