#P8828. Find the Legs of a Right Triangle
Find the Legs of a Right Triangle
Find the Legs of a Right Triangle
Given a right triangle with its two legs a and b (with a ≤ b) and hypotenuse c, where a, b, and c are positive integers satisfying the equation \(a^2+b^2=c^2\), determine the values of a and b when c is provided.
You are guaranteed that there exists a pair \((a, b)\) that meets the above conditions.
inputFormat
The input consists of a single integer \(c\) (the hypotenuse of the right triangle).
outputFormat
Output two space-separated integers \(a\) and \(b\) (with \(a \leq b\)) which are the lengths of the two legs of the triangle.
sample
5
3 4