Last active
February 2, 2020 12:21
-
-
Save dziobex/1cf39713c50aef48013f30b8752963c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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