Successful solution for Ups and Downs problem - http://www.codechef.com/COOK46/problems/ANUUND