You are viewing a single comment's thread. Return to all comments →
This problem is a geometric series so can be solved with maths.
int chocolateFeast(int n, int c, int m) { return ((long)(n/c)*m-1)/(m-1); }
Seems like cookies are disabled on this browser, please enable them to open this website
Chocolate Feast
You are viewing a single comment's thread. Return to all comments →
This problem is a geometric series so can be solved with maths.