|
|||
Curvy Little BottlesIn 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 P between x = xlow and x = xhigh around the x-axis. Thus the x-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 = xlow, and the top of the bottle, at x = xhigh, is left open. The first sample input represents a bottle formed using the simple polynomial 4 - 0.25x, with xlow = 0 and xhigh = 12. The bottom of this bottle is a circle with a radius of 4, and the opening at the top is a circle with a radius of 1. The height of this bottle is 12. Volume markings are in increments of 25. Given a polynomial P, xlow, xhigh, and the volume increment between successive marks on the bottle, compute the distances up from xlow for the marks at successive volume increments. A mark cannot be made past the top of the bottle, and no more than the first 8 increments should be marked. Assume the value of P is greater than zero everywhere between xlow and xhigh. Input SpecificationEach test case consists of three lines of bottle data:
Output Specification
For each test case, display the case number and the volume of the full bottle on one
line. On a second line, display the increasing sequence of no more than 8 successive
distances up from the bottom of the bottle for the volume markings. All volumes and
height marks should be accurate to two decimal places. If the bottle does not have a
volume that allows at least one mark, display the phrase
Sample Input
Output for Sample Input
|
|||
University of Debrecen; Faculty of Informatics; v. 09/30/2024 |