Let’s end this discussion with my comment.

Given that N is as large as 10^6. Before getting into your solution, let’s try some examples.

```
N = 10
Odd = 100
Even = 110
```

Another example

```
N = 1000000
Odd = 1000000000000
Even = 1000001000000
```

(If you didn’t know the formula)

```
Odd = N * N
Even = N * (N + 1)
```

Now, talking about the constraints, the answer is as large as 10^{12}.

So, `int`

, whose range is limited to about 2 \times 10^9, will not be sufficient to store this big value.

Hence, you have to use a bigger data type (usually long or long long).

In case you haven’t followed the entire explanation, here’s the code for you.

##
Your code, modified

```
#include <bits/stdc++.h>
using namespace std;
int main() {
int n = 0;
cin >> n;
long long int odd_sum = 0, even_sum = 0;
for(int i = 1; i <= 2 * n; i++) {
if(i % 2 == 0) {
even_sum += i;
}
else {
odd_sum += i;
}
}
cout << odd_sum << " " << even_sum << '\n';
return 0;
}
```

##
Usual style others prefer

```
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int n = 0;
cin >> n;
long long int odd_sum = 0, even_sum = 0;
odd_sum = n * n;
even_sum = n * (n + 1);
cout << odd_sum << " " << even_sum << '\n';
return 0;
}
```