Given natural numbers, sort them. First, by its number of divisors (the larger the better); in case of a tie, by its number of digits (the larger the better); and in case of another tie, by its value (the smaller the better).
Input consists of several cases, each one with followed by numbers between 1 and . You can assume .
For every case, print lines with every number and its number of divisors, sorted as it is explained above. Print a line with 10 dashes at the end of every case.
Rememeber that, if the factorization of a number is , then its number of divisors is . For instance, for there are divisors.
Author: Unknown
Translator: Salvador Roura
Generation: 2026-01-25T11:21:50.407Z
© Jutge.org, 2006–2026.
https://jutge.org