Introduction to Algorithms
Week 1: Exercises

1. Making Change

Read a price in Czech crowns. Print out a combination of 20-Kč, 10-Kč, 5-Kč and 1-Kč coins that add up to the price, using the smallest possible number of coins.

Enter price: 67
20 Kc: 3
10 Kc: 0
5 Kc: 1
1 Kc: 2

2. 20 Minutes Later

Read two numbers representing a 24-hour time in hours and minutes. Print the time that is 20 minutes later, wrapping past midnight if necessary.

Hours: 2
Minutes: 30
2:50
===
Hours: 5
Minutes: 50
6:10
===
Hours: 23
Minutes: 55
0:15

3. N Minutes Later

Read two numbers representing a 24-hour time in hours and minutes. Read another number representing an offset N in minutes (a positive number). Print the time that is N minutes later, wrapping past midnight if necessary.

Hours: 2
Minutes: 30
Offset: 20
2:50
===
Hours: 5
Minutes: 50
Offset: 100
7:30
===
Hours: 23
Minutes: 55
Offset: 1000
16:35