GATE CS 2021, set 1 · Question 50 · Algorithms · Multiple select (MSQ) · 2 marks · no negative marks
Define Rₙ to be the maximum amount earned by cutting a rod of length n meters into one or more pieces of integer length and selling them. For i > 0, let p[i] denote the selling price of a rod whose length is i meters. Consider the array of prices:
p[1] = 1, p[2] = 5, p[3] = 8, p[4] = 9, p[5] = 10, p[6] = 17, p[7] = 18
Which of the following statements is/are correct about R₇?
- (A) R₇ = 18
- (B) R₇ = 19
- (C) R₇ is achieved by three different solutions.
- (D) R₇ cannot be achieved by a solution consisting of three pieces.
Answer
Answer (A), (C)
Answer from the official GATE CS 2021 answer key.
The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes