Passed 9/10 cases. Can you guys help find the issue? /u/Abject-Cut7213 Python Education

https://usaco.org/index.php?page=viewproblem2&cpid=783 (Question)

b1 = list(int(i) for i in input().split(" ")) b2 = list(int(i) for i in input().split(" ")) len = b1[3] - b1[1] width = b1[2] - b1[0] if b1[2] > b2[0] and b1[0] < b2[2] and b1[1] >= b2[1] and b1[3] <= b2[3]: #covered left/right len = b1[3] - b1[1] if b2[0] <= b1[2]: #left width = b1[2] - b2[2] else: width = b2[0] - b1[0] elif b1[3] > b2[1] and b1[1] < b2[3] and b1[0] >= b2[0] and b1[2] <= b2[2]: #covered up/down width = b1[2] - b1[0] if b1[3] > b2[3]: len = b1[3] - b2[3] else: len = b2[1] - b1[1] print(len*width) 

submitted by /u/Abject-Cut7213
[link] [comments]

​r/learnpython https://usaco.org/index.php?page=viewproblem2&cpid=783 (Question) b1 = list(int(i) for i in input().split(” “)) b2 = list(int(i) for i in input().split(” “)) len = b1[3] – b1[1] width = b1[2] – b1[0] if b1[2] > b2[0] and b1[0] < b2[2] and b1[1] >= b2[1] and b1[3] <= b2[3]: #covered left/right len = b1[3] – b1[1] if b2[0] <= b1[2]: #left width = b1[2] – b2[2] else: width = b2[0] – b1[0] elif b1[3] > b2[1] and b1[1] < b2[3] and b1[0] >= b2[0] and b1[2] <= b2[2]: #covered up/down width = b1[2] – b1[0] if b1[3] > b2[3]: len = b1[3] – b2[3] else: len = b2[1] – b1[1] print(len*width) submitted by /u/Abject-Cut7213 [link] [comments] 

https://usaco.org/index.php?page=viewproblem2&cpid=783 (Question)

b1 = list(int(i) for i in input().split(" ")) b2 = list(int(i) for i in input().split(" ")) len = b1[3] - b1[1] width = b1[2] - b1[0] if b1[2] > b2[0] and b1[0] < b2[2] and b1[1] >= b2[1] and b1[3] <= b2[3]: #covered left/right len = b1[3] - b1[1] if b2[0] <= b1[2]: #left width = b1[2] - b2[2] else: width = b2[0] - b1[0] elif b1[3] > b2[1] and b1[1] < b2[3] and b1[0] >= b2[0] and b1[2] <= b2[2]: #covered up/down width = b1[2] - b1[0] if b1[3] > b2[3]: len = b1[3] - b2[3] else: len = b2[1] - b1[1] print(len*width) 

submitted by /u/Abject-Cut7213
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *