Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
a = list(map(int,input().split()))
x = list(set(a))
b = []
for i in range(len(x)):
    b.append(a.count(x[i]))

b.sort(reverse = True)
c = len(b)
if c > k:
    d = c - k
    print(sum(b[c-d:c]))
else:
    print(0)


Fixed submission:
import collections
n,k = map(int,input().split())
a = list(map(int,input().split()))
l = collections.Counter(a)
l = list(l.values())
l.sort(reverse = True)
print(sum(l[k:]))
Buggy python submission (verdict: Runtime Error):
s = list(input())
l = ['K','I','H','B','R']
j = 0

for i in range(len(s)):
    if s[i] == 'A':
        if i == 0:
            pass
        elif s[i-1] == 'A':
            print('NO')
            exit(0)
        elif j == 1 or j == 2:
            print('NO')
            exit(0)
        else:
            pass
    elif s[i] != l[j]:
        print('NO')
        exit(0)
    else:
        j += 1

print('YES')

Fixed submission:
s = list(input())
l = ['K','I','H','B','R',-1]
j = 0

for i in range(len(s)):
    if s[i] == 'A':
        if i == 0:
            pass
        elif s[i-1] == 'A':
            print('NO')
            exit(0)
        elif j == 1 or j == 2:
            print('NO')
            exit(0)
        else:
            pass
    elif s[i] != l[j]:
        print('NO')
        exit(0)
    elif j > 4 and s[i] != 'A':
        print('NO')
        exit(0)
    else:
        j += 1

if j == 5:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
s = list(input())
l = ['K','I','H','B','R']
j = 0

for i in range(len(s)):
    if s[i] == 'A':
        if s[i - 1] == 'A':
            print('NO')
            exit(0)
        elif j ==  1 or j == 2:
            print('NO')
            exit(0)
        else:
            pass
    elif s[i] != l[j]:
        print('NO')
        exit(0)
    else:
        j += 1

print('YES')

Fixed submission:
s = list(input())
l = ['K','I','H','B','R',-1]
j = 0

for i in range(len(s)):
    if s[i] == 'A':
        if i == 0:
            pass
        elif s[i-1] == 'A':
            print('NO')
            exit(0)
        elif j == 1 or j == 2:
            print('NO')
            exit(0)
        else:
            pass
    elif s[i] != l[j]:
        print('NO')
        exit(0)
    elif j > 4 and s[i] != 'A':
        print('NO')
        exit(0)
    else:
        j += 1

if j == 5:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
n = int(input())
#j = L0
j = 2
#k = L1
k = 1

if n == 0:
    print(2)
if n == 1:
    print(1)

for i in range(1,n):
    l = j + k
    j = k
    k = l

print(l)

Fixed submission:
n = int(input())
#j = L0
j = 2
#k = L1
k = 1

if n == 0:
    print(2)
    exit(0)
if n == 1:
    print(1)
    exit(0)

for i in range(1,n):
    l = j + k
    j = k
    k = l

print(l)

Buggy python submission (verdict: Runtime Error):
n = int(input())
#j = L0
j = 2
#k = L1
k = 1

for i in range(1,n):
    l = j + k
    j = k
    k = l

print(l)

Fixed submission:
n = int(input())
#j = L0
j = 2
#k = L1
k = 1

if n == 0:
    print(2)
    exit(0)
if n == 1:
    print(1)
    exit(0)

for i in range(1,n):
    l = j + k
    j = k
    k = l

print(l)
Buggy python submission (verdict: Runtime Error):
x,y = input().split()
li = ['A','B','C','D',,'E','F']
x = li.index(x)
y = li.index(y)
if x < y:
    print('<')
elif x > y:
    print('>')
else:
    print('=')

Fixed submission:
x,y = input().split()
li = ['A','B','C','D','E','F']
x = li.index(x)
y = li.index(y)
if x < y:
    print('<')
elif x > y:
    print('>')
else:
    print('=')
Buggy python submission (verdict: Runtime Error):
n = int(input())
d = list(map(int,input().split()))
m = int(input())
t = list(map(int,input().split()))
d.sort()
t.sort()
j = 0
for i in range(n):
    if d[i] == t[j]:
        j += 1

