HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > "Informatics Stars" Online Contests - 2011-2014 > problem:


2012-02-2. 50577 - Perfect Numbers and Perfect Cousins

"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

Guest
• Review clarifications (1)

Contest problems

• 2011-04-1. 50586 - Prime Palindromes
• 2011-04-2. 50585 - Inner Product
• 2011-04-3. 50587 - Modular Convers...
• 2011-05-1. 50767 - Censor
• 2011-05-2. 50652 - Prime Factorization
• 2011-05-3. 50653 - Long Divide
• 2011-11-1. 50565 - Binary numbers
• 2011-11-3. 50588 - Processing the li...
• 2012-02-2. 50577 - Perfect Nu...
• 2012-02-4. 50594 - Transformations
• 2012-02-5. 50768 - Where is Waldorf?
• 2012-02-7. 50704 - Connected?
• 2012-02-8. 50596 - Your Ride Is He...
• 2012-02-8. 50596 - Your Ride Is He...
• 2012-03-01. 50563 - Long Modulus
• 2012-03-02. 50567 - Input Data No...
• 2012-03-04. 50597 - Drawing Diam...

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
5 30
Output 1
6
28
     
Input 2
20 500
Output 2
28
220 284
284 220
496

Для отправки решений необходимо выполнить вход.

www.contester.ru