Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=1
b=1
count=0
while a<N:
  while a*b<N:
    count=count+1
    b=b+1
  else:
    b=1
    a=a+1
else:
  print(count)

Fixed submission:
N=int(input())
a=1
count=0
while a<N:
  count=count+(N-1)//a
  a=a+1
else:
  print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
total=0

def divisor_count(n):
    count=0
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            count=count+1
            if i != n // i:
                count=count+1
    return count

for i in range(1,N):
  total=total+divisor_count(i)
print (total)

Fixed submission:
N=int(input())
a=1
count=0
while a<N:
  count=count+(N-1)//a
  a=a+1
else:
  print(count)

Buggy python submission (verdict: Runtime Error):
N=int(input())
total=0
import sympy
for i in range(1,N):
  total=total+sympy.divisor_count(i)
print (total)

Fixed submission:
N=int(input())
a=1
count=0
while a<N:
  count=count+(N-1)//a
  a=a+1
else:
  print(count)

Buggy python submission (verdict: Runtime Error):
import sympy
N=int(input())
total=0
for i in range(1,N):
  total=total+sympy.divisor_count(i)
print (total)

Fixed submission:
N=int(input())
a=1
count=0
while a<N:
  count=count+(N-1)//a
  a=a+1
else:
  print(count)

Buggy python submission (verdict: Runtime Error):
import sympy
N=int(input())
count=0
for i in range(1,N):
  count=count+sympy.divisor_count(i)
print (count)

Fixed submission:
N=int(input())
a=1
count=0
while a<N:
  count=count+(N-1)//a
  a=a+1
else:
  print(count)

Buggy python submission (verdict: Runtime Error):
import sympy
N=int(input())
count=0
for i in range(1,N)
  count=count+sympy.divisor_count(i)
print (count)

Fixed submission:
N=int(input())
a=1
count=0
while a<N:
  count=count+(N-1)//a
  a=a+1
else:
  print(count)
Buggy python submission (verdict: Runtime Error):
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U==S:
  print(A-1,B)
else
  print(A,B-1)

Fixed submission:
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U==S:
  print(A-1,B)
else:
  print(A,B-1)

Buggy python submission (verdict: Runtime Error):
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U==S:
  print(A-1,B)
else
  print(A,B-1)

Fixed submission:
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U==S:
  print(A-1,B)
else:
  print(A,B-1)

Buggy python submission (verdict: Runtime Error):
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U=S:
  print(A-1,B)
else
  print(A,B-1)

Fixed submission:
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U==S:
  print(A-1,B)
else:
  print(A,B-1)

Buggy python submission (verdict: Runtime Error):
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U=S:
  print(A-1,B)
else
  print(B,A-1)

Fixed submission:
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U==S:
  print(A-1,B)
else:
  print(A,B-1)
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
H=list(map(int,input().split()))
count=0
for h in H:
  if h>=K:
  count=count+1
print(count)

Fixed submission:
N, K = map(int, input().split())
H = list(map(int, input().split()))
count = 0
for h in H:
    if h >= K:
        count = count+1
print(count)

Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
H=list[map(int,input().split())]
count=0
for h in H:
  if h>=K:
  count=count+1
print(count)

Fixed submission:
N, K = map(int, input().split())
H = list(map(int, input().split()))
count = 0
for h in H:
    if h >= K:
        count = count+1
print(count)

Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
H=list[map(int,input().split())]
count=0
for h in H:
  if h>K:
  count+=1
print(count)

Fixed submission:
N, K = map(int, input().split())
H = list(map(int, input().split()))
count = 0
for h in H:
    if h >= K:
        count = count+1
print(count)
Buggy python submission (verdict: Runtime Error):
X,Y=map(int,input().split())
print(X+y/2)

