Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

an event of Thanksgiving there is a feast organized for guests. The quantity of cake distributed among N guests is stored in an array plates.

an event of Thanksgiving there is a feast organized for guests. The quantity of cake distributed among N guests is stored in an array plates. However, on the day of the feast additional guests arrived and the manager now has no other way but to reduce the quantity of cakes from these plates. He wants to save at least M kilograms of cake for the extra guests that came in, but wants to reduce the quantity of cake only from those plates which have more than or equal to K kilograms of cake.
56786
9
10
11
12
13
You must help the manager to find and return the maximum value of K, he can maintain after saving at least M kilograms of cake.
Input Specification:
input1: An integer value N, representing the number of guests.
input2: An integer value M. representing the minimum kilograms of cake that needs to be saved.
input3: An integer array plates, where each element represents quantity of cake in each guest's plate.
Output Specification:
Retum the maximum value of K after saving M kilograms of cake
Example 1:
input 1: 4
input2: S
Use
Need Help? Contact us (Please add country code whil
Mets Online Assessment 2021-2031

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Guide To Client Server Databases

Authors: Joe Salemi

2nd Edition

1562763105, 978-1562763107

More Books

Students also viewed these Databases questions

Question

Write a program to check an input year is leap or not.

Answered: 1 week ago

Question

Write short notes on departmentation.

Answered: 1 week ago

Question

What are the factors affecting organisation structure?

Answered: 1 week ago

Question

What are the features of Management?

Answered: 1 week ago

Question

Briefly explain the advantages of 'Management by Objectives'

Answered: 1 week ago

Question

b. Explain how you initially felt about the communication.

Answered: 1 week ago