Code for marcha1 is crafted according to instructions on the tutorial presented for the problem on codechef. Interesting solution using binary mask. Unfortunately it doesn't run in the time alloted. Python3 is too slow. There are some very fast submissions for python3 that seem to be using a different technique. Will review, but probably won't implement. I learned something the way I did this.