wrong answer

what should i do ,everytime its giving wrong answer on codechef? But its giving output on my sysytem

design a new input yourself ( with large numbers), then solve that in paper and check the result in your system.

You may like seeing this.

If you are asking for this solution of yours, consider printing integral numbers as output(Use %d specifier).