Set the layout of the examination classroom 50, automatic ranking, must be before and after the left and right are not students in this class, what is the solution to this problem?

now is this before and after this is not how the students in this class are going to achieve, is there a good solution?

Mar.17,2022

it is recommended to refer to the [eight Queens problem] backtracking algorithm.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3e330-2bb6f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3e330-2bb6f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?