Problem 372: Pencils of rays

FCC link

Let R(M, N) be the number of lattice points (x, y) which satisfy M

Note: represents the floor function.

Test

{{test}}

Console output