2008QA problem 1 solved. passing all test cases.