Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())
cd = (c*d) // math.gcd(c,d)
c_sum = (b // c) - ((a-1) // c)
d_sum = (b // d) - ((a-1) // d)
cd_sum = (b // cd) - ((a-1) // cd)
result = b-a+1 -(c_sum+d_sum-cd_sum)
print(result)

Fixed submission:
import fractions
a,b,c,d = map(int,input().split())
cd = (c*d) // fractions.gcd(c,d)
c_sum = (b // c) - ((a-1) // c)
d_sum = (b // d) - ((a-1) // d)
cd_sum = (b // cd) - ((a-1) // cd)
result = b-a+1 -(c_sum+d_sum-cd_sum)
print(result)

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())
cd = (c*d) // (max(math.gcd(c,d),1))
c_sum = (b // c) - ((a-1) // c)
d_sum = (b // d) - ((a-1) // d)
cd_sum = (b // cd) - ((a-1) // cd)

result = b-a+1 -(c_sum+d_sum-cd_sum)
print(result)

Fixed submission:
import fractions
a,b,c,d = map(int,input().split())
cd = (c*d) // fractions.gcd(c,d)
c_sum = (b // c) - ((a-1) // c)
d_sum = (b // d) - ((a-1) // d)
cd_sum = (b // cd) - ((a-1) // cd)
result = b-a+1 -(c_sum+d_sum-cd_sum)
print(result)

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())
cd = (c*d) // (math.gcd(c,d))
c_sum = (b // c) - ((a-1) // c)
d_sum = (b // d) - ((a-1) // d)
cd_sum = (b // cd) - ((a-1) // cd)

result = b-a+1 -(c_sum+d_sum-cd_sum)
print(result)

Fixed submission:
import fractions
a,b,c,d = map(int,input().split())
cd = (c*d) // fractions.gcd(c,d)
c_sum = (b // c) - ((a-1) // c)
d_sum = (b // d) - ((a-1) // d)
cd_sum = (b // cd) - ((a-1) // cd)
result = b-a+1 -(c_sum+d_sum-cd_sum)
print(result)

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())
cd = (c*d) // math.gcd(c,d)
c_sum = (b // c) - ((a-1) // c)
d_sum = (b // d) - ((a-1) // d)
cd_sum = (b // cd) - ((a-1) // cd)
 
result = b-a+1 -(c_sum+d_sum-cd_sum)
print((result))

Fixed submission:
import fractions
a,b,c,d = map(int,input().split())
cd = (c*d) // fractions.gcd(c,d)
c_sum = (b // c) - ((a-1) // c)
d_sum = (b // d) - ((a-1) // d)
cd_sum = (b // cd) - ((a-1) // cd)
result = b-a+1 -(c_sum+d_sum-cd_sum)
print(result)

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())
cd = (c*d) // math.gcd(c,d)
c_sum = (b // c) - ((a-1) // c)
d_sum = (b // d) - ((a-1) // d)
cd_sum = (b // cd) - ((a-1) // cd)

result = b-a+1 -(c_sum+d_sum-cd_sum)
print((result))

Fixed submission:
import fractions
a,b,c,d = map(int,input().split())
cd = (c*d) // fractions.gcd(c,d)
c_sum = (b // c) - ((a-1) // c)
d_sum = (b // d) - ((a-1) // d)
cd_sum = (b // cd) - ((a-1) // cd)
result = b-a+1 -(c_sum+d_sum-cd_sum)
print(result)

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())
cd = (c*d) // math.gcd(c,d)
c_sum = (b // c) - ((a-1) // c)
d_sum = (b // d) - ((a-1) // d)
cd_sum = (b // cd) - ((a-1) // cd)

result = b-a+1 -(c_sum+d_sum-cd_sum)
print((result))

Fixed submission:
import fractions
a,b,c,d = map(int,input().split())
cd = (c*d) // fractions.gcd(c,d)
c_sum = (b // c) - ((a-1) // c)
d_sum = (b // d) - ((a-1) // d)
cd_sum = (b // cd) - ((a-1) // cd)
result = b-a+1 -(c_sum+d_sum-cd_sum)
print(result)

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())
cd = (c*d) // math.gcd(c,d)
c_sum = (b // c) - ((a-1) // c)
d_sum = (b // d) - ((a-1) // d)
cd_sum = (b // cd) - ((a-1) // cd)

result = b-a+1 -(c_sum+d_sum-cd_sum)
print((result)

Fixed submission:
import fractions
a,b,c,d = map(int,input().split())
cd = (c*d) // fractions.gcd(c,d)
c_sum = (b // c) - ((a-1) // c)
d_sum = (b // d) - ((a-1) // d)
cd_sum = (b // cd) - ((a-1) // cd)
result = b-a+1 -(c_sum+d_sum-cd_sum)
print(result)

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())
cd = (c*d) // math.gcd(c,d)
c_sum = (b // c) - ((a-1) // c)
d_sum = (b // d) - ((a-1) // d)
cd_sum = (b // cd) - ((a-1) // cd)

result = b-a+1 -(c_sum+d_sum-cd_sum)
print((result)

Fixed submission:
import fractions
a,b,c,d = map(int,input().split())
cd = (c*d) // fractions.gcd(c,d)
c_sum = (b // c) - ((a-1) // c)
d_sum = (b // d) - ((a-1) // d)
cd_sum = (b // cd) - ((a-1) // cd)
result = b-a+1 -(c_sum+d_sum-cd_sum)
print(result)

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())
cd = (c*d) // math.gcd(c,d)
print(cd)
c_sum = (b // c) - ((a-1) // c)
d_sum = (b // d) - ((a-1) // d)
cd_sum = (b // cd) - ((a-1) // cd)

result = b-a+1 -(c_sum+d_sum-cd_sum)
print((result))

Fixed submission:
import fractions
a,b,c,d = map(int,input().split())
cd = (c*d) // fractions.gcd(c,d)
c_sum = (b // c) - ((a-1) // c)
d_sum = (b // d) - ((a-1) // d)
cd_sum = (b // cd) - ((a-1) // cd)
result = b-a+1 -(c_sum+d_sum-cd_sum)
print(result)