COURIERS
Time limit2sMemory limit1024 MB
Given two delivery distances in metres, pick the cheaper of two courier price tables for each and print the minimum total cost in leva and stotinki.
- Level
Medium4 of 10
- Topics
- Implementation, Math, Simulation, Greedy
- Solved
- No attempts yet
Problem
The pastry shop where Chris works makes cakes and pastries to order and delivers them to its customers using two courier firms. The tables below give the prices of the transport services depending on the length of the distance travelled.
Table 1. Price list of the first transport firm
Table 2. Price list of the second transport firm
Chris has to deliver cakes for two orders. Help him by writing a program trans that chooses a suitable firm for each of the two deliveries so that the total sum of the transport costs for the two deliveries is minimal.
Input
The only line of the standard input contains 2 natural numbers separated by a single space. Each of them is the distance from the shop to the corresponding customer in metres.
Output
The only line of the standard output must contain the total sum for transporting the ordered pastries to the customers in the format "lv.st", where lv denotes leva and st denotes stotinki.
Constraints
- 100 ≤ x ≤ 100 000