import math import random N = 10**6 st = set() ok = False for i in range(1, 1300): for j in range(1, 1300): g = math.gcd(i, j) st.add((math.atan2(j//g, i//g), i//g, j//g)) if len(st) == N: ok = True break if ok == True: break L = list(st) L.sort() ans = [] nowx = -10**9 + 1 nowy = -10**9 + 1 for i in range(N): x, y = L[i][1], L[i][2] nowx += x nowy += y ans.append((nowx, nowy)) print(N) for i in range(N): print(ans[i][0], ans[i][1]) # N = 10**6 # L = [0] # x = random.randint(1, 10**9) # y = random.randint(1, 10**9) # L.append((math.atan2(x,y), x, y))