Skip to content

Commit b767174

Browse files
committed
Simplified solution for kattis forest
1 parent 0d490a0 commit b767174

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

kattis/Forest for the trees/forest.vn.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@
2525
y = k*yb
2626

2727
k += 1
28-
if x>=x1 and x<=x2:
29-
if y>=y1 and y<=y2:
30-
# We are in the rectangle
31-
# We need to get out
32-
# We are out when x is out or y is out
33-
k = min(x2//xb, y2//yb)+1
34-
continue
28+
if x1<=x<x2 and y1<=y<=y2:
29+
# We are in the rectangle
30+
# We need to get out
31+
# We are out when x is out or y is out
32+
k = min(x2//xb, y2//yb)+1
33+
continue
3534

3635
print("No")
3736
print(x, y)

0 commit comments

Comments
 (0)