若是凉夜已成梦

青春里 总有些事情要努力去做 总有些梦想要拼命去追。


  • 运维

  • 前端

  • 编程

  • 随笔

  • hust-oj

1602: Useless Tile Packers

发表于 2017-10-06   |   分类于 HUSTOJ   |   阅读次数 1,254

题目描述

Useless Tile Packer, Inc., prides itself on efficiency. As their name suggests, they aim to use less space than other companies. Their marketing department has tried to convince management to change the name, believing that “useless'' has other connotations, but has thus far been unsuccessful.

Tiles to be packed are of uniform thickness and have a simple polygonal shape. For each tile, a container is custom-built. The floor of the container is a convex polygon that has the minimum possible space inside to hold the tile it is built for.

This strategy leads to wasted space inside the container. Your job is to compute the percentage of wasted space for a given tile.

输入

The input file consists of several data blocks. Each data block describes one tile. The first line of a data block contains an integer N ( 3<=N<=100) indicating the number of corner points of the tile. Each of the next N lines contains two integers giving the (x, y) coordinates of a corner point (determined using a suitable origin and orientation of the axes) where 0<=x, y<= 1,000. The corner points occur in the same order on the boundary of the tile as they appear in the input. No three consecutive points are collinear.
The input file terminates with a value of 0 for N.

输出

For each tile in the input, print the percentage of wasted space rounded to two digits after the decimal point. Each output must be on a separate line.
Print a blank line after each output block.

样例输入

5
0 0
2 0
2 2
1 1
0 2
5
0 0
0 2
1 3
2 2
2 0
0


样例输出

Tile #1
Wasted Space = 25.00 %

Tile #2
Wasted Space = 0.00 %


参考代码

暂无

解析

暂无

hustoj

发表评论 取消回复

邮箱地址不会被公开。 必填项已用*标注

*
*


hoxis wechat
著作权归作者所有
站点更新说明
  • 文章目录
  • 站点概览
若是凉夜已成梦

若是凉夜已成梦

青春里 总有些事情要努力去做 总有些梦想要拼命去追。

1904 日志
6 分类
12 标签
RSS
weibo github twitter facebook

友情链接

Skip Dreams孤独患者 原站点
© 2017 若是凉夜已成梦
Powered by WordPress | 已运行
Theme By NexT.Mist