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
Answers: 2
Mathematics, 21.06.2019 14:30
Bismuth-210 is an isotope that radioactively decays by about 13% each day, meaning 13% of the remaining bismuth-210 transforms into another atom (polonium-210 in this case) each day. if you begin with 233 mg of bismuth-210, how much remains after 8 days?
Answers: 3
Mathematics, 21.06.2019 16:50
What are the steps to solving the inequality 3b + 8 ≥ 14?
Answers: 1
Mathematics, 21.06.2019 18:00
Pat listed all the numbers that have 15 as a multiple write the numbers in pats list
Answers: 2
Mathematics, 21.06.2019 20:30
The cost for an uberi is $2.50 plus $2.00 mile. if the total for the uber ride was $32.50, how many miles did the customer travel?
Answers: 3
Cerința
Într-un magazin intergalactic sunt n tipuri de obiecte, o infinitate din fiecare; pentru fi...
Mathematics, 05.05.2020 00:34
Business, 05.05.2020 00:34
Mathematics, 05.05.2020 00:34
Mathematics, 05.05.2020 00:34
Physics, 05.05.2020 00:34
Social Studies, 05.05.2020 00:34
Mathematics, 05.05.2020 00:34
Mathematics, 05.05.2020 00:34
History, 05.05.2020 00:34
English, 05.05.2020 00:34
Mathematics, 05.05.2020 00:35