Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def check_sec(main1, main2, add1, add2):
- return int(main1 / main2 == add1 / add2 or main1 / main2 == add2 / add1)
- def check(arr):
- a, b, c, d = arr
- ans = 0
- if a + b < c + d and a + b + c > d and a + b + d > c: # a + b is BC
- ans = max(check_sec(c, d, a, b), ans)
- print(check_sec(c, d, a, b))
- print("Here 1", check_sec(c, d, a, b))
- elif a + b > c + d and a + c + d > b and b + c + d > a: # c + d is BC
- ans = max(check_sec(a, b, c, d), ans)
- print("Here 2", check_sec(a, b, c, d))
- if a + c < b + d and a + c + b > d and a + c + d > b: # a + c is BC
- ans = max(check_sec(b, d, a, c), ans)
- print("Here 3", check_sec(b, d, a, c))
- elif a + c > b + d and a + b + d > c and b + d + c > a: # b + d is BC
- ans = max(check_sec(a, c, b, d), ans)
- print("Here 4", check_sec(a, c, b, d))
- if a + d < b + c and a + d + b > c and a + d + c > b: # a + d is BC
- ans = max(check_sec(b, c, a, d), ans)
- print("Here 5", check_sec(b, c, a, d))
- elif a + d > b + c and a + b + c > d and d + b + c > a: # b + c is BC
- ans = max(check_sec(a, d, b, c), ans)
- print("Here 6", check_sec(a, d, b, c))
- return ans
- a = []
- for i in range(4):
- b = int(input())
- # print(b)
- a.append(b)
- print(check(a))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement