Pythagoras Triplet

why this code showing wrong answer? i my IDE its working fine…
#include < cstdio>
#include < iostream>
#include < cmath>
using namespace std;
#define ll long long int
int main() {
ll x;
int t;
cin >> t;
while (t)
{
cin >> x;

       if (x < 3) { printf("-1\n");  continue; }
       if (x & 1)  printf("%lld %lld\n", (x * x - 1) / 2, (x * x + 1) / 2);
       else printf("%lld %lld\n", ((x * x) / 4) - 1, ((x * x) / 4) + 1);

    t--;
}
return 0;

}

@Rupesh-1984 please share the code using cb ide

here code link

@Rupesh-1984


corrected

1 Like

Regarding Green tick
sir, my code get complied and passes all test cases,but i didn’t get a green tick :heavy_check_mark: why…
its because that i unlocked :unlock: Editorial

@Rupesh-1984 yes if you unlocked editorial before getting 100 points you dont get points for the submission

sir, will this impact on my course progress (percent) if i don’t get a green tick

@Rupesh-1984 i dont think so

Do challenge questions are also part my course progress…

@Rupesh-1984 yes they are

sir, can i unlock editorial after i submitted my code and got 100 point with green tick…
will it deduct my point?

@Rupesh-1984 after getting 100 you can unlock it will not deduct

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.