logo AlgoBeat OnlineJudge
登录 注册

#213389. [GCJ 2013 #1A] Bullseye

内存限制:1024 MiB 时间限制:3000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Maria has been hired by the Ghastly Chemicals Junkies (GCJ) company to help them manufacture bullseyes. A bullseye consists of a number of concentric rings (rings that are centered at the same point), and it usually represents an archery target. GCJ is interested in manufacturing black-and-white bullseyes.

Maria starts with millilitres of black paint, which she will use to draw rings of thickness (one centimetre). A ring of thickness is the space between two concentric circles whose radii differ by .

Maria draws the first black ring around a white circle of radius . Then she repeats the following process for as long as she has enough paint to do so:

  1. Maria imagines a white ring of thickness around the last black ring.
  2. Then she draws a new black ring of thickness around that white ring.

Note that each "white ring" is simply the space between two black rings.

The area of a disk with radius is . One millilitre of paint is required to cover area . What is the maximum number of black rings that Maria can draw? Please note that:

  • Maria only draws complete rings. If the remaining paint is not enough to draw a complete black ring, she stops painting immediately.
  • There will always be enough paint to draw at least one black ring.

输入格式

The first line of the input gives the number of test cases, . test cases follow. Each test case consists of a line containing two space separated integers: and .

输出格式

For each test case, output one line containing "Case #x: ", where is the case number (starting from ) and is the maximum number of black rings that Maria can draw.

样例

样例输入 1

5
1 9
1 10
3 40
1 1000000000000000000
10000000000000000 1000000000000000000

样例输出 1

Case #1: 1
Case #2: 2
Case #3: 3
Case #4: 707106780
Case #5: 49

数据范围与提示

Limits

Small dataset (11 Pts, Test set 1 - Visible)

Large dataset (13 Pts, Test set 2 - Hidden)