def stepen(x, n):
    if n == 0:
        return 1
    return x*stepen(x,n-1)

def stepen_brzi(x, n):
    if n==0:
        return 1
    if n%2==0:
        pom = stepen_brzi(x,n/2)
        return pom*pom
    else:
        # celobrojno deljenje
        pom = stepen_brzi(x, n//2)
        return pom*pom*x

x = float(input('Unesite x:'))
n = float(input('Unesite n:'))

s = stepen_brzi(x,n)
print('Vrednost %f^%d=%f'%(x,n,s))
