The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 406 Weeks Ago, 1 Day Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Â
An online quiz is going to be held at NIT Hamirpur. Each student will be given a system which is connected to internet. Although all the systems are connected to same network, there is still varying data transfer speed among them. This can cause pages to load slower on one system than the other. The organizers do not want a participant to have an advantage over others due to this. The organizers can't increase transfer speed on a system but they can cap it. Also they want to provide maximum speed to each system.
Â
Suppose there are n systems and m participants and speed of each of the n systems is known. Your task is to tell them the maximum speed they should keep on each system, so that atleast m of n systems have the same speed.
Â
Â
First line containing two space separated inputs (n and m) - the number of computer and participants respectively. The next line contains a space separated sequence of n integers: a1, a2, ..., an - where ai denotes the speed of ith computer in KB/s.
Â
Â
Print a single integer representing the maximum data transfer speed that should be kept.
Â
Â
Should contain all the constraints on the input data that you may have. Format it like:
Â
Â
Input: 5 3 250 125 330 3000 1000 Output: 330
Â
Input: 6 6 2000 2100 3000 1500 1250 3000 Output: 1250
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll