Generation of Combinatorial Objects · ILP solvers (Optional)

Lesson 5

Nikolai Chukhin · Alexander S. Kulikov

Programming problem.

Write a program that reads integers \(3 \le n,m \le 7\) and outputs the maximum number of diagonals of length \(\sqrt{5}\) that can be placed on an \(n \times m\) grid so that no two of them share any points.

For example, for \(n=3\) and \(m=3\) the answer is six.

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