$M) { break; } else if($c == $M) { $ans++; break; } else { $M -= $c; $ans++; } } print($ans); ?>