Chocolates are placed in a $100*60$ grid. You can place only one chocolate in every square of the grid. If two chocolates are in the same row or column, and there is no other chocolate between them, then they are called neighbor. Find the maximum number of chocolates that can be placed in the grid such that no chocolate does have more than two neighbors.
I have found filling a small $2*2$ grid fully with chocolates and keeping vacant just the next small $2*2$ grid gives the highest number of neighbors. But not sure with the approach.
We can solve this problem with an integer linear program. For a grid of length $n$ and height $m$:
\begin{align*} \max & \sum_{i,j} x_{ij} \\\\ & L_{ij} + R_{ij} + U_{ij} + D_{ij} \leq 4-2x_{ij} & \forall i,j \\\\ & L_{ij} \geq \frac{1}{n} \sum_{j<j'} x_{ij'} & \forall i,j \\\\ & R_{ij} \geq \frac{1}{n} \sum_{j'<j} x_{ij'} & \forall i,j \\\\ & U_{ij} \geq \frac{1}{m} \sum_{i<i'} x_{i'j} & \forall i,j \\\\ & D_{ij} \geq \frac{1}{m} \sum_{i'<i} x_{i'j} & \forall i,j \\\\ & L_{ij}, R_{ij}, U_{ij}, D_{ij}, x_{ij} \in \{0,1\} & \forall i,j. \end{align*}
Here $x_{ij} = 1$ iff there is a chocolate placed at $(i,j)$.
Intuitively, $L_{ij}=1$ if there is a chocolate on the left of $(i,j)$. Analogous with $R_{ij}, U_{ij}, D_{ij}$. More rigorously, $L_{ij}=0$ only if there is no chocolate on the left of $(i,j)$. $L_{ij}=1$ indicates that there may be a chocolate on the left of $(i,j)$.