Y by khan.academy, RANDOM__USER
Let
and
be positive integers. In an
grid, two cells are considered neighboring if they share a common edge. Kritesh performs the following actions:
1. He begins by writing
in any cell of the grid.
2. He then fills each remaining cell with a non-negative integer such that the absolute difference between the numbers in any two neighboring cells is exactly
.
Kritesh aims to fill the grid in a way that maximizes the sum of the numbers written in all the cells. Determine the maximum possible sum that Kritesh can achieve in terms of
and
.
(Kritesh Dhakal, Nepal)



1. He begins by writing

2. He then fills each remaining cell with a non-negative integer such that the absolute difference between the numbers in any two neighboring cells is exactly

Kritesh aims to fill the grid in a way that maximizes the sum of the numbers written in all the cells. Determine the maximum possible sum that Kritesh can achieve in terms of


(Kritesh Dhakal, Nepal)