def is_prime(x: int): if x % 2 == 0: return x == 2 for i in range(3, math.ceil(x ** 0.5), 2): if x % i == 0: return False return True