James liked mathematics very much. One day when he was doing his math homework, he asked to calculate 9 ~ He immediately wrote the correct answer to the sum of 16: 100. But he is not satisfied with this. He is wondering how many continuous positive number sequences the sum of 100 (including at least two numbers ). It wasn't long before he got another set of continuous positive numbers and 100 sequences:, 22. Now, I will give you the question. Can you quickly find all the continuous positive number sequences for S? Good Luck! Input: multiple groups of data are input. Each data group contains only one INTEGER (S <= 1,000,000 ). If S is a negative number, end the input. Output: corresponding to each group of data. If there is no continuous positive number sequence for S, "Pity!" Is output !"; Otherwise, output all continuous positive numbers for S in the ascending order of the Start number. The end of each data group ends. Sample input: 45100-1 sample output: Pity! #2 3 #9 10 11 12 13 14 15 1618 19 20 21 22 # thoughts: The two pointers are scanned from the front to the back! If the value is greater than S, the lower boundary is ++. If the value is smaller than S, the upper boundary is ++ (the boundary is the upper and lower boundary of the series! Do not make a mistake ~ ). If they are equal, output a pair and continue! S/2. Because the scan is followed, the sum of the two numbers must be greater than S! (A set of sequences must have at least two numbers ~ Haha) code AC: [cpp] # include <stdio. h> int main () {long int s, low, high, half, sum, I; int flag; while (scanf ("% ld", & s )! = EOF) {if (s <0) {break;} if (s <3) {printf ("Pity! \ N "); printf (" # \ n "); continue;} low = 1; high = 2; sum = 3; half = s/2; flag = 0; while (low <= half) {if (sum> s) {sum-= low; low ++;} else if (sum <s) {high ++; sum + = high;} else {flag = 1; for (I = low; I