Skip to content

Instantly share code, notes, and snippets.

@AspirantDrago
Created December 7, 2025 10:45
Show Gist options
  • Select an option

  • Save AspirantDrago/a898f2ee6ef1b57b6f5b6aa41c0c28d4 to your computer and use it in GitHub Desktop.

Select an option

Save AspirantDrago/a898f2ee6ef1b57b6f5b6aa41c0c28d4 to your computer and use it in GitHub Desktop.
for _ in range(int(input())):
w = int(input())
xa, ya = map(int, input().split())
xb, yb = map(int, input().split())
xb -= w
yb -= w
d = ((xb - xa) ** 2 + (yb - ya) ** 2) ** 0.5
print(d + w)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment