Pair of roses(wrong ans.)

when i am running my code on ide it is give correct output for every testcase i entered but in contesst platform it is saying wrong ans on submitting.please help me with it. given blelow is link to my code.

http://ide.codingblocks.com/#/s/15440

http://ide.codingblocks.com/#/s/16322