Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
'''

                            Online Python Compiler.
                Code, Compile, Run and Debug python program online.
Write your code in this editor and press "Run" button to execute it.

'''

n = int(input()) 
  
a = list(map(int,input().strip().split()))[:n] 
x=1  
for i in range(n):
    x*=a[i]
    
if x>1000000000000000000:
    print(-1)
else:
    print(x)
    


Fixed submission:
'''

                            Online Python Compiler.
                Code, Compile, Run and Debug python program online.
Write your code in this editor and press "Run" button to execute it.

'''

n = int(input()) 
  
a = list(map(int,input().strip().split()))[:n] 
x=1
flag=0
flag1=0
for i in range(n):
    if a[i]==0:
        x*=0
        flag1=1
        break
if flag!=1: 
    for i in range(n):
        if x*a[i]>1000000000000000000:
            flag=1
            break
        else:
            x*=a[i]
        
if flag1==1:
    print(0)
elif flag==1:
    print(-1)
else:
    print(x)
Buggy python submission (verdict: Runtime Error):
input_number = input()
if input_number = 0:
  print(1)
else:
  print(0)

Fixed submission:
a = int(input())
if a==1:
  print(0)
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
d, t, s = map(int, input())
t_d = t * d
if td >= d:
  print("yes")
else:
  print("no")

Fixed submission:
d, t, s = map(int, input().split())
if d > t*s:
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
p=1
l=input()
num=input().split()
for n in num:
    p*=int(n)
mx=pow(10,18)
if(p>mx):
    print("-1")
else:
    print(p)

Fixed submission:
p=1
mx=1000000000000000000
n=int(input())
num=input().split()
z=num.count('0')
if(z!=0):
    print('0')
else:    
    for i in num:
        p*=int(i)
        if(p>mx):
            p=-1
            break
    print(p)
Buggy python submission (verdict: Runtime Error):
from decimal import Decimal

m,n=map(Decimal,input().split(''))
print(int(m*n))

Fixed submission:
from decimal import Decimal

m,n=map(Decimal,input().split(' '))
print(int(m*n))
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
if (n == 1 and a == b):
  ans = 1
elif (n == 1):
  ans = 0
elif A > B:
  ans = 0
else:
  ans = (b - a) * (n - 2) + 1
print(ans)

Fixed submission:
n, a, b = map(int, input().split())
if (n == 1 and a == b):
  ans = 1
elif (n == 1):
  ans = 0
elif a > b:
  ans = 0
else:
  ans = (b - a) * (n - 2) + 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split)
l=list(map(int,input().split))
l.sort()
print(sum(l[:k]))

Fixed submission:
n,k=map(int,input().split())
l=list(map(int,input().split()))
l.sort()
print(sum(l[:k]))
Buggy python submission (verdict: Runtime Error):
x,n=map(int, input().split())
l=list(map(int ,input().split()))
i=0
while(True):
    if (x-i) not in l:
        print(x-i)
        break
    if(x+i) not in l:
        print(x+i)
        break
    i+=1



Fixed submission:
l=list(map(int ,input().split()))
print(l.index(0)+1)

Buggy python submission (verdict: Runtime Error):
l=list(map(input().split()))
print(l.index(0)+1)

Fixed submission:
l=list(map(int ,input().split()))
print(l.index(0)+1)

Buggy python submission (verdict: Runtime Error):
l=list(map(input().split()))
print(l.index(0))

Fixed submission:
l=list(map(int ,input().split()))
print(l.index(0)+1)
Buggy python submission (verdict: Runtime Error):
x=int(input)
print(abs(1-x))

Fixed submission:
x=int(input())
print(abs(1-x))
Buggy python submission (verdict: Runtime Error):
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n,m,x=n1()
ca=n3(n)
ca
ans=9999999999

import itertools
book=list(itertools.product([0,1], repeat=n))
price=[]
for line in book:
    p=0
    for i in range(n):
        if line[i]==1:
            p+=ca[i][0]
            
    price.append(p)
for i in range(len(book)):
    t=book[i]
    s=[0]*m
    for j in t:
        if t[j]==1:
            s=[s[k]+ca[j][k+1] for k in range(m)]
    if len([y for y in s if y>=x])==m:
        ans=min(ans,price[i])
