<|instruction|>
Solve the below problem. The solution should start with an abridged problem statement. Then key observations. Then full solution based on the observations. Then C++ and Python implementations with comments.

403. Scientific Problem
Time limit per test: 0.25 second(s)
Memory limit: 65536 kilobytes
input: standard
output: standard



Once upon a time Professor Idioticideasinventor was travelling by train. Watching cheerless landscape outside the window, he decided to invent the theme of his new scientific work. All of a sudden a brilliant idea struck him: to develop an effective algorithm finding an integer number, which is x times less than the sum of all its integer positive predecessors, where number x is given. As far as he has no computer in the train, you have to solve this difficult problem.

Input
The first line of the input file contains an integer number x (1 ≤ x ≤ 109).

Output
Output an integer number — the answer to the problem.

Example(s)
sample input
sample output
1
3

sample input
sample output
2
5

<|response|>
1. Abridged Problem Statement  
Given a positive integer x, find the smallest positive integer N such that the sum of all positive integers less than N is exactly x times N. In equation form:  
 N = (1 + 2 + … + (N–1)) / x  

2. Key Observations  
- The sum of the first (N–1) positive integers is S = (N–1)·N / 2.  
- We need S = x·N.  
- Since N > 0, we can divide both sides by N, yielding (N–1)/2 = x.  
- Solving for N gives N = 2·x + 1.  

3. Full Solution Approach  
Step 1. Read the integer x.  
Step 2. Use the derived formula N = 2·x + 1.  
Step 3. Output N.  
This runs in O(1) time and uses O(1) memory, easily handling x up to 10^9.  

4. C++ Implementation with Detailed Comments  
```cpp
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    long long x;
    // Read the input value x
    cin >> x;

    // Derivation:
    // sum of 1..(N-1) = (N-1)*N/2 must equal x*N
    // => (N-1)/2 = x  =>  N = 2*x + 1
    long long N = 2 * x + 1;

    // Output the result
    cout << N << "\n";
    return 0;
}
```

5. Python Implementation with Detailed Comments  
```python
import sys

def main():
    # Read the integer x from standard input
    data = sys.stdin.read().strip()
    x = int(data)

    # From (N-1)*N/2 = x*N we get (N-1)/2 = x => N = 2*x + 1
    result = 2 * x + 1

    # Print the answer
    print(result)

if __name__ == "__main__":
    main()
```