Buggy python submission (verdict: Time Limit Exceeded):
e = list(map(int,input().split()))
a,b,c,d = e
cnt = 0
for i in range(a,b+1):
    if (int(i/c)-i/c != 0) and (int(i/d)-i/d != 0):
        cnt += 1
    else:
        pass
print(cnt)

Fixed submission:
e = list(map(int,input().split()))
a,b,c,d = e

def gcd(x,y):
    while y !=0:
        x,y = y,x%y
    return x

def sums(x):
    S1 = x//c
    S2 = x//d
    S3 = x// (c*d//gcd(c,d))
    return x - S1 - S2 + S3


print(sums(b)-sums(a-1))

Buggy python submission (verdict: Runtime Error):
e = list(map(int,input().split()))
a = e[0]
b = e[1]
c = e[2]
d = e[3]
cnt = 0
for j in range(a,b+1):
    if j%c != 0 and j%d != 0
        cnt += 1
print(cnt)

Fixed submission:
e = list(map(int,input().split()))
a,b,c,d = e

def gcd(x,y):
    while y !=0:
        x,y = y,x%y
    return x

def sums(x):
    S1 = x//c
    S2 = x//d
    S3 = x// (c*d//gcd(c,d))
    return x - S1 - S2 + S3


print(sums(b)-sums(a-1))

Buggy python submission (verdict: Time Limit Exceeded):
e = list(map(int,input().split()))
a = e[0]
b = e[1]
c = e[2]
d = e[3]
cnt = 0
t = [j for j in range(a,b+1) if j%c != 0 and j%d != 0]
cnt = len(t)
print(cnt)

Fixed submission:
e = list(map(int,input().split()))
a,b,c,d = e

def gcd(x,y):
    while y !=0:
        x,y = y,x%y
    return x

def sums(x):
    S1 = x//c
    S2 = x//d
    S3 = x// (c*d//gcd(c,d))
    return x - S1 - S2 + S3


print(sums(b)-sums(a-1))

Buggy python submission (verdict: Time Limit Exceeded):
e = list(map(int,input().split()))
a = e[0]
b = e[1]
c = e[2]
d = e[3]
cnt = 0
t = [j for j in range(a,b+1) if j%c != 0 and j%d != 0]

for i in t:
    if (int(i/c)-i/c != 0) and (int(i/d)-i/d != 0):
        cnt += 1
    else:
        pass
print(cnt)

Fixed submission:
e = list(map(int,input().split()))
a,b,c,d = e

def gcd(x,y):
    while y !=0:
        x,y = y,x%y
    return x

def sums(x):
    S1 = x//c
    S2 = x//d
    S3 = x// (c*d//gcd(c,d))
    return x - S1 - S2 + S3


print(sums(b)-sums(a-1))

Buggy python submission (verdict: Time Limit Exceeded):
e = list(map(int,input().split()))
a = e[0]
b = e[1]
c = e[2]
d = e[3]
cnt = 0

for i in range(a,b+1):
    if (int(i/c)-i/c != 0) and (int(i/d)-i/d != 0):
        cnt += 1
    else:
        pass
print(cnt)

Fixed submission:
e = list(map(int,input().split()))
a,b,c,d = e

def gcd(x,y):
    while y !=0:
        x,y = y,x%y
    return x

def sums(x):
    S1 = x//c
    S2 = x//d
    S3 = x// (c*d//gcd(c,d))
    return x - S1 - S2 + S3


print(sums(b)-sums(a-1))

Buggy python submission (verdict: Time Limit Exceeded):
e = list(map(int,input().split()))
a = e[0]
b = e[1]
c = e[2]
d = e[3]

def div(x,y):
    cnt = 0
    for i in range(a,b+1):
        if (int(i/x)-i/x != 0) and (int(i/y)-i/y != 0):
            cnt += 1
    return cnt

print(div(c,d))

Fixed submission:
e = list(map(int,input().split()))
a,b,c,d = e

def gcd(x,y):
    while y !=0:
        x,y = y,x%y
    return x

def sums(x):
    S1 = x//c
    S2 = x//d
    S3 = x// (c*d//gcd(c,d))
    return x - S1 - S2 + S3


print(sums(b)-sums(a-1))

Buggy python submission (verdict: Time Limit Exceeded):
e = list(map(int,input().split()))
a = int(e[0])
b = int(e[1])
c = int(e[2])
d = int(e[3])

def div(x,y):
    cnt = 0
    for i in range(a,b+1):
        if (int(i/x)-i/x != 0) and (int(i/y)-i/y != 0):
            cnt += 1
    return cnt

print(div(c,d))

Fixed submission:
e = list(map(int,input().split()))
a,b,c,d = e

def gcd(x,y):
    while y !=0:
        x,y = y,x%y
    return x

def sums(x):
    S1 = x//c
    S2 = x//d
    S3 = x// (c*d//gcd(c,d))
    return x - S1 - S2 + S3


print(sums(b)-sums(a-1))