Buggy python submission (verdict: Runtime Error):
import math
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = round(C*D//gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)

Fixed submission:
from fractions import gcd
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = round(C*D//gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)

Buggy python submission (verdict: Runtime Error):
from fractions import gcd
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = round(C*D//math.gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)

Fixed submission:
from fractions import gcd
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = round(C*D//gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)

Buggy python submission (verdict: Runtime Error):
# ABC131C - Anti-Division
import math
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = round(C*D//math.gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)

Fixed submission:
from fractions import gcd
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = round(C*D//gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)

Buggy python submission (verdict: Runtime Error):
import math
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = C*D//math.gcd(C,D)
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)

Fixed submission:
from fractions import gcd
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = round(C*D//gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)

Buggy python submission (verdict: Runtime Error):
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
Z = B//lcm - (A-1)//int(C/math.gcd(C,D) *D)
print(B-A+1-X-Y+Z)

Fixed submission:
from fractions import gcd
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = round(C*D//gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)

Buggy python submission (verdict: Runtime Error):
import math
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = int(C/math.gcd(C,D) *D)
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)

Fixed submission:
from fractions import gcd
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = round(C*D//gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)

Buggy python submission (verdict: Runtime Error):
import math
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = int(C*D/math.gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)

Fixed submission:
from fractions import gcd
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = round(C*D//gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)

Buggy python submission (verdict: Runtime Error):
import math
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = int(C*D/math.gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)

Fixed submission:
from fractions import gcd
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = round(C*D//gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)