n = int(input()) x1, y1 = map(int, input().split()) x2, y2 = map(int, input().split()) # 计算无障碍物时到终点(2,n)的最短路径长度 def calc_shortest(x, y, n): if x == 2 and y == n: return 0 # 起点就是终点,路径长度为0 # 核心公式:向右走(n-y)步 + 第一行需额外1步向下到第二行 res = (n - y) if x == 1: res += 1 return res # 步骤1:处理终点特殊情况(其中一个/两个在终点) end1 = ...