spoj solutions
third commit