Gondwanaland Telecom makes charges for calls according to distance and time of day. The basis of the charging is contained in the following schedule, where the charging step is related to the distance:
Charging Step | Day Rate 8am to 6pm | Evening Rate 6pm to 10pm | Night Rate 10pm to 8am |
---|
A | 0.10 | 0.06 | 0.02 |
---|
B | 0.25 | 0.15 | 0.05 |
---|
C | 0.53 | 0.33 | 0.13 |
---|
D | 0.87 | 0.47 | 0.17 |
---|
E | 1.44 | 0.80 | 0.30 |
---|
All charges are in dollars per minute of the call. Calls which straddle a rate boundary are charged according to the time spent in each section. Thus a call starting at 5:58 pm and terminating at 6:04 pm will be charged for 2 minutes at the day rate and for 4 minutes at the evening rate. Calls less than a minute are not recorded and no call may last more than 24 hours.
Write a program that reads call details and calculates the corresponding charges.