Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a = [list(map(int,input().split())) for i in range(3)]
n = int(input())
b = [int(input() )for _ in range(n)]

print(a,n,b)
for i in range(3):
    for j in range(3):
        if a[i][j] in b:
            a[i][j] = 0

for i in range(3):
    if a[i] == [0,0,0]:
        print('Yes')
        exit()
for i in range(3):
    if a[j0][i] == 0 and a[1][i] == 0 and a[2][i] == 0:
        print('Yes')
        exit()
if a[0][0] == 0 and a[1][1] == 0 and a[2][2] == 0:
    print('Yes')
    exit()
if a[2][0] == 0 and a[1][1] == 0 and a[0][2] == 0:
    print('Yes')
    exit()
print('No')

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

for i in range(3):
    for j in range(3):
        if a[i][j] in b:
            a[i][j] = 0

for i in range(3):
    if a[i][0] == 0 and a[i][1] == 0 and a[i][2] == 0:
        print('Yes')
        exit()
for i in range(3):
    if a[0][i] == 0 and a[1][i] == 0 and a[2][i] == 0:
        print('Yes')
        exit()
if a[0][0] == 0 and a[1][1] == 0 and a[2][2] == 0:
    print('Yes')
    exit()
if a[2][0] == 0 and a[1][1] == 0 and a[0][2] == 0:
    print('Yes')
    exit()
print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

cnt = [0] * 10**9
for i in a:
    cnt[i-1] += 1
if n == a.count(1):
    print('YES')
else:
    print('NO')

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
for i in range(n-1):
    if a[i] == a[i+1]:
        print('NO')
        exit()
print('YES')

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

cnt = [0] * 10**9
for i in a:
    cnt[i-1] += 1
if n == a.count(1):
    print('Yes')
else:
    print('No')

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
for i in range(n-1):
    if a[i] == a[i+1]:
        print('NO')
        exit()
print('YES')
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
ans = ''
if a <= b:
    for _ in range(b):
        ans.join(a)
else: 
    for _ in range(a):
        ans.join(b)
print(ans)


Fixed submission:
a,b = map(int,input().split())
ans = ''
if a <= b:
    for _ in range(b):
        ans+=str(a)
else: 
    for _ in range(a):
        ans+=str(b)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))
cnt = n

for i in range(n):
    for j in range(i+1):
        if p[i] > p[j]:
            cnt -= 1
            break
print(cnt)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
cnt = 0
minx = max(p)
for i in range(n):
    minx = min(p[i],minx)
    if minx >= p[i]:
        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split())))
ans = 0
b = 10 ** 9
temp = 0

for i in h:
    if i <= b
        temp += 1
    else:
        temp = 0
    b = i
    ans = max(ans,temp)
print(ans)
    

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
ans = 0
b = 0
temp = 0

for i in h:
    if i <= b:
        temp += 1
    else:
        temp = 0
    b = i
    ans = max(ans,temp)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [i for i in range(1,n+1)]
print(sum(a)-n)

Fixed submission:
n = int(input())
print(((n+1)*n)//2-n)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [i for i in range(1,n+1)]
print(sum(a)-max(a))

Fixed submission:
n = int(input())
print(((n+1)*n)//2-n)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for _ in range(n)]

maxa = max(a)
maxb = max(a)
cntmax = a.count(maxa)
if cntmax >= 2:
    for i in range(n):
        print(maxa)
    exit()
else:
    maxi = a.index(maxa)
    if maxi >= 1:
        x = max(a[:maxi])
    if maxi < n - 1 :
        y = max(a[maxi+1:])
    maxb = max(x,y)

for i in a:
    if i == maxa:
        print(maxb)
    else:
        print(maxa)

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]

maxa = max(a)
maxb = max(a)
cntmax = a.count(maxa)
if cntmax >= 2:
    for i in range(n):
        print(maxa)
    exit()
else:
    maxi = a.index(maxa)
    x = 0
    y = 0
    if maxi >= 1:
        x = max(a[:maxi])
    if maxi < n - 1 :
        y = max(a[maxi+1:])
    maxb = max(x,y)

for i in a:
    if i == maxa:
        print(maxb)
    else:
        print(maxa)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for _ in range(n)]

