BST ManySquares from Topcoder SRM 627