package main import . "fmt" func main() { var n,k int Scan(&n,&k) p:=make([]int,n) for i:=range p{ Scan(&p[i]) } var a int for b:=0;b<=401;b++ { var c int for _,s:=range p { if s>=b { c++ } } if c>a&&c<=k { a=c } } Println(a) }