if j == m:
    print('YES')
else:
    print('NO')

Fixed submission:
n = int(input())
d = list(map(int,input().split()))
m = int(input())
t = list(map(int,input().split()))
d.sort()
t.sort()
j = 0
for i in range(n):
    if d[i] == t[j]:
        j += 1
    if j == m:
        break

if j == m:
    print('YES')
else:
    print('NO')

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


for i in range(m):
    try:
        z = d.index(t[i])
    except ValueError:
        print('NO')
        exit(0)
    else:
        d.pop(z)

print('YES')

Fixed submission:
n = int(input())
d = list(map(int,input().split()))
m = int(input())
t = list(map(int,input().split()))
d.sort()
t.sort()
j = 0
for i in range(n):
    if d[i] == t[j]:
        j += 1
    if j == m:
        break

if j == m:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
import sys
N = int(input())
for h in range(1,3500):
    for n in range(1,3500):
        flg = False
        try:
            w = (N*h*n)/(4*h*n-N*n-N*h)
            if w >= 0 and w.is_integer():
                flg = True
        except:
            pass
        if flg:
            print(h,n,int(w))
            exit(0)

Fixed submission:
N = int(input())
for h in range(1,3500):
    for n in range(1,3500):
        flg = False
        try:
            w = (N*h*n)/(4*h*n-N*n-N*h)
            if w >= 0 and w.is_integer():
                flg = True
        except:
            pass
        if flg:
            print(h,n,int(w))
            exit(0)
Buggy python submission (verdict: Runtime Error):
s = list(int(input()))
print(s.count(1))

Fixed submission:
s = list(input())
print(s.count('1'))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
for i in range(n):
    b = int(input())
    if b in a:
        a.remove(b)
    else:
        a.append(b)

print(len(a))

Fixed submission:
import collections
n = int(input())
l = list(input() for i in range(n))
a = collections.Counter(l)
a = list(a.values())
p = 0
for i in range(len(a)):
    if a[i] % 2 != 0:
        p += 1
print(p)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(int(input()) for i in range(n))
b = list(set(a))
p = 0

for i in range(len(b)):
    if a.count(b[i]) % 2 != 0:
        p += 1

print(p)

Fixed submission:
import collections
n = int(input())
l = list(input() for i in range(n))
a = collections.Counter(l)
a = list(a.values())
p = 0
for i in range(len(a)):
    if a[i] % 2 != 0:
        p += 1
print(p)
Buggy python submission (verdict: Runtime Error):
s = list(input())
s = set(s)
s = sorted(s)
m = 'abcdefghijklmnopqrstuvwxyz'

for i in range(len(m)):
    if s[i] != m[i]:
        print(m[i])
        exit(0)

print('None')

Fixed submission:
s = list(input())
s = set(s)
s = sorted(s)
m = 'abcdefghijklmnopqrstuvwxyz'

for i in range(len(m)):
    if s[i] != m[i]:
        print(m[i])
        exit(0)

    if i + 1 != len(m) and i + 1 == len(s):
        print(m[i + 1])
        exit(0)

print('None')

Buggy python submission (verdict: Runtime Error):
s = list(input())
s = set(s)
s = sorted(s)
m = 'abcdefghijklmnopqrstuvwxyz'

for i in range(26):
    if s[i] != m[i]:
        print(m[i])
        exit(0)

print('None')

Fixed submission:
s = list(input())
s = set(s)
s = sorted(s)
m = 'abcdefghijklmnopqrstuvwxyz'

for i in range(len(m)):
    if s[i] != m[i]:
        print(m[i])
        exit(0)

    if i + 1 != len(m) and i + 1 == len(s):
        print(m[i + 1])
        exit(0)

print('None')

Buggy python submission (verdict: Runtime Error):
s = list(input())
s = set(s)
s = sorted(s)
m = 'abcdefghijklmnopqrstuvwxyz'

for i in range(26):
    if s[i] != m[i]:
        print(s[0])
        exit(0)

print('None')

Fixed submission:
s = list(input())
s = set(s)
s = sorted(s)
m = 'abcdefghijklmnopqrstuvwxyz'

for i in range(len(m)):
    if s[i] != m[i]:
        print(m[i])
        exit(0)

    if i + 1 != len(m) and i + 1 == len(s):
        print(m[i + 1])
        exit(0)

print('None')
Buggy python submission (verdict: Runtime Error):
n = int(input())
m = n // 100
if m == n[-1]:
    print('Yes')
else:
    print('No')

Fixed submission:
n = int(input())
i = str(n)
m = n // 100
if str(m) == i[-1]:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int(input().split()))

if b > c:
    print(b - c)
else:
    print(0)

Fixed submission:
a,b,c,d = map(int,input().split())
if max(a,c) > min(b,d):
    print(0)
else:
    print(min(b,d) - max(a,c))
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
a = []
z = []
p = 0
for i in range(m):
    x,y = map(int,input().split())
    if x == 1:
        z.append(y)
    elif y == n:
        a.append(x)
        p += 1
    else:
        pass
flg = False
for i in range(p):
    if a[i] in z:
        flg = True
        break
if flg:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Fixed submission:
n,m = map(int,input().split())
a = [] # 1 → x
z = [] # x → n
an = 0
zn = 0
for i in range(m):
    x,y = map(int,input().split())
    if x == 1:
        zn += 1
        z.append(y)
    elif y == n:
        an += 1
        a.append(x)
    else:
        pass
a.sort()
z.sort()
i = 0
j = 0
while i < an and j < zn:
    if a[i] == z[j]:
        print('POSSIBLE')
        exit(0)
    else:
        if a[i] > z[j]:
            j += 1
        else:
            i += 1
print('IMPOSSIBLE')

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
l = [list(map(int,input().split())) for i in range(m)]
l.sort()
a,b = [list(i) for i in zip(*l)]
z = []
for i in range(m):
    if a[i] == 1:
        x = b[i]
        for j in range(i+1,m):
            if x == a[j]:
                if n == b[j]:
                    print('POSSIBLE')
                    exit(0)
            elif x >= a[j]:
                pass
            else:
                break
    else:
        break
print('IMPOSSIBLE')

Fixed submission:
n,m = map(int,input().split())
a = [] # 1 → x
z = [] # x → n
an = 0
zn = 0
for i in range(m):
    x,y = map(int,input().split())
    if x == 1:
        zn += 1
        z.append(y)
    elif y == n:
        an += 1
        a.append(x)
    else:
        pass
a.sort()
z.sort()
i = 0
j = 0
while i < an and j < zn:
    if a[i] == z[j]:
        print('POSSIBLE')
        exit(0)
    else:
        if a[i] > z[j]:
            j += 1
        else:
            i += 1
print('IMPOSSIBLE')
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
l = list(map(int,input().split()))
l = list.sort(l,reverse = True)
c = 0

for i in range(l):
    c += l[i]

print(c)

Fixed submission:
n,k = map(int,input().split())
l = list(map(int,input().split()))
list.sort(l,reverse = True)
c = 0

for i in range(k):
    c = c + l[i]

print(c)
Buggy python submission (verdict: Time Limit Exceeded):
n,p = map(int,input().split())
a = list(map(int,input().split()))
z = 0
for i in range(2**n):
    x = i
    y = 0
    for j in range(n):
        if x % 2 != 0:
            y += a[j]
        x = x // 2
        if x == 0:
            break
    if y % 2 == p:
        z += 1
print(z)

Fixed submission:
n,p = map(int,input().split())
a = list(map(int,input().split()))
flg = True
for i in a:
    if i % 2 != 0:
        flg = False
        break
if flg:
    if p == 0:
        print(2**n)
    else:
        print(0)
else:
    print(2**(n-1))
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())

m = [a + b,a + c,b + c]

print(m(min))


Fixed submission:
a,b,c = map(int,input().split())

m = min(a + b,a + c,b + c)

print(m)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(input().split())
b = []
for i in range(n):
    b.append(a[i])
    b = b[::-1]
print(' '.join(b))

Fixed submission:
n = int(input())
a = list(input().split())
b = []
a = a[::-1]
for i in range(n)[::2]:
    b.append(a[i])
a = a[::-1]
if n % 2 != 0:
    a.pop(0)
