Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a, b, h = map(int, input().split())

S = (a + b) * h / 2
print(int(S))

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
S = (a+b)*h/2
print(int(S))

Buggy python submission (verdict: Runtime Error):
numsstr = input().split()
nums = []
for i in range(3):
    nums.append(int(numsstr[i]))
S = (nums[0] + nums[1]) * nums[2] / 2
print(int(S))

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
S = (a+b)*h/2
print(int(S))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
b=1
count=0
for i in range(n):
    if(a[i]%2!=0):
        print(count)
        b=0
count=1
while b==1:
    for i in range(n):
        if(a[i]%2!=0):
            print(count)
            b=0
        a[i]/=2
    count+=1

Fixed submission:
# cook your dish here
s = input()
count=0
for c in s:
    if c=='1':
        count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
alphabet="abcdefghijklmnopqrstuvwxyz"
st=input()
s=""
for i in range(0,len(st)):
    if alphabet.index(st[i]) % 2 == 0:
        s+=str(st[i])
    else:
        pass
print(s)


Fixed submission:
X,t = map(int, input().split())
if X-t<0:
    print(str(0))
else:
    print(str(X-t))

Buggy python submission (verdict: Runtime Error):
alphabet="abcdefghijklmnopqrstuvwxyz"
st=input()
s=""
for i in range(0,len(st)):
    if alphabet.index(st[i]) % 2 == 0:
        s+=str(st[i])
    else:
        pass

Fixed submission:
X,t = map(int, input().split())
if X-t<0:
    print(str(0))
else:
    print(str(X-t))

Buggy python submission (verdict: Runtime Error):
X,t =map(int, split())
if X-t <0:
    print(str(0))
else:
    print(str(X-t))

Fixed submission:
X,t = map(int, input().split())
if X-t<0:
    print(str(0))
else:
    print(str(X-t))
Buggy python submission (verdict: Runtime Error):
a,t,i=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(input(i))
c=min(x,i)

Fixed submission:
a,t,i=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(i)
c=min(x,i)
print(c)

Buggy python submission (verdict: Runtime Error):
a,t=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(i)
c=min(x,i)

Fixed submission:
a,t,i=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(i)
c=min(x,i)
print(c)

Buggy python submission (verdict: Runtime Error):
a,t,i=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(input(i))
c=min(x,i)

Fixed submission:
a,t,i=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(i)
c=min(x,i)
print(c)

Buggy python submission (verdict: Runtime Error):
a,t,x=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(i)
c=min(x,i)

Fixed submission:
a,t,i=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(i)
c=min(x,i)
print(c)

Buggy python submission (verdict: Runtime Error):
a,t,x=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(input())
c=min(x,i)

Fixed submission:
a,t,i=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(i)
c=min(x,i)
print(c)

Buggy python submission (verdict: Runtime Error):
a,t,x=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(input(i))
c=min(x,i)

Fixed submission:
a,t,i=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(i)
c=min(x,i)
print(c)

Buggy python submission (verdict: Runtime Error):
a,t=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(input(i))
c=min(x,i)

Fixed submission:
a,t,i=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(i)
c=min(x,i)
print(c)

Buggy python submission (verdict: Runtime Error):
a,t=input().split()
a=int(a)
t=int(t)
x = a * t
i=int(input(i))
c=min(x,i)

Fixed submission:
a,t,i=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(i)
c=min(x,i)
print(c)

Buggy python submission (verdict: Runtime Error):
a,t=input().split()
a=int(a)
t=int(t)
x = a * t
i=int(i)
c=min(x.i)

Fixed submission:
a,t,i=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(i)
c=min(x,i)
print(c)

Buggy python submission (verdict: Runtime Error):
a,t=input().split()
a=int(a)
t=int(t)
x = a * t
i=int(i)
c=min(x,i)

Fixed submission:
a,t,i=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(i)
c=min(x,i)
print(c)

Buggy python submission (verdict: Runtime Error):
n, a, b = (int(i) for i in input().split())

