Pythagorean triplet challenge

passing only three test cases (approach used same as the hint given).what to do?
in the brute force approach also passing the same three test cases
#include
using namespace std;
int main() {
int n;
cin>>n;
int j=1; int i=1;
for( i=1;i>0;i++)
{
if(n==1)
{ cout<<-1<<endl;break;}
for(j=1;j<=(i+n);j++)
{
if(ii+nn==j*j)
{cout<<i<<" "<<j<<endl; break;}

}

if(j>i+n)
continue;
break;}
return 0;
}
what are the mistakes in the codes?

I would recommend you to first go through the hint video given in your course for Pythagorean triplets and then try to implement tht logic in your code…