#include #include #include using namespace std; int main(){ int n,k; cin >> n >> k; int bm = 0; vector p(n); for(int i=0; i> p.at(i); bm = max(bm,p.at(i)); } int b = 0; int cnt = 0; int ans = 0; while(b <= bm){ for(int i=0; i= b){ cnt++; } } if(cnt <= k){ ans = max(ans,cnt); } b++; cnt = 0; } cout << ans << endl; }