N = int(input()) D = [list(map(int, input().split())) for _ in range(N)] INF = 1<<60 dp = [[INF]*N for _ in range(1<