Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- def result_coord(co_a1, co_b1, co_a2, co_b2, co_a3, co_b3, co_a4, co_b4):
- co_a1 = float(co_a1)
- co_b1 = float(co_b1)
- co_a2 = float(co_a2)
- co_b2 = float(co_b2)
- co_a3 = float(co_a3)
- co_b3 = float(co_b3)
- co_a4 = float(co_a4)
- co_b4 = float(co_b4)
- distance1 = math.hypot(co_a1 ** 2, co_b1 ** 2)
- distance2 = math.hypot(co_a2 ** 2, co_b2 ** 2)
- distance3 = math.hypot(co_a3 ** 2, co_b3 ** 2)
- distance4 = math.hypot(co_a4 ** 2, co_b4 ** 2)
- max_distance = max(distance1, distance2, distance3, distance4)
- # distance4
- if max_distance == distance4:
- max_distance2 = max(distance1, distance2, distance3)
- if max_distance2 == distance3:
- if max_distance > max_distance2:
- return print(f"({math.floor(co_a3)}, {math.floor(co_b3)})({math.floor(co_a4)}, {math.floor(co_b4)})")
- elif max_distance == max_distance2:
- if distance1 >= distance2:
- return print(f"({math.floor(co_a1)}, {math.floor(co_b1)})({math.floor(co_a3)}, "
- f"{math.floor(co_b3)})")
- elif distance1 < distance2:
- return print(f"({math.floor(co_a2)}, {math.floor(co_b2)})({math.floor(co_a3)}, "
- f"{math.floor(co_b3)})")
- elif max_distance2 == distance2:
- if max_distance > max_distance2:
- return print(f"({math.floor(co_a2)}, {math.floor(co_b2)})({math.floor(co_a4)}, {math.floor(co_b4)})")
- elif max_distance == max_distance2:
- if distance1 >= distance3:
- return print(f"({math.floor(co_a1)}, {math.floor(co_b1)})({math.floor(co_a2)}, "
- f"{math.floor(co_b2)})")
- elif distance1 < distance3:
- return print(f"({math.floor(co_a3)}, {math.floor(co_b3)})({math.floor(co_a2)}, "
- f"{math.floor(co_b2)})")
- elif max_distance2 == distance1:
- if max_distance > max_distance2:
- return print(f"({math.floor(co_a1)}, {math.floor(co_b1)})({math.floor(co_a4)}, {math.floor(co_b4)})")
- elif max_distance == max_distance2:
- if distance2 >= distance3:
- return print(f"({math.floor(co_a2)}, {math.floor(co_b2)})({math.floor(co_a1)}, "
- f"{math.floor(co_b1)})")
- elif distance2 < distance3:
- return print(f"({math.floor(co_a3)}, {math.floor(co_b3)})({math.floor(co_a1)}, "
- f"{math.floor(co_b1)})")
- # distance3
- elif max_distance == distance3:
- max_distance2 = max(distance1, distance2, distance4)
- if max_distance2 == distance4:
- if max_distance > max_distance2:
- return print(f"({math.floor(co_a4)}, {math.floor(co_b4)})({math.floor(co_a3)}, {math.floor(co_b3)})")
- elif max_distance == max_distance2:
- if distance1 >= distance2:
- return print(f"({math.floor(co_a1)}, {math.floor(co_b1)})({math.floor(co_a3)}, "
- f"{math.floor(co_b3)})")
- elif distance1 < distance2:
- return print(f"({math.floor(co_a2)}, {math.floor(co_b2)})({math.floor(co_a3)}, "
- f"{math.floor(co_b3)})")
- elif max_distance2 == distance2:
- if max_distance > max_distance2:
- return print(f"({math.floor(co_a2)}, {math.floor(co_b2)})({math.floor(co_a3)}, {math.floor(co_b3)})")
- elif max_distance == max_distance2:
- if distance1 >= distance4:
- return print(f"({math.floor(co_a1)}, {math.floor(co_b1)})({math.floor(co_a2)}, "
- f"{math.floor(co_b2)})")
- elif distance1 < distance4:
- return print(f"({math.floor(co_a4)}, {math.floor(co_b4)})({math.floor(co_a3)}, "
- f"{math.floor(co_b3)})")
- elif max_distance2 == distance1:
- if max_distance > max_distance2:
- return print(f"({math.floor(co_a1)}, {math.floor(co_b1)})({math.floor(co_a3)}, {math.floor(co_b3)})")
- elif max_distance == max_distance2:
- if distance2 >= distance4:
- return print(f"({math.floor(co_a2)}, {math.floor(co_b2)})({math.floor(co_a1)}, "
- f"{math.floor(co_b1)})")
- elif distance2 < distance4:
- return print(f"({math.floor(co_a4)}, {math.floor(co_b4)})({math.floor(co_a1)}, "
- f"{math.floor(co_b1)})")
- # distance2
- elif max_distance == distance2:
- max_distance2 = max(distance1, distance3, distance4)
- if max_distance2 == distance4:
- if max_distance > max_distance2:
- return print(f"({math.floor(co_a4)}, {math.floor(co_b4)})({math.floor(co_a2)}, {math.floor(co_b2)})")
- elif max_distance == max_distance2:
- if distance1 >= distance3:
- return print(f"({math.floor(co_a1)}, {math.floor(co_b1)})({math.floor(co_a2)}, "
- f"{math.floor(co_b2)})")
- elif distance1 < distance3:
- return print(f"({math.floor(co_a3)}, {math.floor(co_b3)})({math.floor(co_a2)}, "
- f"{math.floor(co_b2)})")
- elif max_distance2 == distance3:
- if max_distance > max_distance2:
- return print(f"({math.floor(co_a3)}, {math.floor(co_b3)})({math.floor(co_a2)}, {math.floor(co_b2)})")
- elif max_distance == max_distance2:
- if distance1 >= distance4:
- return print(f"({math.floor(co_a1)}, {math.floor(co_b1)})({math.floor(co_a2)}, "
- f"{math.floor(co_b2)})")
- elif distance1 < distance4:
- return print(f"({math.floor(co_a4)}, {math.floor(co_b4)})({math.floor(co_a2)}, "
- f"{math.floor(co_b2)})")
- elif max_distance2 == distance1:
- if max_distance > max_distance2:
- return print(f"({math.floor(co_a1)}, {math.floor(co_b1)})({math.floor(co_a2)}, {math.floor(co_b2)})")
- elif max_distance == max_distance2:
- if distance3 >= distance4:
- return print(f"({math.floor(co_a3)}, {math.floor(co_b3)})({math.floor(co_a1)}, "
- f"{math.floor(co_b1)})")
- elif distance3 < distance4:
- return print(f"({math.floor(co_a4)}, {math.floor(co_b4)})({math.floor(co_a1)}, "
- f"{math.floor(co_b1)})")
- # distance1
- elif max_distance == distance1:
- max_distance2 = max(distance2, distance3, distance4)
- if max_distance2 == distance4:
- if max_distance > max_distance2:
- return print(f"({math.floor(co_a4)}, {math.floor(co_b4)})({math.floor(co_a1)}, {math.floor(co_b1)})")
- elif max_distance == max_distance2:
- if distance2 >= distance3:
- return print(f"({math.floor(co_a2)}, {math.floor(co_b2)})({math.floor(co_a1)}, "
- f"{math.floor(co_b1)})")
- elif distance2 < distance3:
- return print(f"({math.floor(co_a3)}, {math.floor(co_b3)})({math.floor(co_a1)}, "
- f"{math.floor(co_b1)})")
- elif max_distance2 == distance3:
- if max_distance > max_distance2:
- return print(f"({math.floor(co_a3)}, {math.floor(co_b3)})({math.floor(co_a1)}, {math.floor(co_b1)})")
- elif max_distance == max_distance2:
- if distance2 >= distance4:
- return print(f"({math.floor(co_a2)}, {math.floor(co_b2)})({math.floor(co_a1)}, "
- f"{math.floor(co_b1)})")
- elif distance2 < distance4:
- return print(f"({math.floor(co_a4)}, {math.floor(co_b4)})({math.floor(co_a1)}, "
- f"{math.floor(co_b1)})")
- elif max_distance2 == distance2:
- if max_distance > max_distance2:
- return print(f"({math.floor(co_a2)}, {math.floor(co_b2)})({math.floor(co_a1)}, {math.floor(co_b1)})")
- elif max_distance == max_distance2:
- if distance3 >= distance4:
- return print(f"({math.floor(co_a3)}, {math.floor(co_b3)})({math.floor(co_a1)}, "
- f"{math.floor(co_b1)})")
- elif distance3 < distance4:
- return print(f"({math.floor(co_a4)}, {math.floor(co_b4)})({math.floor(co_a1)}, "
- f"{math.floor(co_b1)})")
- co_x1 = input()
- co_y1 = input()
- co_x2 = input()
- co_y2 = input()
- co_x3 = input()
- co_y3 = input()
- co_x4 = input()
- co_y4 = input()
- result_coord(co_x1, co_y1, co_x2, co_y2, co_x3, co_y3, co_x4, co_y4)
Advertisement
Add Comment
Please, Sign In to add comment