#P10520. Coordinate Conversion: Axial to Rectangular

    ID: 12537 Type: Default 1000ms 256MiB

Coordinate Conversion: Axial to Rectangular

Coordinate Conversion: Axial to Rectangular

In this problem, you are given the axial (vertical) coordinates of a regular hexagon's center in the form \((x, y)\). These coordinates come from a cube coordinate system where \(x+y+z=0\). The corresponding rectangular (Cartesian) coordinates \((x', y')\) can be computed using the following formulas:

\(x' = \frac{1}{2}x + \frac{1}{2}y\)

\(y' = \frac{\sqrt{3}}{2}x - \frac{\sqrt{3}}{2}y\)

Your task is to perform this conversion. Read the axial coordinates from input, compute \(x'\) and \(y'\) using the formulas above, and output the results.

inputFormat

The input consists of a single line containing two numbers \(x\) and \(y\) separated by a space, representing the axial coordinates of the hexagon's center.

outputFormat

Output a single line containing two numbers \(x'\) and \(y'\), separated by a space. The values should be computed using the formulas provided. It is recommended to output the results with a precision of 6 decimal places.

sample

1 0
0.500000 0.866025

</p>