Efficient Study

Company: Mathworks IIT Bhubaneswar

Difficulty: medium

Problem Statement

Efficient Study Description An e-book provider offers n programming articles. Article i is articles[i] pages long and is worth iv[i] points of intellectual value. A reader only earns an article's points by reading it twice , so choosing article i costs 2 * articles[i] pages and pays iv[i] points. An article may be chosen at most once -- reading it a third and fourth time earns nothing extra -- and a partly read article earns nothing at all. At most p pages can be read in one day. Choose the set of articles that maximises the total intellectual value earned in a single day. Complete the function maximumLearning in the editor below. Function Signature int maximumLearning(int iv_count, int* iv, int articles_count, int* articles, int p); Input The input is read from standard input as whitespace-separated integers, in this order: iv_count , the number of articles. iv_count integers, the array iv . articles_count , which equals iv_count . articles_count integers, the array articles . p , the