class Solution:

    def myPow(self, x: float, n: int) ->float:
        ans = 1
        if n <= 3 and n >= 0:
            for i in range(n):
                ans *= x
            return ans
        elif n < 0:
            t = self.myPow(x, -n)
            return 1 / t
        else:
            t = self.myPow(x, n // 2)
            if n % 2 == 1:
                return t * t * x
            else:
                return t * t

9ebe1d3e13c6b27c9850edfd180b65e1d6b0deb3
<mask token>

class Solution:
    <mask token>

class Solution:

    def myPow(self, x: float, n: int) ->float:
        ans = 1
        if n <= 3 and n >= 0:
            for i in range(n):
                ans *= x
            return ans
        elif n < 0:
            t = self.myPow(x, -n)
            return 1 / t
        else:
            t = self.myPow(x, n // 2)
            if n % 2 == 1:
                return t * t * x
            else:
                return t * t
