In the DSA learning series, while doing problems, it successfully gives correct output for all public test cases, but it gives the Wrong answer while submitting the code. could someone help with this problem? This problem is about sum is everywhere (sum of the first n even and odd numbers)

Help me I’m stuck for a long time.

[Contest Page | CodeChef](https://sum is everywhere)

#include<bits/stdc++.h>

using namespace std;

int evensum(int n){

int cur=2,sum=0;

for(int i=1;i<=n;i++){

sum+=cur;

cur +=2;

}

return sum;

}

int oddsum(int n){

int cur=1,sum=0;

for(int i=1;i<=n;i++){

sum+=cur;

cur +=2;

}

return sum;

}

int main(){

int n;

cin>>n;

if(n>0)cout<<oddsum(n)<<" "<<evensum(n)<<endl;

return 0;

}