ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules

1120. Sum of Sequential Numbers

Time limit: 0.5 second
Memory limit: 64 MB
There is no involute formulation concerning factitiously activity of SKB Kontur in this problem. Moreover, there is no formulation at all.

Input

There is the only integer S, 1 ≤ S ≤ 109.

Output

Your program is to output two positive integers A and N separated with a space such that:
  1. S = A + (A + 1) + … + (A + N − 1).
  2. You are to choose a pair with the maximal possible value of N.

Sample

inputoutput
14
2 4

Notes

14 = 2 + 3 + 4 + 5
Problem Author: Leonid Volkov
Problem Source: USU Open Collegiate Programming Contest October'2001 Junior Session