print(min(n*a, b)

Fixed submission:
n, a, b = (int(i) for i in input().split())

print(min(n*a, b))

Buggy python submission (verdict: Runtime Error):
X = int(input())
a = X
b = 0
while (a>10):
    b += (a % 10) + (X / 10)
if X % b == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
T,A,B = map(int, input().split())
if T * A <= B:
    print(T*A)
else:
    print(B)

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 18 17:04:29 2017

@author: goto
"""

moji=map(int, input().split())

t=moji[0]*moji[1]
if t<moji[2]:
    minmoji=t
else:
    minmoji=moji[2]
    

print(minmoji)    



Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 18 17:04:29 2017

@author: goto
"""

int1,int2,int3=map(int, input().split())

t=int1*int2

if t<int3:
    minmoji=t
else:
    minmoji=int3
    

print(minmoji)
Buggy python submission (verdict: Runtime Error):
n,m=int,input().split()

print((n-1)*(m-1))


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

print((n-1)*(m-1))

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

print((n-1)*(m-1))


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

print((n-1)*(m-1))
Buggy python submission (verdict: Runtime Error):

s,y,j=input().split()
sss=len(s)
yyy=len(y)
jjj=len(j)

ss=s[0:1]
ssss=s[sss-1:sss]
yy=y[0:1]
yyyy=y[yyy-1:yyy]
jj=j[0:1]
jjjj=j[jjj-1:jjj]

if ssss==yy:
    nyan=1
    
if yyyy==jj:
    nyan+=1
    
if nyan==2:
    print('YES')
else:   
    print('NO')
    


Fixed submission:

s,y,j=input().split()

ss=len(s)
yy=len(y)
jj=len(j)
nyan=0
if s[ss-1:ss]==y[0:1]:
    nyan+=1
    
if y[yy-1:yy]==j[0:1]:
    nyan+=1
    
    
if nyan==2:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
    n = int(input())
     
    f = [int(input().replace(" ", ""), 2) for _ in range(n)]
    p = [list(map(int, input().split())) for _ in range(n)]
     
    ans = float('-inf')
     
    for i in range(1, 1024):
        price = 0
        for j in range(n):
            price += p[j][bin(i & f[j]).count('1')]
        ans = max(ans, price)
     
    print(ans)

Fixed submission:
n = int(input())

f = [int(input().replace(" ", ""), 2) for _ in range(n)]
p = [list(map(int, input().split())) for _ in range(n)]

ans = float('-inf')

for i in range(1, 1024):
    price = 0
    for j in range(n):
        price += p[j][bin(i & f[j]).count('1')]
    ans = max(ans, price)

print(ans)
Buggy python submission (verdict: Runtime Error):
n025, n05, n1, n2 = map(int, raw_input().split())
n = input()
ans = [0 for i in range(4)]


if n >= 2:
    arr = []
    arr.append(n025 * 8)
    arr.append(n05 * 4)
    arr.append(n1 * 2)
    arr.append(n2)
    for i in range(n / 2):
        m = arr.index(min(arr))
        if m == 0:
            ans[m] += 8
        elif m == 1:
            ans[m] += 4
        elif m == 2:
            ans[m] += 2
        else:
            ans[m] += 1

n = (n % 2)

for i in range(n):
    arr = []
    arr.append(n025 * 4)
    arr.append(n05 * 2)
    arr.append(n1)
    for i in range(n):
        m = arr.index(min(arr))
        if m == 0:
            ans[m] += 4
        elif m == 1:
            ans[m] += 2
        else:
            ans[m] += 1
        
tmp = 0
tmp += ans[0] * n025
tmp += ans[1] * n05
tmp += ans[2] * n1
tmp += ans[3] * n2

print tmp

Fixed submission:
n025, n05, n1, n2 = map(int, raw_input().split())
n = input()
ans = 0

if n >= 2:
    arr = []
    arr.append(n025 * 8)
    arr.append(n05 * 4)
    arr.append(n1 * 2)
    arr.append(n2)
    ans += min(arr) * (n / 2)

arr = []
arr.append(n025 * 4)
arr.append(n05 * 2)
arr.append(n1)
ans += min(arr) * (n % 2)

print ans
Buggy python submission (verdict: Runtime Error):
n = input()

a = map(int, raw_input().split())

a.sort()
a.reverse()
f = 1
tmp = [0]
ct = 0

while len(a) != 0:
    nxt = a.pop(0)
    key = a.pop(0)
    if key == nxt:
        tmp.append(key)
	ct += 1
    	if ct == 2:
            break
    key = nxt

if len(tmp) > 2:
    print tmp[1] * tmp[2]
else:
    print 0
    

Fixed submission:
x, a, b = map(int, raw_input().split())

if abs(x - a) < abs (x - b):
    print "A"
else:
    print "B"
Buggy python submission (verdict: Runtime Error):
n = input()

a = map(int, raw_input().split())
a.sort(reverse = True)
tmp = [0]
ct = 0

key = a.pop(0)
while len(a) != 1:
    nxt = a.pop(0)
    if key == nxt:
        tmp.append(key)
	ct += 1
        if ct == 2:
            break
    key = a.pop(0)

if len(tmp) < 2:
    print 0
else:
    print tmp[1] * tmp[2]

Fixed submission:
n = int(input())
tmp = raw_input()

As = [int(a) for a in tmp.split()]

dic = {}
maxes = [0, 0]
for a in As:
    if a not in dic:
        dic[a] = 0
    dic[a] += 1
    if dic[a] % 2 == 0:
        if maxes[0] < a:
            maxes[0], maxes[1] = a, maxes[0]
        elif maxes[1] < a:
                maxes[1] = a

print (maxes[0] * maxes[1])

Buggy python submission (verdict: Runtime Error):
n = input()

a = map(int, raw_input().split())

a.sort()
f = 1
tmp = [0]
ct = 0

key = a.pop(len(a) - 1)
while len(a) != 0:
    nxt = a.pop(len(a) - 1)
    if key == nxt:
        tmp.append(key)
	ct += 1
        if ct == 2:
            print tmp[1] * tmp[2]
            break
    key = a.pop(len(a) - 1)

if len(tmp) < 2:
    print 0
    

Fixed submission:
n = int(input())
tmp = raw_input()

As = [int(a) for a in tmp.split()]

dic = {}
maxes = [0, 0]
for a in As:
    if a not in dic:
        dic[a] = 0
    dic[a] += 1
    if dic[a] % 2 == 0:
        if maxes[0] < a:
            maxes[0], maxes[1] = a, maxes[0]
        elif maxes[1] < a:
                maxes[1] = a

print (maxes[0] * maxes[1])

Buggy python submission (verdict: Runtime Error):
n = input()

a = map(int, raw_input().split())

a.sort()
a.reverse()
f = 1
tmp = [0]
ct = 0

key = a.pop(0)
while len(a) != 0:
    nxt = a.pop(0)
    if key == nxt:
        tmp.append(key)
	ct += 1
        if ct == 2:
            print tmp[1] * tmp[2]
            break
    key = a.pop(0)

if len(tmp) < 2:
    print 0
    

Fixed submission:
n = int(input())
tmp = raw_input()

As = [int(a) for a in tmp.split()]

dic = {}
maxes = [0, 0]
for a in As:
    if a not in dic:
        dic[a] = 0
    dic[a] += 1
    if dic[a] % 2 == 0:
        if maxes[0] < a:
            maxes[0], maxes[1] = a, maxes[0]
        elif maxes[1] < a:
                maxes[1] = a

print (maxes[0] * maxes[1])

Buggy python submission (verdict: Runtime Error):
n = input()

a = map(int, raw_input().split())

a.sort()
a.reverse()
f = 1
tmp = [0]
ct = 0

key = a.pop(0)
while len(a) != 0:
    nxt = a.pop(0)
    if key == nxt:
        tmp.append(key)
	ct += 1
        if ct == 2:
            break
    key = a.pop(0)

if len(tmp) > 2:
    print tmp[1] * tmp[2]
else:
    print 0
    

Fixed submission:
n = int(input())
tmp = raw_input()

As = [int(a) for a in tmp.split()]

dic = {}
maxes = [0, 0]
for a in As:
    if a not in dic:
        dic[a] = 0
    dic[a] += 1
    if dic[a] % 2 == 0:
        if maxes[0] < a:
            maxes[0], maxes[1] = a, maxes[0]
        elif maxes[1] < a:
                maxes[1] = a

print (maxes[0] * maxes[1])
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, raw_input().split())

