#K62652. Power of X Checker
Power of X Checker
Power of X Checker
Given two integers N and X, determine whether N is a power of X. In other words, check if there exists a non-negative integer \(k\) such that \(N = X^k\). You should output True
if such an integer exists, and False
otherwise.
For example, if \(N = 16\) and \(X = 2\), then \(16 = 2^4\), so the output is True
.
inputFormat
The input consists of a single line containing two space-separated integers: N and X.
outputFormat
Output a single line containing either True
or False
based on whether N is a power of X.
16 2
True