ICPC 2012 · Problem B · Curvy Little Bottles

36th ICPC · Warsaw, Poland

Statement

Problem ID: bottle

In her bike rides around Warsaw, Jill happened upon a shop that sold interesting glass bottles. She thought it might make an interesting project to use such bottles for measuring liquids, but this would require placing markings on the bottles to indicate various volumes. Where should those volume marks be placed?

Jill formalized the problem as follows. Assume a bottle is formed by revolving a shape that is the same as the graph of a polynomial PP between x=xx = xlow and x=xx = xhigh around the xx-axis. Thus the xx-axis is coincident with a vertical line through the center of the bottle. The bottom of the bottle is formed by a solid circular region at x=xx=xlow, and the top of the bottle, at x=xx=xhigh, is left open.

The first sample input represents a bottle formed using the simple polynomial 40.25x4- 0.25x, with xxlow =0= 0 and xxhigh =12= 12. The bottom of this bottle is a circle with a radius of 44, and the opening at the top is a circle with a radius of 11. The height of this bottle is 1212. Volume markings are in increments of 2525.

Given a polynomial PP, xxlow, xxhigh, and the volume increment between successive marks on the bottle, compute the distances up from xxlow for the marks at successive volume increments. A mark cannot be made past the top of the bottle, and no more than the first 88 increments should be marked. Assume the value of PP is greater than zero everywhere between xxlow and xxhigh.

Input

Each test case consists of three lines of bottle data:

  • \bullet Line 1: nn, the degree of the polynomial (an integer satisfying 0n100\le n\le 10).

  • \bullet Line 2: a0a_{0}, a1a_{1}, .... . ., ana_{n}, the real coefficients of the polynomial PP defining the bottle’s shape, where a0a_{0} is the constant term, a1a_{1} is the coefficient of x1x^{1}, .... . ., and ana_{n} is the coefficient of xnx^{n}. For each ii, 100ai100- 100\le ai \le 100, and an=0an = 0.

  • \bullet Line 3: x\circ xlow and xxhigh, the real valued boundaries of the bottle (100x- 100 \le xlow <x< xhigh 100\le 100 and xxhigh x- xlow >0.1>0.1). inc\circ inc, an integer which is the volume increment before each successive mark on the bottle (1inc5001\le inc\le 500).

Output

For each test case, display the case number and the volume of the full bottle on one line. On a sec- ond line, display the increasing sequence of no more than 88 successive distances up from the bottom of the bottle for the volume markings. All volumes and height marks should be accurate to two dec- imal places. If the bottle does not have a volume that allows at least one mark, display the phrase insufficient volume. No test case will result in a mark within 0.010.01 from the top of the bottle. The volume of the bottle will not exceed 10001 000. All rounded distances for marks on a bottle differ by at least 0.050.05.

ACM-ICPC World Finals 2012 Problem B: Curvy Little Bottles

Sample Input

1
4.0 -0.25
0.0 12.0 25
1
4.0 -0.25
0.0 12.0 300
0
1.7841241161782
5.0 10.0 20
0
1.0
0.0 10.0 10

Sample Output

Case 1: 263.89
0.51 1.06 1.66 2.31 3.02 3.83 4.75 5.87
Case 2: 263.89
insufficient volume
Case 3: 50.00
2.00 4.00
Case 4: 31.42
3.18 6.37 9.55

ACM-ICPC World Finals 2012 Problem B: Curvy Little Bottles

No official solution in the source collection.