I have seen this template used in CodeForces and it works there.
The problem is when I used it in my solution here. The grader became unresponsive and my file was in the submission queue for 5 minutes only to get a response of TLE where the time taken to run the code was specified as -1 sec.
I don’t know what went wrong which brings me to ask the question if it even supported or allowed to do it or is there some changes to be made in the code so that it works
I’m the author of the fastIO stuff on PyRival. FastIO is made to be very similar to the built in IO, so if the built in IO works, then FastIO should work too. One of the main reasons I made fastIO is to speed up the IO for interactive problems.
As for what went wrong. My best guess is that you forgot to flush stdout. FastIO only flushes if you tell it to, or if you exit Python. Not flushing would result in exactly the issues you are experiencing. If you are already flushing, and the code is still getting stuck, then I would be interested to look into it. So far I haven’t found a case where FastIO fails.