if ans==9999999999:
    print(-1)
else:
    print(ans)

Fixed submission:
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n,m,x=n1()
ca=n3(n)
ca

import itertools
book=list(itertools.product([0,1], repeat=n))
price=[]
for line in book:
    p=0
    for i in range(n):
        if line[i]==1:
            p+=ca[i][0]
            
    price.append(p)
A=[[book[i],price[i]] for i in range(len(book))]
A.sort(key=lambda x:x[1])

for line in A:
    t=line[0]
    s=[0]*m
    for i in range(n):
        if t[i]==1:
            s=[s[j]+ca[i][j+1] for j in range(m)]
    if len([i for i in s if i>=x])==m:
        print(line[1])
        break
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n,m,k=n1()

ans=0
a=1
for i in range(k+1):
    ans+=a*m*pow(m-1,n-1-i,998244353)
    a=a*(n-1-i)//(i+1)
print(ans%998244353)

Fixed submission:
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n,m,k=n1()

def cmb(n, k, mod, fac, ifac):
    """
    nCkを計算する
    """
    k = min(k, n-k)
    return fac[n] * ifac[k] * ifac[n-k] % mod


def make_tables(mod, n):
    """
    階乗テーブル、逆元の階乗テーブルを作成する
    """
    fac = [1, 1] # 階乗テーブル・・・(1)
    ifac = [1, 1] #逆元の階乗テーブル・・・(2)
    inverse = [0, 1] #逆元テーブル・・・(3)

    for i in range(2, n+1):
        fac.append((fac[-1] * i) % mod)
        inverse.append((-inverse[mod % i] * (mod//i)) % mod)
        ifac.append((ifac[-1] * inverse[-1]) % mod)
    return fac, ifac

ans=0
a=1
MOD=998244353
fac, ifac = make_tables(MOD, n-1)
        
for i in range(k+1):
    ans+=m*pow(m-1,n-1-i,998244353)*cmb(n-1, i, MOD, fac, ifac)
print(ans%998244353)

Buggy python submission (verdict: Time Limit Exceeded):
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n,m,k=n1()

ans=0
a=1
for i in range(k+1):
    ans+=a*m*pow(m-1,n-1-i,998244353)
    a=a*(n-1-i)//(i+1)
print(ans%998244353)

Fixed submission:
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n,m,k=n1()

def cmb(n, k, mod, fac, ifac):
    """
    nCkを計算する
    """
    k = min(k, n-k)
    return fac[n] * ifac[k] * ifac[n-k] % mod


def make_tables(mod, n):
    """
    階乗テーブル、逆元の階乗テーブルを作成する
    """
    fac = [1, 1] # 階乗テーブル・・・(1)
    ifac = [1, 1] #逆元の階乗テーブル・・・(2)
    inverse = [0, 1] #逆元テーブル・・・(3)

    for i in range(2, n+1):
        fac.append((fac[-1] * i) % mod)
        inverse.append((-inverse[mod % i] * (mod//i)) % mod)
        ifac.append((ifac[-1] * inverse[-1]) % mod)
    return fac, ifac

ans=0
a=1
MOD=998244353
fac, ifac = make_tables(MOD, n-1)
        
for i in range(k+1):
    ans+=m*pow(m-1,n-1-i,998244353)*cmb(n-1, i, MOD, fac, ifac)
print(ans%998244353)
Buggy python submission (verdict: Time Limit Exceeded):
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n=n0()
a=n1()

for i in range(1,n+1):
    print(a.count(i))

Fixed submission:
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n=n0()
a=n1()
ans=[0]*n

for i in range(len(a)):
    ans[a[i]-1]+=1
for i in range(len(ans)):
    print(ans[i])
Buggy python submission (verdict: Runtime Error):
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n=n0()
c=n1()
ab=[(x[0],x[1]) for x in n3(n-1)]

import networkx as nx
G = nx.Graph()

G.add_nodes_from(range(1,n+1))
G.add_edges_from(ab)

path=[[x] for x in range(1,n+1)]
for i in range(1,n+1):
    path.extend(list(nx.all_simple_paths(G, source=i, target=[x for x in range(i+1,n+1)])))
path_color = [[c[x-1] for x in line] for line in path]
dict_color={i:0 for i in range(1,n+1)}
for x in path_color:
    for i in set(x):
        dict_color[i]+=1
for i in dict_color:
    print(dict_color[i])


Fixed submission:
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n,k=n1()

down=[0]*(n+1)
up=[0]*(n+1)
up[0]=n
ans=0 if k>1 else n+1
for i in range(1,n+1):
    down[i]=down[i-1]+i
    up[i]=up[i-1]+(n-i)
    if i>=k-1:
        ans+=up[i]-down[i]+1
print(ans%(10**9+7))
Buggy python submission (verdict: Runtime Error):
n,m=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]

a.sort()
a.reverse()

ans="Yes"
for i in range(m):
    if a[i]<sum(a)/(4*m):
        ans="No"
        break;
print(ans)

Fixed submission:
a,b,c=[int(x) for x in input().split()]

print(c,a,b)
Buggy python submission (verdict: Runtime Error):
n,m=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]

a.sort()
a.reverse()

ans="Yes"
for i in range(m+1):
    if a[i]<sum(a)/(4*m):
        ans="No"
        break;
print(ans)

Fixed submission:
n,m=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]

a.sort()
a.reverse()

ans="Yes"
for i in range(m):
    if a[i]<sum(a)/(4*m):
        ans="No"
        break;
print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()

ans="No"
if len(s)%2==0:
  if s=="hi"*(len(s)//2):
    ans="Yes"

print(ans

Fixed submission:
s=input()
 
ans="No"
if len(s)%2==0:
  if s=="hi"*(len(s)//2):
    ans="Yes"

print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=map(int,input().split())
if len(a)==list(set(a)):
  print("Yes")
else:
  print("No")

Fixed submission:
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n=n0()
a=n1()

print("YES" if len(a)==len(list(set(a))) else "NO")
Buggy python submission (verdict: Time Limit Exceeded):
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n=n0()
length=len(str(n))

ans=0
for i in range(1,10):
    if n<i:
        break
    s=0
    for j in range(1,length+1):
        if j<=1:
            s+=1
        elif j<length:
            s+=(10**(j-2))
        else:
            for m in range(n,10**(length-1),-1):
                if str(m)[0]==str(m)[-1]==str(i):
                    s+=1
    ans+=s*s
for i1 in range(1,10):
    for i2 in range(1,10):
        if i1==i2:
            break;
        s1=0
        s2=0
        for j in range(2,length+1):
            if j<length:
                s1+=10**(j-2)
                s2+=10**(j-2)
            else:
                for m in range(n,10**(length-1),-1):
                    if str(m)[0]==str(i1) and str(m)[-1]==str(i2):
                        s1+=1
                    elif str(m)[0]==str(i2) and str(m)[-1]==str(i1):
                        s2+=1
        ans+=s1*s2*2
print(ans)

Fixed submission:
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n=n0()
length=len(str(n))

ans=0
for i in range(1,10):
    if n<i:
        break
    s=0
    for j in range(1,length+1):
        if j<=1:
            s+=1
        elif j<length:
            s+=(10**(j-2))
        else:
            if not(length==6 and i>=2):
                for m in range(n,10**(length-1),-1):
                    if str(m)[0]==str(m)[-1]==str(i):
                        s+=1
    ans+=s*s
for i1 in range(1,10):
    for i2 in range(1,10):
        if i1==i2:
            break;
        s1=0
        s2=0
        for j in range(2,length+1):
            if j<length:
                s1+=10**(j-2)
                s2+=10**(j-2)
            else:
                if not(length==6 and i1>=2 and i2>=2):
                    for m in range(n,10**(length-1),-1):
                        if str(m)[0]==str(i1) and str(m)[-1]==str(i2):
                            s1+=1
                        elif str(m)[0]==str(i2) and str(m)[-1]==str(i1):
                            s2+=1
        ans+=s1*s2*2
print(ans)
Buggy python submission (verdict: Runtime Error):
c=input()
l="qwertyuioplkjhgfdsazxcvbnm"
l.sort()
print(l[l.index(c)+1])

Fixed submission:
c=input()
print(chr(ord(c)+1))
Buggy python submission (verdict: Runtime Error):


k,x=n1()
print("Yes" if k*500>=x else "No")

Fixed submission:

def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [[input().split()] for _ in range(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
def t3(n):return [tuple(int(x) for x in input().split()) for _ in range(n)]
# from collections import Counter,deque,defaultdict
# import itertools
# import math
# import networkx
# from bisect import bisect_left,bisect_right

k,x=n1()
print("Yes" if k*500>=x else "No")
Buggy python submission (verdict: Runtime Error):
s=input()
n=len(s)
 
c=0
i=0
while i<n-i-1:
  if s[i]!=s[n-i-1]:
    c+=1
  i+=1
print(c)
s=input()
n=len(n)
 
c=0
i=0
while i<n-i-1:
  if s[i]!=s[n-i-1]:
    c+=1
  i+=1
print(c)
提出情報

Fixed submission:
s=input()
n=len(s)
 
c=0
i=0
while i<n-i-1:
  if s[i]!=s[n-i-1]:
    c+=1
  i+=1
print(c)

Buggy python submission (verdict: Runtime Error):
s=input()
n=len(n)
 
c=0
i=0
while i<n-i-1:
  if s[i]!=s[n-i-1]:
    c+=1
  i+=1
print(c)

Fixed submission:
s=input()
n=len(s)
 
c=0
i=0
while i<n-i-1:
  if s[i]!=s[n-i-1]:
    c+=1
  i+=1
print(c)

Buggy python submission (verdict: Runtime Error):
s=input()
n=len(n)

c=0
i=0
while i<n-i-1
  if s[i]!=s[n-i-1]:
    c+=1
  i+=1
print(c)

Fixed submission:
s=input()
n=len(s)
 
c=0
i=0
while i<n-i-1:
  if s[i]!=s[n-i-1]:
    c+=1
  i+=1
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [[input().split()] for _ in range(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n=n0()
s=s0()

a=[0]*1000
for i in range(1000):
    num=str(i).zfill(3)
    j=0
    for x in s:
        if x==num[j]:
            j+=1
        if j==3:
            a[i]=1
            break
print(sum(a))

Fixed submission:
def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [[input().split()] for _ in range(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n=n0()
s=s0()

a=[0]*1000
for i in range(1000):
    num=str(i).zfill(3)
    j=0
    for x in s:
        if x==num[j]:
            j+=1
        if j==3:
            a[i]=1
            break
print(sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [[input().split()] for _ in range(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n=n0()
s=s0()

import itertools
print(len(set(itertools.combinations(s,3))))

Fixed submission:
def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [[input().split()] for _ in range(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n=n0()
s=s0()

a=[0]*1000
for i in range(1000):
    num=str(i).zfill(3)
    j=0
    for x in s:
        if x==num[j]:
            j+=1
        if j==3:
            a[i]=1
            break
print(sum(a))
Buggy python submission (verdict: Runtime Error):
n=int(input())

t=[]
for i in range(1,10):
  for j in range(1,10):
    t.append(i*j)

if n in t:
  print("Yes")
else:
  Print("No")

Fixed submission:
n=int(input())
 
t=[]
for i in range(1,10):
  for j in range(1,10):
    t.append(i*j)

if n in t:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
s=input()

Sunny, Cloudy, Rainy

if s=="Sunny":
  a="Cloudy"
elif s=="Cloudy":
  a="Rainy"
else:
  a="Sunny"
print(a)


Fixed submission:
s=input()
 
if s=="Sunny":
  a="Cloudy"
elif s=="Cloudy":
  a="Rainy"
else:
  a="Sunny"
print(a)
Buggy python submission (verdict: Runtime Error):
a,b=[int(x) for x in input().split()]
 
c=1
ans=0:
while True:
  if c>=b:
    break
  else:
    c+=a-1
    ans+=1
print(ans)

Fixed submission:
a,b=[int(x) for x in input().split()]
 
c=1
ans=0
while True:
  if c>=b:
    break
  else:
    c+=a-1
    ans+=1
print(ans)

Buggy python submission (verdict: Runtime Error):
a,b=[int(x) for x in input().split()]

c=1
ans=0:
while True:
  if c>=b:
    break
  else:
    c+=a
    ans+=1

Fixed submission:
a,b=[int(x) for x in input().split()]
 
c=1
ans=0
while True:
  if c>=b:
    break
  else:
    c+=a-1
    ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[int(x) for x in input().split()]

ans=0
for i in range(a):
  ans+=1/i
print(1/ans)

Fixed submission:
n=int(input())
a=[int(x) for x in input().split()]
 
ans=0
for i in a:
  ans+=1/i
print(1/ans)
Buggy python submission (verdict: Time Limit Exceeded):

def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def s4(n):return [[x for x in s] for s in s2(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
def t3(n):return [tuple(int(x) for x in input().split()) for _ in range(n)]
def p0(b,yes="Yes",no="No"): print(yes if b else no)
# from sys import setrecursionlimit
# setrecursionlimit(1000000)
from collections import Counter,deque,defaultdict
# import itertools
# import math
# import networkx as nx
# from bisect import bisect_left,bisect_right
# from heapq import heapify,heappush,heappop
n,q=n1()
AB=n3(n-1)
PX=n3(q)

d={i:[] for i in range(1,n+1)}
for a,b in AB:
    d[a].append(b)
    d[b].append(a)

ans=[0]*(n+1)
for p,x in PX:
    ans[p]+=x

q=deque([1])
c=[False]*(n+1)
c[1]=True
while len(q)>0:
    i=q.popleft()
    for j in d[i]:
        if c[j]==False:
            ans[j]+=ans[i]
            c[j]=True
            q.append(j)

print(*ans[1:])

Fixed submission:

def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def s4(n):return [[x for x in s] for s in s2(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
def t3(n):return [tuple(int(x) for x in input().split()) for _ in range(n)]
def p0(b,yes="Yes",no="No"): print(yes if b else no)
# from sys import setrecursionlimit
# setrecursionlimit(1000000)
from collections import Counter,deque,defaultdict
# import itertools
# import math
# import networkx as nx
# from bisect import bisect_left,bisect_right
# from heapq import heapify,heappush,heappop
n,q=n1()
AB=n3(n-1)
PX=n3(q)

d={i:[] for i in range(1,n+1)}
for a,b in AB:
    d[a].append(b)
    d[b].append(a)

ans=[0]*(n+1)
for p,x in PX:
    ans[p]+=x

q=deque([1])
c=[False]*(n+1)
c[1]=True
while len(q)>0:
    i=q.popleft()
    for j in d[i]:
        if c[j]==False:
            ans[j]+=ans[i]
            c[j]=True
            q.append(j)

print(*ans[1:])
Buggy python submission (verdict: Runtime Error):
a.b=[int(x) for x in input().split()]

print(max(a+b,a-b,a*b))

Fixed submission:
a,b=[int(x) for x in input().split()]
 
print(max(a+b,a-b,a*b))
Buggy python submission (verdict: Runtime Error):

def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def s4(n): return [[x for x in s] for s in s2(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
def t3(n):return [tuple(int(x) for x in input().split()) for _ in range(n)]
def p0(b,yes="Yes",no="No"): print(yes if b else no)
# from sys import setrecursionlimit
# setrecursionlimit(1000000)
# from collections import Counter,deque,defaultdict
# import itertools
# import math
# import networkx
# from bisect import bisect_left,bisect_right
# from heapq import heapify,heappush,heappop
# from fractions import gcd
from math import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
a,b,c,d=n1()
a1=b//c
a2=(a-1)//c
b1=b//d
b2=(a-1)//d
l=lcm(c,d)
c1=b//l
c2=(a-1)//l
ans=a1-a2+b1-b2-c1+c2
print(b-a+1-ans)

Fixed submission:

def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def s4(n): return [[x for x in s] for s in s2(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
def t3(n):return [tuple(int(x) for x in input().split()) for _ in range(n)]
def p0(b,yes="Yes",no="No"): print(yes if b else no)
# from sys import setrecursionlimit
# setrecursionlimit(1000000)
# from collections import Counter,deque,defaultdict
# import itertools
# import math
# import networkx
# from bisect import bisect_left,bisect_right
# from heapq import heapify,heappush,heappop
from fractions import gcd
# from math import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
a,b,c,d=n1()
a1=b//c
a2=(a-1)//c
b1=b//d
b2=(a-1)//d
l=lcm(c,d)
c1=b//l
c2=(a-1)//l
ans=a1-a2+b1-b2-c1+c2
print(b-a+1-ans)