Odesk contest on CodingGame (19 October 2013), 50% - first task only (Java)