HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Problems from everywhere > problem:


TopCoder-8. 50641 - Strong Prime Power

Guest
• Discussion of problem (1)

Volume problems

• KBH-1013. 50618 - Code Correction
• TopCoder-1. 50761 - Magic Words
• TopCoder-2. 50246 - Making Potions
• TopCoder-3. 50245 - Santa Gifts
• TopCoder-4. 50701 - Cell Removal
• TopCoder-5. 50760 - Hexatridecimal...
• TopCoder-6. 50759 - Text Statistics
• TopCoder-7. 50244 - Chessboard P...
• TopCoder-8. 50641 - Strong Pr...
• VologdaInterCity-A. 50614 - Numbe...
• VologdaInterCity-B. 50632 - Again ...
• VologdaInterCity-C. 50646 - The m...
• VologdaInterCity-D. 50605 - Behind...
• VologdaInterCity-E. 50624 - Simple ...
• VologdaInterUni-A. 50628 - Matrix
• VologdaInterUni-B. 50541 - Binary t...
• VologdaInterUni-C. 50629 - Minuses

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. Difficulty Beta

A number which can be represented as pq, where p is a prime number and q is an integer greater than 0, is called a prime power. If q is larger than 1, we call the number a strong prime power. You are given an integer n. If n is a strong prime power, find p and q for it.

Input
The single line contains one integer n (2 ≤ n ≤ 1018). n will contain digits only ('0'-'9') without any leading zeros.
Output
If n is a strong prime power, output p and q in the single line separated by one space. If n is not a strong prime power, output 0 instead.

Input 1 Input 2 Input 3 Input 4
27
10
7
576460752303423488
Output 1 Output 2 Output 3 Output 4
3 3
0
0
2 59

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

www.contester.ru