P10520 [XJTUPC 2024] Core of the Banyan Tree
Background
You are right, but “Core of the Banyan Tree” is a strategy multiplayer battle game developed by Corycle, HCCH, MCPlayer542, Veritas, and wh in a game design and development course. The game takes place in a tropical rainforest. Here, you will play as the “core” of a banyan tree, competing with other banyan trees for nutrients and living space.
Description
The game map is made up of several regular hexagons. Players can control the banyan core to move from the **center** of one hexagon to the **center** of an adjacent hexagon, in order to strengthen branches, clear pests, grow new branches, or destroy other banyan trees.

A planar regular hexagonal grid can be viewed as an isometric projection of a 3D shape formed by stacking cubes (as shown in the figure). The projection of each cube is a regular hexagon, so the 3D coordinates of cubes can be used to represent hexagon coordinates. We set the center of one cube at the origin, and all cube center coordinates $(x,y,z)$ satisfy $x+y+z=0$, so one dimension can be omitted, and we use $(x,y)$ to describe the center of the corresponding hexagon. This coordinate system is called the **axial coordinate system**.

The game uses the **axial coordinate system** to describe hexagon positions. To let players see the core’s position intuitively, Veritas needs to convert it into **Cartesian coordinates** for display on the screen. **Please help him convert axial coordinates into Cartesian coordinates**.
The conversion formula from axial coordinates $(x,y)$ to Cartesian coordinates $(x^\prime,y^\prime)$ is:
$$x^{\prime} = \frac{1}{2} x + \frac{1}{2} y$$
$$y^{\prime} = \frac{\sqrt{3}}{2} x - \frac{\sqrt{3}}{2} y $$
Input Format
Only one line, with two integers $x,y$ separated by spaces, representing axial coordinates $(x,y)$ ($-10^6\le x\le 10^6,-10^6\le y\le 10^6$).
Output Format
One line with two real numbers $x^{\prime}$ and $y^{\prime}$ separated by spaces, representing the converted Cartesian coordinates $(x^\prime,y^\prime)$.
Your output is considered correct if, for both real numbers, the smaller one of the relative error and absolute error compared to the answer is no more than $10^{-6}$.
Explanation/Hint
“Core of the Banyan Tree” game link (offline contest teams cannot access this link during the contest): [core-of-banyan.github.io](https://core-of-banyan.github.io/).
Everyone is welcome to play (after the contest).
Translated by ChatGPT 5