编程介的小学生 2017-01-31 08:26 采纳率: 20.5%
浏览 833
已采纳

Extrusion

Description
The Acme Extrusion Company specializes in the production of steel bars with custom-designed cross-sections. The manufacturing process involves cutting a hole in a thick metal plate, the shape of the hole being determined by the customer's specifications.

Molten metal is then forced through the hole to form a long bar. The shape of the hole determines the shape of the cross-section of the resulting bar.

Given a description of a polygonal hole and the volume of molten metal available, determine how long a bar can be formed by this process.

Input
Input consists of one or more data sets consisting of the following information:

An integer, N , indicating the number of vertices making up the polygon. End of input is signaled by any N less than 3.
Next are N lines, each containing a pair of floating-point numbers, (xi, yi) , each denoting one vertex of the polygon. Vertices will be presented in clockwise order (relative to the closest interior point) proceeding around the perimeter of the polygon. The xi and yi values are in units of meters.
The data set is terminated by a floating point value indicating the amount of molten metal available (in cubic meters).

Output
For each data set, the program should produce a single line of output of the form:

BAR LENGTH: x

where ``x " is the maximum bar length, a floating point number expressed with two digits precision.

Sample Input

4
0.0 0.0
0.0 0.1
0.1 0.1
0.1 0.0

1.0
7
0.5 1.25
0.9 1.6
0.9 1.1
0.85 1.0
0.9 0.85
0.9 0.5
0.5 0.75
100.0
0

Sample Output

BAR LENGTH: 100.00
BAR LENGTH: 318.73

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-02-06 15:45
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败
  • ¥15 树莓派5怎么用camera module 3啊
  • ¥20 java在应用程序里获取不到扬声器设备
  • ¥15 echarts动画效果的问题,请帮我添加一个动画。不要机器人回答。
  • ¥15 Attention is all you need 的代码运行
  • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