Under construction

Still being built. Things may change

COURIERS

Time limit2sMemory limit1024 MB

Summary
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

Distance travelled x kmPrice in leva and stotinki
up to 5 km4 leva
over 5 km up to 10 km7 leva
over 10 km up to 20 km12 leva
over 20 km up to 30 km17 leva
over 30 km57 stotinki for each whole km

Table 2. Price list of the second transport firm

Distance travelled x kmPrice in leva and stotinki
up to 2 km90 st. + 90 st. for each whole km
over 2 km up to 5 km1 lev + 85 stotinki for each whole km
over 5 km up to 20 km1 lev and 25 st. + 80 stotinki for each whole km
over 20 km up to 40 km3 leva and 25 st. + 70 stotinki for each whole km
over 40 km9 leva and 25 st. + 55 stotinki for each whole km

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

Examples2

  1. Example 1

    Input
    1020 3005
    
    Expected output
    5.35
    
  2. Example 2

    Input
    320 1125
    
    Expected output
    2.70