Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
an = list(map(int, input().split()))
bn = list(set(an))
allcount = 0
for i in bn:
    a = an.count(i)
    allcount += a*(a-1)//2

for i in an:
    print(allcount - (an.count(i)-1))


Fixed submission:
n = int(input())
an = list(map(int, input().split()))
import collections

c = collections.Counter(an)
allcount = 0

for i in c.values():
    allcount += i*(i-1)//2

for i in an:
    print(allcount - (c[i]-1))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
an = list(map(int, input().split()))
bn = list(set(an))
allcount = 0
for i in bn:
    a = an.count(i)
    allcount += a*(a-1)//2
daburi = []
for i in an:
    daburi.append(an.count(i))
for i in daburi:
    ans = allcount - (i-1)
    print(ans)

Fixed submission:
n = int(input())
an = list(map(int, input().split()))
import collections

c = collections.Counter(an)
allcount = 0

for i in c.values():
    allcount += i*(i-1)//2

for i in an:
    print(allcount - (c[i]-1))
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())
arr = [list(input().split()) for i in range(q)]

for i in arr:
    if len(i) == 1:
        s = s[::-1]
    else:
        if i[1] == '1':
            s = i[2] + s
        else:
            s = s + i[2]
print(s)

Fixed submission:
s = input()
q = int(input())
arr = [list(input().split()) for i in range(q)]
mae1 = 0
mae = []
ato = []
for i in arr:
    if i[0] == '1':
        mae1 = 0 if mae1 == 1 else 1
    else:
        if mae1 == 0:
            if i[1] == '1':
                mae.append(i[2])
            else:
                ato.append(i[2])
        else:
            if i[1] == '1':
                ato.append(i[2])
            else:
                mae.append(i[2])
mae = ''.join(mae)
ato = ''.join(ato)
ans = mae[::-1] + s + ato
if mae1 == 1:
    ans = ans[::-1]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())
arr = [list(input().split()) for i in range(q)]

for i in arr:
    if i[0] == '1':
        s = s[::-1]
    else:
        if i[1] == '1':
            s = i[2] + s
        else:
            s = s + i[2]
print(s)

Fixed submission:
s = input()
q = int(input())
arr = [list(input().split()) for i in range(q)]
mae1 = 0
mae = []
ato = []
for i in arr:
    if i[0] == '1':
        mae1 = 0 if mae1 == 1 else 1
    else:
        if mae1 == 0:
            if i[1] == '1':
                mae.append(i[2])
            else:
                ato.append(i[2])
        else:
            if i[1] == '1':
                ato.append(i[2])
            else:
                mae.append(i[2])
mae = ''.join(mae)
ato = ''.join(ato)
ans = mae[::-1] + s + ato
if mae1 == 1:
    ans = ans[::-1]
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
n,k = map(int,input().split())
ans = math.ceil(math.log(k,n))
print(ans)

Fixed submission:
import math
n,k = map(int,input().split())
if n == 1:
  ans = 1
else:
  ans = math.ceil(math.log(n,k))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
n = int(input())
s = []
for i in range(n):
    s.append(input())
counter = Counter(s)
ansarr = [k for k, v in counter.items() if v == max(counter.values())]
ansarr.sort()
for ans in ansarr:
    print(ans)

Fixed submission:
from collections import Counter
n = int(input())
s = []
for i in range(n):
    s.append(input())
counter = Counter(s)
maxnum = max(counter.values())
keys = [k for k, v in counter.items() if v == maxnum]
keys.sort()
for ans in keys:
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int,input().split())
arr = list(map(int, input().split()))
big = 0
kitai = 0
for i in range(n-k+1):
    kitai = 0
    for j in range(i,i+k):
        kitai = kitai + (arr[j]+1)/2
    if big < kitai:
        big = kitai
print(big)


Fixed submission:
n, k = map(int,input().split())
arr = list(map(int, input().split()))
kitai = 0
biglist = []
if k ==1:
    kitai = (max(arr)+1)/2
    print(kitai)
