subject
Mathematics, 11.11.2020 14:00 tonio638

Cerința Într-un magazin intergalactic sunt n tipuri de obiecte, o infinitate din fiecare; pentru fiecare se cunoaște greutatea G și valoarea V. Un hoț intră în magazin având un rucsac ce poate transporta o greutate maximă GMax. El va fura anumite obiecte, astfel încât suma greutăților obiectelor furate să nu depășească GMax.

Să se stabilească câștigul maxim pe care îl poate obține hoțul. Câștigul este egal cu suma valorilor obiectelor furate.

Date de intrare
Programul citește de la tastatură numerele naturale n și GMax, iar apoi n perechi de valori G V, reprezentând greutatea, respectiv valoarea fiecărui tip de obiect.

Date de ieșire
Programul va afișa pe ecran numărul C, reprezentând câștigul maxim pe care îl poate obține hoțul.

Restricții și precizări
1 ≤ n ≤ 1 000;
1 ≤ G, V, GMax ≤ 10 000.
Problema #2884 Pbinfo

ansver
Answers: 2

Other questions on the subject: Mathematics

image
Mathematics, 21.06.2019 13:30, onlymyworld27
The quadratic function h(t) = -16.1t^2 + 150 models a balls height, in feet, over time, in seconds, after its dropped from a 15 story building. from what height in feet was the ball dropped?
Answers: 2
image
Mathematics, 21.06.2019 17:00, samiam61
The equation of a circle is (x + 4)2 + (y + 6)2 = 16. determine the length of the radius. 10 4 16 8 my flower basket delivers flowers within a 20 mile radius of their store. if this area is represented graphically, with my flower basket located at (5, 2), what is the equation that represents the delivery area? (x - 2)2 + (y - 5)2 = 20 (x - 5)2 + (y - 2)2 = 20 (x + 5)2 + (y + 2)2 = 400 (x - 5)2 + (y - 2)2 = 400
Answers: 1
image
Mathematics, 21.06.2019 19:20, aalichia
Part a: sam rented a boat at $225 for 2 days. if he rents the same boat for 5 days, he has to pay a total rent of $480. write an equation in the standard form to represent the total rent (y) that sam has to pay for renting the boat for x days. (4 points)
Answers: 1
image
Mathematics, 21.06.2019 20:20, bbyjoker
Recall that the owner of a local health food store recently started a new ad campaign to attract more business and wants to know if average daily sales have increased. historically average daily sales were approximately $2,700. the upper bound of the 95% range of likely sample means for this one-sided test is approximately $2,843.44. if the owner took a random sample of forty-five days and found that daily average sales were now $2,984, what can she conclude at the 95% confidence level?
Answers: 1
You know the right answer?
Cerința Într-un magazin intergalactic sunt n tipuri de obiecte, o infinitate din fiecare; pentru fi...

Questions in other subjects:

Konu
Mathematics, 01.10.2021 16:30
Konu
Social Studies, 01.10.2021 16:30