for i in range(len(a))[::2]:
    b.append(a[i])
print(' '.join(b))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(int(input()) for i in range(n))
t = []
o = 1

while o != 2:
    if o in t:
        print(-1)
        exit(0)
    t.append(o)
    o = a[o-1]

print(len(t))

Fixed submission:
n = int(input())
a = list(int(input()) for i in range(n))
t = []
o = 1

while o != 2:
    if len(t) > n:
        print(-1)
        exit(0)
    t.append(o)
    o = a[o-1]

print(len(t))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
t = [0] * 9
 
for i in range(n):
    t[a[i] // 400] += 1
 
z = t.pop(8)
p = t.count(0)
amax = min(8,8-p+z)
if p == 8:
    amin = 1
else:
    amin = 8 - p

print(amin,amax)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
t = [0] * 8
p = 0

for i in range(n):
    if a[i] < 3200:
        t[a[i] // 400] = 1
    else:
        p += 1

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

for i in range(n):
    for j in range(n):
        t = 1
        for k in range(m):
            for l in range(m):
                if a[i+k][j+l] != b[k][l]:
                    t = 0
        if t == 1:
            print('Yes')
            exit(0)

print('No')

Fixed submission:
n,m = map(int,input().split())
a = [list(input()) for i in range(n)]
b = [list(input()) for i in range(m)]

for i in range(n-m+1):
    for j in range(n-m+1):
        t = 1
        for k in range(m):
            for l in range(m):
                if a[i+k][j+l] != b[k][l]:
                    t = 0
        if t == 1:
            print('Yes')
            exit(0)

print('No')
Buggy python submission (verdict: Time Limit Exceeded):
from math import factorial
n = int(input())
m = factorial(n)
s = 2
ans = 1
while s > 1:
    c = 1
    while m % s == 0:
        c += 1
        m = m // s
    ans *= c
    s += 1
print(ans % (10**9+7))

Fixed submission:
from math import factorial
n = int(input())
m = factorial(n)
s = 2
ans = 1
while m != 1:
    c = 1
    while m % s == 0:
        c += 1
        m = m // s
    ans *= c
    s += 1
print(ans % (10**9+7))
Buggy python submission (verdict: Runtime Error):
a,b,c = input().split(',')
print(a + '' + B + '' + C)

Fixed submission:
a,b,c = input().split(',')
print(a + ' ' + b + ' ' + c)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,x = map(int,input().split())
k = 0

b -= b % x

while b >= a:
    b -= x
    k += 1

print(k)

Fixed submission:
a,b,x = map(int,input().split())
b = b // x + 1
a = (a - 1) // x + 1
print(b - a)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,x = map(int,input().split())
t = 0

for i in range(a,b+1):
    if i % x == 0:
        t += 1

print(t)

Fixed submission:
a,b,x = map(int,input().split())
b = b // x + 1
a = (a - 1) // x + 1
print(b - a)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
x,y = map(int,input().split())
for i in range(n-1):
    t,a = map(int,input().split())
    o = t
    p = a
    while x > o or y > p:
        o += t
        p += a
    x = o
    y = p
print(x+y)

Fixed submission:
n = int(input())
A,B = 0,0
for i in range(n):
    x,y = map(int,input().split())
    t,a = 1,1
    if A > x:
        t = A // x
        if A % x != 0:
            t += 1
    if B > y:
        a = B // y
        if B % y != 0:
            a += 1
    m = max(t,a)
    A = x*m
    B = y*m
print(A+B)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
x,y = map(int,input().split())
for i in range(n-1):
    t,a = map(int,input().split())
    o = t
    p = a
    while x > o or y > p:
        o += t
        p += a
    x = o
    y = p
print(x+y)

Fixed submission:
n = int(input())
A,B = 0,0
for i in range(n):
    x,y = map(int,input().split())
    t,a = 1,1
    if A > x:
        t = A // x
        if A % x != 0:
            t += 1
    if B > y:
        a = B // y
        if B % y != 0:
            a += 1
    m = max(t,a)
    A = x*m
    B = y*m
print(A+B)
Buggy python submission (verdict: Runtime Error):
s = list(input())
print(s[:4] + ' ' + s[4:])

Fixed submission:
s = input()
print(s[:4] + ' ' + s[4:])

Buggy python submission (verdict: Runtime Error):
s = list(input())
s = s.insert(4,' ')
print(''.join(s))


Fixed submission:
s = input()
print(s[:4] + ' ' + s[4:])
Buggy python submission (verdict: Runtime Error):
s = list(input())
n = s.count('N')
w = s.count('W')
s = s.count('S')
e = s.count('E')
if (n + s) % 2 == 0 and (w + e) % 2 == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
s = list(input())
we = [0,0]
ns = [0,0]

for i in range(len(s)):
    if s[i] == ('N'):
        ns[0] = 1
    elif s[i] == ('W'):
        we[0] = 1
    elif s[i] == ('S'):
        ns[1] = 1
    else:
        we[1] = 1

if sum(we) % 2 == 0 and sum(ns) % 2 == 0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
s = input()
we = [0,0]
ns = [0,0]

for i in range(len(s)):
    if s[i] == ('N'):
        ns[0] == 1
    elif s[i] == ('W'):
        we[0] == 1
    elif s[i] == ('S'):
        ns[1] == 1
    else
        we[1] == 1

if sum(we) % 2 == 0 and sum(ns) % 2 == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
s = list(input())
we = [0,0]
ns = [0,0]

for i in range(len(s)):
    if s[i] == ('N'):
        ns[0] = 1
    elif s[i] == ('W'):
        we[0] = 1
    elif s[i] == ('S'):
        ns[1] = 1
    else:
        we[1] = 1

if sum(we) % 2 == 0 and sum(ns) % 2 == 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n,l = map(int,input().split())
s = []

for i in range(n):
    s.append(input())

g = sorted(s)

print(''.join(g))

Fixed submission:
A,B,C= input().split()
Sum = int(A) + int(B) + int(C)
if Sum == 17:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
p=input()
if p[len(p)-1]=='s':
  p.append('es')
  print(p)
else:
  p.append('s')
  print(p)
  

Fixed submission:
p =input()
if p[len(p) - 1] == 's':
    print(p+'es')
else:
    print(p+'s')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

ans = 1

for i in range(n):
    ans *= a[i]

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


Fixed submission:
import sys


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

ans = 1

for i in a:
    if i == 0:
        print(0)
        sys.exit(0)

for i in range(n):
    ans *= a[i]
    if ans > 10**18:
        print(-1)
        sys.exit(0)

if ans > 10**18:
    print(-1)
else:
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def GCD(a, b):
    if b == 0:
        return a
    else:
        return GCD(b, a % b)


def LCM(a, b):
    return (a // GCD(a, b)) * b


MOD = 1000000007

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

l = 1
for i in range(n):
    l = LCM(l, a[i])

ans = 0
for i in range(n):
    num = l // a[i]
    ans += num
    ans = ans % MOD
print(ans)


Fixed submission:
MOD = 1000000007


def GCD(a, b):
    if b == 0:
        return a
    else:
        return GCD(b, a % b)


def modinv(a, mod=MOD):
    b = mod
    u = 1
    v = 0
    while b > 0:
        t = a // b
        a -= t * b
        a, b = b, a
        u -= t * v
        u, v = v, u
    u %= mod
    if u < 0:
        u += mod
    return u


def LCM(a, b):
    return (a // GCD(a, b)) * b


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

l = 1
for i in range(n):
    l = LCM(l, a[i])
ans = 0
l %= MOD
for i in range(n):
    ans += l * modinv(a[i]) % MOD
    ans %= MOD
print(ans)
Buggy python submission (verdict: Runtime Error):
n,a,b=int(input())
p = min(a,b)
q = max(a+b-n,0)
print(str(p) + " " + str(q))

Fixed submission:
n,a,b=map(int, input().split())
p = min(a,b)
q = max(a+b-n,0)
print(str(p) + " " + str(q))

Buggy python submission (verdict: Runtime Error):
n,a,b=int(input())
print(str(min(a,b)) + ' ' + str(max(a+b-n,0)))

Fixed submission:
n,a,b=map(int, input().split())
p = min(a,b)
q = max(a+b-n,0)
print(str(p) + " " + str(q))
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1}; // 移動方向


int n;
int h[101];

void input(){
    cin >> n;
    for(int i=0;i<n;i++) cin >> h[i];
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    input();
    int cnt = 0;
    for(int l=0;l<n;l++){
        while(h[l] > 0){
            int r;
            for(r=l+1;r<n;r++){
                if (h[r] == 0) break; 
            }
            for(int x=l;x<r;x++) h[x]--;
            cnt++;
        }
    }
    cout << cnt << endl;
    return 0;
}

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

def lsearch(h): # 左端を探す
    for i in range(len(h)):
        if h[i] != 0:
            return i
    return len(h)-1

def rsearch(h, l): # 右端を探す
    for i in range(l, len(h)):
        if h[i] == 0:
            return i
    return len(h)

n=int(input())
h=list(map(int, input().split()))
cnt=0
while any(h):
    l=lsearch(h)
    r=rsearch(h, l)
    for i in range(l, r):
        h[i] -= 1
    cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
n,h,w=map(int,input().split())
ab=[list(int(input()).split()) for i in range(n)]
c=0
for i in ab:
  if i[0] >= h and i[1] >= w:
    c+=1
    
print(c)

Fixed submission:
n,h,w=map(int,input().split())
ab=[tuple(map(int, input().split())) for i in range(n)]
c=0
for i in ab:
  if i[0] >= h and i[1] >= w:
    c+=1
    
print(c)
Buggy python submission (verdict: Runtime Error):
d=int(input())
if d == 25:
  print('Christmas')
else if d == 24:
  print('Christmas Eve')
else if d == 23:
  print('Christmas Eve Eve')
else if d == 22:
  print('Christmas Eve Eve Eve')

Fixed submission:
d=int(input())
if d == 25:
  print('Christmas')
elif d == 24:
  print('Christmas Eve')
elif d == 23:
  print('Christmas Eve Eve')
elif d == 22:
  print('Christmas Eve Eve Eve')
Buggy python submission (verdict: Runtime Error):
N = int(input())
def dfs(s):
    if int(s) > N:
        return 0
    if all(s.count(c) > 0 for c in '753'):
        ret = 1
    else:
        ret = 0
    for c in '753':
        ret += dfs(s+c)
	return ret
  
print(dfs('0'))


Fixed submission:
N = int(input())
def dfs(s):
    if int(s) > N:
        return 0
    if all(s.count(c) > 0 for c in '753'):
        ret = 1
    else:
        ret = 0
    for c in '753':
        ret += dfs(s+c)
    return ret

print(dfs('0'))

Buggy python submission (verdict: Runtime Error):
N = int(input())
def dfs(s):
    if int(s) > N:
        return 0
    if all(s.count(c) > 0 for c in '753'):
        ret = 1
    else:
        ret = 0
    for c in '753':
        ret += dfs(s+c)

print(dfs('0'))

Fixed submission:
N = int(input())
def dfs(s):
    if int(s) > N:
        return 0
    if all(s.count(c) > 0 for c in '753'):
        ret = 1
    else:
        ret = 0
    for c in '753':
        ret += dfs(s+c)
    return ret

print(dfs('0'))
Buggy python submission (verdict: Runtime Error):
n = int(input())
num = [111,222,333,444,555,666,777,888,999]
for i in range(len(num) - 1):
    if num[i] == n:
        x = num[i]
        break
    if num[i] < n and n < num[i+1]:
        mn = min(abs(n - num[i]),abs(n - num[i+1]))
        if mn == abs(n - num[i]):
            x = num[i]
        else:
            x = num[i+1]
        break
print(x)

Fixed submission:
n = int(input())
if n % 111 == 0:
    x = n
else:
    x = ((n // 111) + 1) * 111
print(x)
Buggy python submission (verdict: Runtime Error):
s=input()
ans=0
for i in range(4):
  if s[i]='+':
    ans += 1
  else:
    ans -= 1
print(ans)

Fixed submission:
s=input()
ans=0
for i in range(4):
  if s[i]=='+':
    ans += 1
  else:
    ans -= 1
print(ans)