Same code is AC in C++17 but WA in all other C++ versions
On Educational Codeforces Round 43 Problem B this solution 37778558 in c++17 gives AC whereas this same solution 37798163 in c++14 gives WA, tried it with c++11 and c++ 5 also but giving WA only c++17 gives AC :/ Can anyone tell me why??