Intelligent optimization of the first homework (1, 2 questions)