Task DescriptionDiscussion (0)
Task :: z-shortest
Mr. Little Z got tired of writing long problem text, so he decided to give you a problem with the shortest text possible:
For given positive integer n find two positive integers a and b such that a^b = n. If there are multiple solutions, give the one with the smallest value of a.
For given positive integer n find two positive integers a and b such that a^b = n. If there are multiple solutions, give the one with the smallest value of a.
INPUT:
From the first line of the standard input read one integer k, (1 <= k <= 1000000), k represents the number of digits of n. From the second line read k characters that represent the number n. n will be greater than 1.
From the first line of the standard input read one integer k, (1 <= k <= 1000000), k represents the number of digits of n. From the second line read k characters that represent the number n. n will be greater than 1.
OUTPUT:
To the standard output, in one line, write two integers a and b
To the standard output, in one line, write two integers a and b
Input:
Output:
2
10
10
Output:
10 1
Input:
Output:
2
16
16
Output:
2 4
Input:
Output:
2
27
27
Output:
3 3
Submit Solution
Available Languages
Task info
| Name: | z-shortest |
| Time: | 0.5 sec. |
| Memory: | 16 MB |
| #Tests: | 10 |
| AddedBy: | admin |
Task Ratings
| Difficulty: | 4.8 (25 votes) |
| Quality: | 4.8 (21 votes) |
Acceptance Rate
Recent Submissions
Fastest Solutions
| User | Time |
|---|---|
| The_Philosopher | 0.015 s. |
| ivan100sic | 0.015 s. |
Solved By
Home
Training
Competitions
Forum
FAQ