Most positive integers may be written as a sum of a sequence of at least two consecutive positive integers. For instance,`8` cannot be so written.Write a program which will compute how many different ways an input number may be written as a sum of a sequence of at least two consecutive positive integers.

6 = 1 + 2 + 3 9 = 5 + 4 = 2 + 3 + 4but

The first line of input will contain the number of problem instances *N* on a line by itself, (1 ≤ *N* ≤ 1000) . This will be followed by *N* lines, one for each problem instance. Each problem line will have the problem number, a single space and the number to be written as a sequence of consecutive positive integers. The second number will be less than 2^{31} (so will fit in a 32-bit integer).

提交代码