#P3945. 三体问题【std 疑似有误】

三体问题【std 疑似有误】

Description

You are given NN celestial bodies with their positions (xi,yi,zi)(x_i, y_i, z_i) in space, initial velocities (vx,vy,vz)(v_x, v_y, v_z), and masses MiM_i. It is known that, under the influence of the "Singer" civilization, time in the three-body world does not flow continuously (it updates every 0.010.01 seconds). All celestial bodies are treated as point masses. Compute the positions of all celestial bodies at time tt.

The universal gravitational constant GG is 6.67408×10116.67408 \times 10^{-11}. In code, you may write:

#define G 6.67408e-11

If your answer’s relative error does not exceed 0.5%0.5\% compared to the standard answer, you will receive AC on that test point. In other words, you may choose how many decimal places to keep. The standard answer keeps 1212 decimal places. This problem uses SPJ to check correctness.

Input Format

The first line contains a positive integer NN and a nonnegative real number tt, representing the number of celestial bodies and the time, respectively.

The next NN lines each contain 77 real numbers xi,yi,zi,Mi,vx,vy,vzx_i, y_i, z_i, M_i, v_x, v_y, v_z, representing each body’s position, mass, and initial velocity (the velocity components in the three directions).

Output Format

Output NN lines. The ii-th line contains the coordinates xi,yi,zix_i, y_i, z_i of the ii-th body at time tt, separated by single spaces.

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
0.620349511786 9.980741705470 0.000000000000
8.333401109655 -5.527609289167 0.000000000000
-8.953750621441 -4.453132416303 0.000000000000
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
6.204092324054 9.982347016794 0.000000000000
5.642963405596 -10.364100727695 0.000000000000
-11.747055729651 0.381753710901 0.000000000000

Hint

Constraints: 3N303 \le N \le 30, 0t1000 \le t \le 100, 100xi,yi,zi100-100 \le x_i, y_i, z_i \le 100. MiM_i is within the range of long long.

Translated by ChatGPT 5