Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# coding: UTF-8
s = raw_input()

if 'N' in s and 'W' in s and 'S' in s and 'E' in s:
    print "Yes"
elif 'N' in s and not 'W' in s and 'S' in s and not 'E' in s:
    print "Yes"
elif not 'N' in s and 'W' in s and not 'S' in s and 'E' in s:
else :
    print "No"


Fixed submission:
# coding: UTF-8
s = raw_input()

if 'N' in s and 'W' in s and 'S' in s and 'E' in s:
    print "Yes"
elif 'N' in s and not 'W' in s and 'S' in s and not 'E' in s:
    print "Yes"
elif not 'N' in s and 'W' in s and not 'S' in s and 'E' in s:
    print "Yes"
else :
    print "No"
Buggy python submission (verdict: Runtime Error):
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

string S[3];
int N;

for(i=0; i<N; i++) cin >> S[i];
if(S[0] == S[1] == S[2]);
  print("Yes")
else;
  print("No)


Fixed submission:
S = input()
if(S[0] == S[1] and S[1] == S[2]):
  print("No")
 
else:
  print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
ans = A[0]

for n in range(1,N):
  ans = ans * A[n]

if ans > 10**18:
  print(-1)
else:
  print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
if 0 in A:
  print(0)
  exit()
ans = A[0]

for n in range(1,N):
  ans = ans * A[n]
  if ans > 10**18:
    print(-1)
    exit()


print(ans)
Buggy python submission (verdict: Runtime Error):
import itertools
N = int(input())
AB = [list(map(int, input().split())) for n in range(N)]

if N % 2 == 0:
  k1 = int(N/2-1)
  k2 = int(N/2)
  arr1 = list(range(AB[k1][0], AB[k1][1] + 1))
  arr2 = list(range(AB[k2][0], AB[k2][1] + 1))
  pattern = list(itertools.product(arr1, arr2))
  ans = set()
  for p in pattern:
    ans.add(sum(p))
  print(len(ans))
else:
  k = int((N+1)/2)-1
  A = AB[k][0]
  B = AB[k][1]
  print(B-A+1)

Fixed submission:
import itertools
N = int(input())
AB = [list(map(int, input().split())) for n in range(N)]
sortA = sorted(AB, key= lambda x:x[0])
sortB = sorted(AB, key= lambda x:x[1])
if N % 2 == 0:
  k1 = int(N/2-1)
  k2 = int(N/2)
  minM = sortA[k1][0] + sortA[k2][0]
  maxM = sortB[k1][1] + sortB[k2][1]
  print(maxM-minM+1)
else:
  k = int((N+1)/2)-1
  A = sortA[k][0]
  B = sortB[k][1]
  print(B-A+1)

Buggy python submission (verdict: Runtime Error):
import itertools
N = int(input())
AB = [list(map(int, input().split())) for n in range(N)]

if N % 2 == 0:
  k1 = int(N/2-1)
  k2 = int(N/2)
  arr1 = list(range(AB[k1][0], AB[k1][1] + 1))
  arr2 = list(range(AB[k2][0], AB[k2][1] + 1))
  pattern = list(itertools.product(arr1, arr2))
  ans = set()
  for p in pattern:
    ans.add(sum(p))
  print(len(ans))
  

else:
  k = int((N+1)/2)-1
  A = AB[k][0]
  B = AB[k][1]
  print(B-A+1)

Fixed submission:
import itertools
N = int(input())
AB = [list(map(int, input().split())) for n in range(N)]
sortA = sorted(AB, key= lambda x:x[0])
sortB = sorted(AB, key= lambda x:x[1])
if N % 2 == 0:
  k1 = int(N/2-1)
  k2 = int(N/2)
  minM = sortA[k1][0] + sortA[k2][0]
  maxM = sortB[k1][1] + sortB[k2][1]
  print(maxM-minM+1)
else:
  k = int((N+1)/2)-1
  A = sortA[k][0]
  B = sortB[k][1]
  print(B-A+1)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
import itertools

N, M = map(int, input().split())
ab = [list(map(int, input().split())) for n in range(N)]
branch = [[False]* N for n in range(N)]

for m in range(M):
  a = ab[m][0] - 1
  b = ab[m][1] -1 
  branch[a][b] = True
  branch[b][a] = True

ans = 0
pattern = list(itertools.permutations(range(1, N+1),N))
for l in pattern:
  if l[0] != 1:
    continue
  for n in range(N):
    if n == N - 1:
      ans += 1
      break
    p = l[n] -1
    np = l[n+1] -1
    if not(branch[p][np]):
      break

print(ans)

Fixed submission:
import sys
input = sys.stdin.readline
import itertools

N, M = map(int, input().split())
ab = [list(map(int, input().split())) for n in range(M)]
branch = [[False]* N for n in range(N)]

for m in range(M):
  a = ab[m][0] - 1
  b = ab[m][1] -1 
  branch[a][b] = True
  branch[b][a] = True

ans = 0
pattern = itertools.permutations(range(1, N+1),N)
for l in pattern:
  if l[0] != 1:
    continue
  for n in range(N):
    if n == N - 1:
      ans += 1
      break
    p = l[n] -1
    np = l[n+1] -1
    if not(branch[p][np]):
      break

print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
import itertools

N, M = map(int, input().split())
ab = [list(map(int, input().split())) for m in range(M)]
branch = [[False]* N for n in range(N)]

for m in range(M):
  a = ab[m][0] - 1
  b = ab[m][1] -1 
  branch[a][b] = True
  branch[b][a] = True

ans = 0
pattern = list(itertools.permutations(range(1, M+1),M))
for l in pattern:
  if l[0]  != 1:
    continue
  for m in range(M):
    if m == M - 1:
      ans += 1
      break
    p = l[m] -1
    np = l[m+1] -1
    if not(branch[p][np]):
      break

print(ans)

Fixed submission:
import sys
input = sys.stdin.readline
import itertools

N, M = map(int, input().split())
ab = [list(map(int, input().split())) for n in range(M)]
branch = [[False]* N for n in range(N)]

for m in range(M):
  a = ab[m][0] - 1
  b = ab[m][1] -1 
  branch[a][b] = True
  branch[b][a] = True

ans = 0
pattern = itertools.permutations(range(1, N+1),N)
for l in pattern:
  if l[0] != 1:
    continue
  for n in range(N):
    if n == N - 1:
      ans += 1
      break
    p = l[n] -1
    np = l[n+1] -1
    if not(branch[p][np]):
      break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())
