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

Задача 33366. List of divisors - 02


Write a program that searches among the integers belonging to the numerical interval [289039; 311993] numbers,  which have exactly 8 different natural divisors, not counting 1 and the number itself. For each found number, print these 8 divisors from a new line in ascending order of the sum of these 8 divisors. Divisors must be in ascending order.