Skip to content

Instantly share code, notes, and snippets.

@dziobex
Last active February 2, 2020 12:21
Show Gist options
  • Save dziobex/1cf39713c50aef48013f30b8752963c3 to your computer and use it in GitHub Desktop.
Save dziobex/1cf39713c50aef48013f30b8752963c3 to your computer and use it in GitHub Desktop.
def warianty(a, b, x, y):
ile = 0
kopia_x = x
kopia_y = y
if x>a and y>b and x%i==0 and y%i==0:
for i in range(1, a):
if x>=a and y>=b and x%i==0 and y%i==0:
x = x/i
y = y/i
l = []
ile+=1
x = kopia_x
y = kopia_y
else:
continue
elif a>=x and b>=y:
for i in range(1, a):
if x*i<=a and y*i<=b:
x = x*i
y = y*i
l = []
ile+=1
x = kopia_x
y = kopia_y
else:
return 0
return ile
a = int(input("Podaj max szer odbiornika: "))
b = int(input("Podaj max wys odbiornika: "))
x = int(input("Podaj wymiar szer w sklepie: "))
y = int(input("Podaj wymiar wys w sklepie: "))
print(warianty(a, b, x, y))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment