You have to start your timer after reading your first line of input and stop it before printing your action. Otherwise you stop all kind of other things (referee, opponent bot).
Thank you very much for your efforts.
It would be much easier if you do a real pull request on github or at least share your final statement instead of the diffs. There’s a probably a tool or a feature of a tool that I don’t know but to me it looks like a lot copy-pasting of single lines.
I can’t promise how fast we will update the statement, as only CodinGame can update the contest.
You are right, the lines aren’t fully parsed in the first run, so the second run gets the linebreak. Try to read one more character with
char line[width + 2] and
fgets(line, width + 2, stdin).
I’m not sure if I should see this as a bug in the game or the code generator.