def proc(data,m): n=len(data) queinfo=[[0 for i in range(n)] for j in range(m)] head=[0]*m tail=[0]*m curtime=0 waitnum=0 i=0 total=0 while i<n or waitnum>0: if i<n and data[i][0]<=curtime: k=data[i][2] __________ tail[k]+=1 waitnum+=1 i+=1 elif waitnum>0: k=0 while __________: k+=1 __________ head[k]+=1 total+=curtime-data[p][0] curtime+=data[p][1] waitnum-=1 else: __________ return "%.4f"%(total/n) n=int(input()) data=[] for i in range(n): data.append(list(map(int,input().split()))) print(proc(data,4))