defrecover(): k = int(input("k: ")) rand = int(input("r: ")) p = int(input("Prime: ")) m1 = 1 recoverD = [] print("Now to input your point like x,y") for i inrange(k): x, y = map(int, input("Input point " + str(i+1) + ": ").split(',')) recoverD.append((x, y)) for i in recoverD: m1 *= i[1] result = 0 for i in recoverD: y = gmpy2.invert(m1//i[1], i[1]) result += m1//i[1]*y*i[0]
DD = result % m1 print("===============Result===============") print(libnum.n2s(DD-rand*p))