Played with marcha1.py some more. I ended up getting it to pass by reducing the number of times my brute force combination for loop ran. I did that by excluding bills that were larger than the amount demanded by the mugger and decrimenting n by one for each bill. I had to rewrite the code to use input() instead of stdin because codechef kept erroring out. The stdin version ran very fast on my machine, only about fifteen miliseconds slower than the fastest version on codechef. My submission was the second slowest passing time, but it still passed so I'm done with this one.