for i in range(n):
    x = 0
    y = 0
    if i >= 1:
        x = max(a[:i])
    if i < n - 1 :
        y = max(a[i+1:])
    print(max(x,y))

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]

maxa = max(a)
maxb = max(a)
cntmax = a.count(maxa)
if cntmax >= 2:
    for i in range(n):
        print(maxa)
    exit()
else:
    maxi = a.index(maxa)
    x = 0
    y = 0
    if maxi >= 1:
        x = max(a[:maxi])
    if maxi < n - 1 :
        y = max(a[maxi+1:])
    maxb = max(x,y)

for i in a:
    if i == maxa:
        print(maxb)
    else:
        print(maxa)
Buggy python submission (verdict: Runtime Error):

import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

a,b,c,d = map(int,input().split())
all = b - a + 1
if c == 1 or d == 1:
    print(0)
    exit()

cd = lcm(a, b)

cs = b//c - a//c + 1
ds = b//d - a//d + 1
cds = b//cd - a//cd + 1

print(all - cs - ds + cds)


Fixed submission:
from fractions import gcd
import math

def lcm(x, y):
    return (x * y) // gcd(x, y)
a,b,c,d = map(int,input().split())
all = b - a + 1
if c == 1 or d == 1:
    print(0)
    exit()

cd = lcm(c, d)

cs = b//c - math.ceil(a/c) + 1
ds = b//d - math.ceil(a/d) + 1
cds = b//cd - math.ceil(a/cd) + 1

print(all - cs - ds + cds)
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
lr = [[] for i in range(m)]
cnt = 0
for _ in range(m):
    l,r = map(int,input().split())
    lr[_].append(l)
    lr[_].append(r)

for nn in range(1,n+1):
    ok = True
    for ran in lr:
        if ran[0] > nn or ran[1] < nn:
            ok = False
    if ok:
        cnt += 1
print(cnt)

Fixed submission:
n,m = map(int,input().split())
ls = [i for i in range(m)]
rs = [i for i in range(m)]
cnt = 0
for _ in range(m):
    ls[_],rs[_] = map(int,input().split())

maxl = max(ls)
minr = min(rs)

for nn in range(1,n+1):
    if maxl <= nn and minr >= nn:
        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):

s = input()
sa = int(s[:2])
sb = int(s[3:])

if sa >= 1 and sa <= 12 and sb >= 1 and  sb <= 12:
    print('AMBIGUOUS')
    exit()
else
    if sa >= 1 and sa <= 12:
        print('MMYY')
        exit()
    if sb >= 1 and sb <= 12:
        print('YYMM')
        exit()

print('NA')

Fixed submission:

s = input()
sa = int(s[:2])
sb = int(s[2:])

if sa >= 1 and sa <= 12 and sb >= 1 and  sb <= 12:
    print('AMBIGUOUS')
    exit()
else:
    if sa >= 1 and sa <= 12:
        print('MMYY')
        exit()
    if sb >= 1 and sb <= 12:
        print('YYMM')
        exit()

print('NA')

Buggy python submission (verdict: Runtime Error):

s = input()
sa = int(s[:2])
sb = int(s[3:])

if sa >= 1 and sa <= 12 and sb >= 1 and  sb <= 12:
    print('AMBIGUOUS')
    exit()
if sa > 12 and sb > 12:
    print('NA')
    exit()
if sa >= 1 and sa <= 12 and sb > 12:
    print('MMYY')
    exit()
if sa > 12 and sb >= 1 sb <= 12:
    print('YYMM')
    exit()


Fixed submission:

s = input()
sa = int(s[:2])
sb = int(s[2:])

if sa >= 1 and sa <= 12 and sb >= 1 and  sb <= 12:
    print('AMBIGUOUS')
    exit()
else:
    if sa >= 1 and sa <= 12:
        print('MMYY')
        exit()
    if sb >= 1 and sb <= 12:
        print('YYMM')
        exit()

