• + 0 comments

    just return this with long long types 10*((r-1)/2)+(r+1)%2+2*(c-1) the (r-1)/2 part will give integer so it works fine as long as you change all int types to long or to long long