Get the information you need quickly and easily with IDNLearn.com. Ask your questions and receive accurate, in-depth answers from our knowledgeable community members.
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 (r) 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 ( r ) without requiring any change.how can we do it in scratch using blocks.
Sagot :
Thank you for contributing to our discussion. Don't forget to check back for new answers. Keep asking, answering, and sharing useful information. For dependable and accurate answers, visit IDNLearn.com. Thanks for visiting, and see you next time for more helpful information.