else:
    for i in range(n-k+1):
        if i == 0:
            big = 0
            for j in range(i+k):
                big = big + arr[j]
        else:
            big = biglist[i-1] - arr[i-1] + arr[i+k-1]
        biglist.append(big)
    max_value = max(biglist)
    max_index = biglist.index(max_value)
    for j in range(max_index,max_index+k):
        kitai = kitai + (arr[j]+1)/2
    print(kitai)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int,input().split())
arr = list(map(int, input().split()))
big = 0
kitai = 0
for i in range(n-k+1):
    kitai = 0
    for j in range(i,i+k):
        kitai = kitai + (arr[j]+1)/2
    if big < kitai:
        big = kitai
print(big)

Fixed submission:
n, k = map(int,input().split())
arr = list(map(int, input().split()))
kitai = 0
biglist = []
if k ==1:
    kitai = (max(arr)+1)/2
    print(kitai)
else:
    for i in range(n-k+1):
        if i == 0:
            big = 0
            for j in range(i+k):
                big = big + arr[j]
        else:
            big = biglist[i-1] - arr[i-1] + arr[i+k-1]
        biglist.append(big)
    max_value = max(biglist)
    max_index = biglist.index(max_value)
    for j in range(max_index,max_index+k):
        kitai = kitai + (arr[j]+1)/2
    print(kitai)
Buggy python submission (verdict: Runtime Error):
n = int(input())
arr = [list(map(int,input().split())) for i in range(n)]
arr.sort()
outcount = 0
#リストの数を減らすと最後の２つがぶつかってた場合が判定できない
#時間がかかりすぎ1回okだったところは次はパスしたい
outnum = 0
def saiki():
    global outcount
    global outnum
    for i in range(outnum, len(arr)-2):
        if arr[i][0] + arr[i][1] > arr[i+1][0] - arr[i+1][1]:#アウトの条件
            outcount += 1
            outnum = i-1
            if [i+1][0] + arr[i+1][1] <= arr[i+2][0] - arr[i+2][1]:#1つあとのやつがぶつかってるか
                arr.pop(i)
            else:
                arr.pop(i + 1)
            return 'no'


while saiki() == 'no':
    saiki()

print(n - outcount)

Fixed submission:
h = int(input())
w = int(input())
n = int(input())

big = max(h, w)
count = 0
kuro = 0
while kuro < n:
    kuro += big
    count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
s,t = map(input().split())
print(t + s)

Fixed submission:
a, b  = map(str, input().split())
print(b + a)
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
div = math.floor(math.sqrt(n))
while True:
  for i in range(2,div+1):
    if i == div+1:
      ans = n
      break
    if n%i==0:
      n+=1
      break
  break
print(ans)

Fixed submission:
import math
n = int(input())
div = math.floor(math.sqrt(n))
def sosu(n):
    if n <= 1:
        return False
    for i in range(2,div+1):
        if n%i==0:
            return False
    return True
while True:
    if sosu(n):
        print(n)
        break
    else:
        n+=1
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
from math import sqrt
root = int(sqrt(n))

for i in range(root,n+1):
    if n%i == 0:
        ans = i+(n/i)-2
        break
print(int(ans))


Fixed submission:
n = int(input())
from math import sqrt
root = int(sqrt(n))

for i in range(root,0,-1):
    if n%i == 0:
        ans = i+(n/i)-2
        break
