Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please can you help me to solve this by java On children's day, a teacher wants to distribute candies to all her students. She has

image text in transcribed

please can you help me to solve this by java

On children's day, a teacher wants to distribute candies to all her students. She has N candies, and each candy has a special value. She wants all candies to have the same special value so she decides to reduce the special values of some candies. However, the special values of all the candies cannot be reduced. Hence, she decides to reduce the special values for as much candies as possible so that at least K candies have the same special value and this value must be as large as possible. Find the maximum value that the teacher can achieve. Input Specification: input1: N, total number of candies innutt. K sandies havine the same snecial vale

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

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

KEY QUESTION Refer to the table in question

Answered: 1 week ago