Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
from collections import Counter

n = int(input())
a = [int(x) for x in input().split()]
d = deque(a)
e = deque([])
# print(d)
for i in range(n):
    ans = 0
    a = d.popleft()
    c = Counter(d)
    # print(c)
    for j in c.values():
        # print(j)
        ans += (j-1)*j//2
    # print(ans, d)
    e.append(ans)
    d.append(a)
    
for k in e:
    print(k)

Fixed submission:
from collections import Counter

n = int(input())
a = [int(x) for x in input().split()]
s = 0
c = Counter(a)
# print(c)
for i in c.values():
    s += i*(i-1)// 2
    
# print(s)
for j in range(n):
    t = c[a[j]]
    print(s-t+1)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
A = list(map(int, input().split()))
for x in range(N):
  ans = 0
  b = A.pop(x)
  #print(A)
  c = collections.Counter(A)
  #print(c)
  v = [k for j,k in c.items()]
  #print(v)
  for i in v:
    ans += i*(i-1)//2
  print(ans)
  A.insert(x,b)

Fixed submission:
from collections import Counter

n = int(input())
a = [int(x) for x in input().split()]
s = 0
c = Counter(a)
# print(c)
for i in c.values():
    s += i*(i-1)// 2
    
# print(s)
for j in range(n):
    t = c[a[j]]
    print(s-t+1)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
A = list(map(int, input().split()))
for x in range(N):
  ans = 0
  b = A.pop(x)
  c = collections.Counter(A)
  v = [k for j,k in c.items()]
  for i in v:
    ans += int(i*(i-1)/2)
  print(ans)
  A.insert(x,b)

Fixed submission:
from collections import Counter

n = int(input())
a = [int(x) for x in input().split()]
s = 0
c = Counter(a)
# print(c)
for i in c.values():
    s += i*(i-1)// 2
    
# print(s)
for j in range(n):
    t = c[a[j]]
    print(s-t+1)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
A = list(map(int, input().split()))
for x in range(N):
  ans = 0
  b = A.pop(x)
  #print(A)
  c = collections.Counter(A)
  #print(c)
  v = [k for j,k in c.items()]
  #print(v)
  for i in v:
    ans += int(i*(i-1)/2)
  print(ans)
  A.insert(x,b)

Fixed submission:
from collections import Counter

n = int(input())
a = [int(x) for x in input().split()]
s = 0
c = Counter(a)
# print(c)
for i in c.values():
    s += i*(i-1)// 2
    
# print(s)
for j in range(n):
    t = c[a[j]]
    print(s-t+1)
Buggy python submission (verdict: Runtime Error):
s = [str(x) for x in input().split(',')]
k = int(input())
print(s[k-1])

Fixed submission:
s = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(s[k-1])
Buggy python submission (verdict: Runtime Error):
n = int(input())
sum = 0
m = n
while n > 0:
    n = int(n / 10)
    # print(n)
    sum = sum + (n % 10)

    
if m % sum == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
n = int(input())
sum = 0
m = n
while n > 0:
    sum = sum + (n % 10)
    n = int(n / 10)
    # print(n)
    # print(sum)

    
if m % sum == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
def main():
    mod = 10**9+7
    #n,a = get_input()
    n = int(input())
    a = [int(x) for x in input().split()]
    aa = [a**2 % mod for x in a]
    ans = 0
    asum = sum(a) 
    p = asum ** 2 % mod
    q = sum(aa) % mod
    ans = (p - q) % mod
    if ans < 0:
      ans += mod
    if ans % 2 == 1:
      ans += mod
    ans = ans // 2
    print(ans)
    
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    mod = 10**9+7
    #n,a = get_input()
    n = int(input())
    a = [int(x) for x in input().split()]
    ans = 0
    asum = sum(a) 
    for i in range(n):
        asum = asum - a[i]
        ans = ( ans + ((a[i] * asum) % mod)) % mod
    
    print(ans)
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
N,M = (int(x) for x in input.split())

hw = [int(x) for x in input().split()]

hwsum = 0

for n in range(len(hw)-1):
  hwsum += hw[n]

if hwsum<=N:
  print(N-hwsum)
else:
  print(-1)


Fixed submission:
N,M = (int(x) for x in input().split())

hw = [int(x) for x in input().split()]

hwsum = 0

for n in range(len(hw)):
  hwsum += hw[n]

if hwsum<=N:
  print(N-hwsum)
else:
  print(-1)

Buggy python submission (verdict: Runtime Error):
N,M = (int(x) for x in input.split())

hw = [int(x) for x in input().split()]

hwsum = 0

for n in range(len(hw)-1):
  hwsum += hw[n]

if hwsum<=N:
  print(N-hwsum)
else:
  print(-1)

Fixed submission:
N,M = (int(x) for x in input().split())

hw = [int(x) for x in input().split()]

hwsum = 0

for n in range(len(hw)):
  hwsum += hw[n]

if hwsum<=N:
  print(N-hwsum)
else:
  print(-1)
Buggy python submission (verdict: Runtime Error):
def main():
    k = int(input())
    if (k%2==0 or k%5==0):
        print("-1")
        return

    #7(10**i-1)が9Kで割り切れるような最小の整数iを求める。

    if k%7==0:
        L=9*k/7
    else:
        L=9*k
    i=1
    for n in range(1,L+1):
        i=(10*i)%L
        if i==1:
            print(n)
            return
    print("-1")
    return

main()

Fixed submission:
def main():
    k = int(input())
    if (k%2==0 or k%5==0):
        print("-1")
        return

    #7(10**i-1)が9Kで割り切れるような最小の整数iを求める。

    if k%7==0:
        L=9*k//7
    else:
        L=9*k
    i=1
    for n in range(1,L+1):
        i=(10*i)%L
        if i==1:
            print(n)
            return
    print("-1")
    return

main()

Buggy python submission (verdict: Runtime Error):
def main():
    k = int(input())
    if (k%2==0 or k%5==0):
        print("-1")
        return

    #7(10**i-1)が9Kで割り切れるような最小の整数iを求める。

    if k%7==0:
        L=9*k/7
    else:
        L=9*k
    i=1
    for n in range(1,L+1):
        i=(10*i)%L
        if i==1:
            print(n)
            return
    print("-1")

main()

Fixed submission:
def main():
    k = int(input())
    if (k%2==0 or k%5==0):
        print("-1")
        return

    #7(10**i-1)が9Kで割り切れるような最小の整数iを求める。

    if k%7==0:
        L=9*k//7
    else:
        L=9*k
    i=1
    for n in range(1,L+1):
        i=(10*i)%L
        if i==1:
            print(n)
            return
    print("-1")
    return

main()
Buggy python submission (verdict: Runtime Error):
                                                                                                                                                                                                                               a,b,c,d = map(int,input().split())
ah=a
ch=c
while(1):
    ah-=d
    ch-=b
    if(ch<=0):
        print("Yes")
        break
    elif(ah<=0):
        print("No")
        break




Fixed submission:
a,b,c,d = map(int,input().split())
ah=a
ch=c
while(1):
    ah-=d
    ch-=b
    if(ch<=0):
        print("Yes")
        break
    elif(ah<=0):
        print("No")
        break

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

Takahashi=a/d
Aoki=c/b-1                                                                                                                                                                                                                           if Takahashi>=Aoki:
    print("Yes")
else:
    print("No")

Fixed submission:
a,b,c,d = map(int,input().split())
ah=a
ch=c
while(1):
    ah-=d
    ch-=b
    if(ch<=0):
        print("Yes")
        break
    elif(ah<=0):
        print("No")
        break
Buggy python submission (verdict: Runtime Error):
import numpy as np
from scipy.sparse.csgraph import connected_components
N,M = map(int, input().split())
A = [-1 for i in range(M)]
B = [-1 for i in range(M)]

