Problem

Source: Iberoamerican Olympiad 2008, problem 1

Tags: combinatorics proposed, combinatorics



The integers from 1 to $ 2008^2$ are written on each square of a $ 2008 \times 2008$ board. For every row and column the difference between the maximum and minimum numbers is computed. Let $ S$ be the sum of these 4016 numbers. Find the greatest possible value of $ S$.