#P4759. [CERC2014] Sums

[CERC2014] Sums

题目描述

Given an integer NN, express it as the sum of at least two consecutive positive integers. For example:

  • 10=1+2+3+410 = 1 + 2 + 3 + 4
  • 24=7+8+924 = 7 + 8 + 9

If there are multiple solutions, output the one with the smallest possible number of summands.

输入格式

The first line of input contains the number of test cases TT. The descriptions of the test cases follow:

Each test case consists of one line containing an integer N(1N109)N(1 \le N \le 10^9).

输出格式

For each test case, output a single line containing the equation in the format: N = a + (a+1) + ... + b as in the example. If there is no solution, output a single word IMPOSSIBLE instead.

3
8
10
24

IMPOSSIBLE
10 = 1 + 2 + 3 + 4
24 = 7 + 8 + 9