Generation of Combinatorial Objects · ILP solvers (Optional)

Lesson 4

Nikolai Chukhin · Alexander S. Kulikov

Programming problem.

Write a program that reads integers \(2 \le n,m \le 11\) and outputs the maximum number of diagonals that can be placed on an \(n \times m\) grid so that no two of them share any points (remember this puzzle).

1 point
Public samples
Public sample 1
Input
3 3
Expected output
6