SPCANDY wrong answer in PHP

i am getting wrong answer in PHP the problem SPCANDY
can any one debug this?
http://www.codechef.com/viewsolution/2518791

try this case…ur code is printing a negative number…

Case:

1
8589934591 10
2 Likes

PHP Suppports only 32 bit integers… try your solution using bcmath library of php… you must ve got integer overflow…

2 Likes

error using bcdiv and bcmod??
can anyone resolve this?