electicode
АсосӣКурсҳоМанбаъҳоМасъалаҳоОлимпиадаи миллӣМусобиқаҳоҶадвали роҳбарон
...

A puzzle about queens

Маҳдудияти вақт: 1000msМаҳдудияти ҳофиза: 256MB
Ҳамаи ҳалҳо

Тавсифи масъала

Vasya recently started playing chess and somewhere read a puzzle in which it was necessary to place the maximum number of queens on an 8×88 \times 88×8 board so that at least one square remained unattacked. This problem is easily solved for a 3×33 \times 33×3 board, since it is clear that it is impossible to place more than two queens on it in this way. Help Vasya solve this problem for an N×NN \times NN×N board.

Input Format

The input contains a natural number NNN -- the size of the chessboard N×NN \times NN×N (1≤N≤100)(1 \le N \le 100)(1≤N≤100).

Output Format

In the output, you need to print the maximum number of queens that can be placed on an N×NN \times NN×N chessboard so that one square remains unattacked.

Мисолҳо

Мисол 1
Вуруд
3
Баромад
2

© 2026 Electicode. All rights reserved.