Product of two primes P80968


Statement
 

pdf   zip

html

Write a program to tell if a given natural number is equal to the product of two different primes.

Input

Input consists of several cases, each with a natural number n between 1 and 109.

Output

For every n, tell if it can be obtained as the product of two different primes.

Observation

In this problem, you should not use vectors or alike.

Public test cases
  • Input

    1
    2
    4
    6
    17
    18
    30
    49
    323
    100000000
    999999991
    999999937
    

    Output

    1: no
    2: no
    4: no
    6: yes
    17: no
    18: no
    30: no
    49: no
    323: yes
    100000000: no
    999999991: yes
    999999937: no
    
  • Information
    Author
    Jordi Cortadella
    Language
    English
    Translator
    Salvador Roura
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++
    User solutions
    C++