Mario Prize X53740


Statement
 

pdf   zip

html

Input

* Vector containing 10 price values * Vector containing 10 weight values

Output

Mario chooses: prize A and prize B with a total profit of value €

NOTE: there will only be one solution. Print prize A and prize B sorted by the index value (A < B).

Public test cases
  • Input

    1 1 1 1 1 1 1 1 1 1
    1 1 1 1 1 1 1 1 1 1
    

    Output

    Mario chooses: prize 0 and prize 1 with a total profit of 2 EUR
    
  • Input

    12 32 200 123 44 0 1 23 44 2
    1 10 2.3 0.2 0.1 1 2.3 4 1 0
    

    Output

    Mario chooses: prize 2 and prize 3 with a total profit of 323 EUR
    
  • Input

    2300 4500 250 9160 30 250 140 80 150 2400
    2.5 13.8 6.4 0.3 0.9 1.3 0.2 1.2 0.5 4.6
    

    Output

    Mario chooses: prize 0 and prize 3 with a total profit of 11460 EUR 
    
  • Input

    0 0 0 0 1 0 0 0 0 1
    4 4 4 4 1.5 4 4 4 4 1.5
    

    Output

    Mario chooses: prize 4 and prize 9 with a total profit of 2 EUR
    
  • Input

    0 3 0 2 0 1 0 4 0 1
    3 1 3 2 3 1 3 2.1 3 2
    

    Output

    Mario chooses: prize 1 and prize 3 with a total profit of 5 EUR
    
  • Input

    444 123 33 467 1200 399 9999 888 328 1000
    1.1 0.8 3 2.2 1.5 0.1 0.5 2.5 1 9

    Output

    Mario chooses: prize 4 and prize 6 with a total profit of 11199 EUR
    
  • Information
    Author
    HP CodeWars
    Language
    English
    Official solutions
    Python
    User solutions
    C++ Java Python