Find the greatest n satisfying given condition
Source: 2020 Caucasus Mathematical Olympiad Seniors Problem 8
March 16, 2020
combinatoricsCombinatorial games
Problem Statement
Peter wrote distinct integers on a board. Basil needs to fill the cells of a table with integers so that the sum in each rectangle (either vertical, or horizontal) is equal to one of the numbers written on the board. Find the greatest such that, regardless of numbers written by Peter, Basil can fill the table so that it would contain each of numbers at least once (and possibly some other integers).