N=int(input()) A=[0]*N B=[0]*N for i in range(N): A[i],B[i]=map(int,input().split()) Ugly=[[0]*N for _ in range(N)] for i in range(N): for j in range(N): if i==j: continue Ugly[i][j]=(B[i]-A[i])+A[j] inf=float("inf") DP=[[inf]*N for _ in range(1<