Problem

Source: China TST 2006

Tags: number theory unsolved, number theory



Given positive integers $m$ and $n$ so there is a chessboard with $mn$ $1 \times 1$ grids. Colour the grids into red and blue (Grids that have a common side are not the same colour and the grid in the left corner at the bottom is red). Now the diagnol that goes from the left corner at the bottom to the top right corner is coloured into red and blue segments (Every segment has the same colour with the grid that contains it). Find the sum of the length of all the red segments.