Advertisement
bl00dt3ars

02. Center Point

Jun 12th, 2021
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. from math import floor
  2.  
  3. def calculate_coordinates(a, b):
  4.     result = abs(a) + abs(b)
  5.     return floor(result)
  6.  
  7.  
  8. x1 = float(input())
  9. y1 = float(input())
  10. x2 = float(input())
  11. y2 = float(input())
  12.  
  13. first_coordinate = calculate_coordinates(x1, y1)
  14. second_coordinate = calculate_coordinates(x2, y2)
  15. if first_coordinate >= second_coordinate:
  16.     print(f"({floor(x2)}, {floor(y2)})")
  17. else:
  18.     print(f"({floor(x1)}, {floor(y1)})")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement