Two spies in a grid will have their covers blown if:
They are both in the same row.
They are both in the same column.
They can see each other diagonally (i.e., lie in a line inclined ° or ° to the base of the grid).
The level of danger is now increased! In addition to the conditions above, no spies may lie in any straight line. This line need not be aligned ° or ° to the base of grid.
Write a program in the language of your choice to place spies (one spy per row) on an grid without blowing anyone's cover. Your program must then print the following lines describing a valid configuration:
The value of .
A space-separated list of -indexed column numbers, where each value is the column number of the spy in row (where ).
Solve this problem for as large as possible, up to (and including) .
Note:Run and Custom Input are not available for this challenge; you must click Submit Code for your submission to be scored. Your score for this challenge will always be the maximum value scored by any of your submissions.
In the examples below, denotes a spy and * denotes an empty cell.