Buggy python submission (verdict: Runtime Error):
import math

A,B,C,D = map(int,input().split())

E =C*D//math.gcd(C,D)

if A%C == 0:
    C_div = B//C - A//C + 1
else:
    C_div = B//C - A//C

if A%D == 0:
    D_div = B//D - A//D + 1
else:
    D_div = B//D- A//D


if A%E == 0:
    CandD_div  = B//E - A//E + 1
else:
    CandD_div  = B//E- A//E


ans = B - A + 1 - (C_div + D_div - CandD_div)
print(ans)


Fixed submission:
import fractions

A,B,C,D = map(int,input().split())

E =C*D//fractions.gcd(C,D)

if A%C == 0:
    C_div = B//C - A//C + 1
else:
    C_div = B//C - A//C

if A%D == 0:
    D_div = B//D - A//D + 1
else:
    D_div = B//D- A//D


if A%E == 0:
    CandD_div  = B//E - A//E + 1
else:
    CandD_div  = B//E- A//E


ans = B - A + 1 - (C_div + D_div - CandD_div)
print(ans)

Buggy python submission (verdict: Runtime Error):
import math

A,B,C,D = (int(i) for i in input().split())

E =C*D//math.gcd(C,D)

if A%C == 0:
    C_div = B//C - A//C + 1
else:
    C_div = B//C - A//C

if A%D == 0:
    D_div = B//D - A//D + 1
else:
    D_div = B//D- A//D


if A%E == 0:
    CandD_div  = B//E - A//E + 1
else:
    CandD_div  = B//E- A//E


ans = B - A + 1 - (C_div + D_div - CandD_div)
print(ans)


Fixed submission:
import fractions

A,B,C,D = map(int,input().split())

E =C*D//fractions.gcd(C,D)

if A%C == 0:
    C_div = B//C - A//C + 1
else:
    C_div = B//C - A//C

if A%D == 0:
    D_div = B//D - A//D + 1
else:
    D_div = B//D- A//D


if A%E == 0:
    CandD_div  = B//E - A//E + 1
else:
    CandD_div  = B//E- A//E


ans = B - A + 1 - (C_div + D_div - CandD_div)
print(ans)

Buggy python submission (verdict: Runtime Error):
import math

A,B,C,D = (int(i) for i in input().split())

E =int(C*D/math.gcd(C,D))

if A%C == 0:
    C_div = B//C - A//C + 1
else:
    C_div = B//C - A//C

if A%D == 0:
    D_div = B//D - A//D + 1
else:
    D_div = B//D- A//D


if A%E == 0:
    CandD_div  = B//E - A//E + 1
else:
    CandD_div  = B//E- A//E


ans = B - A + 1 - (C_div + D_div - CandD_div)
print(ans)


Fixed submission:
import fractions

A,B,C,D = map(int,input().split())

E =C*D//fractions.gcd(C,D)

if A%C == 0:
    C_div = B//C - A//C + 1
else:
    C_div = B//C - A//C

if A%D == 0:
    D_div = B//D - A//D + 1
else:
    D_div = B//D- A//D


if A%E == 0:
    CandD_div  = B//E - A//E + 1
else:
    CandD_div  = B//E- A//E


ans = B - A + 1 - (C_div + D_div - CandD_div)
print(ans)

Buggy python submission (verdict: Runtime Error):
import math

A,B,C,D = (int(i) for i in input().split())
C_div = int(0)
D_div = int(0)
CandD_div = int(0)
E =int(C*D/math.gcd(C,D))

if A%C == 0:
    C_div = int(B/C) - int(A/C) + 1
else:
    C_div = int(B/C) - int(A/C)

if A%D == 0:
    D_div = int(B/D) - int(A/D) + 1
else:
    D_div = int(B/D)- int(A/D)


if A%E == 0:
    CandD_div  = int(B/E) - int(A/E) + 1
else:
    CandD_div  = int(B/E)- int(A/E)


ans = B - A + 1 - (C_div + D_div - CandD_div)
print(ans)


Fixed submission:
import fractions

A,B,C,D = map(int,input().split())

E =C*D//fractions.gcd(C,D)

if A%C == 0:
    C_div = B//C - A//C + 1
else:
    C_div = B//C - A//C

if A%D == 0:
    D_div = B//D - A//D + 1
else:
    D_div = B//D- A//D


if A%E == 0:
    CandD_div  = B//E - A//E + 1
else:
    CandD_div  = B//E- A//E


ans = B - A + 1 - (C_div + D_div - CandD_div)
print(ans)

Buggy python submission (verdict: Runtime Error):
import math

A,B,C,D = (int(i) for i in input().split())
C_div = int(0)
D_div = int(0)
CandD_div = int(0)
E =int(C*D/math.gcd(C,D))

if A%C == 0:
    C_div = int(B/C) - int(A/C) + 1
else:
    C_div = int(B/C) - int(A/C)

if A%D == 0:
    D_div = int(B/D) - int(A/D) + 1
else:
    D_div = int(B/D)- int(A/D)


if A%E == 0:
    CandD_div  = int(B/E) - int(A/E) + 1
else:
    CandD_div  = int(B/E)- int(A/E)


ans = B - A + 1 - (C_div + D_div - CandD_div)
print(ans)


Fixed submission:
import fractions

A,B,C,D = map(int,input().split())

E =C*D//fractions.gcd(C,D)

if A%C == 0:
    C_div = B//C - A//C + 1
else:
    C_div = B//C - A//C

if A%D == 0:
    D_div = B//D - A//D + 1
else:
    D_div = B//D- A//D


if A%E == 0:
    CandD_div  = B//E - A//E + 1
else:
    CandD_div  = B//E- A//E


ans = B - A + 1 - (C_div + D_div - CandD_div)
print(ans)