print a, b, c, d

if a >= c:
    ans = b - c
else:
    ans = d - a

if ans < 0:
    print 0
else:
    print ans



Fixed submission:
def func(s):
    key = len(s)
    for i in range(len(s)):
        if s[key - i - 1] != s[i]:
            return -1
    return 0

s = raw_input()

n = func(s)

if n == 0:
    print "Yes"
else:
    print "No"
Buggy python submission (verdict: Runtime Error):
g2 = [4, 6, 9, 11]
g3 = [2]

s = map(int, raw_input().split())

x = s[0]
y = s[1]

if (x in g1) and (y in g1):
    print "Yes"
elif (x in g2) and (y in g2):
    print "Yes"
elif (x in g3) and (y in g3):
    print "Yes"
else:
    print "No"

Fixed submission:
g1 = [1, 3, 5, 7, 8, 10, 12]
g2 = [4, 6, 9, 11]
g3 = [2]

s = map(int, raw_input().split())

x = s[0]
y = s[1]

if (x in g1) and (y in g1):
    print "Yes"
elif (x in g2) and (y in g2):
    print "Yes"
elif (x in g3) and (y in g3):
    print "Yes"
else:
    print "No"
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, raw_input().split())

if b - a == c - b:
    print "YES"
else:
    print "NO"
                

