Company: Barclays_27july
Difficulty: medium
Reactor Energy Maximization Problem Description Dr. Victor Frankenstein has quit the monster creation business. Nuclear energy now strikes his fantasy. He has created a fission reactor that takes radioactive materials in a liquid state. The capacity of the reactor is 'Y' gallons. He has 'N' vials of radioactive liquids, each with some mass and some volume. Some units of energy are produced when a liquid is poured into the reactor. Victor would like to maximize the energy output. However, there is a catch. Upon studying the chemical property of atomic elements, he came to know that the combined mass of the radioactive liquids inside the reactor must not exceed a certain criticalMass. Moreover the reaction would go out of control and cause a violent explosion. Write an algorithm that will help Victor get the maximum energy from the reactor without losing his life. Input The first line consists of an integer maxCapacity , representing the reactor capacity (Y). The second line consists of