"Informatics Stars" Online Contests - 2011-2014 |
Start: Oct.20.2012 at 10:00:00 AM
Finish: Oct.20.2012 at 03:00:00 PM
The contest is finished!
• Contest scoreboard
|
Feedback | If you notice incorrect translations in Contester, please let author know.
|
|
Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb. From USACO.
Perfect Numbers
Shqip
Perfect number is a number whose sum of divisors are equal to the number itself.
e.g. 6 is a perfect number because sum of its divisors is 1+2+3=6.
And, 220 and 284 are Perfect number cousins. Because the sum of the divisors of 220 is 284
and the sum of divisors of 284 is 220. Thus, they are called as Perfect number cousins.
Write a program that reads two numbers and finds out the perfect numbers and perfect number cousins between the given numbers.
Input specification
There will be two numbers (n and m) in one line seperated by a space where
1 < n < m ≤ 10000.
Output specification
Starting from the smallest one, list every perfect number in a line.
if there are perfect number cousins, list them in the same line.
If there is no perfect number or perfect number cousins between the given numbers, then, show "0" (zero) which means there is no perfect number between the given numbers.
Input I b>
td> |
5 30
td>
tr>
|
Output 1 b> td>
|
6
28
td> tr> |
|
Input 2 b>
td> |
20 500
td>
tr>
|
Output 2 b> td>
|
28
220 284
284 220
496
td> tr> |
|
Для отправки решений необходимо выполнить вход.
|