Fixed submission:
n = input()

x = 800 * n
y = (n / 15) * 200
print x - y
Buggy python submission (verdict: Runtime Error):
n , m = map(int, raw_input().split())

tmp = m - (2 * n)
ans = 0
if tmp < 0:
        tmp = m - 2 * (n - tmp)
        if tmp >= 0:
                n -= n - tmp
                break

m = tmp

ans += n
ans += tmp / 4

print ans

Fixed submission:
n , m = map(int, raw_input().split())

tmp = m - (2 * n)
if tmp < 0:
        ans = m / 2
else:
        ans = 0
        ans += n
        ans += tmp / 4

print ans

Buggy python submission (verdict: Runtime Error):
n , m = map(int, raw_input().split())

tmp = m - (2 * n)
ans = 0
if tmp < 0:
        for i in range(n):
                tmp = m - 2 * (n - i)
                if tmp >= 0:
                        n -= i
                        break

m = tmp

ans += n
ans += tmp / 4

print ans

Fixed submission:
n , m = map(int, raw_input().split())

tmp = m - (2 * n)
if tmp < 0:
        ans = m / 2
else:
        ans = 0
        ans += n
        ans += tmp / 4

print ans

Buggy python submission (verdict: Time Limit Exceeded):
n , m = map(int, raw_input().split())

ct = 0
ans = 0
while m != 0:
        m -= 1
        ct += 1
        if ct == 2 and n > 0:
                n -= 1
                ans += 1
                ct = 0
        elif ct == 4:
                ans += 1
                ct = 0

print ans

Fixed submission:
n , m = map(int, raw_input().split())

tmp = m - (2 * n)
if tmp < 0:
        ans = m / 2
else:
        ans = 0
        ans += n
        ans += tmp / 4

print ans
Buggy python submission (verdict: Runtime Error):
N, A, B = input()
N = int(N)
A = int(A)
B = int(B)
priceA = A * N
if  priceA <= B:
    print(priceA)
else:
    print(B)



Fixed submission:
N, A, B = input().split()
'''                                                                                                                                     
N = input()                                                                                                                             
A = input()                                                                                                                             
B = input()                                                                                                                             
'''
N = int(N)
A = int(A)
B = int(B)
priceA = A * N
if  priceA <= B:
    print(priceA)
else:
    print(B)
Buggy python submission (verdict: Runtime Error):
N=int(input())
a=list(map(int,input().split()))
c=0
d=[]
for i in range(N):
        if(i+1==a[i]):
            d.append("x")
        else:
            d.append("o")
for i in range(len(d)):
    if d[i]=="x":
        d[i]="o"
        d[i+1]="o"
        c+=1
print(c)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
c=0
d=[]
for i in range(N):
        if(i+1==a[i]):
            d.append("x")
        else:
            d.append("o")
for i in range(len(d)):
    if d[i]=="x":
        if i==len(d)-1:
            d[i]="o"
            d[i-1]="o"
            c+=1
        else:
            d[i]="o"
            d[i+1]="o"
            c+=1
        
print(c)
Buggy python submission (verdict: Runtime Error):
x,a,b=list(map(int,input().split()))
if(math.fabs(x-a)>math.fabs(x-b)):
    print("B")
else:
    print("A")

Fixed submission:
import math

x,a,b=list(map(int,input().split()))
if(math.fabs(x-a)>math.fabs(x-b)):
    print("B")
else:
    print("A")
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
 
A=sorted(A,reverse=True)
if(len(A)%2==1):
    A.append(0)
c=0
l=1
for i in range(0,len(A)+1,2):
    if(c==2):
        break
    elif(A[i]==A[i+1]):
        c+=1
        l*=A[i]
if(c==2):
    print(l)
else:
    print(int(0))

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

A=sorted(A,reverse=True)
if(len(A)%2==1):
    A.append(0)
c=0
l=1
t=0
th=0
for i in range(0,len(A),2):
    if(c==2):
        break
    if(A[i]==A[i+1]):
        c+=1
        l*=A[i]
        th=True
    elif(t==A[i] and not(th)):
        c+=1
        l*=A[i]
        th=False
    else:
        th=False
    t=A[i+1]
if(c==2):
    print(l)
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
import math
N,M=list(map(int,input().split()))
x=math.factorial(N)
y=math.factorial(M)
if(abs(N-M)>1):
    print(0)
else:
    if((N%2==0 and M%2==0) or N==M):
        print(x*y*2%(10**9+7))
    else:
        print(x*y)

Fixed submission:
import math
N,M=list(map(int,input().split()))
x=math.factorial(N)*math.factorial(M)%(10**9+7)
if(abs(N-M)>1):
    print(0)
else:
    if((N%2==0 and M%2==0) or N==M):
        print(x*2%(10**9+7))
    else:
        print(x)
Buggy python submission (verdict: Runtime Error):
a,b,c = [int(i) for i in raw_input().split(" ")] 
if (b-a) == (c-b) :
	print("YES")
else:
	print("NO")

Fixed submission:
a,b,c = [int(i) for i in raw_input().split(" ")] 
if (b-a) == (c-b) :
	print("YES")
else:
	print("NO")
Buggy python submission (verdict: Runtime Error):
#A One card Poker
A,B = [int(i) for i in input().split(" ")]
if A == B:
    print("Draw")
elif (A == 1) or (A>B and B!=1):
    print("Alice")
else:
    print("Bob")

Fixed submission:
#A One card Poker
A,B = [int(i) for i in input().split(" ")]
if A == B:
    print("Draw")
elif (A == 1) or (A>B and B!=1):
    print("Alice")
else:
    print("Bob")
Buggy python submission (verdict: Runtime Error):
#001
a = raw_input()
a=a.replace(',',' ')
print(a)

Fixed submission:
#001
a = raw_input()
a=a.replace(',',' ')
print(a)
Buggy python submission (verdict: Runtime Error):
#001
a,op,b = input().split(" ")
a = int(a)
b = int(b)
if op=="+":
    print(a+b)
else:
    print(a-b)

Fixed submission:
#001
a,op,b = input().split(" ")
a = int(a)
b = int(b)
if op=="+":
    print(a+b)
else:
    print(a-b)
Buggy python submission (verdict: Runtime Error):
#001
vowel = ['a','e','u','i','o']

x=raw_input()

if x in vowel:
    print("vowel")
else:
    print("consonant")

Fixed submission:
vowel = 'aeuio'
x=raw_input()
if x in vowel:
    print("vowel")
else:
    print("consonant")

Buggy python submission (verdict: Runtime Error):
#001
vowel = "aeuio"
x=str(raw_input())
if x in vowel:
    print("vowel")
else:
    print("consonant")

Fixed submission:
vowel = 'aeuio'
x=raw_input()
if x in vowel:
    print("vowel")
else:
    print("consonant")
Buggy python submission (verdict: Runtime Error):
# import time

# starttime=time.clock()

A,B,C =input().split()
a=int(A)
b=int(B)
c=int(C)
print(a+c)
 
if a>b:
    temp = a
    a = b
    b = temp
if b>c:
    temp = b
    b = c
    c = temp
if (a+b)==c:
    print("Yes")
#     endtime = time.clock()
#     print(endtime-starttime)
else:
    print("No")
#     endtime = time.clock()
#     print(endtime-starttime)
#      


Fixed submission:
# import time

# starttime=time.clock()

A,B,C =input().split()
a=int(A)
b=int(B)
c=int(C)
# print(a+c)
 
if a>b:
    temp = a
    a = b
    b = temp
if b>c:
    temp = b
    b = c
    c = temp
if (a+b)==c:
    print("Yes")
#     endtime = time.clock()
#     print(endtime-starttime)
else:
    print("No")