n = 0
for x in range(K+1):
  for y in range(K+1):
    if x+y > S:
      break
    for z in range(K+1):
      if x+y+z == S:
        n += 1
      elif x+y+z > S:
        break
print(n)

Fixed submission:
K, S = map(int, input().split())
n = 0
for x in range(K+1):
  for y in range(K+1):
    z = S-x-y
    if z>=0 and z<=K:
      n +=1
print(n)

Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())
n = 0
for x in range(K+1):
  for y in range(K+1):
    if x+y > S:
      break
    for z in range(K+1):
      if x+y+z == S:
        n += 1
print(n)

Fixed submission:
K, S = map(int, input().split())
n = 0
for x in range(K+1):
  for y in range(K+1):
    z = S-x-y
    if z>=0 and z<=K:
      n +=1
print(n)

Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())
n = 0
for x in range(K+1):
  for y in range(K+1):
    for z in range(K+1):
      if x+y+z == S:
        n += 1
print(n)

Fixed submission:
K, S = map(int, input().split())
n = 0
for x in range(K+1):
  for y in range(K+1):
    z = S-x-y
    if z>=0 and z<=K:
      n +=1
print(n)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = [int(i) for i in input().split()]
s = sum(a)
if(n=>s):
  print(n-s)
else:
  print("-1")

Fixed submission:
n,m = map(int,input().split())
a = [int(i) for i in input().split()]
s = sum(a)
if(n>=s):
  print(n-s)
else:
  print("-1")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(i) for i in input().split()]