mat = np.zeros((N,N),dtype=np.uint8)

for i in range(M):
    A[i],B[i] = map(int, input().split())

for i in range(M):
    mat[A[i]-1][B[i]-1] = 1
    mat[B[i]-1][A[i]-1] = 1


n, labels = connected_components(mat)
print(n-1)

Fixed submission:

N,M = map(int, input().split())
A = [-1 for i in range(M)]
B = [-1 for i in range(M)]
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

for i in range(M):
    A[i],B[i] = map(int, input().split())

uf = UnionFind(N)

for i in range(M):
    uf.union(A[i]-1,B[i]-1)

print(uf.group_count()-1)
Buggy python submission (verdict: Runtime Error):
X,Y,A,B,C = map(int,input().split())

p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
result = 0
Z = 0
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

pindex = 0
qindex = 0
rindex = 0
while (X>0 or Y>0) and X+Y-Z>0:
        
    
    if (X>0 or Y>0) and X+Y-Z>0:
        if p[pindex]>=q[qindex] and p[pindex]>=r[rindex] and X > 0:
            result += p[pindex]
            pindex += 1
            X-=1
        elif q[qindex]>=p[pindex] and q[qindex]>=r[rindex] and Y > 0:
            result += q[qindex]
            
            qindex +=1
            Y-=1
        elif r[rindex]>=q[qindex] and r[rindex]>=p[pindex]:
        
            result += r[rindex]
            rindex += 1
            Z+=1

        elif X > 0:
            result += p[pindex]
            pindex += 1
            X-=1
        elif Y > 0:
            result += q[qindex]
            
            qindex +=1
            Y-=1
       
print(result)


Fixed submission:
X,Y,A,B,C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

p = p[0:X]
q = q[0:Y]

p.extend(q)
p.extend(r)

p.sort(reverse=True)
s=0
for i in range(X+Y):
    s+=p[i]
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
X,Y,A,B,C = map(int,input().split())

p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
result = 0
Z = 0
while (X>0 or Y>0) and X+Y-Z>0:
        
    p.sort(reverse=True)
    q.sort(reverse=True)
    r.sort(reverse=True)
    if (X>0 or Y>0) and X+Y-Z>0:
        if p[0]>=q[0] and p[0]>=r[0] and X > 0:
            result += p[0]
            
            p[0] = 0
            X-=1
        elif q[0]>=p[0] and q[0]>=r[0] and Y > 0:
            result += q[0]
            
            q[0] = 0
            Y-=1
        elif r[0]>=q[0] and r[0]>=p[0]:
        
            result += r[0]
            r[0] = 0
            Z+=1

        elif X > 0:
            result += p[0]
            
            p[0] = 0
            X-=1
        elif Y > 0:
            result += q[0]
            
            q[0] = 0
            Y-=1
       
print(result)


Fixed submission:
X,Y,A,B,C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

p = p[0:X]
q = q[0:Y]

p.extend(q)
p.extend(r)

p.sort(reverse=True)
s=0
for i in range(X+Y):
    s+=p[i]
print(s)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int, input().split())
if c-a-b<0:
  print("No")
else:
  if 4ab<(c-a-b)**2:
    print("Yes")
  else:
    print("No")
    
    

Fixed submission:
a,b,c=map(int, input().split())
if c-a-b<0:
  print("No")
else:
  if 4*a*b<(c-a-b)**2:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = ["" for i in range(N)]
dict1 = {"key":0}
names =[]
for i in range(N):
    S[i] = input()

for i in range(N):
    if not (S[i] in names):
        names.append(S[i])
        dict1.update({S[i]:1})
    else:
        dict1[S[i]] +=1
max = 0
for i in range(len(names)):
    if max < dict1[names[i]]:
        max = dict1[names[i]]

winners = []

for i in range(len(names)):
    if dict1[names[i]] == max:
        winners.append(names[i])

