Shamir's secret sharing
Shamir's Secret Sharing scheme divides a secret into n shares, of which any t are enough to recover the secret, while t-1 provide no information. The scheme is based on a polynomial of degree t-1: the constant term (the value at x=0) — is the secret. The shares — are points of the polynomial (x, f(x) mod p).
In this challenge, a 3-out-of-5 scheme is used (t=3, n=5). The attached ulushlar.txt file contains a prime number p and 5 (x, y) shares. Take any 3 shares and calculate f(0) with Lagrange interpolation mod p — this is the secret. If you convert the number to bytes, the flag will appear.
Lagrange (for x=0): f(0) = Σ y_j · Π_{m≠j} (-x_m)/(x_j - x_m) mod p. Division — via modular inverse.