Ahdali wants to learn more about math and physics. In his research, he discovered a point in any object called the center of mass. In geometry, one often assumes uniform mass density, in which case the center of mass coincides with the centroid.
Ahdali found this equation for the centroid of a weighted triangle (where all three points have weights): $$$$$$C_x = \frac{a \times x_1 + b \times x_2 + c \times x_3 }{a + b + c}, C_y = \frac{a \times y_1 + b \times y_2 + c \times y_3 }{a + b + c}$$$$$$
where $$$x_i$$$ and $$$y_i$$$ are the coordinates of the $$$i$$$-th point. and $$$a$$$, $$$b$$$, $$$c$$$, are the weights of the first, second and third point. respectively.
Shadi and Taim want to see if Ahdali understood the concept correctly, so they proposed an inverse problem: They will give Ahdali a point and the weights of a triangle (a, b, and c), and Ahdali must find a triangle with these weights and this centroid.
An additional constraint they added is that each of the triangle's sides must be longer than 1.
Whether Ahdali actually completed this task is another tale.
For the time being, you should take a crack at this problem.
Input consists of two lines. First line has three integers $$$a$$$, $$$b$$$, $$$c$$$. ($$$ 1 \le a,b,c \le 1000 $$$). The weights of the first, second, and third point on the triangle, respectively.
Second line has two integers $$$c_x$$$, $$$c_y$$$. ($$$ -1000 \le c_x, c_y \le 1000 $$$). The coordinates of the desired centroid.
Output three lines. Each line has two floating point numbers, representing the three points of the triangle.
All number in the output must be between $$$10^6$$$ and $$$-10^6$$$.
Your answer is considered correct if the square distance between the centroid of your triangle and the desired centroid is less than $$$10^{-9}$$$
1 1 10 0
-0.3333333333 -0.3333333333 0.6666666667 -0.3333333333 -0.3333333333 0.6666666667
Note that the order of the points you output matters. such that the first point has weight $$$a$$$ and the second has weight $$$b$$$. and the third has weight $$$c$$$.