#t485. 求和问题

求和问题

Consecutive Subsequence Sums

Problem Description

Given the numbers 11 to nn, you need to find several consecutive numbers whose sum equals mm. Clearly there can be many such schemes; output every one of them, following the format shown in the sample.

Input Format

The first line contains two integers nn and mm.

Output Format

Several lines of output, each line a valid scheme given as a closed interval: [a,b][a,b] means the consecutive integers from aa to bb. When multiple schemes exist, output them in increasing order of aa.

Sample Input

20 15

Sample Output

[1,5]
[4,6]
[7,8]
[15,15]

Hint

1+2+3+4+5=151+2+3+4+5 = 15

4+5+6=154+5+6 = 15

7+8=157+8 = 15

15=1515 = 15

n,m≤100000000n, m \le 100000000.