![subject](/tpl/images/cats/mat.png)
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](/tpl/images/cats/User.png)
Answers: 2
Another question on Mathematics
![question](/tpl/images/cats/mat.png)
Mathematics, 21.06.2019 14:30
Which system of linear inequalities is represented by the graph?
Answers: 2
![question](/tpl/images/cats/mat.png)
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](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
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](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/ekonomika.png)
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 30.01.2021 06:10
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 30.01.2021 06:10
![question](/tpl/images/cats/mkx.png)
Arts, 30.01.2021 06:10
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 30.01.2021 06:10
![question](/tpl/images/cats/es.png)
Spanish, 30.01.2021 06:10
![question](/tpl/images/cats/fizika.png)
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/ap.png)
Advanced Placement (AP), 30.01.2021 06:10
![question](/tpl/images/cats/mat.png)
Mathematics, 30.01.2021 06:10
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/en.png)
English, 30.01.2021 06:10
![question](/tpl/images/cats/mat.png)
Mathematics, 30.01.2021 06:10
![question](/tpl/images/cats/mat.png)
Mathematics, 30.01.2021 06:10