Problem Link: http://www.spoj.com/problems/CANDY3/

The problem is very trivial. Just make sure you can store large numbers.

Solution Link: https://github.com/bharaththiruveedula/Algorithms/blob/master/SPOJ/CANDY3.java

Advertisements