Restore the Triangle
Limits: 2 sec., 256 MiB
This statement was translated automatically from Ukrainian.
Zenyk drew a triangle on a piece of paper in the morning, but now he has lost it. He only remembers the perimeter of the triangle \(P\) and the radius of its inscribed circle \(r\).
Marichka claims that she can draw a new triangle using this information.
Can you?
Input
The single line contains two positive integers \(P\) and \(r\) — the perimeter of the triangle and the radius of the inscribed circle.
Output
In three lines, output \(x_i\) and \(y_i\) — the coordinates of the vertices of the triangle.
\(|x_i|\) and \(|y_i|\) must not exceed \(10^4\). It is guaranteed that there exists a triangle satisfying such constraints.
Let \(P'\) be the perimeter of your triangle, and \(r'\) be the radius of the circle inscribed in it. The answer will be considered correct if \(\frac{|P'-P|}{P} < 10^{-4}\) and \(\frac{|r'-r|}{r} < 10^{-4}\).
Constraints
\(1 \le P, r \le 10^3\).
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 12 1 | 0 0 3 0 0 4 |
Notes
For \(P=12, r = 1\) one of the possible answers is a right-angled triangle with legs \(3\) and \(4\) and hypotenuse \(5\).
Submit a solution
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|