Fixed submission:
X,Y=map(int,input().split())
print(X+Y//2)
Buggy python submission (verdict: Runtime Error):
N=input()
a=sum(map(int,str(N)))
if N%a==0:
  print("Yes")
else:
  print("No")

Fixed submission:
N=int(input())
n=sum(map(int,str(N)))
print("Yes" if N%n==0 else "No")

Buggy python submission (verdict: Runtime Error):
N=input()
a=sum(map(int,str(N)))
if N%a==0:
  print("Yes")
else:
  print("No")

Fixed submission:
N=int(input())
n=sum(map(int,str(N)))
print("Yes" if N%n==0 else "No")

Buggy python submission (verdict: Runtime Error):
N=input()
n=sum(map(int,str(N)))
if N%n==0:
  print("Yes")
else:
  print("No")

Fixed submission:
N=int(input())
n=sum(map(int,str(N)))
print("Yes" if N%n==0 else "No")

Buggy python submission (verdict: Runtime Error):
N=input()
n=sum(map(int,N))
if N%n==0:
  print("Yes")
else :
  print("No")

Fixed submission:
N=int(input())
n=sum(map(int,str(N)))
print("Yes" if N%n==0 else "No")
Buggy python submission (verdict: Runtime Error):
n,m =map(int,imput().split())
print((n-1)*(m-1))

Fixed submission:
n,m =map(int,input().split())
print((n-1)*(m-1))

Buggy python submission (verdict: Runtime Error):
n,m =map(int,imput().split())
print((n-1)*(m-1))

Fixed submission:
n,m =map(int,input().split())
print((n-1)*(m-1))

Buggy python submission (verdict: Runtime Error):
n,m =map(int(),imput().split())
print((n-1)*(m-1))

Fixed submission:
n,m =map(int,input().split())
print((n-1)*(m-1))

Buggy python submission (verdict: Runtime Error):
n,m =map(int(),imput().split)
print((n-1)*(m-1))

Fixed submission:
n,m =map(int,input().split())
print((n-1)*(m-1))
Buggy python submission (verdict: Runtime Error):
S=input
print("yes" if len(S)==len(set(S)) else "no")

Fixed submission:
S=input()
print("yes" if len(S)==len(set(S)) else "no")

Buggy python submission (verdict: Runtime Error):
S=input
print("yes" if len(S)=len(set(S)) else "no")

Fixed submission:
S=input()
print("yes" if len(S)==len(set(S)) else "no")
Buggy python submission (verdict: Runtime Error):
import math
N=int(input())
print(math.factrial(N)%(10**9+7))

Fixed submission:
import math
N=int(input())
print(math.factorial(N) % (10**9+7))
Buggy python submission (verdict: Runtime Error):
x = input()
print(1 - x)

Fixed submission:
x = int(input())
print(1 - x)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int, input().split()))
ans = 1
for e in li:
    ans *= e

if ans > 1e18:
    print(-1)
else:
    print(ans) 

Fixed submission:
n = int(input())
li = list(map(int, input().split()))
if 0 in li:
    print(0)
    exit()
ans = 1
for e in li:
    ans *= e
    if ans > 10**18:
        print(-1)
        exit()

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, d = map(int, input().split())
ans = float('inf')*-1
for i in range(a, b+1):
  for j in range(c, d+1):
    ans = max(ans, i*j)

print(ans)

Fixed submission:
a, b, c, d = map(int, input().split())
ans = float('inf')*-1
ans = max(ans, a*c)
ans = max(ans, a*d)
ans = max(ans, b*c)
ans = max(ans, b*d)
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np

n, k = map(int, input().split())
a = tuple(map(int, input().split()))
i = 1
prev = np.prod(a[:k])

while i+k <= n:
  tmp = np.prod(a[i:i+k])
  if tmp > prev:
    print('Yes')
  else:
    print('No')
  prev = tmp
  i += 1


Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
ans = [0]*(n-k)
for i in range(k, n):
  ans[i-k] = (a[i]>a[i-k])
for i in range(0, n-k):
  print('Yes' if ans[i] else 'No')

Buggy python submission (verdict: Time Limit Exceeded):
def calc(l, k):
  res = 1
  for i in range(k):
    res = res*l[i]
  return res

n, k = map(int, input().split())
a = tuple(map(int, input().split()))
i = 1
prev = calc(a[:k], k)