print(int(ans))
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
arrh = list(map(int,input().split())
count = 0
for i in arrh:
            if i >= k:
            	count += 1
print(count)

Fixed submission:
n,k = map(int,input().split())
arrh = list(map(int,input().split()))
count = 0
for i in arrh:
    if i >= k:
        count += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
arr = list(map(int,input().split()))
ans = []
for i in range(1,n+1):
    ans.append(arr.index(i)+1)
print(' '.join(map(str,ans)))

Fixed submission:
n = int(input())
arr = list(map(int,input().split()))
ans = []
#二次元リストを作る→ソート
for i in range(1,n+1):
    ans.append([arr[i-1],i])
ans.sort()
ans = [i[1] for i in ans]


print(' '.join(map(str,ans)))
Buggy python submission (verdict: Runtime Error):
s = input()
a = ['Sunny','Cloudy','Rainy']
print(a[(a.index(s)+1) % 3]


Fixed submission:
s = input()
if s == 'Sunny':
  print('Cloudy')
elif s == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')
Buggy python submission (verdict: Runtime Error):
n = int(input())
arr = list(map(int,input().split()))

count = 0
for i in range(n):
  if arr[n]!=i+1:
    count += 1

if count<=2:
  print('YES')
else:
  print('NO')

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

count = 0
for i in range(n):
  if arr[i]!=i+1:
    count += 1

if count<=2:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
n = int(input())
ai = []
for i in range(n):
  ai[i] = int(input())
bi = ai[:]
bi.sort()
num1 = bi[-1]
num2 = bi[-2]
for i in ai:
  if i == num1:
    print(num2)
  else:
    print(num1)


Fixed submission:
n = int(input())
ai = [0]*n
for i in range(n):
  ai[i] = int(input())
bi = ai[:]
bi.sort()
num1 = bi[-1]
num2 = bi[-2]
for i in ai:
  if i == num1:
    print(num2)
  else:
    print(num1)
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
a -= 1
from math import gcd
divac = a // c
divad = a // d
divbc = b // c
divbd = b // d
divacd = a // (c*d//gcd(c,d))
divbcd = b // (c*d//gcd(c,d))
Acd = divac + divad - divacd
Bcd = divbc + divbd - divbcd
wareru = Bcd - Acd
ans = b-a-wareru
print(ans)


Fixed submission:
a,b,c,d = map(int,input().split())
a -= 1
from fractions import gcd
divac = a // c
divad = a // d
divbc = b // c
divbd = b // d
divacd = a // (c*d//gcd(c,d))
divbcd = b // (c*d//gcd(c,d))
Acd = divac + divad - divacd
Bcd = divbc + divbd - divbcd
wareru = Bcd - Acd
ans = b-a-wareru
print(ans)

Buggy python submission (verdict: Runtime Error):
a, b, c, d  = map(int, input().split())
import math
divc = (b-a)//c
if a % c == 0:
    divc += 1
if b % c == 0:
    divc += 1
if a % c == 0 and b % c == 0:
    divc -= 1
if b-a<c:
    divc += 1

divd = (b-a)//d
if a % d == 0:
    divd += 1
if b % d == 0:
    divd += 1
if a % d == 0 and b % d == 0:
    divd -= 1   
if b-a<d:
    divd += 1

gcd = math.gcd(c,d)
cd = c * d // gcd
divcd = (b-a)//cd
if a % cd == 0:
    divcd += 1
if b % cd == 0:
    divcd += 1
if a % cd == 0 and b % cd == 0:
    divcd -= 1 
if b-a<cd:
    divcd += 1
wareru = divc + divd - divcd
ans = b - a - wareru +1
print(ans)

Fixed submission:
a,b,c,d = map(int,input().split())
a -= 1
from fractions import gcd
divac = a // c
divad = a // d
divbc = b // c
divbd = b // d
divacd = a // (c*d//gcd(c,d))
divbcd = b // (c*d//gcd(c,d))
Acd = divac + divad - divacd
Bcd = divbc + divbd - divbcd
wareru = Bcd - Acd
ans = b-a-wareru
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,d=map(int,input().split())
count = 0
for i in range(a,b+1):
  if i % c != 0 and i % d !=0:
    count += 1
print(count)


Fixed submission:
a,b,c,d = map(int,input().split())
a -= 1
from fractions import gcd
divac = a // c
divad = a // d
divbc = b // c
divbd = b // d
divacd = a // (c*d//gcd(c,d))
divbcd = b // (c*d//gcd(c,d))
Acd = divac + divad - divacd
Bcd = divbc + divbd - divbcd
wareru = Bcd - Acd
ans = b-a-wareru
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,d=map(int,input().split())
count = 0
for i in range(a,b+1):
  if i % c != 0 and i % d !=0:
    count += 1
print(count)

Fixed submission:
a,b,c,d = map(int,input().split())
a -= 1
from fractions import gcd
divac = a // c
divad = a // d
divbc = b // c
divbd = b // d
divacd = a // (c*d//gcd(c,d))
divbcd = b // (c*d//gcd(c,d))
Acd = divac + divad - divacd
Bcd = divbc + divbd - divbcd
wareru = Bcd - Acd
ans = b-a-wareru
print(ans)
Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
li = list(map(int,input().split()))
count = 1
kyori
for i in li:
  kyori = kyori + i
  count += 1
  if kyori > x:
    break
print(count-1)

Fixed submission:
n,x = map(int,input().split())
li = list(map(int,input().split()))
count = 1
kyori = 0
for i in li:
  kyori = kyori + i
  count += 1
  if kyori > x:
    count -=1
    break
print(count)
Buggy python submission (verdict: Runtime Error):
a,p = map(int,input().split())
ans = (2*a + P)//2
print(ans)

Fixed submission:
a,p = map(int,input().split())
ans = (3*a + p)//2
print(ans)
Buggy python submission (verdict: Runtime Error):
arr = [0]*5
for i in range(5):
    arr[i] = int(input())
time = 0
for ar in arr:
    time += (-(-ar//10))*10
amari = []
for i in arr:
    amari.append(i%10)
amari.sort()
while 0 in amari:
    amari.remove(0)
print(time - (10-amari[0]))


Fixed submission:
arr = [0]*5
for i in range(5):
    arr[i] = int(input())
time = 0
for ar in arr:
    time += (-(-ar//10))*10
amari = []
for i in arr:
    amari.append(i%10)
amari.sort()
while 0 in amari:
    amari.remove(0)
if amari == []:
    amari.append(10)
print(time - (10-amari[0]))

Buggy python submission (verdict: Runtime Error):
arr = [0]*5
for i in range(5):
  arr[i] = int(input())
time = 0
for ar in arr:
  time += -(-ar//10)
amari = []
for i in arr:
  amari.append(i%10)
amari.sort()
print(time - (10-amari[0])

Fixed submission:
arr = [0]*5
for i in range(5):
    arr[i] = int(input())
time = 0
for ar in arr:
    time += (-(-ar//10))*10
amari = []
for i in arr:
    amari.append(i%10)
amari.sort()
while 0 in amari:
    amari.remove(0)
if amari == []:
    amari.append(10)
print(time - (10-amari[0]))
Buggy python submission (verdict: Runtime Error):
n = int(input())
arr = []
for i in range(n):
  arr[i]=int(input())
arr.sort()
ans = arr[-1]//2+sum(arr[:-1])
print(ans)

Fixed submission:
n = int(input())
arr = [0]*n
for i in range(n):
    arr[i]=int(input())
arr.sort()
ans = arr[-1]//2+sum(arr[:-1])
print(ans)
Buggy python submission (verdict: Runtime Error):
x,y = map(int,inpu().split())
print(x+int(y/2))

Fixed submission:
x,y = map(int,input().split())
print(x+int(y/2))
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n ==1:
  print('Hello World'):
else:
  a = int(input())
  b = int(input())
  print(a+b)

Fixed submission:
n = int(input())
if n ==1:
  print('Hello World')
else:
  a = int(input())
  b = int(input())
  print(a+b)
Buggy python submission (verdict: Runtime Error):
n = int(input())
if (n%7)%4==0:
  print('Yes')
  break
elif (n%4)%7==0:
  print('Yes')
  break
else:
  print('No')

Fixed submission:
n = int(input())
kouho = []
for i in range(26):
    for j in range(15):
        kouho.append(i*4+j*7)
if n in kouho:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
s = int(input())
ans = 0
for i in s:
  if i == '+':
    ans += 1
  else:
    ans -= 1
print(ans)

Fixed submission:
s = input()
ans = 0
for i in s:
  if i == '+':
    ans += 1
  else:
    ans -= 1
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,n = map(int,input().split())
if a+b>=c:
  print('Yes')
else:
  print('No')

Fixed submission:
a,b,c = map(int,input().split())
if a+b>=c:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
arare = list(map(int,input().split()))
if 'Y' in arare:
  print('Four')
else:
  print('Three')

Fixed submission:
n = int(input())
arare = list(map(str,input().split()))
if 'Y' in arare:
  print('Four')
else:
  print('Three')
Buggy python submission (verdict: Runtime Error):
a,b = input().split()
num = int(a+b)
import math
root = math.sqrrt(num)
if root%1==0:
  print('Yes')
else:
  print('No')

Fixed submission:
a,b = input().split()
num = int(a+b)
import math
root = math.sqrt(num)
if root%1==0:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
s = input()
print(int(s.count('1'))

Fixed submission:
s = input()
print(int(s.count('1')))
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int,input(),split())
print(min(a*n,b))

Fixed submission:
n,a,b = map(int,input().split())
print(min(a*n,b))
Buggy python submission (verdict: Runtime Error):
alf = ['A','B','C','D','E','F']
a,b = map(str,input().split())
if alf.index(a)<alf.index(b):
  print('<')
elif alf.index(a)=alf.index(b):
  print('=')
else:
  print('>')


Fixed submission:
alf = ['A','B','C','D','E','F']
a,b = input().split()
if alf.index(a)<alf.index(b):
  print('<')
elif alf.index(a)==alf.index(b):
  print('=')
else:
  print('>')

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

Fixed submission:
alf = ['A','B','C','D','E','F']
a,b = input().split()
if alf.index(a)<alf.index(b):
  print('<')
elif alf.index(a)==alf.index(b):
  print('=')
else:
  print('>')
Buggy python submission (verdict: Runtime Error):
n = input()
if n[0]=n[2]:
  print('Yes')
else:
  print('No')


Fixed submission:
n = input()
if n[0]==n[2]:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
n = input()
if n[0]=n[2]:
  priint('Yes')
else:
  print('No')

Fixed submission:
n = input()
if n[0]==n[2]:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
x,a,b = map(int,input().split())
kigen = b-a
if x>kigen:
  print('delicious')
elif x=kigen:
  print('safe')
else:
  print('dangerous')

Fixed submission:
x,a,b = map(int,input().split())
kigen = b-a
if 0>=kigen:
    print('delicious')
elif 0<kigen<=x:
    print('safe')
else:
    print('dangerous')
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a=='H':
  print(b)
else:
  if b=='D':
    print('H')
  else:
    print('D')

Fixed submission:
a,b = input().split()
if a=='H':
  print(b)
else:
  if b=='D':
    print('H')
  else:
    print('D')
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a==b:
  print('Draw')
elif a==1:
  print('Alice')
elif b==1:
  print('Bob')
elif a>b:
  print('Alice')
else b>a:
  print('Bob')



Fixed submission:
a,b = map(int,input().split())
if a==b:
  print('Draw')
elif a==1:
  print('Alice')
elif b==1:
  print('Bob')
elif a>b:
  print('Alice')
else:
  print('Bob')
Buggy python submission (verdict: Runtime Error):
s = input()
boin = [a,e,i,o,u]
if s in boin:
  print('vowel')
else:
  print('consonant')

Fixed submission:
s = input()
boin = ["a","e","i","o","u"]
if s in boin:
  print('vowel')
else:
  print('consonant')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
P = [int(el) for el in input().split(" ")]

ans = 0
for i in range(n):
	for j in range(i):
		if P[i] <= P[j]:
			pass
		else:
			break
	else:
		ans += 1
print(ans)

Fixed submission:
n = int(input())
P = [int(el) for el in input().split(" ")]

ans = 1
m = P[0]
for i in range(1, n):
	if P[i] <= m:
		ans += 1
	m = min(m, P[i])

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# ABC 137, c
from collections import Counter
import math
n = int(input())
S = []
for i in range(n):
    s = ''.join(sorted(input()))
    S.append(s)
count = 0
for i in range(n):
    for j in range(i+1, n):
        if S[i] == S[j]:
            count += 1
print(count)










Fixed submission:
# ABC 137, c
n = int(input())
S = []
D = {}
count = 0
for i in range(n):
    s = ''.join(sorted(input()))
    if s in D:
        count += D[s]
        D[s] += 1
    else:
        D[s] =1
print(count)

Buggy python submission (verdict: Runtime Error):
# ABC 137, c
from collections import Counter
import math
n = int(input())
d = []
for i in range(n):
    s = ''.join(sorted(input()))
    d.append(s)

C = Counter(d).most_common()
def comb(n, r):
    if n < r:
        return(0)
    f = math.factorial
    return (f(n) / f(r) / f(n-r))

count = 0
for key, value in C:
    count += comb(value, 2)
print(int(count))


Fixed submission:
# ABC 137, c
n = int(input())
S = []
D = {}
count = 0
for i in range(n):
    s = ''.join(sorted(input()))
    if s in D:
        count += D[s]
        D[s] += 1
    else:
        D[s] =1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
import math
l, r = map(int, input().split(' '))

min_x = 2018
for i in range(l, r+1):
    for j in range(i+1, r+1):
        x = (i*j) % 2019
        if x < min_x:
            min_x = x
print(min_x)


Fixed submission:
import math
l, r = map(int, input().split(' '))

R = min(l+2018, r)
min_x = 2018

for i in range(l, R+1):
    for j in range(i+1, R+1):

        x = (i*j) % 2019
        if x < min_x:
            min_x = x
print(min_x)
Buggy python submission (verdict: Runtime Error):
from scipy.special import comb

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

def f(x,y):
    return comb(x-1, y-1)

for i in range(1,k+1):
    S = f(n-k, i-1) + 2 * f(n-k, i) + f(n-k, i+1)
    print(int(f(k, i) * S))
    

Fixed submission:
from math import factorial

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

def binom_fac(n,k):
    return factorial(n) // (factorial(n-k) * factorial(k))

def f(n,k):
    if n < k:
        return 0
    if n == 0 & k == 0:
        return 1
    if k < 1:
        return 0
    
    return binom_fac(n-1, k-1)

for i in range(1,k+1):
    S = f(n-k, i-1) + 2 * f(n-k, i) + f(n-k, i+1)
    out = int(f(k, i) * S)
    
    print(out % (10**9 + 7))
Buggy python submission (verdict: Runtime Error):
# ABC 129, c
n, m = map(int, input().split())
dp = [int(el) for el in input().split(' ')]
dp[0] = 1
dp[1] = 1
for j in [int(input()) for j in range(m)]:
    dp[j] = -1
for i in range(n + 1):
    if i < 2:
        if dp[i] == -1:
            dp[i] = 0
    else:
        if dp[i] == -1:
            dp[i] = 0
        else:
            dp[i] = (dp[i-1] + dp[i-2]) % 1000000007
print(dp[n])


Fixed submission:
# ABC 129, c
n, m = map(int, input().split())
dp = [0 for i in range(n+1)]
dp[0] = 1
dp[1] = 1
for j in [int(input()) for j in range(m)]:
    dp[j] = -1
for i in range(n + 1):
    if i < 2:
        if dp[i] == -1:
            dp[i] = 0
    else:
        if dp[i] == -1:
            dp[i] = 0
        else:
            dp[i] = (dp[i-1] + dp[i-2]) % 1000000007
print(dp[n])
Buggy python submission (verdict: Time Limit Exceeded):
# ABC 127 c
n, m = [int(el) for el in input().split(' ')]
for i in range(m):
    l, r = [int(el) for el in input().split(' ')]
    if i == 0:
        cards = set(range(l, r + 1))
    else:
        newcards = set(range(l, r + 1))
        cards = cards.intersection(newcards)
print(len(cards))


Fixed submission:
# ABC 127 c
n, m = [int(el) for el in input().split(' ')]
max_l = 0
min_r = n
for i in range(m):
    l, r = [int(el) for el in input().split(' ')]
    max_l = max(max_l, l)
    min_r = min(min_r, r)

print(max(min_r - max_l + 1, 0))
Buggy python submission (verdict: Runtime Error):
#ABC 122, B - ATCoder
S = input()
N = len(S)

ans = 0
for i in range(N):
    for j in range(i, N):
        if all('ACGT'.count(c) == 1 for c in S[i:j+1])
            ans = max(ans, j - i + 1)
print(ans)


Fixed submission:
#ABC 122, B - ATCoder
S = input()
N = len(S)

ans = 0
for i in range(N):
    for j in range(i, N):
        if all('ACGT'.count(c) == 1 for c in S[i:j+1]):
            ans = max(ans, j - i + 1)
print(ans)