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

Another question on Mathematics

question
Mathematics, 21.06.2019 14:30
Which system of linear inequalities is represented by the graph?
Answers: 2
question
Mathematics, 21.06.2019 17:00
In the given figure ar(adf) =ar(cda) and ar(cdf) = ar(cdf). show that abdc and cdfe are trapeziums.
Answers: 2
question
Mathematics, 21.06.2019 19:30
If x is 6, then 7x= a. 13 b. 42 c. 42x d. 76
Answers: 2
question
Mathematics, 21.06.2019 23:30
Find each value of the five-number summary for this set of data. [note: type your answers as numbers. do not round.] 46, 19, 38, 27, 12, 38, 51 minimum maximum median upper quartile lower quartile
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
question
Mathematics, 30.01.2021 06:10
question
Mathematics, 30.01.2021 06:10
question
Arts, 30.01.2021 06:10
question
Mathematics, 30.01.2021 06:10
question
Spanish, 30.01.2021 06:10
question
Mathematics, 30.01.2021 06:10
Questions on the website: 13722367