1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream> 
#include <string> 
using namespace std; 

short wynik[121];

int main()
{ 	
cin.tie(0); 
cout.tie(0); 
ios_base::sync_with_stdio(false); 
short n,k;
short bufor;
cin>>n>>k;
for(int i=0;i<n;i++)
{
cin>>bufor;
wynik[bufor]++;
}
short suma=0;
int j=121;
while(suma<k)
{
suma+=wynik[j];
j--;
}
cout<<suma;
}