2004 lge code jam contest 1 : problem 1 not completed