#P27. [KBC001C] Sequence 1
[KBC001C] Sequence 1
Source
This problem is adapted from Long Long OJ. All rights reserved.
Problem Description
Given an integer , output all continuous positive integer sequences with a sum of and a length greater than or equal in order.
Input Format
An integer .
Output Format
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
Sample 1 Explanation
Sample 2 Explanation
$\displaystyle \sum_{i=34}^{35}i=\sum_{i=22}^{24}i=\sum_{i=9}^{14}i=69.$
Data Range
- For of the testcases, .
- For of the testcases, .