Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import numpy as np
import math

# input

r, D, x = [int(_) for _ in input().split()]

xans = np.ones(10)

def Linear_Recursive(x, r, D, N):
    
    if N==0:
        xans = x
        return xans
    
        
    
    xans = r*Linear_Recursive(x, r, D, N-1) - D # linear eq.
    
    return xans
  
for i in range(10):
    xans[i] = round(Linear_Recursive(x, r, D, i+1))
    
    print(xans[i])
    


Fixed submission:
import numpy as np
import math

N = float(input())

p = math.ceil(N/2)/N

print(p)
Buggy python submission (verdict: Runtime Error):
N = int(input())

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

ans = B[0] + B[N-1]

for i in range(1,N):
    ans+=min(B[i],B[i-1])
    
print(ans)

Fixed submission:
N = int(input())

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

ans = B[0] + B[N-2]

for i in range(1,N-1):
    ans+=min(B[i],B[i-1])
    
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())

B = [int(i) for i in input()split()]

ans = B[0] + B[N-1]

for i in range(1,N):
    ans+=min(B[i],B[i-1])
    
print(ans)

Fixed submission:
N = int(input())

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

ans = B[0] + B[N-2]

for i in range(1,N-1):
    ans+=min(B[i],B[i-1])
    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import math

# input

N = int(input())
s = [str(input()) for _ in range(N)]

# sort
for i in range(0,N):
    s[i] = sorted(s[i])
    
def Number_Each_Element(group):
    group = sorted(group)
    discrepancy = np.array([])
    
    for i in range(len(group)-1):
        if group[i] != group[i+1]:
            discrepancy = np.append(discrepancy,i)
    discrepancy = np.append(discrepancy,len(group)-1)
    
    
    result = np.ones(len(discrepancy))
    for i in range(len(result)):
        if i == 0:
            result[i] = int(discrepancy[i]+1)
        else:
            result[i] = int(discrepancy[i]-discrepancy[i-1])
            
            
    return result

result = Number_Each_Element(s)

count = 0
for i in result:
    count += i*(i-1)/2

print(int(count))

Fixed submission:
import numpy as np

def Speed_Anag_Count(String):
    count = {}
    for i in String:
        i = sorted(i)
        i = str(''.join(i))
        if count.get(i) is None:
            count[i] = 0
        count[i] += 1
    
    return count

N = int(input())

S = [str(input()) for _ in range(N)]

count = Speed_Anag_Count(S)

ans=0
for i in count.values():
    ans += (i*(i-1)/2)
    
print(int(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import math

# input

N = int(input())
s = [str(input()) for _ in range(N)]

# sort
for i in range(0,N):
    s[i] = sorted(s[i])
    
count = 0 
for i in range(N):
    for j in range(i+1,N):
        if (s[i] == s[j]):
            count += 1

print(count)


Fixed submission:
import numpy as np

def Speed_Anag_Count(String):
    count = {}
    for i in String:
        i = sorted(i)
        i = str(''.join(i))
        if count.get(i) is None:
            count[i] = 0
        count[i] += 1
    
    return count

N = int(input())

S = [str(input()) for _ in range(N)]

count = Speed_Anag_Count(S)

ans=0
for i in count.values():
    ans += (i*(i-1)/2)
    
print(int(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import math

# input

N = int(input())
s = [str(input()) for _ in range(N)]

# sort
for i in range(0,N):
    s[i] = sorted(s[i])
    
count = 0 
for i in range(N):
    for j in range(N):
        if (s[i] == s[j]) & (i < j):
            count += 1

print(count)

Fixed submission:
import numpy as np

def Speed_Anag_Count(String):
    count = {}
    for i in String:
        i = sorted(i)
        i = str(''.join(i))
        if count.get(i) is None:
            count[i] = 0
        count[i] += 1
    
    return count

N = int(input())

S = [str(input()) for _ in range(N)]

count = Speed_Anag_Count(S)

ans=0
for i in count.values():
    ans += (i*(i-1)/2)
    
print(int(ans))
Buggy python submission (verdict: Runtime Error):
import numpy as np
import math

# input

r, D, x = [int(_) for _ in input().split()]

xans = np.ones(10)

def Linear_Recursive(x, r, D, N):
    
    if N==0:
        xans = x
        return xans
    
        
    
    xans = r*Linear_Recursive(x, r, D, N-1) - D # linear eq.
    
    return xans
  
for i in range(10):
    xans[i] = Linear_Recursive(x, r, D, i+1)
    
    pritnt(x[i])
    


Fixed submission:
import numpy as np
import math

# input

r, D, x = [int(_) for _ in input().split()]

xans = x


for i in range(10):
    xans = r*xans - D
    
    print(xans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
import math

# input

r, D, x = [float(_) for _ in input().split()]

xans = np.ones(10)

def Linear_Recursive(x, r, D, N):
    
    if N==0:
        xans = x
        return xans
    
        
    
    xans = r*Linear_Recursive(x, r, D, N-1) - D # linear eq.
    
    return xans
  
for i in range(10):
    xans[i] = Linear_Recursive(x, r, D, 10)
    
    pritnt(x[i])
    


Fixed submission:
import numpy as np
import math

# input

r, D, x = [int(_) for _ in input().split()]

xans = x


for i in range(10):
    xans = r*xans - D
    
    print(xans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
import math

# input

r, D, x = [float() for _ in input().split()]

xans = np.ones(10)

def Linear_Recursive(x, r, D, N):
    
    if N==0:
        xans = x
        return xans
    
        
    
    xans = r*Linear_Recursive(x, r, D, N-1) - D # linear eq.
    
    return xans
  
for i in range(10):
    xans[i] = Linear_Recursive(x, r, D, 10)
    
    pritnt(x[i])
    


Fixed submission:
import numpy as np
import math

# input

r, D, x = [int(_) for _ in input().split()]

xans = x


for i in range(10):
    xans = r*xans - D
    
    print(xans)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N,M =[int(i) for i in input().split()]

A = np.ones(N)
B = np.ones(N)

for i in range(N):
    A[i],B[i] = [int(i) for i in input().split()]
    
count=0
price=0
for i in range(N):
    if count>=M:
        break
    min_pr = min(A)
    min_num = np.where(A==min_pr)
    min_num_count = 0
    for i in min_num[0]:
        min_num_count +=B[i]
    A = np.delete(A,min_num[0])
    B = np.delete(B,min_num[0])
    if (count+min_num_count) <=M:
        price+=min_num_count*min_pr
        count+=min_num_count
    elif (count+min_num_count) >M:
        price += (M-count)*min_pr
        count+=min_num_count

        
print(int(price))

Fixed submission:
import numpy as np

N,M =[int(i) for i in input().split()]

AB = np.ones([N,2])


for i in range(N):
    AB[i,0],AB[i,1] = [int(i) for i in input().split()]
    
count=0
price=0

AB_new = AB[np.argsort(AB[:,0])]

for i in range(N):

    if count<=M: 
        count+=AB_new[i,1]
        if count<=M:
            price+=AB_new[i,0]*AB_new[i,1]
        elif count>M:
            price+=AB_new[i,0]*(M-count+AB_new[i,1])
    else:
        break

        
print(int(price))
Buggy python submission (verdict: Runtime Error):
s = int(input())
k = int(input())


ind = 0
num = 1


for i in range(len(s)):
    ind = i+1
    if s[i] != 1:
        num = int(s[i])
        break
        
if k>= ind:
    ans = num
else:
    ans = 1
    
print(ans)

Fixed submission:
s = str(input())
k = int(input())



num = 1


for i in range(len(s)):
    ind = i+1
    if s[i] != '1':
        num = int(s[i])
        break
        
if k>= ind:
    ans = num
else:
    ans = 1
    
print(ans)
Buggy python submission (verdict: Runtime Error):
import collections
import numpy as np

def prime_factorize(n):
    a = []
    if n%2 ==1:
		a=0
      
    while n % 2 == 0:
		a.append(2)
        n //= 2
    return a

N =int(input())

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

ans_array = np.zeros(N)

for i in range(N):
    dummy = prime_factorize(a[i])
  
    ans_array[i] = dummy
ans = int(sum(ans_array))
print(ans)

Fixed submission:
import collections
import numpy as np

def prime_factorize(n):
	a = 0   
	while n % 2 == 0:
		a+=1
		n //= 2
	return a

N =int(input())

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

ans_array = np.zeros(N)

for i in range(N):
    dummy = prime_factorize(a[i])
  
    ans_array[i] = dummy
ans = int(sum(ans_array))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
import numpy as np

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

N =int(input())

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

ans_array = np.zeros(N)

for i in range(N):
    dummy = prime_factorize(a[i])
    if collections.Counter(dummy).get(2) is not None:
        ans_array[i] = collections.Counter(dummy)[2]
ans = int(sum(ans_array))
print(ans)

Fixed submission:
import collections
import numpy as np

def prime_factorize(n):
	a = 0   
	while n % 2 == 0:
		a+=1
		n //= 2
	return a

N =int(input())

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

ans_array = np.zeros(N)

for i in range(N):
    dummy = prime_factorize(a[i])
  
    ans_array[i] = dummy
ans = int(sum(ans_array))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

n, m = [int(i) for i in input().split()]

connected_1 = []
connected_n = []
for i in range(m):
    a, b = [int(i) for i in input().split()]
    
    if a == 1:
        connected_1.append(b)
        
    if b == n:
        connected_n.append(a)

        
for i in range(len(connected_1)):
    if connected_1[i] in connected_n:
        print("POSSIBLE")
        break
    if i == len(connected_1)-1:
        print("IMPOSSIBLE")
    

Fixed submission:
import numpy as np

n, m = [int(i) for i in input().split()]

connected_1 = {}

for i in range(m):
    a, b = [int(i) for i in input().split()]
    
    if a == 1:
        if connected_1.get(b) is None:
            connected_1[b] = 1
        elif connected_1[b] ==1:
            print("POSSIBLE")
            break
        
        
    if b == n:
        if connected_1.get(a) is None:
            connected_1[a] = 1
        elif connected_1[a] ==1:
            print("POSSIBLE")
            break
        
       
        
    if i==m-1:
        print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
import numpy as np

S = str(input())

import numpy as np

for i in range(1,int(np.floor(len(S)/2))):
    j = int(np.floor(len(S)/2)) - i
    print(j)
    if first_str == second_str:
        num = 2*j
        break
    elif (first_str != second_str) & (j==1):
        num = 0
        break

print(num)  


Fixed submission:
import numpy as np

S = str(input())

import numpy as np

for i in range(1,int(np.floor(len(S)/2))):
    j = int(np.floor(len(S)/2)) - i

    first_str = S[:j]
    second_str = S[j:2*j]
    if first_str == second_str:
        num = 2*j
        break
    elif (first_str != second_str) & (j==1):
        num = 0
        break

print(num)
Buggy python submission (verdict: Runtime Error):
n = int(input())

s =str(input())


left_save = 0
dept=0

for i in range(len(s)):
    if s[i] ==')':
        if left_save = 0:
            dept +=1
        else:
            left_save-=1
            
    else:
        left_save+=1

ans = '('*dept + s + ')'*left_save

print(ans)

Fixed submission:
n = int(input())

s =str(input())


left_save = 0
dept=0

for i in range(len(s)):
    if s[i] ==')':
        if left_save == 0:
            dept +=1
        else:
            left_save-=1
            
    else:
        left_save+=1

ans = '('*dept + s + ')'*left_save

print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np



N,M =[int(i) for i in input().split()]

a = np.ones(M)
b = np.ones(M)

for i in in range(M):
    a[i],b[i] = [int(j) for j in input().split()]
    
ans = np.zeros(N)
    
for i in range(N):
    A = int(a[i]-1)
    B = int(b[i]-1)
    ans[A]+=1
    ans[B]+=1
    
for i in range(N):
    print(ans[i])
    


Fixed submission:
import numpy as np



N,M =[int(i) for i in input().split()]

a = np.ones(M)
b = np.ones(M)

for i in range(M):
    a[i],b[i] = [int(j) for j in input().split()]
    
ans = np.zeros(N)
    
for i in range(M):
    A = int(a[i]-1)
    B = int(b[i]-1)
    ans[A]+=1
    ans[B]+=1
    
for i in range(N):
    print(int(ans[i]))
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())

A_s =str(A)
B_s = str(B)

if len(A_s) > len(B_s):
    print("GREATER")
elif len(A_s) < len(B_s):
    print("LESS")
else:
    for i in range(len(A_s)):
        if A_s[i] > B_s[i]:
            print("GREATER")
            break
        elif A_s[i] < B_s[i]:
            print("LESS")
            break
        elif (A[i] == B[i]) & (i == len(A_s)-1):
            print("EQUAL")
            break
            
    
            

Fixed submission:
A = int(input())
B = int(input())

A_s =str(A)
B_s = str(B)

if len(A_s) > len(B_s):
    print("GREATER")
elif len(A_s) < len(B_s):
    print("LESS")
else:
    for i in range(len(A_s)):
        if A_s[i] > B_s[i]:
            print("GREATER")
            break
        elif A_s[i] < B_s[i]:
            print("LESS")
            break
        elif (A_s[i] == B_s[i]) & (i == len(A_s)-1):
            print("EQUAL")
            break

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

A_s =str(A)
B_s = str(B)

if len(A_s) > len(B_s):
    print("GREATER")
elif len(A_s) < len(B_s):
    print("LESS")
else:
    for i in range(len(A_s)):
        if A[i] > B[i]:
            print("GREATER")
            break
        elif A[i] < B[i]:
            print("LESS")
            break
        elif (A[i] == B[i]) & (i == len(A_s)-1):
            print("EQUAL")
            break
            
    
            

Fixed submission:
A = int(input())
B = int(input())

A_s =str(A)
B_s = str(B)

if len(A_s) > len(B_s):
    print("GREATER")
elif len(A_s) < len(B_s):
    print("LESS")
else:
    for i in range(len(A_s)):
        if A_s[i] > B_s[i]:
            print("GREATER")
            break
        elif A_s[i] < B_s[i]:
            print("LESS")
            break
        elif (A_s[i] == B_s[i]) & (i == len(A_s)-1):
            print("EQUAL")
            break
Buggy python submission (verdict: Runtime Error):
N=int(input())
mod_lar = 10**9+7

def fact_mod(n):
    if n==1:
        return 1
    ans = int((n%mod_lar)*(fact_mod(n-1)%mod_lar))
    return ans

print(fact_mod(N))

Fixed submission:
N=int(input())
mod_lar = 10**9+7
ans =1

for i in range(1,N+1):
    ans = (i%mod_lar)*(ans%mod_lar)%mod_lar
    

print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
    
strong_order = np.array([14,2,3,4,5,6,7,8,9,10.11,12,13])

A,B = [int(i)-1 for i in input().split()]

if strong_order[A] > strong_order[B]:
    print("Alice")
elif strong_order[A] < strong_order[B]:
    print("Bob")
else:
    print("Draw")
    
    

Fixed submission:
import numpy as np
    
strong_order = np.array([14,2,3,4,5,6,7,8,9,10,11,12,13])

A,B = [int(i)-1 for i in input().split()]

if strong_order[A] > strong_order[B]:
    print("Alice")
elif strong_order[A] < strong_order[B]:
    print("Bob")
else:
    print("Draw")
Buggy python submission (verdict: Runtime Error):
s = str(input())

if s[-1] == s[0]:
  if len(S)%2 == 0:
    print("First")
  else:
    print("Second")
  

else:
  if len(S)%2 == 1:
    print("First")
  else:
    print("Second")

Fixed submission:
s = str(input())

if s[-1] == s[0]:
  if len(s)%2 == 0:
    print("First")
  else:
    print("Second")
  

else:
  if len(s)%2 == 1:
    print("First")
  else:
    print("Second")
Buggy python submission (verdict: Runtime Error):
s = str(input())

if len(s) == 2:
    if s[0] ==s[1]:
        start_ind =1
        end_ind = 2
    else:
        start_ind = -1
        end_ind = -1
        
elif len(s)>2:
    start_ind = -1
            end_ind = -1
    for i in range(len(s)-2):
        par_str = s[i:i+3]
        if (par_str.count(par_str[0])>=2) | (par_str.count(par_str[1])>=2):
            start_ind = i + 1
            end_ind = i + 3
            break
        
        

ans = str(start_ind) + ' ' + str(end_ind)

print(ans)

Fixed submission:
s = str(input())

if len(s) == 2:
    if s[0] ==s[1]:
        start_ind =1
        end_ind = 2
    else:
        start_ind = -1
        end_ind = -1
        
elif len(s)>2:
    start_ind = -1
    end_ind = -1
    for i in range(len(s)-2):
        par_str = s[i:i+3]
        if (par_str.count(par_str[0])>=2) | (par_str.count(par_str[1])>=2):
            start_ind = i + 1
            end_ind = i + 3
            break
        
        

ans = str(start_ind) + ' ' + str(end_ind)

print(ans)

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

if len(s) == 2:
    if s[0] ==s[1]:
        start_ind =1
        end_ind = 2
    else:
        start_ind = -1
        end_ind = -1
        
elif len(s)>2:
    for i in range(len(s)-2):
        par_str = s[i:i+3]
        if (par_str.count(par_str[0])>=2) | (par_str.count(par_str[1])>=2):
            start_ind = i + 1
            end_ind = i + 3
            break

ans = str(start_ind) + ' ' + str(end_ind)

print(ans)

Fixed submission:
s = str(input())

if len(s) == 2:
    if s[0] ==s[1]:
        start_ind =1
        end_ind = 2
    else:
        start_ind = -1
        end_ind = -1
        
elif len(s)>2:
    start_ind = -1
    end_ind = -1
    for i in range(len(s)-2):
        par_str = s[i:i+3]
        if (par_str.count(par_str[0])>=2) | (par_str.count(par_str[1])>=2):
            start_ind = i + 1
            end_ind = i + 3
            break
        
        

ans = str(start_ind) + ' ' + str(end_ind)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())

A = [K] * N

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

for i in range(N):
    if A[i] > 0:
        print('Yes')
    else:
        print('No')
            

Fixed submission:
N, K, Q = map(int, input().split())

correctNum = [0] * N
for i in range(Q):
    Ax = int(input())
    correctNum[Ax-1] += 1

for i in range(N):
    #print(str(i+1) + ":correctNum:" + str(correctNum[i]))
    if K-Q+correctNum[i] > 0:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    A, B, N = (int(x) for x in input().split())
    mini = 0
    if N >= B:
        for x in range(B-1, N+1, B):
            k = x / B
            ans = int(A*k) - int(k)
            if ans > mini:
                mini = ans
    else:
        ans = int(A*(N)/B)
    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    A, B, N = (int(x) for x in input().split())
    mini = 0
    if N >= B:
        ans = int(A*(B-1)/B)
    else:
        ans = int(A*(N)/B)
    print(ans)


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    A, B, N = (int(x) for x in input().split())
    mini = 0
    if N >= B:
        for x in range(B-1, N+1, B):
            k = x / B
            ans = int(A*k) - int(k)
            if ans > mini:
                mini = ans
    else:
        ans = int(A*(N)/B)
    print(ans)


if __name__ == "__main__":
    main()

Fixed submission:
def main():
    A, B, N = (int(x) for x in input().split())
    mini = 0
    if N >= B:
        ans = int(A*(B-1)/B)
    else:
        ans = int(A*(N)/B)
    print(ans)


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    A, B, N = (int(x) for x in input().split())
    mini = 0
    if N >= B:
        for x in range(B-1, N+1, B):
            k = x / B
            ans = int(A*k) - int(k)
            if ans > mini:
                mini = ans
    else:
        for x in range(1, N+1):
            k = x / B
            ans = int(A * k)
            if ans > mini:
                mini = ans
    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    A, B, N = (int(x) for x in input().split())
    mini = 0
    if N >= B:
        ans = int(A*(B-1)/B)
    else:
        ans = int(A*(N)/B)
    print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(x) for x in input().split()]


for i in range(1, N + 1):
    print(A.count(i))

Fixed submission:
from collections import Counter

N = int(input())
A = [int(x) for x in input().split()]
a = Counter(A)

for i in range(1, N + 1):
    print(a[i])

Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict

N = int(input())
A = [int(x) for x in input().split()]
k = defaultdict(lambda: 0)

for i in range(1, N + 1):
    k[i] = 0
    for a in A:
        if a == i:
            k[i] += 1

for j in k.values():
    print(j)


Fixed submission:
from collections import Counter

N = int(input())
A = [int(x) for x in input().split()]
a = Counter(A)

for i in range(1, N + 1):
    print(a[i])
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce


def gcd(*numbers):
    return reduce(math.gcd, numbers)


K = int(input()) + 1
res = 0
for i in range(1, K):
    for j in range(1, K):
        for k in range(1, K):
            res += gcd(i, j, k)

print(res)


Fixed submission:
import math
from functools import reduce
 
 
def gcd(*numbers):
    return reduce(math.gcd, numbers)
 
 
K = int(input()) + 1
res = 0
for i in range(1, K):
    for j in range(1, K):
        for k in range(1, K):
            res += gcd(i, j, k)
 
print(res)
Buggy python submission (verdict: Runtime Error):
a = [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 = input()
print(a[k-1])

Fixed submission:
k = int(input())
a = [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]
print(a[k-1])
Buggy python submission (verdict: Runtime Error):
H, W = (int(x) for x in input().split())
if H * W % 2 == 0:
    k = H * W / 2
else:
    if H == 1 or W == 1:
        a = list(filter(lambda x: x != 1, [H, W]))
        k = int(a[0] / 2) + 1
    else:
        k = int(H/2) + (int(W/2))*H + 1
print(k)

Fixed submission:
H, W = (int(x) for x in input().split())

if H == 1 or W == 1:
    k = 1
elif H*W % 2 == 1:
    k = int(H / 2) + (int(W / 2)) * H + 1
else:
    k = int(H * W / 2)

print(k)

Buggy python submission (verdict: Runtime Error):
H, W = (int(x) for x in input().split())
if H * W % 2 == 0:
    k = H * W / 2
else:
    if H == 1 or W == 1:
        a = map(lambda x: x != 1, [H, W])
        k = int(a / 2) + 1
    else:
        k = int(H/2) + (int(W/2))*H + 1
print(k)

Fixed submission:
H, W = (int(x) for x in input().split())

if H == 1 or W == 1:
    k = 1
elif H*W % 2 == 1:
    k = int(H / 2) + (int(W / 2)) * H + 1
else:
    k = int(H * W / 2)

print(k)
Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = (int(x) for x in input().split())
s = ""
while True:
    for i in range(A):
        if len(s) != N:
            s += "b"
        else:
            break

    for j in range(B):
        if len(s) != N:
            s += "r"
        else:
            break
    if len(s) == N:
        break

print(s[:N].count("b"))

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

a, b = divmod(N, (A + B))
if A <= b:
    print((a+1) * A)
else:
    print((a * A) + b)