Skip to content

Commit 24cacb3

Browse files
author
Vic-Nas
committed
Added temp.* to gitignore + new kattis solution
1 parent 68b3dba commit 24cacb3

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
.history
22
__pycache__
3-
temp.py
3+
temp.*
44
input.txt
55
temp
6+
temp/
67

78
# Build artifacts
89
build/
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Forest for the trees
2+
# https://open.kattis.com/problems/forestforthetrees
3+
# Number-theory
4+
# 21/01/2025
5+
6+
7+
from math import gcd
8+
xb, yb = map(int, input().split())
9+
pgcd = gcd(xb, yb)
10+
11+
xb //= pgcd
12+
yb //= pgcd
13+
14+
x1, y1, x2, y2 = map(int, input().split())
15+
16+
for k in range(1, pgcd):
17+
x = k*xb
18+
y = yb*x//xb
19+
if x*yb != y*xb: continue
20+
if x>=x1 and x<=x2 and y>=y1 and y<=y2:
21+
continue
22+
23+
print("No")
24+
print(x, y)
25+
break
26+
else:
27+
print("Yes")

0 commit comments

Comments
 (0)