#P11271. 「Diligent-OI R1 A」DlgtPattern
「Diligent-OI R1 A」DlgtPattern
Problem Description
A cup is placed in an opaque box. The base of the cup can be regarded as a circle. The box can be regarded as a rectangular cuboid, and its thickness can be ignored.
Now place the bottom face of the box in a 2D Cartesian coordinate system. Its four vertices are at , , , and .
You only know that the center of the circular base of the cup is at . What is the maximum possible radius of the cup’s base?
Input Format
Only one line is given, containing four integers .
Output Format
Output only one number: the maximum possible radius of the cup’s base.
10 5 3 4
1
Hint
Explanation for Sample #1
The situation where the cup radius is the largest is shown in the figure below.

Constraints
For of the testdata, and .
| Test Point ID | Special Property |
|---|---|
| AB | |
| B | |
| None |
Special Property A: .
Special Property B: . That is, the center of the cup’s base is at the geometric center of the box’s bottom face.
Translated by ChatGPT 5