Can you kindly check why it is failing the testcase?
Vivek and Factors
@duttrohan0302
Your code will produce a TLE for large input files because your n1 is 1000000 and u have used i*i in your code. try to reduce your complexity
But I have used ll, so even if n1 is 1000000 , i*i still lies in the long long range
How is your code working?