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, 20.06.2019 18:04
It costs 4.25 for 1 pound of roast beef. how much will it cost to purchase 2.5 pounds of roast beef? round to nearest cent
Answers: 1
question
Mathematics, 21.06.2019 13:30
Jim makes $10.35 per hour. write an equation that jim can use to calculate his pay.
Answers: 3
question
Mathematics, 21.06.2019 18:20
What is the y-intercept of the line given by the equation
Answers: 2
question
Mathematics, 22.06.2019 00:00
How can i differentiate this equation?
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.11.2020 17:40
question
Mathematics, 30.11.2020 17:40
question
English, 30.11.2020 17:40
Questions on the website: 13722361