In Orlandia, there are only two types of banknotes in use: those worth eagles and those worth eagles. Your task is to help an Orlandian find the minimum number of banknotes required to make a payment of eagles. You need to specify how many banknotes of each denomination ( and ) are used.
Provide the values , , and where 10 \leq k, r \leq 3 \times 10^6 and 10 \leq \text{sum} \leq 3 \times 10^9.
Output the number of banknotes of the smaller denomination and the number of banknotes of the larger denomination, along with the total minimum number of banknotes used. If it is impossible to achieve the exact sum with the given denominations, output .
Example 1
Example 2