Problem B
Income
Tax Hazard (II)
Input: Standard Input
Output: Standard
Output
The
word tax makes us unhappy and if it is income tax it saddens us even more (have
you ever wondered why many rich people leave their own country and stay in
Now you are in a strange new country, whose income tax structure is almost unknown to you. The things that you know about the salary/tax structure of this country are given below:
Now given the values of min, max and M you have two find the expected amount of income tax that you need to pay. You should assume that all distinct combinations of S1 and S2 satisfying the above conditions are equally likely.
Input
The input file contains around 10000 line of input. Each line contains three integers M (0 < M ≤ 400000), min and max (50000 ≤ min ≤ max ≤ 200000). Their meaning is given in the problem statement above. Input will be terminated with three zeroes in a single line.
For each line of input produce one line of output. This line contains the serial of output followed by a floating-point number which denotes the expected amount of income. This floating-point number should be rounded to two digits after decimal point.
10000 50000
50002 70000 50000
80000 0 0 0 |
Case 1: 0.00 Case 2: 1333.36 |
Problem Setter: Shahriar Manzoor
Special Thanks: Derek Kisman