#P5671. 「SWTR-2」Triangles

「SWTR-2」Triangles

Description

He encountered two puzzles:

  • In a plane, the line segment DEDE intersects the line FGFG at point OO. Given DOF=x\angle DOF=x^{\circ}, find a point PP on the line FGFG such that DOP\triangle DOP is an isosceles triangle, and compute the measure of D\angle D. (If the answer is not an integer, keep 11 decimal place.)

  • Given a right triangle with two sides m,nm,n, find the length of the third side (keep 55 decimal places).

Write a program to compute the answers to the problems.

Input Format

One line with three positive integers: x,m,nx,m,n.

Output Format

Output two lines. The first line is the answer to the first question, and the second line is the answer to the second question.

If there are multiple solutions, separate them with spaces and output them in increasing order.

60 1 1
30 60
1.41421

Hint


Sample Explanation

Problem 11:

  • When point PP is to the left of point OO, the formed DOP\triangle DOP is an equilateral triangle, so D=60\angle D=60^{\circ}.

  • When point PP is to the right of point OO, in the formed DOP\triangle DOP, DOP=18060=120\angle DOP=180^{\circ}-60^{\circ}=120^{\circ} is the vertex angle, so D=(180120)/2=30\angle D=(180^{\circ}-120^{\circ})/2=30^{\circ}.

Problem 22:

The third side is the hypotenuse, with length 12+12=2=1.41421\sqrt{1^2+1^2}=\sqrt{2}=1.41421\dots.


Constraints and Notes

x<90,mn109x<90,m\leq n\leq 10^9.


Problem Setter's Hint

There are countless methods, but reading carefully comes first. Multiple solutions are not considered, and a wrong answer brings two lines of tears.

Translated by ChatGPT 5