OpenKattis
Kattis Set 04 - Dynamic Programming

#### Start

2021-02-01 04:00 AKST

## Kattis Set 04 - Dynamic Programming

#### End

2021-02-08 00:30 AKST
The end is near!
Contest is over.
Not yet started.
Contest is starting in -353 days 18:47:34

164:30:00

0:00:00

# Problem EBundles of Joy

Bob’s Bakery is celebrating its grand opening! To commemorate this exciting occasion, they are offering a “Bundles of Joy” sale to encourage people to sample their full range of delectable desserts.

## Output

The output for each test case is a single line containing the minimum cost of purchasing bundles to ensure you get at least one of each item. This value is guaranteed to fit in a 32-bit signed integer.

Sample Input 1 Sample Output 1
4
4 3
20 2 1 2
20 2 3 4
38 4 1 2 3 4
2 3
5 1 1
10 2 1 2
4 1 2
2 2
1 1 1
5 2 2 1
1 2
2 1 1
1 1 1

38
9
5
1