Given an n*n grid (where n<=1000 and n >=2) with different weights for each cell (w <= 1000 and w >= 0) and an infinite number of balls, determine the maximum combin