Pythagoras triplet timelimit error

sir i feel my code is correct
the last two test cases are showing timelimit error
plzz suggest me something .

link for my code is https://ide.codingblocks.com/s/76709

the question should to be solved in O(n) time complexity.
1 sec = 10^9
here, n can have values upto 10^9.

but the code you have written is exceeding the time constraint.
Try to reduce the complexity.