• 沒有找到結果。

Its length is 4 times the diameter of each disc

N/A
N/A
Protected

Academic year: 2021

Share "Its length is 4 times the diameter of each disc"

Copied!
1
0
0

加載中.... (立即查看全文)

全文

(1)

11001 Necklace

The people of a certain tribe produce circular ceramic discs with equal diameter by some rare clay. A necklace is formed by connecting one or more discs. The figure below shows a necklace made with 4 discs. Its length is 4 times the diameter of each disc.

The thickness of each disc is fixed. The diameter D and the volume of clay used V has the following relationship:

p(x) =

{0.3

V − V0 if V > V0

0 if V ≤ V0

where V0 is the volume consumed in the baking process, in the same unit of V . When V ≤ V0, no ceramic discs can be made. As an example, let Vtotal = 10, V0 = 1. If we use it to make 1 disc, V = Vtotal = 10, D = 0.9. If we divide the clay into 2 parts, the volume of each part V = Vtotal/2 = 5, and diameter of each disc formed is D = 0.3

5− 1 = 0.6, thus the length of necklace formed this way is 1.2.

As per the above example, it is obvious that the lengths of necklaces differ as the number of discs made changes. Please write a program that computes the number of discs one should make so that the necklace formed is the longest.

Input

Each line of input contains two numbers, Vtotal (0 < Vtotal ≤ 60000) and V0 (0 < V0 ≤ 600), as defined above. Input ends with a case where Vtotal= V0 = 0.

Output

Each line of output should give the number of discs one should make so that the necklace formed is the longest. If this number is not unique, or no necklaces can be formed at all, output ‘0’ instead.

Sample Input 10 1

10 2 0 0

Sample Output 5

0

參考文獻

相關文件

A constant state u − is formed on the left side of the initial wave train followed by a right facing (with respect to the velocity u − ) dispersive shock having smaller

Murphy.Woodward.Stoltzfus.. 17) The pressure exerted by a column of liquid is equal to the product of the height of the column times the gravitational constant times the density of

An additional senior teacher post, to be offset by a post in the rank of APSM, is provided to each primary special school/special school with primary section that operates six or

An additional senior teacher post, to be offset by a post in the rank of APSM, is provided to each primary special school/special school with primary section that operates six or

An additional senior teacher post, to be offset by a post in the rank of CM or APSM as appropriate, is provided to each primary special school/special school with

[This function is named after the electrical engineer Oliver Heaviside (1850–1925) and can be used to describe an electric current that is switched on at time t = 0.] Its graph

We are going to define the length of a general curve by first approximating it by a polygon and then taking a limit as the number of segments of the polygon is increased...

Figure 3: Comparison of the partitioning of the hemisphere effected by a VQPCA-based model (left) and a PPCA mixture model (right). The illustrated boundaries delineate regions of