Answer not Matching Question(Help Ramu)

https://ide.codingblocks.com/s/61810
The answer for the first test case is coming out to be 11 but the answer is shown 12. Where is it going wrong?

Hi, just change line number 27 to for(int i=0;i<m;i++).
You were running the loop till n i.e. the number of rickshaws.