while i+k <= n:
  tmp = calc(a[i:i+k], k)
  if tmp > prev:
    print('Yes')
  else:
    print('No')
  prev = tmp
  i += 1


Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
ans = [0]*(n-k)
for i in range(k, n):
  ans[i-k] = (a[i]>a[i-k])
for i in range(0, n-k):
  print('Yes' if ans[i] else 'No')

Buggy python submission (verdict: Time Limit Exceeded):
def calc(l, k):
  res = 1
  for i in range(k):
    res = res*l[i]
  return res

n, k = map(int, input().split())
a = list(map(int, input().split()))
l = []
i = 0
while i+k <= n:
  tmp = a[i:i+k]
  l.append(calc(tmp, k))
  i += 1

for i in range(1,len(l)):
  if l[i] > l[i-1]:
    print('Yes')
  else:
    print('No')

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
ans = [0]*(n-k)
for i in range(k, n):
  ans[i-k] = (a[i]>a[i-k])
for i in range(0, n-k):
  print('Yes' if ans[i] else 'No')
Buggy python submission (verdict: Runtime Error):
x, y = list(map(int, input().split()))

flg = true
for i in range(x):
  if 2*i + 4*(x-i) == y:
    print('Yes'):
    flg = False
      break
      
if flg:print('No')

Fixed submission:
x, y = list(map(int, input().split()))

flg = True

for i in range(x+1):
  if i*2 + (x-i)*4 == y:
    print('Yes')
    flg = False
    break
    
if flg:print('No')
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

s, c = [], []
for _ in range(m):
  s_, c_ = map(int, input().split())
  s.append(s_)
  c.append(c_)

flg = False
for i in range(10**n):
  for j in range(m):
    if str(i)[s[j]-1] != str(c[j]):
      break
  else:
    print(i)
    flg = True
    break
if not flg:
  print(-1)

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

s, c = [], []
for _ in range(m):
  s_, c_ = map(int, input().split())
  s.append(s_)
  c.append(c_)

for i in range(10**n):
  ans = str(i)
  if len(ans) == n and all([ans[s[j]-1] == str(c[j]) for j in range(m)]):
    print(ans)
    exit()

