Skip to main content
LIVE CONTEST: Round #7 · Begin Marathon is live now! …

~/algor $ cat problems/while/largest-k-with-sum-at-most-n

Largest k with sum at most n

Author Iqbolshoh Ilhomjonov 3 @iqbolshoh 650 problems
Easy 1000 ms 64 MB 27%
Share

A positive integer is given. Find the largest positive integer for which the condition holds, and the sum itself:

The largest term at which the sum of consecutive numbers does not exceed the given number

Input

One integer .

Output

One line with two integers separated by a space: and the sum.

Note

Examples

Input #1
10
Output #1
4 10
Input #2
12
Output #2
4 10

Sign in to submit a solution

Signing up is free and takes a minute.