if you don't know please skip and not rejected under any category**** DO NOT ATTEND IF YOU DONT KNOW c++ language **** Do it in kotlin language** make sure you have correct output

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

** if you don't know please skip and not rejected under any category**** DO NOT ATTEND IF YOU DONT KNOW c++ language **** Do it in kotlin language** make sure you have correct output

Culinary expert has N laddus, l-th of which
has a size si. There are no two laddues with
equivalent size, for example all the laddus
have various sizes.
There are K children that came to meet Chef
today. Culinary expert needs to give a
solitary laddu to every one of these K
children. Likewise, he needs to limit the
distinction in the sizes which the children
get, for example he needs to limit the most
extreme distinction in the extents of the
laddus conveyed. This is on the grounds
that children feel envious of one another if
the other one has a greater laddu that him/
her.
All in all, discover a subset of size K which
limits the worth of max_element of the
subset - min_element of the subset, and
output this base contrast.
Input
The primary line of the input contains an
integer T indicating the quantity of
experiments. The portrayal of T experiments
follows.
The primary line of each experiment
contains two space isolated integers N, K.
The second line of each experiment
contains N space isolated indicating the
cluster s.
Output
For each experiment, output a solitary
integer comparing to the base distinction in
the measures of the laddus disseminated to
the children
Transcribed Image Text:Culinary expert has N laddus, l-th of which has a size si. There are no two laddues with equivalent size, for example all the laddus have various sizes. There are K children that came to meet Chef today. Culinary expert needs to give a solitary laddu to every one of these K children. Likewise, he needs to limit the distinction in the sizes which the children get, for example he needs to limit the most extreme distinction in the extents of the laddus conveyed. This is on the grounds that children feel envious of one another if the other one has a greater laddu that him/ her. All in all, discover a subset of size K which limits the worth of max_element of the subset - min_element of the subset, and output this base contrast. Input The primary line of the input contains an integer T indicating the quantity of experiments. The portrayal of T experiments follows. The primary line of each experiment contains two space isolated integers N, K. The second line of each experiment contains N space isolated indicating the cluster s. Output For each experiment, output a solitary integer comparing to the base distinction in the measures of the laddus disseminated to the children
Input
3
41
3425
52
15379
63
1 12 7 9 5 17
Output
O N4
Transcribed Image Text:Input 3 41 3425 52 15379 63 1 12 7 9 5 17 Output O N4
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY