Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- N, K = 3, 2
- a0, x, y = 3, 1, 2
- result = [a0]
- for i in range(1, N+1):
- result.append((x * result[i-1] + y) % 2**30)
- print(sorted(result)[1:K+1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement