**Link to the problem:** https://cses.fi/problemset/task/1093

**Code:**

```
#include <bits/stdc++.h>
using namespace std;
#define FASTIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using ll = long long;
const int MOD = 1e9 + 7;
const ll INF = (1LL<<62);
const int MAXN = 2e5+5;
int main()
{
FASTIO
int n;
cin >> n;
ll dp[MAXN];
memset(dp,0,sizeof(dp));
dp[0] = 1;
int sum = (n*(n+1))/2;
if(!(sum&1))
{
sum /= 2;
for(int i=1; i<=n; i++)
{
for(int j=sum; j>=0; j--)
{
if(i+j <= sum)
{
dp[i+j] += dp[j];
dp[i+j] %= MOD;
}
}
}
cout << dp[sum]/2 << "\n";
}
else
cout << "0\n";
return 0;
}
```

The above code fails on 5 out of 25 test cases. For example,

```
For n = 112
Correct output: 979144036
My output: 479144032
```

Can anyone please point out the error in the above code?