winners.sort()
for i in range(len(winners)):
    print(winners[i])


Fixed submission:
N = int(input())
S = ["" for i in range(N)]
dict1 = {}
names =[]
for i in range(N):
    S[i] = input()

for i in range(N):
    if not (S[i] in dict1.keys()):
        names.append(S[i])
        dict1.update({S[i]:1})
    else:
        dict1[S[i]] +=1
maxv = 0
for i in range(len(names)):
    if maxv < dict1[names[i]]:
        maxv = dict1[names[i]]

winners = []

for i in range(len(names)):
    if dict1[names[i]] == maxv:
        winners.append(names[i])

winners.sort()
for i in range(len(winners)):
    print(winners[i])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = ["" for i in range(N)]
dict1 = {"key":0}
names =[]
for i in range(N):
    S[i] = input()

for i in range(N):
    if not (S[i] in names):
        names.append(S[i])
        dict1.update({S[i]:1})
    else:
        dict1[S[i]] +=1
max = 0
for name in names:
    if max < dict1[name]:
        max = dict1[name]

winners = []

for name in names:
    if dict1[name] == max:
        winners.append(name)

winners.sort()
for i in range(len(winners)):
    print(winners[i])


Fixed submission:
N = int(input())
S = ["" for i in range(N)]
dict1 = {}
names =[]
for i in range(N):
    S[i] = input()

for i in range(N):
    if not (S[i] in dict1.keys()):
        names.append(S[i])
        dict1.update({S[i]:1})
    else:
        dict1[S[i]] +=1
maxv = 0
for i in range(len(names)):
    if maxv < dict1[names[i]]:
        maxv = dict1[names[i]]

winners = []

for i in range(len(names)):
    if dict1[names[i]] == maxv:
        winners.append(names[i])

winners.sort()
for i in range(len(winners)):
    print(winners[i])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = input().split(" ")
b= []

flag = True
for i in range(N):

    if a[i] in b:
        flag = False
        break
    b.append(a[i])


if flag:
    print("YES")

else:
    print("NO")

    
    

Fixed submission:
N = int(input())
a = list(map(int, input().split(" ")))
b=a
b.sort()

flag = True
s =0
e =N-1
for i in range(N-1):
    if b[i] == b[i+1]:
        flag = False
        break
        



if flag:
    print("YES")

else:
    print("NO")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = input().split(" ")
b= [0 for i in range(N)]

flag = True
for i in range(N):

    if a[i] in b:
        flag = False
        break
    b[i] =a[i]


if flag:
    print("YES")

else:
    print("NO")

    
    



    

Fixed submission:
N = int(input())
a = list(map(int, input().split(" ")))
b=a
b.sort()

flag = True
s =0
e =N-1
for i in range(N-1):
    if b[i] == b[i+1]:
        flag = False
        break
        



if flag:
    print("YES")

else:
    print("NO")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = input().split(" ")
b= []

flag = True
for i in range(N):

    if a[i] in b:
        flag = False
    b.append(a[i])


if flag:
    print("YES")

else:
    print("NO")


Fixed submission:
N = int(input())
a = list(map(int, input().split(" ")))
b=a
b.sort()

flag = True
s =0
e =N-1
for i in range(N-1):
    if b[i] == b[i+1]:
        flag = False
        break
        



if flag:
    print("YES")

else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
V = input().split()
N = int(V[0])
K = int(V[1])
Q = int(V[2])
A = [0 for i in range(Q)]
P = [K for i in range(N)]
for i in range(Q):
    A[i] = int(input())

for i in range(Q):
    P[A[i]+1] += 1

for i in range(N):
    if P[i] - Q <=0:
        print("No")
    if P[i] - Q > 0:
        print("Yes")

Fixed submission:
V = input().split()
N = int(V[0])
K = int(V[1])
Q = int(V[2])
A = [0 for i in range(Q)]
P = [K for i in range(N)]
for i in range(Q):
    A[i] = int(input())

