Control C301C P57882


Statement
 

pdf   zip

thehtml

Given a natural number n ≥ 1, being s(n) the sum of its divisors not counting itself. A number n ≥ 3 is called popiropis if n = s(n−2) + s(n) + s(n+2). A number n ≥ 3 is called k-popiropis if n*k = s(n−2) + s(n) + s(n+2) for an integer k ≥ 2.

For instance, the number 133 is popiropis, because s(131) = 1, s(133) = 27 and s(135) = 105. Besides, 132 is 3-popiropis, because s(130) + s(132) + s(134) = 396 = 132*3.

Your task is to write a program that, for each natural number given, print if it is popiropis, if is k-popiropis (and which is the value of k), or if it is nothing.

Input

The input is a sequence of natural numbers n ≥ 3.

Output

Your program must print a line for each n, indicating which class is: popiropis, k-popiropis, or nothing.

Observation

Your program must implement and use the function

int sum_divisors(int n);

that, given a natural number |n| different than 0, returns the sum of its divisors (not counting itself).

Public test cases
  • Input

    131
    132
    133
    134
    

    Output

    131: nothing
    132: 3-popiropis
    133: popiropis
    134: nothing
    
  • Input

    3
    80
    273
    38222
    44642
    1000000
    1629073
    8802908
    

    Output

    3: nothing
    80: 3-popiropis
    273: popiropis
    38222: 4-popiropis
    44642: 4-popiropis
    1000000: nothing
    1629073: popiropis
    8802908: 3-popiropis
    
  • Information
    Author
    Professorat de P1
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++
    User solutions
    C++