Sum of squares (#9) - Azerbaijan Computing Olympiad