eval"N,M,X,*A="+`dd`.split*?, p A.sort!.bsearch{|y|*b=A b.delete_at A.index y b.reverse.count{b.shift while b[0]&.<=X+y-_1 b.shift}