For the former method / * principle: If the three columns are enclosed in a ring, the total number of trays is n, and the law of its movement is: if n is an even number: 2 steps per time; even 1 step per time If n is an odd number: an odd number disk each time 1 step; the even number disk is 2 steps each time; as for the next one of which pillars on the move, it can be judged by size and order. The above can pass mathematical proof, not described above! * /
The following is the second algorithm:
#include