In the plane the points with integer coordinates are the vertices of unit squares. The squares are colored alternately black and white (as on a chessboard).

For any pair of positive integers mm and nn, consider a right-angled triangle whose vertices have integer coordinates and whose legs, of lengths mm and nn, lie along edges of the squares.

Let S1S_1 be the total area of the black part of the triangle and S2S_2 be the total area of the white part. Let

f(m,n)=S1S2.f(m,n) = |S_1 - S_2|.

(a) Calculate f(m,n)f(m,n) for all positive integers mm and nn which are either both even or both odd.

(b) Prove that f(m,n)12max{m,n}f(m,n) \leq \frac{1}{2}\max\{m,n\} for all mm and nn.

(c) Show that there is no constant CC such that f(m,n)<Cf(m,n) < C for all mm and nn.