Multiples and Power Differences
HardRating 2200CodeforcesConstructive Algorithms
Approach hintTry it first, then revealHide
lcm(1, ..., 16) = 720720 is a multiple of every possible entry and fits within the bound. Combine it with a chessboard colouring, and look for a fourth power that keeps each cell of the other colour a multiple of its own a.