Wrong answer in 2nd testcase

@mudit2jain
Code is correct just take input in long of x and y both.
It will help.

yeah it worked, but in the constraints the x and y value was supposed to be < 10^6 then, why didnt it worked before?

@mudit2jain
whenever we multiply two int values,the result of product(ab) gets stored in first variable.
for e.g.Consider
int x;
long d=x
x;
Here,xx product gets stored in LHS x first then it gets passed onto d.
Now comes why Wrong Answer in 2nd Test Case,
Suppose x=10^5,
then x
x=10^10;
hence when the 10^10 gets stored in long var d,it loses its value by internal type-casting.
I hope this will clear your doubt.

ok, Got it.
Thanks, I didn’t knew about this before.