def CountFrequency(my_list,n1): 
    count1 = 0
    freq = {} 
    for items in my_list: 
        freq[items] = my_list.count(items) 
    for key, value in freq.items():
    	print(value)
    	count1+=1
    if(count1!=n1):
        for i in range(n1-count1):
            print("0")
CountFrequency(a,n)

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
arr = [0 for i in range(n)]
for i in range(n-1):
    arr[a[i]-1]+=1
for i in range(n):
    print(arr[i])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s_list = []
for _ in range(n):
    s = "".join(sorted(input()))
    s_list.append(s)

count = 0
for i in range(n-1):
    for j in range(i+1, n):
        if s_list[i] == s_list[j]:
            count += 1

print(count)


Fixed submission:
n = int(input())
d = {}

ans = 0
for _ in range(n):
    s = "".join(sorted(input()))
    if not s in d:
        d[s] = 0
    else:
        d[s] += 1
        ans += d[s]

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s_list = []
for _ in range(n):
    s = "".join(sorted(input()))
    s_list.append(s)

count = 0
for i in range(n-1):
    for j in range(i+1, n):
        if s_list[i] == s_list[j]:
            count += 1

print(count)


Fixed submission:
n = int(input())
d = {}

ans = 0
for _ in range(n):
    s = "".join(sorted(input()))
    if not s in d:
        d[s] = 0
    else:
        d[s] += 1
        ans += d[s]

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import scipy.linalg as linalg
import numpy as np

n = int(input())
coef = [[0 for _ in range(n)] for _ in range(n)]
for i in range(n):
    if i == n-1:
        coef[i][0] = 1/2
        coef[i][-1] = 1/2
    else:
        coef[i][i] = 1/2
        coef[i][i+1] = 1/2
    
A = np.zeros((n, n))
for i in range(n):
    A[i] = coef[i]

b = np.array([int(x) for x in input().split()])

LU = linalg.lu_factor(A)
ans = linalg.lu_solve(LU, b)

print(" ".join(map(str, map(int, ans))))

Fixed submission:
n = int(input())
A = [int(x) for x in input().split()]
S = sum(A)

X_1 = S
i = 0
while 2*i+1 < n:
    X_1 -= 2 * A[2*i+1]
    i += 1

X = [0] * n
X[0] = X_1

for i in range(n-1):
    X_i_1 = 2 * A[i] - X[i]
    X[i+1] = X_i_1
    
print(" ".join(map(str, X)))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
coef = [[0 for _ in range(n)] for _ in range(n)]
for i in range(n):
    if i == n-1:
        coef[i][0] = 1/2
        coef[i][-1] = 1/2
    else:
        coef[i][i] = 1/2
        coef[i][i+1] = 1/2
    
A = np.zeros((n, n))
for i in range(n):
    A[i] = coef[i]

b = np.array([int(x) for x in input().split()])

ans = np.linalg.solve(A, b)

print(" ".join(map(str, map(int, ans))))

Fixed submission:
n = int(input())
A = [int(x) for x in input().split()]
S = sum(A)

X_1 = S
i = 0
while 2*i+1 < n:
    X_1 -= 2 * A[2*i+1]
    i += 1

X = [0] * n
X[0] = X_1

for i in range(n-1):
    X_i_1 = 2 * A[i] - X[i]
    X[i+1] = X_i_1
    
print(" ".join(map(str, X)))
Buggy python submission (verdict: Runtime Error):
n, m = [int(x) for x in input().split()]
l = [0] * m
r = [0] * m
for i in range(m):
    l[i], m[i] = map(int, input().split())

L = max(l)
R = min(r)

if L <= R:
    print(R - L + 1)
else:
    print(0)

Fixed submission:
n, m = [int(x) for x in input().split()]
l = [0] * m
r = [0] * m
for i in range(m):
    l[i], r[i] = map(int, input().split())

L = max(l)
R = min(r)

if L <= R:
    print(R - L + 1)
