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

30938번 - Probing the Disk 다국어인터랙티브

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 (추가 시간 없음) 1024 MB225433821.965%

문제

This is an interactive problem.

A thin black disk is laid flat on the square bottom of a white box. The sides of the box bottom are 10ドル^5$ units long.

Somehow, you are not allowed to look into the box, but you want to know how large the disk is and where in the box bottom the disk is laid. You know that the shape of the disk is a true circle with an integer units of radius, not less than 100ドル$ units, and its center is integer units distant from the sides of the box bottom. The radius of the disk is, of course, not greater than the distances of the center of the disk from any of the sides of the box bottom.

You can probe the disk by projecting a thin line segment of light to the box bottom. As the reflection coefficients of the disk and the box bottom are quite different, from the overall reflection intensity, you can tell the length of the part of the segment that lit the disk.

Your task is to decide the exact position and size of the disk through repetitive probes.

입력

출력

제한

인터랙션

You can repeat probes, each of which is a pair of sending a query and receiving the response to it. You can probe at most 1024ドル$ times.

A query should be sent to the standard output in the following format, followed by a newline.

query $x_1$ $y_1$ $x_2$ $y_2$

Here, $(x_1, y_1)$ and $(x_2, y_2)$ are the positions of the two ends of the line segment of the light. They have to indicate distinct points. The coordinate system is such that one of the corners of the box bottom is the origin $(0, 0)$ and the diagonal corner has the coordinates $(10^5 , 10^5 )$. All of $x_1,ドル $y_1,ドル $x_2,ドル and $y_2$ should be integers between 0ドル$ and 10ドル^5,ドル inclusive.

In response to this query, a real number is sent back to the standard input, followed by a newline. The number indicates the length of the part of the segment that lit the disk. It is in decimal notation without exponent part, with 7ドル$ digits after the decimal point. The number may contain an absolute error up to 10ドル^{-6$.

When you become sure about the position and the size of the disk through the probes, you can send your answer. The answer should have the center position and the radius of the disk. It should be sent to the standard output in the following format, followed by a newline.

answer $x$ $y$ $r$

Here, $(x, y)$ should be the position of the center of the disk, and $r$ the radius of the disk. All of $x,ドル $y,ドル and $r$ should be integers.

After sending the answer, your program should terminate without any extra output. Thus, you can send the answer only once.

Notes on interactive judging

When your output violates any of the conditions above (incorrect answer, invalid format, $x_1,ドル $y_1,ドル $x_2,ドル or $y_2$ being out of the range, too many queries, any extra output after sending your answer, and so on), your submission will be judged as a wrong answer. As some environments require flushing the output buffers, make sure that your outputs are actually sent. Otherwise, your outputs will never reach the judge.

You are provided with a command-line tool for local testing. For more details, refer to the clarification in the contest system.

예제 입력 1

60000.0000000
0.0000000
12315.3774869

예제 출력 1

query 40000 0 40000 100000
query 0 10000 100000 10000
query 60000 60000 80000 80000
answer 40000 60000 30000

힌트

Figure K.1. Sample Interaction

출처

ICPC > Regionals > Asia Pacific > Japan > ICPC 2023 Asia Yokohama Regional K번

채점 및 기타 정보

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

출처

대학교 대회

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

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