For this Question: Alex always skips math class. As a punishment, his teacher has given him an array of size n where every number except one is the power of x.
Being poor in mathematics, Alex has asked for your help to solve the problem. Can you help him to find the bad number which is not a power of x?

<b>NOTE:</b>
It is guaranteed that there always exists an answer.The first line of the input contains the integers n and x 
The following line contains n integers describing the array a 

<b>Constraints</b>
2 &le; n &le; 1000
1 &le; x &le; 20
1 &le a<sub>i</sub> &le; 10<sup>8</sup>For each test case, output a single line containing the bad number.input
6 7
16807 343 50 823543 2401 5764801 

output
50, I have written this Solution Code: y=input().split()
n=int(y[0])
x=int(y[1])
a=input().split()
a=list(map(int,a))
k=0
for i in a:
    r=i
    while r!=1:
        r/=x
        if int(r)!=r:
            print(i)
            k=1
            break
    if k==1:
        break, In this Programming Language: Python, Now tell me if this Code is compilable or not?