编程介的小学生 2017-02-15 03:32 采纳率: 20.5%
浏览 749
已采纳

Cutting a Block

Description

Carpenter Bill has a huge wooden block. The block has a shape of rectangular parallelepiped.

The block is so huge that it cannot pass through the door of Bill’s house. So he decided to cut it into n smaller blocks. Bill is not a very smart guy so he wants to make all small blocks rectangular, and all of them should be equal.

Write a program that would help Bill to cut his block.

Input

Let us introduce a coordinate system such that the edges of the block are parallel to the coordinate axes and one of the block’s corners is placed at the origin. The opposite corner of the block has coordinates (x, y, z).

The first line of the input file contains four integer numbers — x, y, z and n (1 ≤ x, y, z, n ≤ 1 000).

Output

Output file should contain n lines each describing one small block. Each small block is described by six numbers: x1, y1, z1, x2, y2, z2, where (x1, y1, z1) are the coordinates of one corner of the block and (x2, y2, z2) are the coordinates of its opposite corner.

Coordinates must be precise up to eight digits after the decimal point.

Sample Input

sample input #1
3 2 2 4

sample input #2
3 2 2 6
Sample Output

sample output #1
0 0 0 1.5 1 2
3 0 0 1.5 1 2
0 1 0 1.5 2 2
3 1 0 1.5 2 2

sample output #2
0 0 0 1 2 1
0 0 1 1 2 2
1 0 0 3 1 1
1 0 1 3 1 2
1 1 0 3 2 1
1 1 1 3 2 2

  • 写回答

2条回答 默认 最新

  • threenewbee 2017-02-20 15:31
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