Uzastopni
시간 제한: 1000ms메모리 제한: 64MB출처: COCI 2016-2017BOJ 12116
문제
Output all the ways in which a given positive integer N can be obtained as the sum of several (two or more) consecutive positive integers. -The author apologizes if reading the task took too long, and promises that, in the future, he will try to be more concise, i.e., that he will try to explain the task using as less words and apologies in the footnotes as possible-
입력
The first line of input contains the positive integer N (3 ≤ N ≤ 1010).
출력
For each sum of consecutive positive integers that is equal to N, in one line output the first and the last addend. The order of lines in the output is not important. In each test case, at least one corresponding sum will exist.
힌트
10 = 1 + 2 + 3 + 4.
예제
예제 1
입력
10
출력
1 4
예제 2
입력
27
출력
13 14 8 10 2 7
코드를 제출하려면 로그인하세요.