I am getting correct answer for all test case I am taking but wrong in original testcases

https://ide.codingblocks.com/s/226418 This is the link of my Code and according to me its correct both logically and by Code … I am tired thinking on it …Can Someone Please make correction ?