First candidate solution for topcoder: 11995