eval"N,M,X,*A="+$<.read.split*?, p A.sort!.bsearch{|y|*b=A b.delete_at A.index y (N-3).downto(i=0).count{|j|i+=1while b[i]&.<=X+y-b[j] i