The issue has little to do with the value of MAX_C you chose. Look at this loop, along with the usage of the variable j:
while (primes[j] < input[i].factors.back())
j++;
while (!finished)
{
total = input[i].total*primes[j];
When I run your code, j goes beyond the limit of the primes vector, since you're incrementing j in the while(!finished) loop.
The while(!finished) loop doesn't throttle how high j will go, so you need to make sure your loop either terminates or does something other than access the primes vector with an out-of-bounds value for j.
One way to ensure you don't go out of bounds:
while (!finished && j < primes.size() )
{
total = input[i].total*primes[j];