PERCAPTA | Problem with ios_base::sync_with_stdio(0); cin.tie(0); giving RUNTIME ERROR

Problem link:

Compiler used : C++14(gcc 6.3)
Using ios_base :: sync_with_stdio(false);cin.tie(NULL); gives RUNTIME ERROR on the following submission:

I haven’t even used any scanf/printf after declaring ios_base :: sync_with_stdio(false);cin.tie(NULL); as it could have caused some errors as the streams are untied(scanf and cin ; printf and cout).

After removing this part the same code gets ACCEPTED:

Note : while using C++17 with gcc9.1 no such RE verdict is received.