The below mentioned code is giving random answer on submission on codeforces, but on my local maschine it is giving correct answer. I am using the following g++ version gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) and compiling using the command g++ -g -std=c++0x d.cpp code
No return in mdr function.
always use the following command for compiling: c++: g++ -O2 -static -Wl,--stack,268435456 -s -lm code.cpp c++11: g++ -std=c++0x -O2 -static -Wl,--stack,268435456 -s -lm -o code.cpp otherwise your code could have a different result from CF.
Thanks