else:
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = [int(x) for x in input().split()]
l, r = [int(x) for x in input().split()]
s1 = {int(x) for x in range(l, r+1)}
for i in range(m-1):
    l, r = [int(x) for x in input().split()]
    s2 = {int(x) for x in range(l, r+1)}
    s1 = s1 & s2
    
print(len(s1))

Fixed submission:
n, m = [int(x) for x in input().split()]
l = [0] * m
r = [0] * m
for i in range(m):
    l[i], r[i] = map(int, input().split())

L = max(l)
R = min(r)

if L <= R:
    print(R - L + 1)
else:
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
l, r = map(int, input().split())
s1 = {int(x) for x in range(l, r+1)}
for i in range(m-1):
    l, r = map(int, input().split())
    s2 = {int(x) for x in range(l, r+1)}
    s1 = s1 & s2
    
print(len(s1))

Fixed submission:
n, m = [int(x) for x in input().split()]
l = [0] * m
r = [0] * m
for i in range(m):
    l[i], r[i] = map(int, input().split())

L = max(l)
R = min(r)

if L <= R:
    print(R - L + 1)
else:
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
l, r = map(int, input().split())
s1 = {int(x) for x in range(l, r+1)}
for i in range(m-1):
    l, r = map(int, input().split())
    s2 = {int(x) for x in range(l, r+1)}
    s1 = s2.intersection(s1)
    
print(len(s1))

Fixed submission:
n, m = [int(x) for x in input().split()]
l = [0] * m
r = [0] * m
for i in range(m):
    l[i], r[i] = map(int, input().split())

L = max(l)
R = min(r)

if L <= R:
    print(R - L + 1)
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = [int(x) for x in input().split()]

inf = 10 ** 10
dp = [inf] * n
dp[0] = 0

for i in range(n):
    for j in range(1, k+1):
        if i+j >= n:
            break
        dp[i+j] = min(dp[i+j], dp[i] + abs(h[i] - h[i+j]))
        
print(dp[n-1])

Fixed submission:
n, k = map(int, input().split())
h = [int(x) for x in input().split()]

inf = 10 ** 10
dp = [inf] * n
dp[0] = 0

for i in range(n):
    for j in range(1, k+1):
        if i+j >= n:
            break
        dp[i+j] = min(dp[i+j], dp[i] + abs(h[i] - h[i+j]))
        
print(dp[n-1])
Buggy python submission (verdict: Time Limit Exceeded):
n, w = map(int, input().split())
dp = [[0 for _ in range(w+1)] for _ in range(n+1)]


for i in range(n):
    wi, vi = map(int, input().split())
    sum_w = 0
    while sum_w <= w:
        if sum_w - wi >= 0:
            dp[i+1][sum_w] = max(dp[i+1][sum_w], dp[i][sum_w - wi] + vi)
        dp[i+1][sum_w] = max(dp[i+1][sum_w], dp[i][sum_w])
        sum_w += 1

print(dp[n][w])

Fixed submission:
n, w = map(int, input().split())
dp = [[0 for _ in range(w+1)] for _ in range(n+1)]


for i in range(n):
    wi, vi = map(int, input().split())
    sum_w = 0
    while sum_w <= w:
        if sum_w - wi >= 0:
            dp[i+1][sum_w] = max(dp[i+1][sum_w], dp[i][sum_w - wi] + vi)
        dp[i+1][sum_w] = max(dp[i+1][sum_w], dp[i][sum_w])
        sum_w += 1

print(dp[n][w])
Buggy python submission (verdict: Time Limit Exceeded):
import math 
def num_divisors_table(n):
  maxnum=math.floor((n + 1)/2) 
  length=n-maxnum
  aftersum=int(maxnum*length+length*(length+1)/2)
  aftersum+=(1+n)*n/2
  if n>=2:
    if n%2==0:
      aftersum+=(1+n/2)*n/2
    else:
      aftersum+=(1+(n-1)/2)*(n-1)/2

  for i in range(3, maxnum+1):
    for j in range(i, n+1, i):
      aftersum += j
  return aftersum

N=int(input())
print(int(num_divisors_table(N)))

