DWITE '02 R2 #1 - Sales!

View as PDF

Submit solution

Points: 5
Time limit: 0.6s
Memory limit: 32M

Problem types
DWITE Online Computer Programming Contest, November 2002, Problem 1

You are to determine which item at a store, out of a group of three items which are on sale, offers the best discount as a percentage out of 100.

Input Specification

The input will contain data sets for five separate sales. Each sale will contain three pairs of data. Each pair will contain two lines, one for the regular price of an item and the other for the sales price of an item, in that order. The regular price will always be greater than the sales price.

Output Specification

The output will contain five lines of data, each representing the percentage discount of the item that offers the greatest discount. The percentage is displayed out of 100 (no percent sign needed), rounded to 3 decimal places, right justified in a field width of 7.

Sample Input (only two sales given)

10.00
9.55
10.00
9.25
10.00
9.45
44.50
22.25
50.00
24.00
60.00
31.00

Sample Output

  7.500
 52.000

Comments

There are no comments at the moment.