编程介的小学生 2020-08-10 08:09 采纳率: 20.5%
浏览 40
已结题

Cover the Square 正方形覆盖

Problem Description
Oh no! The Enterprise is being attacked by a Borg unit cube. We all know that resistance is futile, but that won’t prevent the captain from trying anyway!

The engineers aboard the Enterprise have recently upgraded the size of the ships’s laser beam weapons, such that it can now cut large circular holes into enemy ships. In fact, they can even cut out holes of diameter one, which should get rid of most of the Borg cube in one deadly blow. However, the Borgs are frighteningly persistent, and the captain fears that the remaining undestroyed pieces will cause trouble. Thus, he wants to destroy at least n percent of the cube.

The Borg cube is positioned such that one of its faces is perpendicular to the enterprise’s line of sight, so the problem is approximately equivalent to trying to cover a unit square with circles of diameter one. Under this approximation and assuming that the undestroyed parts simply remain motionless at their original position, how many shots are required to destroy at least n percent of the cube?

Input
The first line of the input will contain m, the number of test cases. m lines will follow, each containing an integer n between 0 and 100 inclusively.

Output
For each test case, output the number of circles required to cover n percent of the square.

Sample Input
3
0
50
100

Sample Output
0
1
4

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 MATLAB动图的问题
    • ¥15 求差集那个函数有问题,有无佬可以解决
    • ¥15 【提问】基于Invest的水源涵养
    • ¥20 微信网友居然可以通过vx号找到我绑的手机号
    • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
    • ¥15 解riccati方程组
    • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
    • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
    • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
    • ¥50 树莓派安卓APK系统签名