UVa 382

From Algorithmist
Jump to navigation Jump to search

382 - Perfection[edit]

Summary[edit]

  • Find if the sum of the divisors are greater than, less than or equal to the number provided.

Explanation[edit]

  • If num > sum divisors output deficient
  • If num < sum divisors output abundant
  • If num == sum output Perfect

Gotchas[edit]

  • the END OF OUTPUT line must be followed by a '\n'

Input[edit]

15 28 6 56 60000 22 496 0

Test avoid the more simple case:

1

The answer need to be DEFICIENT.

Output[edit]

PERFECTION OUTPUT
   15  DEFICIENT
   28  PERFECT
    6  PERFECT
   56  ABUNDANT
60000  ABUNDANT
   22  DEFICIENT
  496  PERFECT
END OF OUTPUT

Solutions[edit]