print(-1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

flg = True
for i in range(n):
  if a[i]%2 == 0:
    cnt += 1
    if a[i]%3 == 0 or a[i]%5 == 0:
      pass
    else:
      flg = False
if flg: print("APPROVED")
else: print("DENIED")

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

flg = True
for i in range(n):
  if a[i]%2 == 0:
    if a[i]%3 == 0 or a[i]%5 == 0:
      pass
    else:
      flg = False
if flg: print("APPROVED")
else: print("DENIED")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
ans = 0
for i in range(1000):
  a = [str(i//100), str((i//10)%10), str(i%10)]
  cnt = 0
  for j in range(n):
    if cnt <= 2 and a[cnt] == s[j]: cnt+=1
  if cnt == 3: ans += 1
print(ans)

Fixed submission:
n = int(input())
s = input()
ans = 0
for i in range(1000):
  a = [i//100, (i//10)%10, i%10]
  cnt = 0
  for j in range(n):
    if cnt <= 2 and a[cnt] == int(s[j]): cnt+=1
  if cnt == 3: ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
ans = 0
for i in range(1000):
  a = [i//100, (i//10)%10, i%10]
  cnt = 0
  for j in range(n):
    if cnt <= 2 and a[cnt] == int(s[j]): cnt+=1
  if cnt == 3: ans += 1
print(ans)

Fixed submission:
n = int(input())
s = input()
ans = 0
for i in range(1000):
  a = [i//100, (i//10)%10, i%10]
  cnt = 0
  for j in range(n):
    if cnt <= 2 and a[cnt] == int(s[j]): cnt+=1
  if cnt == 3: ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
h = list(map(int, input().split()))
inf = float('inf')
dp = [inf] * N
dp[0] = 0

for i in range(N-1):
  for j in range(1, K+1):
    if i+j < N:
      dp[i+j] = min(dp[i]+abs(h[i]-h[i+j]), dp[i+j])

print(dp[N-1])

Fixed submission:
N, K = map(int, input().split())
h = list(map(int, input().split()))
inf = float('inf')
dp = [inf] * N
dp[0] = 0

for i in range(N-1):
  for j in range(1, K+1):
    if i+j < N:
      dp[i+j] = min(dp[i]+abs(h[i]-h[i+j]), dp[i+j])

print(dp[N-1])
Buggy python submission (verdict: Runtime Error):
N, W = map(int, input().split())
w = []
v = []
for _ in range(N):
  wi, vi = map(int, input().split())
  w.append(wi)
  v.append(vi)
dp = [[0]*(W+1) for _ in range(N+1)]

for i in range(N):
  for sum_w in range(W+1):
    if sum_w-w[i] >= 0:
      dp[i+1][sum_w] = max(dp[i][sum_w], dp[i][sum_w-w[i]]+v[i])
    else:
      dp[i+1][sum_w] = dp[i][sum_w]

print(dp[N][W])

Fixed submission:
N, W = map(int, input().split())
w = []
v = []
for _ in range(N):
  wi, vi = map(int, input().split())
  w.append(wi)
  v.append(vi)
dp = [[float('inf')]*(max(v)*N+1) for _ in range(N+1)]
dp[0][0] = 0

for i in range(N):
  for sum_v in range(max(v)*N+1):
    if v[i] - sum_v > 0:
      dp[i+1][sum_v] = dp[i][sum_v]
    else:
      dp[i+1][sum_v] = min(dp[i][sum_v], dp[i][sum_v - v[i]] + w[i])

ans = 0
for sum_v in range(max(v)*N+1):
  if dp[N][sum_v] <= W:
    ans = sum_v
print(ans)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = list(map(int, input().split()))

ans = float('inf')
for bit in range(1<<(n-1)):
  cand = [0]*(n-1)
  for i in range(n-1):
    if bit & 1<<i: cand[i] = 1
  if cand.count(1) != k-1: continue
  cost = 0
  mx = a[0]
  for i in range(1, n):
    if cand[i-1]:
      if a[i] <= mx:
        cost += mx-a[i]+1
        mx += 1
    mx = max(mx, a[j])
  ans = min(ans, cost)
print(ans)

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

ans = float('inf')
for bit in range(1<<(n-1)):
  cand = [0]*(n-1)
  for i in range(n-1):
    if bit & 1<<i: cand[i] = 1
  if cand.count(1) != k-1: continue
  cost = 0
  mx = a[0]
  for i in range(1, n):
    if cand[i-1]:
      if a[i] <= mx:
        cost += mx-a[i]+1
        mx += 1
    mx = max(mx, a[i])
  ans = min(ans, cost)
print(ans)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = list(map(int, input().split()))

ans = float('inf')
for bit in range(1<<(n-1)):
  cost = 0
  cand = [0]*(n-1)
  for i in range(n-1):
    if bit & 1<<i: cand[i] = 1
  if cand.count(1) != k-1: continue
  mx = a[0]
  for i in range(1, n):
    if cand[i-1]:
      if a[i] <= mx:
        cost += prev-a[i]+1
        ms += 1
    mx = max(mx, a[j])
  ans = min(ans, cost)
print(ans)

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

ans = float('inf')
for bit in range(1<<(n-1)):
  cand = [0]*(n-1)
  for i in range(n-1):
    if bit & 1<<i: cand[i] = 1
  if cand.count(1) != k-1: continue
  cost = 0
  mx = a[0]
  for i in range(1, n):
    if cand[i-1]:
      if a[i] <= mx:
        cost += mx-a[i]+1
        mx += 1
    mx = max(mx, a[i])
  ans = min(ans, cost)
print(ans)
Buggy python submission (verdict: Runtime Error):
def replace(s, r, c):
    for row in range(r - 1, r + 2):
        for column in range(c - 1, c + 2):
            value = s[row][column]
            if value != "#":
                value = value + 1 if value != "." else 1
                s[row][column] = value

h, w = map(int, input().split(" "))
s = []
for _ in range(h):
    row = input()
    tmp = []
    for i in range(w):
        tmp.append(row[i])
    s.append(tmp)

for row in range(h):
    for column in range(w):
        if s[row][column] == "#":
            replace(s, row, column)

for row in range(h):
    res = ""
    for column in range(w):
        res += str(s[row][column])
    print(res)


Fixed submission:
def replace(s, r, c):
    for row in range(r - 1, r + 2):
        for column in range(c - 1, c + 2):
            if row < 0 or len(s) <= row:
                continue

            if column < 0 or len(s[row]) <= column:
                continue

            value = s[row][column]
            if value != "#":
                value += 1
                s[row][column] = value


h, w = map(int, input().split(" "))
s = []
for _ in range(h):
    row = input()
    tmp = []
    for i in range(w):
        tmp.append(row[i] if row[i] == "#" else 0)
    s.append(tmp)

for row in range(h):
    for column in range(w):
        if s[row][column] == "#":
            replace(s, row, column)

for row in range(h):
    res = ""
    for column in range(w):
        res += str(s[row][column])
    print(res)

Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split(" "))
s = []
for _ in range(h):
    row = input()
    tmp = []
    for i in range(w):
        tmp.append(row[i])
    s.append(tmp)

for row in range(h):
    for column in range(w):
        if s[row][column] == "#":
            replace(s, row, column)

for row in range(h):
    res = ""
    for column in range(w):
        res += str(s[row][column])
    print(res)


Fixed submission:
def replace(s, r, c):
    for row in range(r - 1, r + 2):
        for column in range(c - 1, c + 2):
            if row < 0 or len(s) <= row:
                continue

            if column < 0 or len(s[row]) <= column:
                continue

            value = s[row][column]
            if value != "#":
                value += 1
                s[row][column] = value


h, w = map(int, input().split(" "))
s = []
for _ in range(h):
    row = input()
    tmp = []
    for i in range(w):
        tmp.append(row[i] if row[i] == "#" else 0)
    s.append(tmp)

for row in range(h):
    for column in range(w):
        if s[row][column] == "#":
            replace(s, row, column)

for row in range(h):
    res = ""
    for column in range(w):
        res += str(s[row][column])
    print(res)
Buggy python submission (verdict: Runtime Error):
import math

a, b, c = map(int, input().split())
res = False
n = abs(b * c // (b - a))
for i in range(n -1, n + 1 + 1):
    if a * i % b == c:
        res = True

print("YES" if res == True else "NO")

Fixed submission:
a, b, c = map(int, input().split())
res = False
for i in range(a, a * b + 1, a):
    if i % b == c:
        res = True

print("YES" if res == True else "NO")

Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
res = False
n = abs(b * c // (b - a))
for i in range(n -1, n + 1 + 1):
    if a * i % b == c:
        res = True

print("YES" if res == True else "NO")

Fixed submission:
a, b, c = map(int, input().split())
res = False
for i in range(a, a * b + 1, a):
    if i % b == c:
        res = True

print("YES" if res == True else "NO")
Buggy python submission (verdict: Time Limit Exceeded):
#codinng:utf-8

N = int(input())
count = 0

while N > 0:
    count += (N % 10000000) % 9
    N = N // 10000000

if count % 9 == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
#codinng:utf-8

N = int(input())
count = 0

while N > 0:
    count += (N % (10 ** 100)) % 9
    N = N // (10 ** 100)

if count % 9 == 0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
#codinng:utf-8

N = int(input())
count = 0

while N > 0:
    count += (N % 100) % 9
    N = N // 100

if count % 9 == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
#codinng:utf-8

N = int(input())
count = 0

while N > 0:
    count += (N % (10 ** 100)) % 9
    N = N // (10 ** 100)

if count % 9 == 0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
#codinng:utf-8

N = int(input())
count = 0

while N > 0:
    count += N % 10
    N = N // 10

if count % 9 == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
#codinng:utf-8

N = int(input())
count = 0

while N > 0:
    count += (N % (10 ** 100)) % 9
    N = N // (10 ** 100)

if count % 9 == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
#coding:utf-8
import math

N,K = map(int,input().split())

A = [int(y) for y in input().split()]

Ma = max(A)
mi = 0

ans = Ma

def execute(f):
    count = 0
    for i in A:
        count += math.ceil(i / f) - 1
    if count <= K:
        return True
    else:
        return False

while True:
    median = (Ma + mi) // 2
    
    bobo = execute(median)
    
    if bobo:
        ans = min(ans,median)
        Ma = median
    else:
        mi = median + 1
    
    if Ma == mi:
        break

print("{}".format(ans))

Fixed submission:
#coding:utf-8
import math

N,K = map(int,input().split())

A = [int(y) for y in input().split()]

Ma = max(A)
mi = 1

ans = Ma

def execute(f):
    count = 0
    for i in A:
        count += math.ceil(i / f) - 1
    if count <= K:
        return True
    else:
        return False

while True:
    median = (Ma + mi) // 2
    
    bobo = execute(median)
    
    if bobo:
        ans = min(ans,median)
        Ma = median
    else:
        mi = median + 1
    
    if Ma == mi:
        break

print("{}".format(ans))

Buggy python submission (verdict: Runtime Error):
#coding:utf-8
import math

N,K = map(int,input().split())

A = [int(y) for y in input().split()]

Ma = max(A)
mi = 0

ans = Ma

def execute(f):
    count = 0
    for i in A:
        count += (i - 0.01) // f
    if count <= K:
        return True
    else:
        return False

while True:
    median = (Ma + mi) // 2
    
    bobo = execute(median)
    
    if bobo:
        ans = min(ans,median)
        Ma = median
    else:
        mi = median + 1
    
    if Ma == mi:
        break

print("{}".format(ans))

Fixed submission:
#coding:utf-8
import math

N,K = map(int,input().split())

A = [int(y) for y in input().split()]

Ma = max(A)
mi = 1

ans = Ma

def execute(f):
    count = 0
    for i in A:
        count += math.ceil(i / f) - 1
    if count <= K:
        return True
    else:
        return False

while True:
    median = (Ma + mi) // 2
    
    bobo = execute(median)
    
    if bobo:
        ans = min(ans,median)
        Ma = median
    else:
        mi = median + 1
    
    if Ma == mi:
        break

print("{}".format(ans))
Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
import random

D = int(input())

C = [int(y) for y in input().split()]

S = []

ans = []

def scoring(inp,poi):
    
    score = 0
    day = 1
    last = [0] * 26
    
    for I in inp:
        score += poi[day-1][I-1]
        last[I-1] = day
        for ind,J in enumerate(last):
            score -= C[ind] * (day - ind - 1)
        day += 1
        
    return score

for i in range(D):
    s = [int(y) for y in input().split()]
    S.append(s)

for i in S:
    k = 0
    num = 0
    for f,t in enumerate(i):
        k = max(k,t)
        if k == t:
            num = f + 1
    ans.append(num)

counter = 10000

base = scoring(ans,S)
nbase = 0
d = 0
ansc = ans.copy()

for i in range(counter):
    p = random.randint(0,25)
    q = random.randint(0,D-1)
    ansc[q] = p
    nbase = scoring(ansc,S)
    if nbase > base:
        ans = ansc.copy()
    else:
        ansc = ans.copy()

for i in ans:
    print("{}".format(int(i)))

Fixed submission:
#coding:utf-8

D = int(input())

C = [int(y) for y in input().split()]

S = []

for i in range(D):
    s = [int(y) for y in input().split()]
    S.append(s)

for i in S:
    k = 0
    num = 0
    for f,t in enumerate(i):
        k = max(k,t)
        if k == t:
            num = f + 1
    print("{}".format(num))
Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8

N = int(input())

A = [int(i) for i in input().split()]

ans = 1

for i in A:
    ans = ans * i
    
if ans > (10 ** 18) :
    ans = -1
    

print("{}".format(ans))

Fixed submission:
#coding:utf-8

N = int(input())

A = [int(i) for i in input().split()]

ans = 1
flag = True

for i in A:
    if i == 0:
        ans = 0
        flag = False

if flag:
    for i in A:
        ans = ans * i
        if ans > (10 ** 18):
            ans = -1
            break   

print("{}".format(ans))