#C7052. Power of an Integer
Power of an Integer
Power of an Integer
Given an integer N (presented as a string), determine if N can be expressed as B^k for some integer B > 1 and integer k ≥ 2. In other words, check whether there exist integers B and k with B > 1 and k ≥ 2 such that
\(N = B^k\)
For example, 16 can be written as 24, and 27 can be written as 33. You are to implement a solution that reads N from standard input and prints True
if such a representation exists and False
otherwise.
inputFormat
The input is read from stdin as a single line containing a string representing the non-negative integer N.
outputFormat
The output should be written to stdout as a single line: print True
if N can be represented in the form \(B^k\) with B > 1 and k ≥ 2, or False
otherwise.
16
True