#P28. [KBC001C] Sequence 1
[KBC001C] Sequence 1
Source
This problem is adapted from Long Long OJ. All rights reserved.
Description
Given an integer , output all continuous positive integer sequences with a sum of and a length greater than or equal in order.
Input
An integer .
Output
Output a total of lines, where represents the number of different sequences. Each line outputs two numbers and (both greater than ), indicating the starting and ending numbers of the sequence. Note that when there are multiple sequences, they should be outputted in descending order based on . If there is no answer, DO NOT output anything.
Samples
27
13 14
8 10
2 7
69
34 35
22 24
9 14
Tips
Sample Explanation 1:
Sample Explanation 2:
$\displaystyle \sum_{i=34}^{35}i=\sum_{i=22}^{24}i=\sum_{i=9}^{14}i=69.$
- For of the testcases, .
- For of the testcases, .