import algorithm, sequtils, strutils var k = (stdin.readLine.split)[1].parseInt a = stdin.readLine.split.map parseInt sort a var cnt = 0 for v in a: if k < v: break k.dec v inc cnt echo cnt, " ", k