I met with some weird problems when solving https://codeforces.com/contest/1599/problem/C The question is simple, but plz take a look at these 4 submissions below:
The only difference is the "inline" of the function
Take a look at the test cases for more information.
The only difference is the "cout" line in function
Also take a look at the test cases for more information.
Compiler: GNU G++14 6.4.0
Everything works fine on my local environment, G++11/14 or else.