from decimal import Decimal, getcontext # 设置足够高的计算精度(例如 30 位) getcontext().prec = 30 # 读取输入坐标 x1, y1 = map(int, input().split()) x2, y2 = map(int, input().split()) # 转换为高精度 Decimal 类型 dx = Decimal(abs(x1 - x2)) dy = Decimal(abs(y1 - y2)) # 计算曼哈顿距离和欧几里得距离 dM = dx + dy dE = (dx ** 2 + dy ** 2).sqrt() ...