Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
import math

def num_of_complements(x,c,d):
    lcm = c * d // math.gcd(c, d)
    num = x + x//lcm - x//c - x//d
    return num

ans = num_of_complements(b,c,d) - num_of_complements(a-1,c,d)
print(ans)


Fixed submission:
a,b,c,d = map(int,input().split())
from fractions import gcd
lcm = c * d // gcd(c, d)
def num_of_complements(x,c,d,lcm):
    num = x + x//lcm - x//c - x//d
    return num

ans = num_of_complements(b,c,d,lcm) - num_of_complements(a-1,c,d,lcm)
print(ans)

Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
import math
lcm = c * d // math.gcd(c, d)

def num_of_complements(x,c,d):
    num = x + x//lcm - x//c - x//d
    return num

ans = num_of_complements(b,c,d) - num_of_complements(a-1,c,d)
print(ans)


Fixed submission:
a,b,c,d = map(int,input().split())
from fractions import gcd
lcm = c * d // gcd(c, d)
def num_of_complements(x,c,d,lcm):
    num = x + x//lcm - x//c - x//d
    return num

ans = num_of_complements(b,c,d,lcm) - num_of_complements(a-1,c,d,lcm)
print(ans)

Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
import math
lcm = c * d // math.gcd(c, d)
def num_of_complements(x,c,d):

    num = x + x//lcm - x//c - x//d
    return num

ans = num_of_complements(b,c,d) - num_of_complements(a-1,c,d)
print(int(ans))


Fixed submission:
a,b,c,d = map(int,input().split())
from fractions import gcd
lcm = c * d // gcd(c, d)
def num_of_complements(x,c,d,lcm):
    num = x + x//lcm - x//c - x//d
    return num

ans = num_of_complements(b,c,d,lcm) - num_of_complements(a-1,c,d,lcm)
print(ans)

Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
import math
lcm = c * d // math.gcd(c, d)
def num_of_complements(x,c,d):

    num = x + x//lcm - x//c - x//d
    return num

ans = num_of_complements(b,c,d) - num_of_complements(a-1,c,d)
print(int(ans))


Fixed submission:
a,b,c,d = map(int,input().split())
from fractions import gcd
lcm = c * d // gcd(c, d)
def num_of_complements(x,c,d,lcm):
    num = x + x//lcm - x//c - x//d
    return num

ans = num_of_complements(b,c,d,lcm) - num_of_complements(a-1,c,d,lcm)
print(ans)

Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
import math
lcm = c * d // math.gcd(c, d)
def num_of_complements(x,c,d):

    num = x + x//lcm - x//c - x//d
    return num

ans = num_of_complements(b,c,d) - num_of_complements(a-1,c,d)
print(int(ans)))


Fixed submission:
a,b,c,d = map(int,input().split())
from fractions import gcd
lcm = c * d // gcd(c, d)
def num_of_complements(x,c,d,lcm):
    num = x + x//lcm - x//c - x//d
    return num

ans = num_of_complements(b,c,d,lcm) - num_of_complements(a-1,c,d,lcm)
print(ans)

Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
import math
def num_of_complements(x,c,d):
    lcm = c * d // math.gcd(c, d)
    num = x + x//lcm - x//c - x//d
    return num

ans = num_of_complements(b,c,d) - num_of_complements(a-1,c,d)
print(ans)



Fixed submission:
a,b,c,d = map(int,input().split())
from fractions import gcd
lcm = c * d // gcd(c, d)
def num_of_complements(x,c,d,lcm):
    num = x + x//lcm - x//c - x//d
    return num

ans = num_of_complements(b,c,d,lcm) - num_of_complements(a-1,c,d,lcm)
print(ans)