Solution for MAANDI in Codechef October long contest.
Bonus solution for SAMER08F in SPOJ.