m@main=getLine>>=print.f.reads>>m f[(x,l)]=product[x,x-length l..1]