import List main=interact$unlines.f[].sortBy(\a b->compare(n b::Int)$n a).lines n=read.last.words f _[]=[] f x(h:t)=(show(1+sum[1|y<-x,y>n h])++' ':h):f(n h:x)t
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page