Given a set of packages and a number of days, find the minimum capacity of a ship to transport all packages within the given time frame.