Assume that there are certain types of investment projects that can increase your money. Let's assume that project i need investment a; to be done. Once the project is established, it returns your initial investment and gives you an additional profit b₁. Each project may be established once. Currently you have an amount of money equal p. Note that you can't establish a project that takes more money than what you currently have. Your task is to find the maximum possible profit out of these projects. Input The first line contains the integers n and p, where n is the number of available projects and p is your initial amount of money. Then two lines follow, each containing n integers describing the arrays a and b [Note: a;: the amount of money that you have to invest (spend) to establish the project i. b;: the amount of revenue that you get as an addition to the amount of money already spent to establish the project i. Output For each test case, output a single value that present the maximum profit you can achieve. Example Ex1 np a; → Ex3 b; → Ex2 np a; → bi → np a; → bi → input 5 $200 $200 $200 $500 $200 $200 $200 $200 $200 $200 $200 3 $150 $200 $400 $150 $90 $1000 $50 5 $80 $1280 $640 $320 $160 $80 $1280 $640 $320 $160 $80 output $1000 $140 $2480

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter11: Nonlinear Programming
Section11.13: Pareto Optimality And Tradeoff Curves
Problem 5P
icon
Related questions
Question
Assume that there are certain types of investment projects that can increase your money.
Let's assume that project i need investment a, to be done. Once the project is established,
it returns your initial investment and gives you an additional profit b₁. Each project may be
established once. Currently you have an amount of money equal p. Note that you can't
establish a project that takes more money than what you currently have. Your task is to
find the maximum possible profit out of these projects.
Input
The first line contains the integers n and p, where n is the number of available projects
and p is your initial amount of money.
Then two lines follow, each containing n integers describing the arrays a and b
[Note:
a;: the amount of money that you have to invest (spend) to establish the project i.
b;: the amount of revenue that you get as an addition to the amount of money already
spent to establish the project i.
Output
For each test case, output a single value that present the maximum profit you can
achieve.
Example
Ex1
Ex2
Ex3
np
a; →
bi →
np
a; →
bi →
np
a; →
b; →
input
5 $200
$200 $200 $500 $200 $200
$200 $200 $200 $200 $200
3 $150
$200 $400 $150
$90 $1000 $50
5 $80
$1280 $640 $320 $160 $80
$1280 $640 $320 $160 $80
output
$1000
$140
$2480
Transcribed Image Text:Assume that there are certain types of investment projects that can increase your money. Let's assume that project i need investment a, to be done. Once the project is established, it returns your initial investment and gives you an additional profit b₁. Each project may be established once. Currently you have an amount of money equal p. Note that you can't establish a project that takes more money than what you currently have. Your task is to find the maximum possible profit out of these projects. Input The first line contains the integers n and p, where n is the number of available projects and p is your initial amount of money. Then two lines follow, each containing n integers describing the arrays a and b [Note: a;: the amount of money that you have to invest (spend) to establish the project i. b;: the amount of revenue that you get as an addition to the amount of money already spent to establish the project i. Output For each test case, output a single value that present the maximum profit you can achieve. Example Ex1 Ex2 Ex3 np a; → bi → np a; → bi → np a; → b; → input 5 $200 $200 $200 $500 $200 $200 $200 $200 $200 $200 $200 3 $150 $200 $400 $150 $90 $1000 $50 5 $80 $1280 $640 $320 $160 $80 $1280 $640 $320 $160 $80 output $1000 $140 $2480
Expert Solution
steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Knowledge Booster
Project Analysis
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole