proizvod2
Merchant Joca uses a system of multiplicative prices in his shop. In other words, for each item there's a basic price and Merchant Joca's tax. The buyer must pay the price equal to their product.
Merchant Joca is currently taking inventory and is setting new prices. For one item he has a specific number of plastic digits for displaying the price of that item on a sign. With those plastic digits he wants to set the base price and tax for the item so that the buyer must pay the maximum price. Since he does all his calculations on paper, he has asked you to find the last digits of that maximum price so that he can check the validity of his calculations. A base price and tax must each contain at least one digit.
plastic digits. Before and between the digits in the second row there are no blank spaces.
4 2
2397Output:
16Explanation:
The maximum price can be made with the basic price of 92 and Joca's tax of 73 (or vice versa). Then the maximum price is 6716, but only the last two digits are shown in the output, ie. 16.
3 3
501Output:
050Explanation:
The maximum price can be made with the basic price 5 and Joca's tax of 10 (or vice versa) or if the basic price is 50 and the tax is 1 (or vice versa). Then the maximum price is 50, but it's shown in the output as the full price with one leading zero, i.e. 050.
Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.