There are n available fountains, for each fountain its beauty and cost are known. There are two types of money in the game: coins and diamonds, so each fountain cost can be either in coins or diamonds. You have c coins and d diamonds, no money changes between the types are allowed. Find two fountains with maximum total beauty so that you can buy both at the same time.
Constraints: n, d, c <= 10^5.