题目描述
Problem Background
The three-body inhabitants live in a star system where the uncertainty of three-body motion causes their lives to be unstable. Kind human programmers (that's you, the great hero!) decide to help the foolish three-body inhabitants who can't even write programs to simulate the trajectories of celestial bodies. At this time, the bored "Singer" civilization decides to tease you a bit and adds some new celestial bodies to the three-body system.
Problem Description
Given \( N \) celestial bodies with their coordinates \((x_i, y_i, z_i)\), initial velocities \((v_x, v_y, v_z)\), and masses \( M_i \), it is known that the flow of time in the three-body world is not continuous due to the influence of the "Singer" (refreshed every 0.01 seconds). All celestial bodies are considered as mass points. Calculate the coordinates of all celestial bodies at time \( t \).
The gravitational constant \( G \) is taken as \( 6.67408 \times 10^{-11} \), which can be written in the code as:
#define G 6.67408e-11
Your answer will be considered correct if the relative error with the standard answer does not exceed \( 0.5\% \). That is, you can determine the number of decimal places to keep. The standard answer will retain 12 decimal places. The problem uses a Special Judge (SPJ) to determine if your answer is correct.
Input Format
The first line contains a positive integer \( N \) and a non-negative real number \( t \), representing the number of celestial bodies and the time respectively.
The next \( N \) lines each contain 7 real numbers \( x_i, y_i, z_i, M_i, v_x, v_y, v_z \), representing the coordinates, mass, and initial velocities (in three directions) of each celestial body.
Output Format
\( N \) lines, each containing the coordinates \( x_i, y_i, z_i \) of the \( i \)-th celestial body at time \( t \), separated by a single space.
Sample Input and Output
Input Sample #1
3 100
0 10 0 10000000 0.006207480877613 0 0
8.660254037844 -5 0 10000000 -0.003103740438807 -0.00537583613352 0
-8.660254037844 -5 0 10000000 -0.003103740438807 0.00537583613352 0
Output Sample #1
0.620349511786 9.980741705470 0.000000000000
8.333401109655 -5.527609289167 0.000000000000
-8.953750621441 -4.453132416303 0.000000000000
Input Sample #2
3 100
0 10 0 10000000 0.06207480877613 0 0
8.760254037844 -5 0 10000000 -0.03103740438807 -0.0537583613352 0
-8.660254037844 -5 0 10000000 -0.03103740438807 0.0537583613352 0
Output Sample #2
6.204092324054 9.982347016794 0.000000000000
5.642963405596 -10.364100727695 0.000000000000
-11.747055729651 0.381753710901 0.000000000000
Notes
\( 3 \le N \le 30, 0 \le t \le 100, -100 \le x_i, y_i, z_i \le 100 \). \( M_i \) is within the range of long long.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分