If n is odd and m is even, then x does not exist. If a cup is to be turned over, the number of times it is turned over must be odd, so when n is odd, the total number of times all cups are turned over is the sum of odd numbers, and the result is still odd. Odd numbers cannot be divisible by even m, so this situation cannot achieve the goal.
Detailed analysis:
1, n is an integer multiple of m, which is the simplest, and X=N/M, which is easy to understand.
2, N=M+ 1, this is the second simplest, X=N, that is, turning around is equivalent to turning one at a time.
3. N & gt2M, that is to say, the number of cups that rotate each time is less than half of the total. There is also a formula for how to calculate at this time. Because we need the cups to be rotated an odd number of times, we should start counting by rotating each cup once. One condition needs to be met: the total number of times all cups rotate must be divisible by the number of cups rotated each time, so we have to change a cup from 1 time to three times first, and add 2 to the total. Add 4 to the total number of times, and so on, that is, first use N/M to see if it can be divided. If not, use (N+2)/M, if not, use (N+4)/M until it is divisible. After divisibility, this quotient is the final number of times, for example, 8 cups turn three times at a time, 8/3 is not good, 65438.
4. N & lt2M, that is to say, the number of pages per turn is more than half of the total number of pages. This time is relatively simple. Please remember:
5, n and m have the same parity, and it will be done after three times.
6, n is occasional, m is odd, do it 4 times.
So far, all the situations have been listed, so we must judge them from top to bottom, and we can't use a single method to calculate them.