Pythagorean's Challenge : Getting TLE and Compilation error

Could you please check my code I am getting compilation and TLE error.

Please suggest some way to write more optimized code for this problem.

Google Drive link :
Please check my code here: https://drive.google.com/file/d/11ki2ioZpkYittZ5RiPRqEcINy0LgpQlG/view?usp=sharing

Screenshot of pycharm (code is working fine in pycharm ide ): https://drive.google.com/file/d/1qj0CaYzv9VyGhruwJp0sKcWFqYuXqk7c/view?usp=sharing

Hey @vi20083389, this is a leaderboard challenge, you need to complete this challenges on your own. In case you are still unable to do that, you need to open the editorial to take the help. Hope you understand the ethical grounds behind it.

Hope this resolved your doubt. :blush:

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.