Ali needs to buy a watch urgently and goes to a shop where each watch costs ( k) rupees.He has an unlimited number of 10-rupee coins and exactly one coin of (r) rupees (where() is between 1 and 9).
To find out the minimum number of watches Ali needs to buy so he can pay the exact amount without needing change, follow these steps:
1. **Input:** Get the price of one watch (k) and the value of the special coin (r ).2. **Output:** Calculate the minimum number of watches Ali needs to buy to make the total price a multiple of 10 or to be able to use the special coin to make up the exact amount.
**Example:** (take these two input using ask block and save in two variables)- Price of one watch: 117 rupees
-Value of the special coin: 3 rupees
**Solution:**
Ali should buy a minimum of 9 watches to be able to pay the exact amount without needing change.
**Explanation:**
To solve this problem, you need to determine the smallest number (n) such that the total cost of ((n) watches can be paid using 10-rupee coins and the special coin () without requiring any change.