topcoder 300pt problem