/* Reference question: N numbers are given, and if M numbers exist, the sum of M numbers is a multiple of n. If there are multiple groups of solutions, output a group at will. If it does not exist, the output value is 0. Question: First of all, we must declare that this question must be resolved. Principle Based on the drawer principle: Because there are n numbers, the remainder is obtained for N numbers. If there is no 0 in the remainder, according to the Pigeon nest principle, there must be two numbers with the same remainder. If the remainder is 0, naturally, it is a multiple of N. That is to say, the sum of N numbers must be multiples of N. The idea of this question is to obtain the sum of the remainder of the I (I <= N) and N from the first number, and record the existence status of the corresponding remainder in sequence, if sum = 0, the sum from the first item to the first item meets the meaning of the question. If the obtained sum already exists in the front, assume that the same sum value exists in the J (j <I, the sum of items J + 1 to I must satisfy the meaning of the question. */# Include <stdio. h> # include <string. h> # define Max 16000int s [Max], sum [Max], has [Max]; int main (void) {int N, I, j; while (scanf ("% d", & N )! = EOF) {int L, R; memset (has,-1, sizeof (has); memset (sum, 0, sizeof (SUM )); has [0] = 0; for (I = 1; I <= N; I ++) scanf ("% d", & S [I]); for (I = 1; I <= N; I ++) {sum [I] = (sum [I-1] + s [I]) % N; if (has [sum [I] =-1) has [sum [I] = I; else {L = has [sum [I]; R = I ;}} printf ("% d \ n", R-l); for (I = L + 1; I <= r; I ++) {printf ("% d \ n", s [I]) ;}} return 0 ;}