Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
if k > a:
  a=0
  k-=a
  if k > b:
    b=0
  else:
    b-=k
else:
  a-=k
print(' '.join([str(a),str(b)])


Fixed submission:
a,b,k = map(int,input().split())
if k > a:
  k-=a
  a=0
  if k > b:
    b=0
  else:
    b-=k
else:
  a-=k
print(' '.join([str(a),str(b)]))

Buggy python submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
if k > a:
  a=0
  k-=a
  if k > b:
    b=0
  else:
    b-=k
else:
  a-=k
print(' '.join([a,b])


Fixed submission:
a,b,k = map(int,input().split())
if k > a:
  k-=a
  a=0
  if k > b:
    b=0
  else:
    b-=k
else:
  a-=k
print(' '.join([str(a),str(b)]))

Buggy python submission (verdict: Runtime Error):
a,b,k = int(input().split())
if k > a:
  a=0
  k-=a
  if k > b:
    b=0
  else:
    b-=k
else:
  a-=k
print(' '.join([a,b])

Fixed submission:
a,b,k = map(int,input().split())
if k > a:
  k-=a
  a=0
  if k > b:
    b=0
  else:
    b-=k
else:
  a-=k
print(' '.join([str(a),str(b)]))
Buggy python submission (verdict: Runtime Error):
n=int(input())
prime=0
tmp = n
while prime == 0:
  flag=True
  for i in range(2,int(n**0.5)+1):
  	flag=False
    break
  if frag:
    prime=tmp
  tmp+=1
print(prime)


Fixed submission:
n=int(input())
prime=0
tmp = n
while prime == 0:
  flag=True
  for i in range(2,int(tmp**0.5)+1):
    if tmp%i==0:
      flag=False
      break
  if flag:
    prime=tmp
  tmp+=1
print(prime)
Buggy python submission (verdict: Runtime Error):
n=int(input)
s,t=input().split()
ans=''
for i in range(n):
  ans +=s[i]
  ans +=t[i]
print(ans)

Fixed submission:
n=int(input())
s,t=input().split()
ans=''
for i in range(n):
  ans +=s[i]
  ans +=t[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
import fractions
a,b = map(int,input().split())
print(a*b//gcd(a,b))

Fixed submission:
import fractions
a,b = map(int,input().split())
print(a*b//fractions.gcd(a,b))
Buggy python submission (verdict: Runtime Error):
n = int(input().split())
*l, = map(int,input().split())
ans = 0
tmp=1
for i in range(n):
  if l[i] == tmp:
    tmp+=1
  else:
    ans += 1
print(-1 if ans==n else ans)

Fixed submission:
n = int(input())
*l, = map(int,input().split())
ans = 0
tmp=1
for i in range(n):
  if l[i] == tmp:
    tmp+=1
  else:
    ans += 1
print(-1 if ans==n else ans)
Buggy python submission (verdict: Runtime Error):

#O(nm) = O(60n)で解けるはず・・・！
n = int(input())
*l, = map(int,input().split())
#2進数の桁の出現数をカウントする。
lone = [0]*60
for i in range(n):
  m = l[i]
  for j in range(60):
    lone[j] += m%2
    m=m>>1
    if m==0:
      continue
ans = 0
for i in range(len(lone)):
  ans += 2**i*lone[i]*(n-lone[i])
print(ans%(10**9+7))

Fixed submission:
a,b, c = map(int,input().split())
ans = 'win'
if a+b+c >21:
  ans = 'bust'
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(-int(-n**0.5//1),0,-1):
  if n%i=0:
    a=i
    b=n//i
print(a+b-2)

Fixed submission:
n = int(input())
for i in range(-int(-n**0.5//1),0,-1):
  if n%i==0:
    a=i
    b=n//i
    break
print(a+b-2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
*l, = map(int,input().split())
ans = [0]*n
for i in range(n):
  ans[l[i]-1] = l[i]
print(' '.join(ans))

Fixed submission:
n = int(input())
*l, = map(int,input().split())
ans = [0]*n
for i in range(n):
  ans[l[i]-1] = i+1
print(' '.join(map(str,ans)))
Buggy python submission (verdict: Runtime Error):
#AとBの最大公約数を素因数分解してから考える。
from fractions import gcd
a,b = map(int,input().split())
g = gcd(a,b)
#gを素因数分解し、素因数のセットを作る。
s = set([1,g])
for i in range(2,int(-(-g**0.5//1)+1)):
  flag = True
  while flag:
    if g%i==0:
      if len(l1) == 0 or l1[-1] != i:
        s.add(i)
      g=g//i
    else:
      flag = False
print(len(s))

Fixed submission:
#AとBの最大公約数を素因数分解してから考える。
from fractions import gcd
a,b = map(int,input().split())
g = gcd(a,b)
#gを素因数分解し、素因数のセットを作る。
s = set([1])
for i in range(2,int(-(-g**0.5//1)+1)):
  flag = True
  while flag:
    if g%i==0:
      s.add(i)
      g=g//i
    else:
      flag = False
s.add(g)
print(len(s))
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
l = sorted(list(map(int,input().split())))
l.reverse()
yl = [0]*n
r = [-(-l[0]//i) for i in l]
chk = 1
flag = False
while True:
  #group 1
  for i in range(n):
    if r[i] > chk:
        break
    elif r[i] > chk//2 :
        yl[i]+=1
        m-=1
        if m == 0:
            flag = True
        break
  if flag:
     break
  #group 2
  for i in range(n):
    if r[i] > chk//2:
      break
    else:
      yl[i]+=1
      m-=1
      if m == 0:
        flag = True
        break
  if flag:
    break
  chk *= 2
ans = 0
for i,j in zip(l,yl):
  ans += i//(2**j)
print(ans)

Fixed submission:
s = input()
if s == 'Sunny':
  print('Cloudy')
elif s == ('Cloudy'):
  print('Rainy')
else:
  print('Sunny')
Buggy python submission (verdict: Runtime Error):
a,b =map(int,input())
print((b-1)//(a-1))


Fixed submission:
a,b =map(int,input().split())
print(-((1-b)//(a-1)))
Buggy python submission (verdict: Runtime Error):
n = int(input())
*l, = map(int,input().split())
ans=0
counter=0
for i in range(1,n):
  if l[i] <= l[i-1]:
    counter+=1
  else:
    ans=max([ans,counter])
    counter=0
print(max[ans,counter])


Fixed submission:
n = int(input())
*l, = map(int,input().split())
ans=0
counter=0
for i in range(1,n):
  if l[i] <= l[i-1]:
    counter+=1
  else:
    ans=max([ans,counter])
    counter=0
print(max([ans,counter]))

Buggy python submission (verdict: Runtime Error):
n = int(input())
*l, = map(int,input.split())
ans=0
counter=0
for i in range(1,n):
  if l[i] <= l[i-1]:
    counter+=1
  else:
    ans=max([ans,counter])
    counter=0
print(ans)


Fixed submission:
n = int(input())
*l, = map(int,input().split())
ans=0
counter=0
for i in range(1,n):
  if l[i] <= l[i-1]:
    counter+=1
  else:
    ans=max([ans,counter])
    counter=0
print(max([ans,counter]))
Buggy python submission (verdict: Runtime Error):
n = int(input())
,l* = map(int,input().split())
inv=0
for i in l:
  inv += 1/i
print(1/inv)

Fixed submission:
n = int(input())
*l, = map(int,input().split())
inv=0
for i in l:
  inv += 1/i
print(1/inv)
Buggy python submission (verdict: Runtime Error):
n = int(input())
*l, = map(int,input().split())
l = l.sort()
ans=l[0]
for i in l:
  ans = ans/2 + i/2
print(ans)

Fixed submission:
n = int(input())
*l, = map(int,input().split())
l.sort()
ans=l[0]
for i in l:
  ans = ans/2 + i/2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
l = [list(map(int,input().split())) for _ in [0]*n]
l.sort(key=lambda x:x[0])
ans = 0
tmpl = []
flag = True
i = 0
for d in range(1,m+1):
  while i<=n-1 and l[i][0] <= d:
    tmpl.append(l[i][1])
    i += 1
  if len(tmpl) > 0:
    maxindex = tmpl.index(max(tmpl))
    ans += tmpl[maxindex]
    del tmpl[maxindex]
print(ans)


Fixed submission:
from heapq import heappush,heappop
n,m = map(int,input().split())
l = [list(map(int,input().split())) for _ in [0]*n]
l.sort(key=lambda x:x[0])
ans = 0
tmpl = []
i = 0
for d in range(1,m+1):
  while i<=n-1 and l[i][0] <= d:
    #tmpl.append(l[i][1])
    heappush(tmpl,-l[i][1])
    i += 1
  if len(tmpl) > 0:
    #maxindex = tmpl.index(max(tmpl))
    #ans += tmpl[maxindex]
    #del tmpl[maxindex]
    ans -= heappop(tmpl)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
l = [list(map(int,input().split())) for _ in [0]*n]
l.sort(key=lambda x:x[0])
ans = 0
tmpl = []
flag = True

for d in range(1,m+1):
  while  len(l)>=1 and l[0][0] <= d:
    tmpl.append(l[0][1])
    del l[0]
  if len(tmpl) > 0:
    maxindex = tmpl.index(max(tmpl))
    ans += tmpl[maxindex]
    del tmpl[maxindex]
print(ans)


Fixed submission:
from heapq import heappush,heappop
n,m = map(int,input().split())
l = [list(map(int,input().split())) for _ in [0]*n]
l.sort(key=lambda x:x[0])
ans = 0
tmpl = []
i = 0
for d in range(1,m+1):
  while i<=n-1 and l[i][0] <= d:
    #tmpl.append(l[i][1])
    heappush(tmpl,-l[i][1])
    i += 1
  if len(tmpl) > 0:
    #maxindex = tmpl.index(max(tmpl))
    #ans += tmpl[maxindex]
    #del tmpl[maxindex]
    ans -= heappop(tmpl)
print(ans)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
l = [list(map(int,input().split())) for _ in [0]*n]
l.sort(key=lambda x:x[1])
ans = 0
tmpl = []
d = 1
flag = True

while len(l)>=1 and d<=m:
  while l[0][0] <= d and len(l)>=1:
    tmpl.append(l[0][i])
    del l[0]
  maxindex = tmpl.index(max(tmpl))
  ans += tmpl[maxindex]
  del tmpl[maxindex]
print(tmp)

Fixed submission:
from heapq import heappush,heappop
n,m = map(int,input().split())
l = [list(map(int,input().split())) for _ in [0]*n]
l.sort(key=lambda x:x[0])
ans = 0
tmpl = []
i = 0
for d in range(1,m+1):
  while i<=n-1 and l[i][0] <= d:
    #tmpl.append(l[i][1])
    heappush(tmpl,-l[i][1])
    i += 1
  if len(tmpl) > 0:
    #maxindex = tmpl.index(max(tmpl))
    #ans += tmpl[maxindex]
    #del tmpl[maxindex]
    ans -= heappop(tmpl)
print(ans)
Buggy python submission (verdict: Runtime Error):
S = int(input())
 
if S =< 10**9:
  print(0,0,S,0,0,1)
elif S == 10*18:
  print(0,0,10**9,0,0,10**9)
  end
else:
  q,r = divmod(S,10**9)
  if r = 0:
    print(0,0,0,10**9,q,0)
  else:
    print(0,0,1,10**9,q+1,10**9-r)

Fixed submission:
S = int(input())
 
if S <= 10**9:
  print(0,0,S,0,0,1)
elif S == 10*18:
  print(0,0,10**9,0,0,10**9)
  end
else:
  q,r = divmod(S,10**9)
  if r == 0:
    print(0,0,0,10**9,q,0)
  else:
    print(0,0,1,10**9,q+1,10**9-r)

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

if S =< 10**9:
  print(0,0,S,0,0,1)
elif S == 10*18:
  print(0,0,10**9,0,0,10**9)
  end
else:
  q,r = divmod(S,10**9)
  if r = 0:
    print(0,0,0,10**9,q,0)
  else:
  	print(0,0,1,10**9,q+1,10**9-r)

Fixed submission:
S = int(input())
 
if S <= 10**9:
  print(0,0,S,0,0,1)
elif S == 10*18:
  print(0,0,10**9,0,0,10**9)
  end
else:
  q,r = divmod(S,10**9)
  if r == 0:
    print(0,0,0,10**9,q,0)
  else:
    print(0,0,1,10**9,q+1,10**9-r)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = [int(input()) for _ in [0]*n]
#最大値が2つある場合に注意しないといけない。
#最大値が2つ以上ある場合を先に処理
import sys
if l.count(max(l))>1:
  for i in range(n):
    print(max(l))
#O(n)の処理なら何回やってもいいくらいの気持ちでいく
else:
  s=set(l)
  m1 = max(s)
  s.remove(max(s))
  m2 = max(s)
  for i in l:
    if i == m1:
      print(m2)
    else:
      print(m1)

Fixed submission:
n = int(input())
numlist = []
for i in range(n):
    numlist.append(int(input()))
argmax = numlist.index(max(numlist))
maxnum = max(numlist)
del numlist[argmax]
secondnum = max(numlist)
                       
for i in range(argmax):
    print (maxnum)
print (secondnum)
for i in range(argmax+1,n):
    print (maxnum)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = [int(input()) for _ in [0]*n]
#最大値が2つある場合に注意しないといけない。
#最大値が2つ以上ある場合を先に処理
import sys
if l.count(max(l))>1:
  for i in range(n):
    print(max(l))
#O(n)の処理なら何回やってもいいくらいの気持ちでいく
else:
  s=set(l)
  s.remove(max(s))
  m = max(s)
  for i in l:
    if i == max(l):
      print(m)
    else:
      print(max(l))

Fixed submission:
n = int(input())
numlist = []
for i in range(n):
    numlist.append(int(input()))
argmax = numlist.index(max(numlist))
maxnum = max(numlist)
del numlist[argmax]
secondnum = max(numlist)
                       
for i in range(argmax):
    print (maxnum)
print (secondnum)
for i in range(argmax+1,n):
    print (maxnum)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
numlist = []
for i in range(n):
    numlist.append(int(input()))
for i in range(n):
    tmplist = numlist.copy()
    del tmplist[i]
    print (max(tmplist))

Fixed submission:
n = int(input())
numlist = []
for i in range(n):
    numlist.append(int(input()))
argmax = numlist.index(max(numlist))
maxnum = max(numlist)
del numlist[argmax]
secondnum = max(numlist)
                       
for i in range(argmax):
    print (maxnum)
print (secondnum)
for i in range(argmax+1,n):
    print (maxnum)
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
print(min([n*a,b])

Fixed submission:
n,a,b = map(int,input().split())
print(min([n*a,b]))
Buggy python submission (verdict: Runtime Error):
n.m = map(int,input().split())
l = [int(input()) for _ in[0]*m]
l=set(l)
dp=[0]*(n+1)#0〜n段目までのn+1通り。
#1段目までは手動。
dp[0]=1
dp[1]=0 if 1 in l else 1
MOD =10**9+7
#dp 貰うタイプ
for i in range(2,n+1):
  if i not in l:#床が壊れてなければ
    dp[i] = (dp[i-1] + dp[i-2])%MOD
print(dp[n])

Fixed submission:
n,m = map(int,input().split())
l = [int(input()) for _ in[0]*m]
l=set(l)
dp=[0]*(n+1)#0〜n段目までのn+1通り。
#1段目までは手動。
dp[0]=1
dp[1]=0 if 1 in l else 1
MOD =10**9+7
#dp 貰うタイプ
for i in range(2,n+1):
  if i not in l:#床が壊れてなければ
    dp[i] = (dp[i-1] + dp[i-2])%MOD
print(dp[n])
Buggy python submission (verdict: Runtime Error):
a, b = map(int,input().split())
if a <= 5:
  print(0)
elif a < = 12:
  print(b//2)
else:
  print(b)

Fixed submission:
a, b = map(int,input().split())
if a <= 5:
  print(0)
elif a <= 12:
  print(b//2)
else:
  print(b)
Buggy python submission (verdict: Runtime Error):
#010101…と101010…の2通り
#2通りともコストを計算して小さい方を採用するだけ。
#文字列処理のほうが楽。if文注意
s = input()
even = true
ans1=0#010101…
ans2=1#101010…
for c in s:
  if even:
    if c == '0':
      ans2 += 1
    else:
      ans1 += 1
  else:
    if c == '0':
      ans1 += 1
    else:
      ans2 += 1
print(min([ans1,ans2]))

Fixed submission:
#010101…と101010…の2通り
#2通りともコストを計算して小さい方を採用するだけ。
#文字列処理のほうが楽。if文注意
s = input()
even = True
ans1=0#010101…
ans2=0#101010…
for c in s:
  if even:
    even = False
    if c == '0':
      ans2 += 1
    else:
      ans1 += 1
  else:
    even = True
    if c == '0':
      ans1 += 1
    else:
      ans2 += 1
print(min([ans1,ans2]))
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
l = len(s)
#TLEになりそうな方法
while '01' in s or '10' in s:
  s = s.replace('01','')
  s = s.replace('10','')
print(l-len(s))


Fixed submission:
s = input()
print(len(s)-abs(s.count('1')-s.count('0')))
Buggy python submission (verdict: Runtime Error):
d = int(input())
s = 'Christmas'
for i range(25-d):
  s = s+' Eve'
print(s)

Fixed submission:
d = int(input())
s = 'Christmas'
for i in range(25-d):
  s = s+' Eve'
print(s)
Buggy python submission (verdict: Runtime Error):
x1, y1,x2,y2 = map(int,input().split())
x3 = x2 - (y2-y1)
y3 = y2 + (x2-x1)
x4 = x3 - (y3-y2)
y4 = y4 + (x3-x3)
print(x3,y3,x4,y4)

Fixed submission:
x1, y1,x2,y2 = map(int,input().split())
x3 = x2 - (y2-y1)
y3 = y2 + (x2-x1)
x4 = x3 - (y3-y2)
y4 = y3 + (x3-x2)
print(x3,y3,x4,y4)
Buggy python submission (verdict: Runtime Error):
n.k = map(int,input().split())
if n%k ==0:
  print(0)
else:
  print(1)

Fixed submission:
n,k = map(int,input().split())
if n%k ==0:
  print(0)
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input())
if max([a,b]) >= 9:
  print(':(')
else:
  print('Yay!')

Fixed submission:
a,b = map(int,input().split())
if max([a,b]) >= 9:
  print(':(')
else:
  print('Yay!')
Buggy python submission (verdict: Runtime Error):
import sys
n = int(input())
an = list(map(int,input().split()))
l = 1
r = 1
ans = 1
tmpsum=an[0]
while r<n:
  while tmpsum^an[r]==tmpsum+an[r]and r<n:
    tmpsum+=an[r]
    r += 1
    ans += r-l+1
  tmpsum -= an[l-1]
  l +=1
  if l>r:
    r=l
    tmpsum=an[l-1]
    ans += 1
print(ans)

Fixed submission:
import sys
n = int(input())
an = list(map(int,input().split()))
l = 1
r = 1
ans = 1
tmpsum=an[0]
while True:
  if r == n:
    print(ans)
    sys.exit()
  while tmpsum^an[r]==tmpsum+an[r]:
    tmpsum+=an[r]
    r += 1
    ans += r-l+1
    if r == n:
      print(ans)
      sys.exit()
  tmpsum -= an[l-1]
  l +=1
  if l>r:
    r=l
    tmpsum=an[l-1]
    ans += 1

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

l = 1
r = 1
ans = 1
tmpsum=an[0]
while True:
  while tmpsum^an[r]==tmpsum+an[r]:
    tmpsum+=an[r]
    r += 1
    ans += r-l+1
    if r == n:
      print(ans)
      sys.exit()
  tmpsum -= an[l-1]
  l +=1
  if l>r:
    r=l
    tmpsum=an[l-1]
    ans += 1
    if r == n:
      print(ans)
      sys.exit()


Fixed submission:
import sys
n = int(input())
an = list(map(int,input().split()))
l = 1
r = 1
ans = 1
tmpsum=an[0]
while True:
  if r == n:
    print(ans)
    sys.exit()
  while tmpsum^an[r]==tmpsum+an[r]:
    tmpsum+=an[r]
    r += 1
    ans += r-l+1
    if r == n:
      print(ans)
      sys.exit()
  tmpsum -= an[l-1]
  l +=1
  if l>r:
    r=l
    tmpsum=an[l-1]
    ans += 1
Buggy python submission (verdict: Runtime Error):
_=input()
s=set(map(input().split()))
if len(s) == 3:
  print('Three')
else:
  print('Four')

Fixed submission:
_=input()
s=set(input().split())
if len(s) == 3:
  print('Three')
else:
  print('Four')
Buggy python submission (verdict: Runtime Error):
_ = input()
l = list(map(int,input().split()))
l.sort()
l.reverse()
print(sum(l[::2]-sum(l[1::2])))

Fixed submission:
_ = input()
l = list(map(int,input().split()))
l.sort()
l.reverse()
print(sum(l[::2])-sum(l[1::2]))
Buggy python submission (verdict: Runtime Error):
n,h = map(int,input().split())
al=[]
bl=[]
for _ in [0]*n:
  a,b = map(int,input().split())
  al.append(a)
  bl.append(b)
al.sort()
bl.sort()
ans = 0
while h>0:
  if bl[-1]>al[-1]:
    h-=bl[-1]
    ans+=1
    del bl[-1]
  else:
    ans += -(-h//al[-1])
    h=0
print(ans)

Fixed submission:
n,h = map(int,input().split())
al=[]
bl=[]
for _ in [0]*n:
  a,b = map(int,input().split())
  al.append(a)
  bl.append(b)
al.sort()
bl.sort()
ans = 0
while h>0:
  if len(bl)>0 and bl[-1]>al[-1]:
    h-=bl[-1]
    ans+=1
    del bl[-1]
  else:
    ans += -(-h//al[-1])
    h=0
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if (a+b)% == 1:
  print ((a+b+1)/2)
else:
  print((a+b)/2)

Fixed submission:
a,b = map(int,input().split())
if (a+b)%2 == 1:
  print (int((a+b+1)/2))
else:
  print(int((a+b)/2))
Buggy python submission (verdict: Runtime Error):
import math
print(int(math.sqrt(int(input()))**2)

Fixed submission:
import math
n = int(input())
print(int(math.sqrt(n))**2)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
ll =[[0]*n for _ in [0]*n]
edges = [list(map(int,input().split())) for _ in [0]*m]
for edge in edges:
  ll[edge[0]][edge[1]] = 1
  ll[edge[1]][edge[0]] = 1
originalll = ll.copy()
seen = [0]*n
ans = 0

for edge in edges:
  ll = originalll.copy()
  ll[edge[0]][edge[1]] = 0
  ll[edge[1]][edge[0]] = 0
  seen = [0]*n
  tmp = 0
  seen,tmp,ll = dfs(seen,tmp,ll)
print(ans)

def dfs(seen,tmp,ll):
  for i in range(n):
    if ll[tmp][i] = 1 and seen[i] = 0
    seen[i] = 1
    tmp = i
    seen,tmp,ll = dfs(seen,tmp,ll)
  if sum(seen) == n:
    ans+=1
  return seen,tmp,ll



Fixed submission:
import copy
def dfs(tmp):
  for i in range(n):
    if ll[tmp][i] == 1 and seen[i] == 0:
      seen[i] = 1
      dfs(i)

n,m = map(int,input().split())
ll =[[0]*n for _ in [0]*n]
edges = [list(map(int,input().split())) for _ in [0]*m]
for edge in edges:
  ll[edge[0]-1][edge[1]-1] = 1
  ll[edge[1]-1][edge[0]-1] = 1
originalll = ll.copy()
seen = [0]*n
ans = 0

for edge in edges:
  ll = copy.deepcopy(originalll)
  ll[edge[0]-1][edge[1]-1] = 0
  ll[edge[1]-1][edge[0]-1] = 0
  seen = [0]*n
  tmp = 0
  seen[tmp] = 1
  dfs(tmp)
  if sum(seen) < n:
    ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
ll =[[0]*n for _ in [0]*n]
edges = [list(map(int,input().split())) for _ in [0]*m]
for edge in edges:
  ll[edge[0]][edge[1]] = 1
  ll[edge[1]][edge[0]] = 1
originalll = ll.copy()
seen = [0]*n
ans = 0

def dfs(seen,tmp,ll):
  for i in range(n):
    if ll[tmp][i] = 1 and seen[i] = 0
    seen[i] = 1
    tmp = i
    seen,tmp,ll = dfs
  

Fixed submission:
import copy
def dfs(tmp):
  for i in range(n):
    if ll[tmp][i] == 1 and seen[i] == 0:
      seen[i] = 1
      dfs(i)

n,m = map(int,input().split())
ll =[[0]*n for _ in [0]*n]
edges = [list(map(int,input().split())) for _ in [0]*m]
for edge in edges:
  ll[edge[0]-1][edge[1]-1] = 1
  ll[edge[1]-1][edge[0]-1] = 1
originalll = ll.copy()
seen = [0]*n
ans = 0

for edge in edges:
  ll = copy.deepcopy(originalll)
  ll[edge[0]-1][edge[1]-1] = 0
  ll[edge[1]-1][edge[0]-1] = 0
  seen = [0]*n
  tmp = 0
  seen[tmp] = 1
  dfs(tmp)
  if sum(seen) < n:
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n,a = map(int,input().split())
print(n**2-a)

Fixed submission:
n = int(input())
a = int(input())
print(n**2-a)
Buggy python submission (verdict: Runtime Error):
n = int(input())
*l, = map(int,input().split())
ans = 0
for i in range(n-1):
  if l[i] == i+1:
    l[i+1] = l[i]
    ans += 1
if l[-1] = n:
  ans += 1
print(ans)

Fixed submission:
n = int(input())
*l, = map(int,input().split())
ans = 0
for i in range(n-1):
  if l[i] == i+1:
    l[i+1] = l[i]
    ans += 1
if l[-1] == n:
  ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
*l, = map(int,input().split())
rect = [i for i in set(l) if l.count(i)>=2]
squ = [i for i in rect if l.count(i)>=4]
rect.sort()
squ.sort()
if len(rect)>=2:
  srect = rect[-1]*rect[-2]
else:
  srect = 0
if len(squ)>=1:
  ssqu=squ[-1]**2
else:
  ssqu=0
print(max([srect,ssqu]))
  

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
l.sort()
l.reverse()
squ = 0
rec = []
count = 0
tmp = 0
for i in l:
  if i == tmp:
    count += 1
  else:
    tmp = i
    count = 1
  
  if count == 2:
    rec.append(tmp)
  elif count == 4:
    squ = max([squ,tmp])

if len(rec)<2:
  print(squ*squ)
else:
  print(max([squ*squ,rec[0]*rec[1]]))
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
m = int(input())
p_x = []
for i in range(m):
  p_x.append(list(map(int,input()).split()))
for i in range(m):
  p = p_x[i][0]
  x = p_x[i][1]
  print(sum(l) - l[p-1] + x) 

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
m = int(input())
p_x = []
for i in range(m):
  p_x.append(list(map(int,input().split())))
for i in range(m):
  p = p_x[i][0]
  x = p_x[i][1]
  print(sum(l) - l[p-1] + x)
Buggy python submission (verdict: Runtime Error):
n = int().input()
print (str(int(n*(n+1)/2)))

Fixed submission:
n = int(input())
print (int(n*(n+1)/2))
Buggy python submission (verdict: Runtime Error):
numlist = list(map(int,input().split()))
if max(numlist) == 7 and min(numlist) == 5 and sum(sumlist) == 17:
  print('YES')
else:
  print('NO')

Fixed submission:
numlist = list(map(int,input().split()))
if max(numlist) == 7 and min(numlist) == 5 and sum(numlist) == 17:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]
c =1
for i in A:
  c *= i
print(c if c <= 10**18 else "-1")

Fixed submission:
def main():
  N = int(input())
  A = [int(i) for i in input().split()]
  
  if 0 in A:
    print(0)
    return
  
  c = 1
  for i in A:
    c *= i
    
    if c > 10**18:
      print(-1)
      return
  print(c)
  
main()

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = map(int,input().split())
c =1
for i in A:
  c *= i
if c <= 10**18:
  print(c)
else:
  print(-1)

Fixed submission:
def main():
  N = int(input())
  A = [int(i) for i in input().split()]
  
  if 0 in A:
    print(0)
    return
  
  c = 1
  for i in A:
    c *= i
    
    if c > 10**18:
      print(-1)
      return
  print(c)
  
main()

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = map(int,input().split())
c =1
for i in A:
  c *= i
if c <= 10**18:
  print(c)
else:
  print(-1)

Fixed submission:
def main():
  N = int(input())
  A = [int(i) for i in input().split()]
  
  if 0 in A:
    print(0)
    return
  
  c = 1
  for i in A:
    c *= i
    
    if c > 10**18:
      print(-1)
      return
  print(c)
  
main()
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k = map(int,input().split())

for i in range(k):
  if a > 0:
    a -= 1
  elif b > 0:
    b -=1
  else:
    break
    
print("{} {}".format(a,b))



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


if k <= a:
    a -= k

elif a < k < a+b:
  b -= (k - a)
  a = 0
elif k >= a+b:
  a = 0
  b = 0
    
    
print("{} {}".format(a,b))