IDNLearn.com: Your trusted source for finding accurate and reliable answers. Ask your questions and receive comprehensive and trustworthy answers from our experienced community of professionals.
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 :
We value your participation in this forum. Keep exploring, asking questions, and sharing your insights with the community. Together, we can find the best solutions. IDNLearn.com is dedicated to providing accurate answers. Thank you for visiting, and see you next time for more solutions.