Ultra Fast Mathematicians

Testcases failure due to wrong answer. Logic is according to the question.
Link to the code : https://ide.codingblocks.com/s/199619

@Chirag-Jain-1414278322030453
hello chirag ,
take input in form of string only.