The Largest/Smallest Box..

2020年1月17日 862点热度 0人点赞 0条评论

The Largest/Smallest Box..

时间: 1ms        内存:64M

描述:

The following figure shows a rectangular card of width W, length L, and thickness 0. Four x x x squares are cut from the four corners of the card shown by the dotted lines. The card is then folded along the dashed lines to make a box without a cover.

Given the width and height of the box, find the values of x for which the box has maximum and minimum volume.

输入:

The input file contains several lines of input. Each line contains two positive floating point numbers L ( 0 < L < 10, 000) and W ( 0 < W < 10, 000), which indicate the length and width of the card, respectively.

输出:

For each line of input, give one line of output containing two or more floating point numbers separated by a single space. Each floating point number should contain three digits after the decimal point. The first number indicates the value which maximizes the volume of the box, while the subsequent values (sorted in ascending order) indicate the cut values which minimize the volume of the box.

示例输入:

1 1
2 2
3 3

示例输出:

0.167 0.000 0.500
0.333 0.000 1.000
0.500 0.000 1.500

提示:

参考答案:

解锁文章

没有看到答案?微信扫描二维码可免费解锁文章

微信扫描二维码解锁

使用微信扫描二维码打开广告页面后可以立即关闭,再刷新此页面即可正常浏览此文章

所跳转广告均由第三方提供,并不代表本站观点!

已经扫描此二维码?点此立即跳转

code

这个人很懒,什么都没留下

文章评论