Sum of two squares

EOlymp - 650