Question: (9) You write the code in GO programming language Monica is making N dishes(food items) for joey, each of these food items have some nutritive

(9) You\ write the code in GO programming language\ Monica is making

N

dishes(food items) for joey, each of these food items have some nutritive value and these nutritive values are stored in an array V. You have to help Monica to divide these food items into separate meals while making sure of the following points:\ each meal should contain at least

k

food items the difference between the maximum and minimum nutritive value of the food items in the meals can be at most

M

\ your task is to find and return an integer value representing the minimum number of. meals into which Monica can divide the food items, If the food item cannot be divided into meals using the following the above criteria return -1\ Input Specification:\ Input 1: An integer value N, representing the number of food items.\ Input 2: An integer value M, representing the maximum allowed nutritional value in a meal.\ Input 3: An integer value

K

, representing the minimum number of food items required in one meal.\ Input 4: An integer array

V

, representing the nutritional values of food items.

 (9) You\ write the code in GO programming language\ Monica is

You write the code in CO programming language Monica is making N dishes(food items) for joey. each of these food items have some nutritive value and these nutritive values are stored in an array V. You have to help Monica to divide these food items into separate meals while making sure of the following points: each meal should contain at least k food items the difference between the maximum and minimum nutritive value pf the food items in the meals can be at most M your task is to find and return an integer value representing the minimum number of meals into which Monica can divide the food items, if the food item cannot be divided into meals using the following the above criteria return -1 Input Specification: Input 1: An integer value N, representing the number of food items. Input 2: An integer value M, representing the maximum allowed nutritional value in a meal. Input 3: An integer value K, representing the minimum number of food items required in one meal. Input 4: An integer array V, representing the nutritional values of food litems

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!