Comments
+13

Problem B, Test case 10... It took half hour for me to pass that test. Probably it requires using long, not integer. Since a possible sum of stones like 13*10^9 can not be stored in int. Sad contest for me :(

Thank you so much, that helped a lot.