All submissions for this problem are available.
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:
- 1 ≤ n ≤ 200
- 1 ≤ m ≤ n
Input: 5 3 250 125 330 3000 1000 Output: 330
Input: 6 6 2000 2100 3000 1500 1250 3000 Output: 1250
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions