Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = 5
Dishes = [int(input()) for _ in range(N)]
Dishes_10 = [0]*N

for i in range(N):
    d = int(str(Dishes[i])[-1])
    if d!=0:
        Dishes_10[i] = Dishes[i]+10-d
    else:
        Dishes_10[i] = Dishes[i]

Max=0
for i in range(N):
    
    if (Dishes_10[i]-Dishes[i])>Max:
        posi = i
        Max = Dishes_10[i]-Dishes[i]
        
Dishes_10[posi] = Dishes[posi]

print(sum(Dishes_10))

Fixed submission:
N = 5
D = [int(input()) for _ in range(N)]

srv_t = 0
last_srv = 0

for d in D:
   if d%10!=0:
       t = 10 - d%10
   else:
       t = 0
    
   srv_t += (d+t)
    
   last_srv = max(last_srv,t)
    
print(srv_t-last_srv)

Buggy python submission (verdict: Runtime Error):
N = 5
Dishes = [int(input()) for _ in range(N)]
Dishes_10 = []

for i in range(N):
    d = int(str(Dishes[i])[-1])
    if d!=0:
        Dishes_10.append(int(Dishes[i])+10-d)
    else:
        Dishes_10.append(int(Dishes[i]))

for i in range(N):
    Max=0
    if (Dishes_10[i]-Dishes[i])>Max:
        posi = i
        Max = Dishes_10[i]-Dishes[i]

Dishes_10[posi] = Dishes[posi]

print(sum(Dishes_10))

Fixed submission:
N = 5
D = [int(input()) for _ in range(N)]

srv_t = 0
last_srv = 0

for d in D:
   if d%10!=0:
       t = 10 - d%10
   else:
       t = 0
    
   srv_t += (d+t)
    
   last_srv = max(last_srv,t)
    
print(srv_t-last_srv)
Buggy python submission (verdict: Runtime Error):
from math import gcd
from functools import reduce
def lcm_base(x,y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
    
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
    
N = int(input())
a = [int(i) for i in input().split(" ")]

x = lcm_list(a)-1
Sum = 0
for a_ in a:
    Sum += x%a_
print(Sum)

Fixed submission:
from fractions import gcd
from functools import reduce
def lcm_base(x,y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
    
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
    
N = int(input())
a = [int(i) for i in input().split(" ")]

x = lcm_list(a)-1
Sum = 0
for a_ in a:
    Sum += x%a_
print(Sum)
Buggy python submission (verdict: Time Limit Exceeded):
A,B, C, K = map(int,input().split())
flag = 1
for k in range(K):
  A,B,C = B+C, C+A, A+B
  if abs(A-B) > 10**18:
    print("Unfair")
    flag = 0
    break
if flag:
  print(A-B)

Fixed submission:
A,B, C, K = map(int,input().split())
if K%2==0:
  print(A-B)
else:
  print(B-A)

Buggy python submission (verdict: Time Limit Exceeded):
A,B, C, K = map(int,input().split())
for k in range(K):
  A,B,C = B+C, C+A, A+B
if abs(A-B) > 10**18:
  print("Unfair")
else:
  print(A-B)

Fixed submission:
A,B, C, K = map(int,input().split())
if K%2==0:
  print(A-B)
else:
  print(B-A)
Buggy python submission (verdict: Runtime Error):
List = sorted([int(i) for i in input().split(" ")],reversed=True)
K = int(input())
List[0] = List[0]*(2**K)
print(sum(List))
 

Fixed submission:
List = sorted([int(i) for i in input().split(" ")],reverse=True)
K = int(input())
List[0] = List[0]*(2**K)
print(sum(List))
Buggy python submission (verdict: Runtime Error):
Cube = [int(i) for i in input().split(" ")]
# 一番長い辺で切れば断面の数は最小
L = max(Cube)
plane = [i for i in Cube if i!=L]
if len(plane)==0:
    A = L
    B = L
elif len(plane)==1:
    A = plane[0]
    B = L
else:
    A,B = map(int,plabe)
print(abs((A*B*(L//2))-(A*B*(L-(L//2)))))

Fixed submission:
Cube = [int(i) for i in input().split(" ")]
# 一番長い辺で切れば断面の数は最小
L = max(Cube)
plane = [i for i in Cube if i!=L]
if len(plane)==0:
    A = L
    B = L
elif len(plane)==1:
    A = plane[0]
    B = L
else:
    A,B = map(int,plane)
print(abs((A*B*(L//2))-(A*B*(L-(L//2)))))

Buggy python submission (verdict: Runtime Error):
Cube = [int(i) for i in input().split(" ")]
# 一番長い辺で切れば断面の数は最小
L = max(Cube)
A,B = map(int,[i for i in Cube if i!=L])

print(abs((A*B*(L//2))-(A*B*(L-(L//2)))))

Fixed submission:
Cube = [int(i) for i in input().split(" ")]
# 一番長い辺で切れば断面の数は最小
L = max(Cube)
plane = [i for i in Cube if i!=L]
if len(plane)==0:
    A = L
    B = L
elif len(plane)==1:
    A = plane[0]
    B = L
else:
    A,B = map(int,plane)
print(abs((A*B*(L//2))-(A*B*(L-(L//2)))))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if (a<0 and b>0) or a == 0 or b == 0:
    print("Zero")
else:
    nega = [i for i in list(range(a,b+1)) if i<0]
    if len(nega)%2==0:
        print("Positive")
    else:
        print("Negative")

Fixed submission:
a,b = map(int,input().split())
if (a<=0 and b>=0) :
    print("Zero")
else:
    if a>0:
        print("Positive")
    elif b<0:
        if (b-a+1)%2==0:
            print("Positive")
        else:
            print("Negative")
Buggy python submission (verdict: Runtime Error):
n = iin()
a = list(map(int, input().split()))
ans = [1 for i in range(n) if a[i]%2 and i%2==0]
print(sum(ans))

Fixed submission:
"""
NTC here
"""


#!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase

profile = 0
pypy = 1


def iin(): return int(input())


def lin(): return list(map(int, input().split()))



def main():
    T = 1
    while T:
        T -= 1
        n = iin()
        a = lin()
        ans = [1 for i in range(n) if a[i]%2 and i%2==0]
        print( sum(ans) if ans else 0)




    
        










    




                

        

 
 
 
 
 
 
# region fastio
 
BUFSIZE = 8192
 
 
class FastIO(IOBase):
    newlines = 0
 
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
 
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
 
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
 
if pypy:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
    input = lambda: sys.stdin.readline().rstrip("\r\n")
 
# endregion
 
if __name__ == "__main__":
    if profile:
        import cProfile
        cProfile.run('main()')
    else:
        main()
Buggy python submission (verdict: Runtime Error):
"""
NTC here
"""
from sys import stdin, setrecursionlimit
setrecursionlimit(10**7)

def iin(): return int(stdin.readline())
 
 
def lin(): return list(map(int, stdin.readline().split()))

# range = xrange
# input = raw_input
from math import gcd
gcd=gcd
def lcm(a,b):
    return (a*b)//(gcd(a,b))
def main():
    n=iin()
    a=lin()
    s2=sum(a)
    s1=0
    mn=abs(s2-s1)
    for i in range(n-1):
        s1+=a[i]
        s2-=a[i]
        mn=min(mn,abs(s1-s2))
    print(mn)

"""
1 2 5 8 15 20 23 11 45
"""
        


    
    
            



    
                











main()

Fixed submission:
"""
NTC here
"""
from sys import stdin, setrecursionlimit
setrecursionlimit(10**7)

def iin(): return int(stdin.readline())
 
 
def lin(): return list(map(int, stdin.readline().split()))

# range = xrange
# input = raw_input
def main():
    n=iin()
    a=lin()
    s2=sum(a)
    s1=0
    mn=abs(s2-s1)
    for i in range(n-1):
        s1+=a[i]
        s2-=a[i]
        mn=min(mn,abs(s1-s2))
    print(mn)

"""
1 2 5 8 15 20 23 11 45
"""
        


    
    
            



    
                











main()
Buggy python submission (verdict: Runtime Error):
"""
NTC here
"""
import sys
input= sys.stdin.readline
# import t  hreading
# setrecursionlimit(10**6)
# threading.stack_size(2**26)

def iin(): return int(input())
def lin(): return list(map(int, input().split()))

# range = xrange
# input = raw_input

def main():
    n, k= lin()
    h=lin()
    ans=[0]*(n)
    for i in range(n-2,-1,-1):
        ans[i]=min(
            [abs(h[i]-h[j+i+1])+ans[i+j+1] for j in range(min(n-i-1,k))]
            )
    print(ans[0])
        



                









        
main()
#threading.Thread(target=main).start()


Fixed submission:
"""
NTC here
"""
import sys
input= sys.stdin.readline
# import t  hreading
# setrecursionlimit(10**6)
# threading.stack_size(2**26)

def iin(): return int(input())
def lin(): return list(map(int, input().split()))

# range = xrange
# input = raw_input

def main():
    n = iin()
    Q = [lin() for i in range(n)]
    ans = [[0, 0, 0] for i in range(n+1)] 
   # print(ans)
    for i in range(n-1, -1, -1):
        for j in range(3):
            ans[i][j]=Q[i][j]+max([
                ans[i+1][k] for k in range(3) if k!=j
            ])
  #  print(ans)
    print(max(ans[0]))

        



                









        
main()
#threading.Thread(target=main).start()
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

lst = list(map(int, input().split()))
lst = sorted(lst, reverse=True)
class Queue:
  def __init__(self):
    self.queue_lst = []
    self.first_flag = True
    self.count = 0
  
  def add(self, friend_val):
    if self.first_flag:
      self.queue_lst.append(friend_val)
      self.first_flag = False
    else:
      self.queue_lst.append(friend_val)
      self.queue_lst.append(friend_val)
      self.count += self.queue_lst.pop(0)
  
queue = Queue()

for i in lst:
  queue.add(i)



print(queue.count)

Fixed submission:
n = int(input())

lst = list(map(int, input().split()))
lst = sorted(lst, reverse=True)
class Queue:
  def __init__(self):
    self.queue_lst = []
    self.first_flag = True
    self.count = 0
    self.index = 0
  
  def add(self, friend_val):
    if self.first_flag:
      self.queue_lst.append(friend_val)
      self.first_flag = False
    else:
      self.queue_lst.append(friend_val)
      self.queue_lst.append(friend_val)
      self.count += self.queue_lst[self.index]
      self.index += 1
  
queue = Queue()

for i in lst:
  queue.add(i)



print(queue.count)
Buggy python submission (verdict: Runtime Error):
x, n = map(int, input().split())
lst = [int(input()) for _ in range(n)]
a = 100
b = 0

for i in range(1, 102):
  if i in lst:
    continue

  if a > abs(x-i):
    a = abs(x-i)
    b = i

print(i)

Fixed submission:
x, n = map(int, input().split())
lst = []
if n > 0:
  lst = list(map(int, input().split()))
a = 100
b = 0

for i in range(0, 102):
  if i in lst:
    continue

  if a > abs(x-i):
    a = abs(x-i)
    b = i

print(b)

Buggy python submission (verdict: Runtime Error):
x, n = map(int, input().split())
lst = [int(input()) for _ in range(n)]
a = 100
b = ''

for i in range(1, 102):
  if i in lst:
    continue

  if a > abs(x-i):
    a = abs(x-i)
    b = i

print(i)

Fixed submission:
x, n = map(int, input().split())
lst = []
if n > 0:
  lst = list(map(int, input().split()))
a = 100
b = 0

for i in range(0, 102):
  if i in lst:
    continue

  if a > abs(x-i):
    a = abs(x-i)
    b = i

print(b)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
k = 1
flag = True
for i in a:
  k *= i
  
if k > 10 ** 18:
  print(-1)
  flag = False
if flag:
  print(k)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
k = 1
flag = True
for i in a:
  k *= i  
  if k > 10 ** 18:
    flag = False
    break

if 0 in a:
  print(0)
elif flag:
  print(k)
else:
  print(-1)
Buggy python submission (verdict: Runtime Error):
a = [ int(input()) for i in range(int(input()))]
flag = True
for i in a:
  if i % 2 == 0:
    if i%3 != 0 and i%5 != 0:
      flag = False
      break
print('APPROVED' if flag else 'DENIED')

Fixed submission:
input()
a = list(map(int, input().split()))
flag = True
for i in a:
  if i % 2 == 0:
    if i%3 != 0 and i%5 != 0:
      flag = False
      break
print('APPROVED' if flag else 'DENIED')
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
ans_ac = 0
ans_wa = 0
dic = {}
for i in range(1, n):
  dic[i] = [False, 0]

for i in range(m):
  p, s = input().split()
  if dic[int(p)][0]:
    continue
  if s == 'WA':
    dic[int(p)][1] += 1
  else:
    ans_ac += 1
    ans_wa += dic[int(p)][1]
    dic[int(p)][0] = True
    
print(ans_ac, ans_wa)


Fixed submission:
n, m = map(int, input().split())
ans_ac = 0
ans_wa = 0
lst = []
for i in range(n):
  lst.append([False, 0])
for i in range(m):
  p, s = input().split()
  p = int(p) - 1
  if lst[p][0]:
    continue
  if s == 'WA':
    lst[p][1] += 1
  else:
    ans_ac += 1
    ans_wa += lst[p][1]
    lst[p][0] = True
print(ans_ac, ans_wa)
Buggy python submission (verdict: Runtime Error):
n = int(input())
lst = []

for i in range(n):
  a, b = input().split()
  b = int(b)
  lst.append([a, b])
x = input()
sum_time = 0
flag = false
for i in lst:
  if i[0] == x:
    flag = true
  if flag:
    sum_time += i[1]
print(sum_time)

Fixed submission:
n = int(input())
lst = []

for i in range(n):
  a, b = input().split()
  b = int(b)
  lst.append([a, b])
x = input()
sum_time = 0
flag = False
for i in lst:
  if flag:
    sum_time += i[1]
  if i[0] == x:
    flag = True
print(sum_time)
Buggy python submission (verdict: Time Limit Exceeded):
a, b =map(int, input().split())

m = a*b
lst = []
for i in range(1, b+1):
  if m < a*i:
    break
  lst.append(a*i)

for j in range(1, a+1):
  if j*b in lst:
    print(j*b)
    break

Fixed submission:
a, b = map(int, input().split())
aa = []
bb = []

count = 2

while True:
  if a == 1:
    aa.append(a)
    break
  if a%count == 0:
    aa.append(count)
    a = a//count
  else:
      count += 1
    
count = 2

while True:
  if b == 1:
    bb.append(b)
    break
  if b%count == 0:
    bb.append(count)
    b = b//count
  else:
      count += 1
answer = 1
c = set(aa) | set(bb)
for i in c:
  answer *= i ** max(aa.count(i), bb.count(i))
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())
m = a*b
for i in range(1, m+1):
  if i%a==0 and i%b==0:
    print(i)
    break

Fixed submission:
a, b = map(int, input().split())
aa = []
bb = []

count = 2

while True:
  if a == 1:
    aa.append(a)
    break
  if a%count == 0:
    aa.append(count)
    a = a//count
  else:
      count += 1
    
count = 2

while True:
  if b == 1:
    bb.append(b)
    break
  if b%count == 0:
    bb.append(count)
    b = b//count
  else:
      count += 1
answer = 1
c = set(aa) | set(bb)
for i in c:
  answer *= i ** max(aa.count(i), bb.count(i))
print(answer)
Buggy python submission (verdict: Runtime Error):
class Stack:
  def __init__(self):
    self.count = 1
    self.lst = []
  
  def push(self, element):
    if element == count:
      self.lst.append(element)
      self.count += 1
  
  def length(self):
    return len(self.lst)

n = int(input())
a = list(map(int, input().split()))
stack = Stack()
for i in a:
  stack.push(i)

b = stack.length()
if b == 0:
  print('-1')
else:
  print(n - b)

Fixed submission:
class Stack:
  def __init__(self):
    self.count = 1
    self.lst = []
  
  def push(self, element):
    if element == self.count:
      self.lst.append(element)
      self.count += 1
  
  def length(self):
    return len(self.lst)

n = int(input())
a = list(map(int, input().split()))
stack = Stack()
for i in a:
  stack.push(i)

b = stack.length()
if b == 0:
  print('-1')
else:
  print(n - b)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
m = list(map(int, input().split()))
count = []
for i in range(1, n+1):
  if i not in m:
    break
  j = m.index(i)
  count += [i]
  m = m[j+1:]

if len(count) == 0:
  print(-1)
else:
  print(n-len(count))


Fixed submission:
class Stack:
  def __init__(self):
    self.count = 1
    self.lst = []
  
  def push(self, element):
    if element == self.count:
      self.lst.append(element)
      self.count += 1
  
  def length(self):
    return len(self.lst)

n = int(input())
a = list(map(int, input().split()))
stack = Stack()
for i in a:
  stack.push(i)

b = stack.length()
if b == 0:
  print('-1')
else:
  print(n - b)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
m = list(map(int, input().split()))
count = []
for i in range(1, n+1):
  if i not in m:
    break
  
  for j in range(len(m)):
    if i==m[j]:
      count += [i]
      m = m[j+1:]
      break
if len(count) == 0:
  print(-1)
else:
  print(n-len(count))

Fixed submission:
class Stack:
  def __init__(self):
    self.count = 1
    self.lst = []
  
  def push(self, element):
    if element == self.count:
      self.lst.append(element)
      self.count += 1
  
  def length(self):
    return len(self.lst)

n = int(input())
a = list(map(int, input().split()))
stack = Stack()
for i in a:
  stack.push(i)

b = stack.length()
if b == 0:
  print('-1')
else:
  print(n - b)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
pb = 0

for i in range(1, n):
  mul = 0
  
  while k > i * 2** mul:
    mul += 1
    
  pb += (0.5 ** mu) / n
print(pb)

Fixed submission:
n, k = map(int, input().split())
pb = 0
 
for i in range(1, n+1):
  mul = 0
  
  while k > i * (2 ** mul):
    mul += 1
    
  pb += 1/(n*(2**mul))
print(pb)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
pb = 0
count = 0
if n >= k:
  pb += (n-k+1)/n
  count = k - 1
else:
  count = n
 
for i in range(1, count+1):
  mul = 0
  while k > i ** mul:
    mul += 1
  pb = pb +  (1/n) * (1 / (2**mul))
print(pb)

Fixed submission:
n, k = map(int, input().split())
pb = 0
 
for i in range(1, n+1):
  mul = 0
  
  while k > i * (2 ** mul):
    mul += 1
    
  pb += 1/(n*(2**mul))
print(pb)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
num = int(input())
lst = [i if i==s[num] else "*" for i in s]
print(*lst, sep='')

Fixed submission:
n = int(input())
a = input()
l = int(input())
for i in range(n):
  if a[l-1] != a[i]:
    print('*', end='')
  else:
    print(a[l-1], end='')
Buggy python submission (verdict: Runtime Error):
a = list(input())
b = a[::2].index('0') + a[1::2].index('1')
c = min(b, len(a) - b)
print(c)


Fixed submission:
a = list(input())
b = a[::2].count('0') + a[1::2].count('1')
c = min(b, len(a) - b)
print(c)

Buggy python submission (verdict: Runtime Error):
a = input()
b = a[::2].index('0') + a[1::2].index('1')
c = min(b, len(a) - b)
print(c)

Fixed submission:
a = list(input())
b = a[::2].count('0') + a[1::2].count('1')
c = min(b, len(a) - b)
print(c)
Buggy python submission (verdict: Runtime Error):
judge = ['A','G', 'C', 'T']
string_list = [i in judge for i in input()]
string = ''.join(string_list).split('False')
print(max([i.count('True') for i in string]))


Fixed submission:
s = input()
lst = ['A', 'G', 'C', 'T']
count = 0
m = 0
for i in s:
  if i in lst:
    count += 1
  else:
    count = 0
  m = max(m, count)
print(m)
Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int, input().split())
s = input()
for i in range(q):
  l, r = map(int, input().split())
  print(s[l-1:r].count('AC'))

Fixed submission:
n, q = map(int, input().split())
s = input()
count = [0] * n
for i in range(1, n):
  count[i] += count[i-1]
  if s[i-1:1+i] == 'AC' :
    count[i] += 1
for i in range(q):
  l, r = map(int, input().split())
  print(count[r-1] - count[l-1])
Buggy python submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = map(int, input().split())
counter = 0
for i in range(n):
  a = map(int, input().split())
  if sum([b[i]*a[i] for i in range(m)]) + c > 0:
    counter += 1
print(counter)

Fixed submission:
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
count = 0
 
for i in range(n):
  a = list(map(int, input().split()))
  p = c
  for j in range(m):
  	p += a[j] * b[j]
  if 0 < p:
    count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
count = 0
 
for i in range(n):
  a = list(map(int, input().split()))
  p = c
  for j in range(m):
  p += a[j] + b[j]
  if 0 < p:
    count += 1
print(count)

Fixed submission:
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
count = 0
 
for i in range(n):
  a = list(map(int, input().split()))
  p = c
  for j in range(m):
  	p += a[j] * b[j]
  if 0 < p:
    count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
count = 0
 
for i in range(n):
  a = list(map(int, input().split()))
  for j in range(m):
    if 0 < a[m] * b[m] + c:
      count += 1
print(count)

Fixed submission:
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
count = 0
 
for i in range(n):
  a = list(map(int, input().split()))
  p = c
  for j in range(m):
  	p += a[j] * b[j]
  if 0 < p:
    count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = map(int, input().split())
count = 0
 
for i in range(n):
  a = map(int, input().split())
  for j in range(m):
    if 0 < (a[j] * b[j] + c):
      count += 1
print(count)

Fixed submission:
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
count = 0
 
for i in range(n):
  a = list(map(int, input().split()))
  p = c
  for j in range(m):
  	p += a[j] * b[j]
  if 0 < p:
    count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = map(int, input().split())
count = 0
 
for i in range(n):
  a = map(int, input().split())
  for j in range(m):
    if 0 < a[j] * b[j] + c:
      count += 1
print(count)

Fixed submission:
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
count = 0
 
for i in range(n):
  a = list(map(int, input().split()))
  p = c
  for j in range(m):
  	p += a[j] * b[j]
  if 0 < p:
    count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = map(int, input().split())
count = 0

for i in range(n):
  a = map(int, input().split())
  for j in range(m):
    if 0 < a[m] * b[m] + c:
      count += 1
print(count)

Fixed submission:
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
count = 0
 
for i in range(n):
  a = list(map(int, input().split()))
  p = c
  for j in range(m):
  	p += a[j] * b[j]
  if 0 < p:
    count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
print('Heisei' if n<='2019/4/30' else 'TBD')

Fixed submission:
print("Heisei" if input()<="2019/04/30" else "TBD")
Buggy python submission (verdict: Runtime Error):
n = int(input())
count = 0
for i in range(n):
  x, y = input().split()
  if y == 'JPY':
    x = int(x)
  else:
    x = int(x) * 3.8e5
  count += x
print(count)

Fixed submission:
n = int(input())
count = 0
for i in range(n):
  x, y = input().split()
  if y == 'JPY':
    x = int(x)
  else:
    x = float(x) * 3.8e5
  count += x
print(count)

Buggy python submission (verdict: Runtime Error):
n = int(input())
count = 0
for i in range(n):
  x, y = input().split()
  if y == 'JPY':
    x = int(x)
  else:
    x = int(x) * 3.8e5
  count += x
print(x)

Fixed submission:
n = int(input())
count = 0
for i in range(n):
  x, y = input().split()
  if y == 'JPY':
    x = int(x)
  else:
    x = float(x) * 3.8e5
  count += x
print(count)