#     endtime = time.clock()
#     print(endtime-starttime)
#

Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
if a>b:
    temp = a
    a = b
    b = temp

if b>c:
    temp = b
    b = c
    c = temp


if (a+b)==c:
    print("Yes")
else:
    print("No")

Fixed submission:
# import time

# starttime=time.clock()

A,B,C =input().split()
a=int(A)
b=int(B)
c=int(C)
# print(a+c)
 
if a>b:
    temp = a
    a = b
    b = temp
if b>c:
    temp = b
    b = c
    c = temp
if (a+b)==c:
    print("Yes")
#     endtime = time.clock()
#     print(endtime-starttime)
else:
    print("No")
#     endtime = time.clock()
#     print(endtime-starttime)
#
Buggy python submission (verdict: Runtime Error):
#D    高橋君と見えざる手 / An Invisible Hand
N,T = [int(i) for i in input().split(" ")]
A=[int(i) for i in input().split(" ")]
Max = 0
count = 1
for i in range(N-1,0,-1):
    for j in range(i-1,-1,-1):
        temp = A[i]-A[j]
        if temp>Max:
            Max = temp
            count = 1
        elif temp==Max:
            count +=1

print(count)

Fixed submission:
#003
list = list(input())
result = 0

for i in range(len(list)-1):
    if list[i]!=list[i+1]:
        result+=1

print(result)
Buggy python submission (verdict: Time Limit Exceeded):
#D    高橋君と見えざる手 / An Invisible Hand
N,T = [int(i) for i in input().split(" ")]
A=[int(i) for i in input().split(" ")]
Max = 0
count = 1
for i in range(N-1,0,-1):
    for j in range(i-1,-1,-1):
        temp = A[i]-A[j]
        if temp>Max:
            Max = temp
            count = 1
        elif temp==Max:
            count +=1

print(count)

Fixed submission:
#D    高橋君と見えざる手 / An Invisible Hand
N,T = [int(i) for i in input().split(" ")]
A=[int(i) for i in input().split(" ")]
Max = 0
count = 1
Min = A[0]
for i in range(N):
    if A[i] <= Min :
        Min = A[i]
    else :
        temp = A[i]-Min
        if temp > Max:
            Max = temp 
            count = 1
        elif temp == Max :
            count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
#D    高橋君と見えざる手 / An Invisible Hand
N,T = [int(i) for i in input().split(" ")]
A=[int(i) for i in input().split(" ")]
Max = 1
count = 0
for i in range(N-1,0,-1):
    for j in range(i-1,-1,-1):
        if (A[i]-A[j])>Max:
            Max = A[i]-A[j]
            count = 1
        elif (A[i]-A[j])==Max:
            count +=1

print(count)

Fixed submission:
#D    高橋君と見えざる手 / An Invisible Hand
N,T = [int(i) for i in input().split(" ")]
A=[int(i) for i in input().split(" ")]
Max = 0
count = 1
Min = A[0]
for i in range(N):
    if A[i] <= Min :
        Min = A[i]
    else :
        temp = A[i]-Min
        if temp > Max:
            Max = temp 
            count = 1
        elif temp == Max :
            count += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
numbers=[]
for n in range(0,N):
    number=int(input())
    if number in numbers:
        numbers.remove(number)
    else:
        numbers.append(number)
print(len(numbers))


Fixed submission:
N=int(input())
numbers={}
for n in range(0,N):
    number=int(input())
    if number in numbers:
        numbers[number]+=1
    else:
        numbers[number]=1
ans=0
for n in list(numbers.values()):
    ans+=n%2
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
N,T1=int(input()),int(input())
for n in range(1,N):
    T2=int(input())
    T1=int(T1*T2/math.gcd(T1,T2))
print(T1)


Fixed submission:
import fractions
N,T1=int(input()),int(input())
for n in range(1,N):
    T2=int(input())
    T1=(T1*T2)//fractions.gcd(T1,T2)
print(T1)

Buggy python submission (verdict: Runtime Error):
import math
N,T1=int(input()),int(input())
for n in range(1,N):
    T2=int(input())
    T1=T1*T2/math.gcd(T1,T2)
print(int(T1))


Fixed submission:
import fractions
N,T1=int(input()),int(input())
for n in range(1,N):
    T2=int(input())
    T1=(T1*T2)//fractions.gcd(T1,T2)
print(T1)