Input 20 1 5 8 9 10 17 17 20 24 30 31 32 33 34 35
Fantastic news! We've Found the answer you've been seeking!
Question:
Input 20 1 5 8 9 10 17 17 20 24 30 31 32 33 34 35 36 37 38 39 40 2 3 5
Expected output 50
Transcribed Image Text:
A rod cutting company streling corporation will cut rods of specific lengths only. Given a list of lengths by which this company will make rods, a rod of length 'n' and list of prices of each piece of rod that shall be cut by the company, write an algorithm and implement it using top down dynamic programming to find maximum revenue that shall be generated. In that case, give a penalty of Rs 1 for each meter of the residue. Input Format First line contains the length of the rod, n Next line contains price of various lengths of rods from 1 to n Next line cotains the number of preferred lengths Next line contains the preferred lengths separated by a space Output Format Print the maximum revenue that may be generated A rod cutting company streling corporation will cut rods of specific lengths only. Given a list of lengths by which this company will make rods, a rod of length 'n' and list of prices of each piece of rod that shall be cut by the company, write an algorithm and implement it using top down dynamic programming to find maximum revenue that shall be generated. In that case, give a penalty of Rs 1 for each meter of the residue. Input Format First line contains the length of the rod, n Next line contains price of various lengths of rods from 1 to n Next line cotains the number of preferred lengths Next line contains the preferred lengths separated by a space Output Format Print the maximum revenue that may be generated
Expert Answer:
Answer rating: 100% (QA)
include include include int maxint a int b return a b a b and price as prices of diffe... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these algorithms questions
-
Describe a situation in which you had to make a difficult ethical decision in the workplace. It might have been the decision not to do something you were tempted to do, or it might have a time when...
-
Ayayai Company prepares its statement of cash flows using the direct method for operating activities. For the year ended December 31, 2024, Ayayai Company reports the following: Sales on account...
-
A road building company is purchasing an excavator for $500,000. The corporate tax rate is 45% and the expected after-tax rate of return is 12%. What would be the present value of the future tax...
-
Understanding the history and background of your company gives you valuable insights as to what to do and what not to do going forward. A brief written summary of the background and history of the...
-
In the theory of relativity, the Lorentz contraction formula L = L01 v2/c2 expresses the length L of an object as a function of its velocity v with respect to an observer, where L0 is the length of...
-
What do you think is the most important thing to be learned from your interview? What do you think about using the interview method to study this particular topic? Please make connections to the...
-
Consider the gasoline mileage performance data in Table B.3. a. Use the all-possible-regressions approach to find an appropriate regression model. b. Use stepwise regression to specify a subset...
-
A ccess the FASBs Codification Research System at the FASB website (www.fasb.org). Required: Determine the specific citation for accounting for each of the following items: 1. If it is only...
-
The following year-end information is taken from the December 31 adjusted trial balance and other records of Leone Company. Advertising expense Depreciation expense-Office equipment $ 28,750 7,250...
-
The Tamer Tire Company provided the following partial trial balance for the current year ended December 31. The company is subject to a 40% income tax rate. Required a. Prepare a single- step income...
-
New Ventures Limited issued floating-rate notes with a one-year maturity, an interest rate of Jibar plus 125 basis points, and total face value of R500 million. The company predicts that interest...
-
How would the U.S. economy likely differ today if Standard Oil had not been broken up?
-
Private colleges of the same caliber generally charge roughly the same tuition. Would you characterize these colleges as a cartel type of oligopoly?
-
What did Adam Smith mean when he wrote, Seldom do businessmen of the same trade get together but that it results in some detriment to the general public?
-
True or false? It is obvious that all for-profit businesses in the United States will maximize profit. Why?
-
Some economists have compared managers to politicians. a. How do the incentives facing managers resemble those of politicians? b. How do they differ? c. What does your answer say about the relative...
-
1. If the graduated dial on the Bridgeport milling machine is turned one revolution and the dial reads from 0 to 190 and back to 0, how many revolutions is required to move an axis 3 inches? 5 Turns...
-
President Lee Coone has asked you to continue planning for an integrated corporate NDAS network. Ultimately, this network will link all the offices with the Tampa head office and become the...
-
Cypress Corporation has regular taxable income of $170,000 (assume annual gross receipts are greater than $5 million) and regular tax liability of $49,550 for 2012. The corporation also has tax...
-
Scott Butterfield is self-employed as a CPA. He uses the cash method of accounting, and his Social Security number is 644-47-7833. His principal business code is 541211. Scott's CPA practice is...
-
Carl and Jenny adopt a Russian orphan. The adoption takes 2 years and two trips to Russia and is final in 2012. They pay $6,000 in 2011 and $7,500 in 2012 of qualified adoption expenses, and have AGI...
-
Quick Copies recorded a cash collection on account by debiting Cash and crediting Accounts Payable. What will the trial balance show for this error? a. Cash is overstated. b. Liabilities are...
-
Daniel Bronstein practices medicine under the business title Daniel Bronstein, M.D. During July, the medical practice completed the following transactions: The business uses the following accounts:...
-
In December, the first five transactions of Gillespie Consulting have been posted to the T-accounts. Prepare the journal entries that served as the sources for the five transactions. Include an...
Study smarter with the SolutionInn App