print('NA')
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ans=0
for i in range(1,n+1):
    x,y=i,(n//i)*i
    ans+=((n//i)*(x+y)//2)
print(ans)

Fixed submission:
n=int(input())
ans=0
for i in range(1,n+1):
    x,y=i,(n//i)*i
    ans+=((n//i)*(x+y)//2)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

q = int(input())
b = []
c = []

for i in range(q):
    B, C = [int(i) for i in input().split()]
    b.append(B)
    c.append(C)

int_list = {}

for i in a:
    int_list[i] = 0

for i in a:
    int_list[i] += 1

ans = 0
for k, v in int_list.items():
    ans += k*v # 3


for i in range(q):
    ans = 0
    p = int_list[b[i]] # 1 1
    ans = 0
    int_list[b[i]] = 0
    try:
        int_list[c[i]] += p
    except KeyError:
        int_list[c[i]] = p
    for k, v in int_list.items():
        ans += k*v
    
    print(ans)

Fixed submission:
MX = 100005
n = int(input())
cnt = [0] * MX
a = list(map(int, input().split()))

for i in a:
    cnt[i] += 1

total = 0

for i in range(MX):
    total += i*cnt[i]

q = int(input())
b = []
c = []
 
for i in range(q):
    B, C = [int(i) for i in input().split()]
    b.append(B)
    c.append(C)

for i in range(q):
    total -= b[i]*cnt[b[i]]
    total -= c[i]*cnt[c[i]]
    cnt[c[i]] += cnt[b[i]]
    cnt[b[i]] = 0
    total += c[i]*cnt[c[i]]
    print(total)
Buggy python submission (verdict: Runtime Error):
import sympy
n = int(input())

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

a.sort(reverse = True)

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

if len(set(a)) == 1:
    print(0)
else:
    
    
    ans = 0

    for i in range(n):
        target = sympy.divisors(a[i])
        if len(set(target) & set(a)) == 1:
            ans += 1

    print(ans)
        

Fixed submission:
n = int(input())

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

M = 1000005

cnt = [0 for i in range(M)]

for x in a:
    if cnt[x] != 0:
        cnt[x] = 2
        continue
    for i in range(x, M, x):
        cnt[i] += 1

ans = 0

for x in a:
    if cnt[x] == 1:
        ans += 1
    
print(ans)

Buggy python submission (verdict: Runtime Error):
import sympy
#sympy.divisors(10**9)
n = int(input())

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

a.sort(reverse = True)

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

if len(set(a)) == 1:
    print(0)
else:
    
    
    ans = 0

    for i in range(n):
        target = make_divisors(a[i])
        if len(set(target) & set(a)) == 1:
            ans += 1

    print(ans)
        

Fixed submission:
n = int(input())

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

M = 1000005

cnt = [0 for i in range(M)]

for x in a:
    if cnt[x] != 0:
        cnt[x] = 2
        continue
    for i in range(x, M, x):
        cnt[i] += 1

ans = 0

for x in a:
    if cnt[x] == 1:
        ans += 1
    
print(ans)

Buggy python submission (verdict: Runtime Error):
import sympy
sympy.divisors(10**9)
n = int(input())

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

a.sort(reverse = True)

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

if len(set(a)) == 1:
    print(0)
else:
    
    
    ans = 0

    for i in range(n):
        target = make_divisors(a[i])
        if len(set(target) & set(a)) == 1:
            ans += 1

    print(ans)
        

Fixed submission:
n = int(input())

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

M = 1000005

cnt = [0 for i in range(M)]

for x in a:
    if cnt[x] != 0:
        cnt[x] = 2
        continue
    for i in range(x, M, x):
        cnt[i] += 1

ans = 0

for x in a:
    if cnt[x] == 1:
        ans += 1
    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

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

for i in range(1, n+1):
    print(a.count(i))

Fixed submission:
n = int(input())

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

men = {}

for i in range(1, n+1):
    men[i] = 0

for i in a:
    men[i] += 1

for i in range(1, n+1):
    print(men[i])
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations

n, k = map(int, input().split())

def choose(select):
    wa = []
    ans = 0
    for combi in combinations(range(n+1), select):
        tmp_wa = 0
        for i in range(select):
            tmp_wa += combi[i]
        if tmp_wa in wa:
            continue
        else:
            wa.append(tmp_wa)
            ans += 1
    
    return ans
            

res = 0

for i in range(k, n+2):
    res += choose(i) % (pow(10, 9) + 7)

print(res)

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

ans = 0

def select(l, r):
    return (l+r)*(r-l+1) // 2

for i in range(k, n+2):
    l = select(0, i-1)
    r = select(n-i+1, n)
    ans += (r-l+1) 
    ans %= (pow(10, 9) + 7)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()

ans = 0

for i in range(n):
    for j in range(i+1, n):
        for k in range(j+1, n):
            if s[i] != s[j] and s[j] != s[k] and s[k] != s[i] and j-i != k-j:
                ans += 1

print(ans)
            

Fixed submission:
n = int(input())
s = input()

a = [0]*n

for i in range(n):
    if s[i] == 'R':
        a[i] = 0
    if s[i] == 'G':
        a[i] = 1
    if s[i] == 'B':
        a[i] = 2

cnt = [0]*3

for i in range(n):
    cnt[a[i]] += 1

ans = 1

for i in range(3):
    ans *= cnt[i]

for j in range(n):
    for i in range(j):
        k = j + (j-i)
        if k < n:
            
            if a[i] == a[j]:
                continue
            if a[j] == a[k]:
                continue
            if a[k] == a[i]:
                continue
            ans -= 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

n, x, y = map(int, input().split())

inf = 100100100
x -= 1
y -= 1

ans = [0] * n

for i in range(n):
    dist = [inf] * n
    queue = deque()
    queue.append(i)
    dist[i] = 0
    while queue:
        current = queue.popleft()
        d = dist[current]

        if current - 1 >= 0 and dist[current - 1] == inf:
            queue.append(current - 1)
            dist[current - 1] = d + 1
        if current + 1 < n and dist[current + 1] == inf:
            queue.append(current + 1)
            dist[current + 1] = d + 1
        if current == x and dist[y] == inf:
            queue.append(y)
            dist[y] = d + 1
        if current == y and dist[x] == inf:
            queue.append(x)
            dist[x] = d + 1

    for j in range(n):
        ans[dist[j]] += 1

for k in range(1, n):
    print(ans[k] // 2)


Fixed submission:
from collections import deque

n, x, y = map(int, input().split())

inf = 100100100
x -= 1
y -= 1

ans = [0] * n

for i in range(n):
    dist = [inf] * n
    queue = deque()
    queue.append(i)
    dist[i] = 0
    while queue:
        current = queue.popleft()
        d = dist[current]

        if current - 1 >= 0 and dist[current - 1] == inf:
            queue.append(current - 1)
            dist[current - 1] = d + 1
        if current + 1 < n and dist[current + 1] == inf:
            queue.append(current + 1)
            dist[current + 1] = d + 1
        if current == x and dist[y] == inf:
            queue.append(y)
            dist[y] = d + 1
        if current == y and dist[x] == inf:
            queue.append(x)
            dist[x] = d + 1

    for j in range(n):
        ans[dist[j]] += 1

for k in range(1, n):
    print(ans[k] // 2)
Buggy python submission (verdict: Runtime Error):
x, y, a, b, c = map(int, input().split())

p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

eat_list = []

for _ in range(x):
    if p[0] < r[0]:
        eat_list.append(r.pop(0))
    else:
        eat_list.append(p.pop(0))

for _ in range(y):
    if q[0] < r[0]:
        eat_list.append(r.pop(0))
    else:
        eat_list.append(q.pop(0))

print(sum(eat_list))
    

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

p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p.sort(reverse=True)
q.sort(reverse=True)

eat_list = []

for i in range(x):
    eat_list.append(p[i])
for i in range(y):
    eat_list.append(q[i])
for i in range(c):
    eat_list.append(r[i])
    
eat_list.sort(reverse=True)

ans = 0

for i in range(x+y):
    ans += eat_list[i]

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
x = []
y = []
for i in range(N):
    a,b = map(int, (input().split()))
    x.append(a)
    y.append(b)
​
aaa = 0
for i in range(N):
    for k in range(N):
        aaa += ((x[i] - x[k])**2+(y[i] - y[k])**2)**0.5
print(aaa/N)

Fixed submission:
N = int(input())
x = []
y = []
for i in range(N):
    a,b = map(int, (input().split()))
    x.append(a)
    y.append(b)
aaa = 0
for i in range(N):
    for k in range(N):
        aaa += ((x[i] - x[k])**2+(y[i] - y[k])**2)**0.5
print(aaa/N)
Buggy python submission (verdict: Runtime Error):
s = int(input())

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

count = 0
box = []

for i in range(s-1):
    if a[i] >= a[i+1]:
        count += 1
    else:
        count = 0
        
    box.append(count)
    
print(max(box))
        


Fixed submission:
s = int(input())

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

count = 0
box = []


for i in range(s-1):
    if a[i] >= a[i+1]:
        count += 1
    else:
        count = 0
        
    box.append(count)
    
print(max(box)) if s >=2 else print(0)
Buggy python submission (verdict: Runtime Error):
import math

n, X = map(int, input().split())

x = list(map(int, input().split()))

x.append(X)

x.sort()

dis = []

for i in range(1, n+1):
    dis.append(x[i] - x[i-1])

for i in range(n):
    if i == 0:
        now = dis[i]
    else:
        now = math.gcd(dis[i], now)

print(now)


Fixed submission:
import fractions

n, X = map(int, input().split())

x = list(map(int, input().split()))

x.append(X)

x.sort()

dis = []

for i in range(1, n+1):
    dis.append(x[i] - x[i-1])

for i in range(n):
    if i == 0:
        now = dis[i]
    else:
        now = fractions.gcd(dis[i], now)

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

for x in range(N//2):
    for y in range(N//2):
        if x*4 + y*7 == N:
            flag = True
        else:
            flag = False
            

print("Yes") if flag else print("No")

Fixed submission:
N = int(input())

count = 0

for x in range(0,N):
    for y in range(0,N):
        if x*4 + y*7 == N:
            count += 1
            
           
            

print("No") if count == 0 else print("Yes")

Buggy python submission (verdict: Runtime Error):

N = int(input())

for x in range(N//2):
    for y in range(N//2):
        if x*4 + y*7 == N:
            flag = True
            

print("Yes") if flag else print("No")

Fixed submission:
N = int(input())

count = 0

for x in range(0,N):
    for y in range(0,N):
        if x*4 + y*7 == N:
            count += 1
            
           
            

print("No") if count == 0 else print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

box =[]

for x in range(1,n):
    for y in range(1,n):
        if x + y == n:
            xsum = sum(list(map(int, str(x))))
            ysum = sum(list(map(int, str(y))))
            box.append(xsum + ysum)
            
print(min(box))
            

Fixed submission:
n = int(input())

box =[]

for x in range(1,n):
    y = n -x
    xsum = sum(list(map(int, str(x))))
    ysum = sum(list(map(int, str(y))))
    box.append(xsum + ysum)
            
    
            
print(min(box))
Buggy python submission (verdict: Runtime Error):
N = int(input())

a = sorted(map(int,input().split()))

a.reverse()

A = []
B = []

for x in range(0,N+1,2):
    A.append(a[x])
    
if N%2 == 1:
    for y in range(1,N,2):
        B.append(a[y])
        
    
else:
    for y in range(1,N+1,2):
        B.append(a[y])
    
    
    

    

print(sum(A)-sum(B))


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

S = N%500

print("Yes") if A >= S else print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())

a = sorted(map(int,input().split()))

a.reverse()

A = []
B = []

for x in range(0,N+1,2):
    A.append(a[x])
    
if N%2 == 1:
    for y in range(1,N,2):
        B.append(a[y])
        
    
else:
    for y in range(1,N+1,2):
        B.append(a[y])
    
    
    

    

print(sum(A)-sum(B))


Fixed submission:
N = int(input())

a = sorted(map(int,input().split()))

a.reverse()

A = []
B = []

for x in range(0,N,2):
    A.append(a[x])
    
        
for y in range(1,N,2):
    B.append(a[y])
    
print(sum(A)-sum(B))

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

a = sorted(map(int,input().split()))

a.reverse()

A = []
B = []

for x in range(0,N+1,2):
    A.append(a[x])

for y in range(1,N,2):
    B.append(a[y])
    

print(sum(A)-sum(B))

Fixed submission:
N = int(input())

a = sorted(map(int,input().split()))

a.reverse()

A = []
B = []

for x in range(0,N,2):
    A.append(a[x])
    
        
for y in range(1,N,2):
    B.append(a[y])
    
print(sum(A)-sum(B))
Buggy python submission (verdict: Runtime Error):
x = int(input())
a = list(map(int,input().split()))
count = 0
flag = 0
while flag == 0:
    count += 1
    for i in range(x):
        if a[i]%2 == 0:
            a[i] = a[i]/2
        
        else:
            flag = flag+1
            break
print(count-1)

Fixed submission:
S = list(input())

print(S.count('1'))

Buggy python submission (verdict: Runtime Error):
x = int(input())
a = list(map(int,input().split()))
count = 0
flag = True
while flag:
    count += 1
    for i in range(x):
        if a[i]%2 == 0:
            a[i] = a[i]/2
        
        else:
            flag = False
            break
print(count-1)

Fixed submission:
S = list(input())

print(S.count('1'))
Buggy python submission (verdict: Runtime Error):
S = list(map(int,input().split()))
 
if S[0] =< S[1] =< S[2] =< S[3]:
    print (0)
    
elif S[0] =< S[2] =< S[3] =< S[1]:
    print(S[3]-S[2])
    
elif S[0] =< S[2] =< S[1] =< S[3]:
    print(S[1] - S[2])
    
elif S[2] =< S[0] =< S[3] =< S[1]:
    print(S[3] - S[0])
 
elif S[2] =< S[3] =< S[0] =< S[1]:
    print(0)

Fixed submission:
A,B,C,D=map(int,input().split())
 
if B<=C or D<=A:
    print(0)
elif A<=C and B<=D:
    print(B-C)
elif C<=A and D<=B:
    print(D-A)
elif A<=C and D<=B:
    print(D-C)
elif C<=A and B<=D:
    print(B-A)
Buggy python submission (verdict: Time Limit Exceeded):
limit, result = map(int, input().split())  

sum = 0

for x in range(limit+1):
    for y in range(limit+1):
        for z in range(limit+1):
            if x + y + z == result:
                sum = sum+1
            
            
       
        
        
            
print(sum)

Fixed submission:
k, s = map(int, input().split())
 
count = 0
 
for x in range(0, k + 1):
    for y in range(0, k + 1):
        z = s - x - y
        if 0 <= z and z <= k:
            count += 1
 
print(count)
Buggy python submission (verdict: Runtime Error):
N, L = map(int, input().split())

a = [input() for i in range(L)]

a.sort()

c = ''

for x in a:
    
    c = c+x
    

print(str(c))

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

a = [input() for x in range(N)]

a.sort()

print(''.join(a))

Buggy python submission (verdict: Runtime Error):
N, L = map(int, input().split())

a = [input() for i in range(L)]

a.sort()

c = ''

for x in a:
    c = c+x
    

print(c)

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

a = [input() for x in range(N)]

a.sort()

print(''.join(a))
Buggy python submission (verdict: Runtime Error):
"
ABC162A
https://atcoder.jp/contests/abc162/tasks/abc162_a
"

# arr.include?(str) = arr内にstrが存在するか？(bool)
puts (gets.chomp.split("").include?("7")) ? "Yes" : "No"

Fixed submission:
print("Yes" if ('7' in list(input())) else "No")