Company: Graviton_4nov
Difficulty: medium
Tasty dishes Problem Description There are N dishes in a line. You are given two arrays size and taste . For all i (1 <= i <= N), size i denotes the size of the i-th dish and taste i denotes the taste of the i-th dish. You are allowed to eat at most M dishes. The satisfaction of eating some dishes is given as follows: If you eat k different dishes, the value of satisfaction will be equal to the sum of the sizes of all k dishes multiplied by the minimum taste among all the k dishes. Calculate the maximum satisfaction you can get after eating at most M different dishes. Function description Complete the function solve . This function takes the following 4 parameters and returns the required answer: N : Represents the total number of dishes M : Represents the maximum number of dishes you can eat size : Represents an array of sizes N denoting the sizes of the dishes taste : Represents an array of sizes N denoting the tastes of the dishes Input/Output Specification Note: Use this inpu