for i in range(Q):
    P[A[i]-1] += 1

for i in range(N):
    if P[i] - Q <=0:
        print("No")
    if P[i] - Q > 0:
        print("Yes")

Buggy python submission (verdict: Runtime Error):
V = input().split()
N = int(V[0])
K = int(V[1])
Q = int(V[2])
A = [0 for i in range(Q)]
P = [K for i in range(N)]
for i in range(Q):
    A[i] = int(input())

for i in range(Q):
    P[A[i]] += 1

for i in range(N):
    if P[i] <= Q:
        print("No")
    if P[i] > Q:
        print("Yes")

Fixed submission:
V = input().split()
N = int(V[0])
K = int(V[1])
Q = int(V[2])
A = [0 for i in range(Q)]
P = [K for i in range(N)]
for i in range(Q):
    A[i] = int(input())

for i in range(Q):
    P[A[i]-1] += 1

for i in range(N):
    if P[i] - Q <=0:
        print("No")
    if P[i] - Q > 0:
        print("Yes")

Buggy python submission (verdict: Time Limit Exceeded):
V = input().split()
N = int(V[0])
K = int(V[1])
Q = int(V[2])
A = [0 for i in range(Q)]
P = [K for i in range(N)]
for i in range(Q):
    A[i] = int(input())

for i in range(Q):
    for j in range(N):
        if j+1 != A[i]:
            P[j] -= 1
            

for i in range(N):
    if P[i] <= 0:
        print("No")
    elif P[i] > 0:
        print("Yes")


Fixed submission:
V = input().split()
N = int(V[0])
K = int(V[1])
Q = int(V[2])
A = [0 for i in range(Q)]
P = [K for i in range(N)]
for i in range(Q):
    A[i] = int(input())

for i in range(Q):
    P[A[i]-1] += 1

for i in range(N):
    if P[i] - Q <=0:
        print("No")
    if P[i] - Q > 0:
        print("Yes")
Buggy python submission (verdict: Runtime Error):
/* ex4_1
  bonbonc */

#include<stdio.h>
int main(void){
	int tree, range;
	int assigned;//一人が割り当てられる木の本数の最大値

	scanf("%d %d",&tree,&range);
	assigned = 2*range+1; //自分のいる位置と左右にrange本

	if (tree%assigned==0){//木の本数がassignedで割り切れるとき
		printf("%d\n",tree/assigned);//木の本数をassignedで割った商を出力
	}else{
		printf("%d\n",tree/assigned +1);//木の本数をassignedで切り捨て除算し、1を加えて出力
	}

	
	return 0;
}

Fixed submission:
N,D=map(int,input().split())
assined = 2*D+1
if N%assined==0:
  print(N//assined)
else:
  print(N//assined+1)
Buggy python submission (verdict: Runtime Error):
N=int(input())
h=list(map(int,input().split()))
ans=0
flag = False
for hei in range(1,101):
  for i in range(N+1):
    if h[i] >= hei or i!=N:
      flag = True
    else:
      if flag:
        ans+=1
        flag = False
print(ans)


Fixed submission:
N=int(input())
h=list(map(int,input().split()))
h.append(0)
ans=0
flag = False
for hei in range(1,101):
  for i in range(N+1):
    if h[i] >= hei and i!=N:
      flag = True
    else:
      if flag:
        ans+=1
        flag = False
print(ans)

Buggy python submission (verdict: Runtime Error):
N=int(input())
h=list(map(int,input().split()))
ans=0
flag = False
for hei in range(1,101):
  for i in range(N+1):
    if h[i] >= hei and i!=N:
      flag = True
    else:
      if flag:
        ans+=1
        flag = False
print(ans)

Fixed submission:
N=int(input())
h=list(map(int,input().split()))
h.append(0)
ans=0
flag = False
for hei in range(1,101):
  for i in range(N+1):
    if h[i] >= hei and i!=N:
      flag = True
    else:
      if flag:
        ans+=1
        flag = False
print(ans)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(a+b+c)
if d<22:
    print("win")
else:
    print("bust")


Fixed submission:
x = input().split()
a, b, c =x
d = int(a)+int(b)+int(c)
if d<22:
    print("win")
else:
    print("bust")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

printed = False
if 0 in a:
    print(0)
    printed = True

ans = 1

for x in a:
    ans *= x
    if ans > 1e18:
        if not printed:
            print(-1)
        printed = True
    
if not printed:
    print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))

