Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Test string: 1 3 5 1 1 1 5 3 3 4 2
- inp = list(map(int, input().split(" ")))
- # Separate circle data from rect data
- rect = inp[:8]
- cir = inp[8:]
- # Debug coords #1
- # print(rect)
- # Detach coordinates and delete duplicates
- xs = sorted(list(dict.fromkeys(rect[::2])))
- ys = sorted(list(dict.fromkeys(rect[1::2])))
- # Debug coords #2
- # print(xs, ys)
- del rect
- if xs[0] <= cir[0] <= xs[1] and ys[0] <= cir[1] <= ys[1]:
- # print("Center is inside of rect")
- if min(
- [
- abs(xs[0] - cir[0]),
- abs(xs[1] - cir[0]),
- abs(ys[0] - cir[1]),
- abs(ys[1] - cir[1])
- ]
- ) >= cir[2]:
- print("Circle is fully inside of rect")
- quit()
- print("Circle is not inside of rect")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement