fn=gn+o(r-n|n|-m),