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 20:00
Evaluate the discriminant of each equation. tell how many solutions each equation has and whether the solutions are real or imaginary. x^2 - 4x - 5 = 0
Answers: 2
question
Mathematics, 21.06.2019 21:00
If 30 lb of rice and 30 lb of potatoes cost ? $27.60? , and 20 lb of rice and 12 lb of potatoes cost ? $15.04? , how much will 10 lb of rice and 50 lb of potatoes? cost?
Answers: 1
question
Mathematics, 21.06.2019 22:00
Problem situation: caren is making rice and beans. she can spend no more than $10 on ingredients. she buys one bag of rice for $4.99. beans cost $0.74 per pound. how many pounds of beans, x, can she buy? inequality that represents this situation: 10≥4.99+0.74x drag each number to show if it is a solution to both the inequality and the problem situation, to the inequality only, or if it is not a solution.
Answers: 1
question
Mathematics, 21.06.2019 23:20
Which best describes a central bank's primary goals? limiting inflation and reducing unemployment reducing unemployment and maintaining cash flow controlling stagflation and reducing unemployment managing credit and ensuring the money supply's liquidity
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, 20.11.2020 01:00
question
Chemistry, 20.11.2020 01:00
question
Mathematics, 20.11.2020 01:00
question
Mathematics, 20.11.2020 01:00
Questions on the website: 13722359