{Be Efficient!} {- Generate the sequence x[i] - Generate the sequence s[i], where s[i] = x[0] + x[1] + ... x[i] Since we only deal with module m, you can write s[i] = (s[i-1] + x[i]) % m; - For each 0<=r