[*1..9].permutation{|_|a,b,c,d,e,f=_;print 0,_,$/if f<6&&_[7]<6&&10*d+e<24&&10*b+c<31}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page