Олимпиадный тренинг

Задача 38951. Training task - 5


Задача

Темы: ЕГЭ
Let M – the sum of the minimum even and maximum odd natural divisors of an integer, not counting one and the number itself. If the number does not have any divisor (either even or odd), then the value of this divisor is considered equal to zero.
Write a program that iterates over integers greater than 12,000,000, in ascending order, looking for those for which 0 < M < 1,000,000 . Print the first five found numbers and their corresponding values ​​M

Output format: for each of the five such found numbers in a separate line, the number itself is displayed first, then – value M (separated by one space). Lines are displayed in ascending order of found numbers.