CodeJam 2014 Qualification Round Java