from random import randint,random import time import sys input=sys.stdin.readline inf=pow(2,61)-1 def calc(a,b): return ((star[a][0]-star[b][0])**2+(star[a][1]-star[b][1])**2)*star[a][2]*star[b][2] def sell(strict): pos=0 go={0} ans=[0] ansdis=0 while len(go)r: l,r=r,l pre=(dist[ans[l-1]][ans[l]][0]+dist[ans[r]][ans[r+1]][0])-(dist[ans[l-1]][ans[r]][0]+dist[ans[l]][ans[r+1]][0]) if pre>0 or random()nea: nea=pre pos=j star[N+i+1]=[star[pos][0],star[pos][1],1] while True: gr=[[0,0,0] for j in range(M-1)] for j in range(N): nea=inf pos=-1 for k in range(M-1): pre=(star[N+k][0]-star[j][0])**2+(star[N+k][1]-star[j][1])**2 if prepow(2.72,(pre-now)/temp): change(-x,-y,p) temp=temp*c for i in range(M): print(*star[N+i][:2]) ans=sell(True) finalans=[] for i in range(len(ans)-1): for j in dist[ans[i]][ans[i+1]][1]: finalans.append(j) finalans.append(0) print(len(finalans)) for i in finalans: if i>=N: print(2,i-N+1) else: print(1,i+1)