Ayesha must choose which of several proposals to fund at a game studio, each with a cost and expected impact, to maximize impact within budget.
What your program reads
Line1: N W. Next N lines: cost impact.
What your program prints
Maximum achievable impact.
Limits
1 ≤ N ≤ 500
Example input
3 50 10 60 20 100 30 120
Expected output
220
main.c
Your work is saved in this browser as you type.
Loading editor…
Input for Run
Run tries your code on the input above and shows what it prints. Submit checks your output against every test, including hidden ones.
Shortcut: Ctrl + Enter sends it to the judge.