by rcoker7 » Tue Apr 03, 2012 1:33 pm
There's different ways to solve each different case to this problem.
case 1: the problem says you need to find the number of POSITIVE integers.
Ok let's say we have ax+by=c. If neither a or b divide c, then you don't always do the same thing. The exact answer for this is c/(ab)+1-(min(x)/b+min(y)/a) where min(x) is the smallest value of x that works and min(y) is the smallest value of y that works. So basically you have c/(ab) either rounded up or down, depending on the numbers.
If one of a or b divides c, then you take c/(ab) and round it down. If both divide c, then you round it down then subtract 1.
case 2: the problem says you need to find the number of NONNEGATIVE integers.
This works the exact same when neither a or b divide c.
If either a or b(or both) divide c then you simply take c/(ab) and round up.
sorry for the 3 day bump and the lack of latex, btw.
EDIT: This only works if a and b are relatively prime.
Region scores
NS: 368
CALC: 308
MATH: 318
SCIENCE: 232(32,96,104)