printed = False
if 0 in a:
    print(0)
    printed = True

ans = 1

for x in a:
    ans *= x
    if ans > 1e18:
        if not printed:
            print(-1)
            printed = True
        break    
    
if not printed:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

ans = 1
for x in a:
    ans *= x
    
if ans > 1e18:
    print(-1)
else:
    print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))

printed = False
if 0 in a:
    print(0)
    printed = True

ans = 1

for x in a:
    ans *= x
    if ans > 1e18:
        if not printed:
            print(-1)
            printed = True
        break    
    
if not printed:
    print(ans)
Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
    if b == 0:
        return a
    
    return gcd(b, a % b)

def lcm(a, b):
    return a * b // math.gcd(a, b)

N = int(input())
T = []

for i in range(N):
    t = int(input())
    T.append(t)
    
ans = 1
for i in range(N):
    ans = lcm(ans, T[i])
    
print(ans)

Fixed submission:
def gcd(a, b):
    if b == 0:
        return a
    
    return gcd(b, a % b)

def lcm(a, b):
    return a * b // gcd(a, b)

N = int(input())
T = []

for i in range(N):
    t = int(input())
    T.append(t)
    
ans = 1
for i in range(N):
    ans = lcm(ans, T[i])
    
print(ans)

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

def lcm(a, b):
    return a * b // math.gcd(a, b)

N = int(input())
T = []

for i in range(N):
    t = int(input())
    T.append(t)
    
ans = 1
for i in range(N):
    ans = lcm(ans, T[i])
    
print(ans)

Fixed submission:
def gcd(a, b):
    if b == 0:
        return a
    
    return gcd(b, a % b)

def lcm(a, b):
    return a * b // gcd(a, b)

N = int(input())
T = []

for i in range(N):
    t = int(input())
    T.append(t)
    
ans = 1
for i in range(N):
    ans = lcm(ans, T[i])
    
print(ans)
Buggy python submission (verdict: Runtime Error):
A = input()
B = input()

A = int(A)
B = int(B)

if A > B :
    X = A
    A = A - 1

else :
    X = B
    B = B - 1

if A > B :
    X = X + A
else :
    X = X + B

print(X)


Fixed submission:
A,B = input().split(' ')

A = int(A)
B = int(B)

if A > B :
    X = A
    A = A - 1

else :
    X = B
    B = B - 1

if A > B :
    X = X + A
else :
    X = X + B

print(X)

Buggy python submission (verdict: Runtime Error):
A = input()
B = input()

A = int(A)
B = int(B)

if A > B :
    X = A
    A = A - 1

else :
    X = B
    B = B - 1

if A > B :
    X = X + A
else :
    X = X + B

print(X)

Fixed submission:
A,B = input().split(' ')

A = int(A)
B = int(B)

if A > B :
    X = A
    A = A - 1

else :
    X = B
    B = B - 1

if A > B :
    X = X + A
else :
    X = X + B

print(X)

Buggy python submission (verdict: Runtime Error):
A = input()
B = input()

if A < B :
    X = A
    A = A - 1
else :
    X = B
    B = B - 1
if A > B :
    X = X + A
else :
    X = X + B

print(X)

Fixed submission:
A,B = input().split(' ')

A = int(A)
B = int(B)

if A > B :
    X = A
    A = A - 1

else :
    X = B
    B = B - 1

if A > B :
    X = X + A
else :
    X = X + B

print(X)