“Don’t forget to flush the output after printing each line!” - what does it mean?
Problem link
Read this :- Interactive Problems and the way to deal with them!