#P2459. [SDOI2007] 立体分割

    ID: 1465 远端评测题 1000ms 128MiB 尝试: 0 已通过: 0 难度: 3 上传者: 标签>2007各省省选网络流山东Special Judge最大流最小割

[SDOI2007] 立体分割

Description

Ghy recruited nn underlings, such as Psf, Hf, Csr, Ll, and of course you. (as in the original text...)

As the boss, he never asks his underlings for anything. Instead, he often gives them gifts.

One day, he got a rectangular cuboid cake. But Ghy does not like eating cake, so he wants to give all of it to his underlings. Ghy believes all underlings are equal, so he asks you to divide this cake into nn rectangular cuboid small cakes that are equal in both size and shape (i.e., congruent small cakes).

We move the cake into a 3D coordinate system, taking one vertex OO as the origin (0,0,0) (0, 0, 0) . The vertex opposite to OO (the farthest point from OO) has coordinates (x,y,z) (x, y, z) . In fact, x,y,z x, y, z represent the length, width, and height of the rectangular cuboid.

Input Format

Four positive integers, x,y,z,n x, y, z, n . Their meanings are as described above.

Output Format

nn lines, each containing 6 real numbers, representing the coordinates of a pair of opposite vertices of one congruent rectangular cuboid small cake. Output the coordinates of the first vertex x1,y1,z1x_1, y_1, z_1, followed by x2,y2,z2x_2, y_2, z_2. The absolute error must not exceed 10910^{-9}. You may output the small cakes in any order, and for each small cake, you may output any one pair of opposite vertices.

2 3 2 6
0 0 0 1 1 2
1 0 0 2 1 2
0 1 0 1 3 1
0 1 1 1 3 2
1 1 0 2 3 1
1 1 1 2 3 2

Hint

Sample explanation (added by admin on 2023-09-29).

Constraints

For 100%100\% of the testdata, 1x,y,z,n10001 \leq x, y, z, n \leq 1000, and x,y,zx, y, z are integers.

Translated by ChatGPT 5