Fixed submission:
import math 
def num_divisors_table(n):
  maxnum=math.floor((n + 1)/2) #3
  #table = [0 for _ in range(n+1)]
  length=n-maxnum
  aftersum=int(maxnum*length+length*(length+1)/2)
  aftersum+=(1+n)*n/2
  if n>=2:
    if n%2==0:
      aftersum+=(1+n/2)*n/2
    else:
      aftersum+=(1+(n-1)/2)*(n-1)/2

  for i in range(3, maxnum+1):
    for j in range(i, n+1, i):
      aftersum += j
      #print(i,j)
  return aftersum

N=int(input())
#Nlist,ans_1=num_divisors_table(N)
#print(Nlist)
print(int(num_divisors_table(N)))
#print(int(sum(Nlist)+ans_1))

Buggy python submission (verdict: Time Limit Exceeded):
import math 
def num_divisors_table(n):
  maxnum=math.floor((n + 1)/2) #3
  table = [0 for _ in range(n+1)]
  length=n-maxnum
  aftersum=int(maxnum*length+length*(length+1)/2)

  for i in range(1, maxnum+1):
    for j in range(i, n+1, i):
      aftersum += j
      #print(i,j)
  return aftersum

N=int(input())
#Nlist,ans_1=num_divisors_table(N)
#print(Nlist)
print(num_divisors_table(N))
#print(int(sum(Nlist)+ans_1))

Fixed submission:
import math 
def num_divisors_table(n):
  maxnum=math.floor((n + 1)/2) #3
  #table = [0 for _ in range(n+1)]
  length=n-maxnum
  aftersum=int(maxnum*length+length*(length+1)/2)
  aftersum+=(1+n)*n/2
  if n>=2:
    if n%2==0:
      aftersum+=(1+n/2)*n/2
    else:
      aftersum+=(1+(n-1)/2)*(n-1)/2

  for i in range(3, maxnum+1):
    for j in range(i, n+1, i):
      aftersum += j
      #print(i,j)
  return aftersum

N=int(input())
#Nlist,ans_1=num_divisors_table(N)
#print(Nlist)
print(int(num_divisors_table(N)))
#print(int(sum(Nlist)+ans_1))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
Alist=list(map(int,input().split()))
ans=1
for i in range(N):
  ans=ans*Alist[i]

if ans>10**18:
  print(-1)
else:
  print(ans)

Fixed submission:
N=int(input())
Alist=list(map(int,input().split()))
Alist.sort()
ans=1
err=0
for i in range(N):
  ans=ans*Alist[i]
  if ans>10**18:
    print(-1)
    err=1
    break
if err==0:
  print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
A,B,N=list(map(int,input().split()))
list_ans=[]
minimum=min(N-3,0)
for i in range(minimum,N+1):
  list_ans.append(int(A*i/B)-A*int(i/B))
print(int(max(list_ans)))

Fixed submission:
A,B,N=list(map(int,input().split()))
list_ans=[]
minimum=min(B-1,N)
print(int(A*minimum/B)-A*int(minimum/B))

Buggy python submission (verdict: Time Limit Exceeded):
A,B,N=list(map(int,input().split()))
list_ans=[]
minimum=min(N-10,0)
for i in range(minimum,N+1):
  list_ans.append(int(A*i/B)-A*int(i/B))
print(int(max(list_ans)))

Fixed submission:
A,B,N=list(map(int,input().split()))
list_ans=[]
minimum=min(B-1,N)
print(int(A*minimum/B)-A*int(minimum/B))

Buggy python submission (verdict: Time Limit Exceeded):
A,B,N=list(map(int,input().split()))
list_ans=[]
minimum=min(N-20,0)
for i in range(minimum,N+1):
  list_ans.append(int(A*i/B)-A*int(i/B))
print(int(max(list_ans)))

Fixed submission:
A,B,N=list(map(int,input().split()))
list_ans=[]
minimum=min(B-1,N)
print(int(A*minimum/B)-A*int(minimum/B))

Buggy python submission (verdict: Time Limit Exceeded):
A,B,N=list(map(int,input().split()))
list_ans=[]
minimum=min(N-100,0)
for i in range(minimum,N+1):
  list_ans.append(int(A*i/B)-A*int(i/B))
print(int(max(list_ans)))

Fixed submission:
A,B,N=list(map(int,input().split()))
list_ans=[]
minimum=min(B-1,N)
print(int(A*minimum/B)-A*int(minimum/B))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N,K = list(map(int, input().split()))
while True:
  temp_N=N-K
  if temp_N>0:
    N=np.abs(temp_N)
  else:
    break
if np.abs(temp_N)>N:
  print(N)
else:
  print(np.abs(temp_N))


Fixed submission:
n, k = map(int, input().split())
print(min(n%k, k - n%k))
Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()
if a==b and a==c:
  print("No")
else:
  print("Yes")

Fixed submission:
a=input()
if a[0]==a[1] and a[0]==a[2]:
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()
if a==b and a==c:
  print(No)
else:
  print(Yes)

Fixed submission:
a=input()
if a[0]==a[1] and a[0]==a[2]:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
n,a,b=input().split()
cicle=int(n/(a+b))
res=n-cicle*(a+b)
if res>a:
  ans=cicle*a+a
else:
  ans=cicle*a+res
print(ans)

Fixed submission:
n,a,b=(int(x) for x in input().split())
cycle=int(n/(a+b))
res=n-cycle*(a+b)
if res>a:
  ans=cycle*a+a
else:
  ans=cycle*a+res
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b=(int(x) for x in input().split())
if int(25*(a+1)/2)<int(10*b):
  print(-1)
if int(25*(a+1)/2)=int(10*b):
  if a%2==0:
    print(-1)
  else:
    print(int(25*a/2))
if int(10*(b+1))<=int(25*a/2):
  print(-1)
else:
  if a%2==1:
    print(max([int(25*a/2+1),int(10*b)]))
  else:
    print(max([int(25*a/2),int(10*b)]))
    

Fixed submission:
a,b=(int(x) for x in input().split())
if int(25*(a+1)/2)<int(10*b):
  print(-1)
elif int(25*(a+1)/2)==int(10*b):
  if a%2==1:
    print(-1)
  else:
    print(int(10*b))
elif int(10*(b+1))<=int(25*a/2):
  print(-1)
elif int(10*(b+1)-1)==int(25*a/2):
  if a%2==1:
    print(-1)
  else:
    print(int(25*a/2))  
else:
  if a%2==1:
    print(max([int(25*a/2+1),int(10*b)]))
  else:
    print(max([int(25*a/2),int(10*b)]))
Buggy python submission (verdict: Runtime Error):
yy,mm,dd =map(int,input().split('/'))

if yy>2019:
  print('TBD')
else:
  if mm>4:
    print('TBD')
  else:
    if mm==1 or mm==3:
      if dd>31:
        print('TBD')
      else:
        print('Heisei')
    if mm==2:
      if d>29:
        print('TBD')
      else:
        print('Heisei')
    if mm==4:
      if d>30:
        print('TBD')
      else:
        print('Heisei')




Fixed submission:
yy,mm,dd =map(int,input().split('/'))

if yy>2019:
  print('TBD')
else:
  if mm>4:
    print('TBD')
  else:
    if mm==1 or mm==3:
      if dd>31:
        print('TBD')
      else:
        print('Heisei')
    if mm==2:
      if dd>29:
        print('TBD')
      else:
        print('Heisei')
    if mm==4:
      if dd>30:
        print('TBD')
      else:
        print('Heisei')

Buggy python submission (verdict: Runtime Error):
yy,mm,dd =map(int,input().split('/'))

if yy>2019:
  print('TBD')
else:
  if mm>4:
    print('TBD')
  else:
    if mm==1 or mm==3:
      if dd>31:
        print('TBD')
      else:
        print('Heisei')
    if mm==2:
      if d>29:
        print('TBD')
      else:
        print('Heisei')
    if mm==4:
      if d>30:
        print('TBD')
      else:
        print('Heisei')



  if mm<=4:
    if dd<=30:
      print('Heisei')
else:
  print('TBD')



Fixed submission:
yy,mm,dd =map(int,input().split('/'))

if yy>2019:
  print('TBD')
else:
  if mm>4:
    print('TBD')
  else:
    if mm==1 or mm==3:
      if dd>31:
        print('TBD')
      else:
        print('Heisei')
    if mm==2:
      if dd>29:
        print('TBD')
      else:
        print('Heisei')
    if mm==4:
      if dd>30:
        print('TBD')
      else:
        print('Heisei')

Buggy python submission (verdict: Runtime Error):
yy,mm,dd =map(int,input().split('/'))

if yy>2019:
  print('TBD')
else:
  if mm>4:
    print('TBD')
  else:
    if mm==1 or m==3:
      if dd>31:
        print('TBD')
      else:
        print('Heisei')
    if mm==2:
      if d>29:
        print('TBD')
      else:
        print('Heisei')
    if mm==4:
      if d>30:
        print('TBD')
      else:
        print('Heisei')



  if mm<=4:
    if dd<=30:
      print('Heisei')
else:
  print('TBD')



Fixed submission:
yy,mm,dd =map(int,input().split('/'))

if yy>2019:
  print('TBD')
else:
  if mm>4:
    print('TBD')
  else:
    if mm==1 or mm==3:
      if dd>31:
        print('TBD')
      else:
        print('Heisei')
    if mm==2:
      if dd>29:
        print('TBD')
      else:
        print('Heisei')
    if mm==4:
      if dd>30:
        print('TBD')
      else:
        print('Heisei')
Buggy python submission (verdict: Runtime Error):
N = int(input())

answer=0
for _ in range(N):
    money_str, unit = input().split()
    money = float(money)
    if unit == "BTC":
        money *= 380000
    answer += money

print(answer)


Fixed submission:
N = int(input())

answer=0
for _ in range(N):
    money_str, unit = input().split()
    money = float(money_str)
    if unit == "BTC":
        money *= 380000
    answer += money

print(answer)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(a*b/2)

Fixed submission:
a,b,c=map(int,input().split())
print(int(a*b/2.0))
Buggy python submission (verdict: Runtime Error):
import itertools
import numpy as np

N, M, X = map(int, input().split())
lis_all = [list(map(int, input().split())) for _ in range(N)]

lis_C = np.array(list(map(lambda x: x[0], lis_all)))
lis_A = np.array(list(map(lambda x: x[1:], lis_all)))

row_idx = []
bools = [True,False]
for boollis in itertools.product(bools, repeat=M):
    row_idx.append(list(boollis))

c_min = lis_C.sum()+100
for i in range(len(lis_idx)):
    if all(lis_A[row_idx[i]].sum(axis=0) >= X):
        c_min = min(lis_C[row_idx[1]].sum(), c_min)
if c_min > lis_C.sum():
    ans = -1
else :
    ans = c_min
print(ans)

Fixed submission:
import itertools
import numpy as np

N, M, X = map(int, input().split())
lis_all = [list(map(int, input().split())) for _ in range(N)]

lis_C = np.array(list(map(lambda x: x[0], lis_all)))
lis_A = np.array(list(map(lambda x: x[1:], lis_all)))

row_idx = []
bools = [True,False]
for boollis in itertools.product(bools, repeat=N):
    row_idx.append(list(boollis))


c_min = lis_C.sum()+100
for i in range(len(row_idx)):
    if all(lis_A[row_idx[i]].sum(axis=0) >= X):
        c_min = min(lis_C[row_idx[i]].sum(), c_min)
if c_min > lis_C.sum():
    ans = -1
else :
    ans = c_min
print(ans)
Buggy python submission (verdict: Runtime Error):
N = input()
if '7' in N:
    pritn('Yes')
else :
    print('No')

Fixed submission:
N = input()
if '7' in N:
    print('Yes')
else :
    print('No')