Find the three edge lengths of a rectangular parallelepiped from the pairwise face diagonals.
Parallelepiped
You are given three positive integers representing the areas of three pairwise adjacent rectangular faces of a rectangular parallelepiped (box).
Let the edge lengths be , , and . Then the three face areas are:
Your task is to recover one valid triple of positive integers that matches the given face areas.
If multiple answers are possible, any valid one is acceptable.
Notes
- The three given values are guaranteed to come from some integer box.
- The order of the three edges in the output does not matter.
Input Format
The input consists of three integers , , and — the areas of the three faces.
Output Format
Print three positive integers , , and such that:
Any valid ordering is accepted.
Constraints
- A valid integer solution exists.
Hints
- Try multiplying the three equations together.
- Once you know , each edge length can be recovered by dividing by the right face area and taking a square root where appropriate.
Input Format
Three integers , , and representing the areas of three pairwise adjacent faces.
Output Format
Print three positive integers , , and such that , , and .
Constraints
- A valid integer solution exists.
Example 1
Input
4 6 3
Output
2 2 3
Explanation
A valid set is , , , which gives face areas , , and . Since the input is intended to match the three pairwise face areas, the output demonstrates the recovery idea rather than this exact sample.
Premium problem context
Unlock deeper context for this problem
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.