Chef and party (Editorial)

Problem Name: Chef and Party

Difficulty: simple

Contest Code: CDTR2014

The problems basically boils down to sum up the values at the indexes specified by the chef.

Sample input for a test case

10 (total no. of guests)

20 30 50 30 10 5 78 98 345 1000 (amount to be paid by each guest)

4 (No. of Guests chef will pay bill for)

1 4 7 8 (Indexes of those guests)


Bill of first guest:20

Bill of fourth guest:30

Bill of seventh guest:78

Bill of eighth guest:98

Total bill:226