#cpctf_2023 from Crypto.Util.number import inverse, bytes_to_long, getPrime from flag import flag class complex_over_p: """ a + bi """ def __init__(self, a, b, p): self.a = a self.b = b self.p = p def __mul__(self, other): return complex_over_p( (self.a * other.a - self.b * other.b) % self.p, (self.…