You are viewing a single comment's thread. Return to all comments →
c#
public static int howManyGames(int p, int d, int m, int s)
{ long cost = 0; int games = 0; int i = 0; while(cost <= (long)s) { cost += Math.Max((long)(p - (d * i)), (long)m); i++; games++; } games--; return games; }
Seems like cookies are disabled on this browser, please enable them to open this website
Halloween Sale
You are viewing a single comment's thread. Return to all comments →
c#
public static int howManyGames(int p, int d, int m, int s)