Company: Walmart_12march
Difficulty: medium
Energy Maximization Problem Description In the bustling town of Techville, the grand science fair is in full swing. Among the curious minds is Dr. Alistair, a scientist intrigued by an unusual challenge involving N mysterious crystals, each uniquely numbered from 1 to N. Each crystal i requires Di energy to activate and releases Ai energy once energized. Additionally, these crystals are linked: activating crystal i (for 1 ≤ i Dr. Alistair can change exactly K of these bonds before activating any crystals. He must choose K crystals (1 ≤ i Dr. Alistair can achieve by making the optimal K bond changes and then activating the best set of crystals. Help Dr. Alistair solve this puzzle and shine at the Techville science fair! Input Format The first line contains two space seperated integers n and K. The second line contains n integers a1,a2,...,an, each denoting the energy given by crystal i. The third line contains n integers D1,D2,...,Dn, each denoting the energy given by crystal i. O