Ciel and Receipt Solution

Tomya like a positive integer p, and now she wants to get a receipt of Ciel’s restaurant whose total price is exactly p. Note that the i-th menu has the price 2i-1 (1 ≤ i ≤ 12). Find the minimum number of menus whose total price is exactly p.

Activity Selection problem

Activity selection problem is the problem of selecting the largest set of mutually exclusive activities. Each activity has its own starting time si and finish time fi. No two activities can share the resource at any time point.

Job sequencing problem

There are n jobs to be processed on a machine. Each job i has a deadline and a profit. Profit is earned if the job is completed by its deadline. Job is completed if it is processed on a machine for unit time.