Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
table = list(range(1, N + 1))
if A < B:
    dif = B - A
else:
    dif = A - B
if dif % 2 == 0:
    ans = int(dif / 2)
else:
    a = [abs(table[0] - table[A - 1]), abs(table[-1] - table[A - 1]), abs(table[0] - table[B - 1]), abs(table[-1] - table[B - 1])]
    a = sorted(a)
    ans = a[0] + (a[1] - a[0])
print(ans)

Fixed submission:
N, A, B = map(int, input().split())
dif = abs(A - B)
ans = 0

if dif % 2 == 0:
    ans = dif // 2
else:
    ans = min(A - 1, N - B) + 1 + dif // 2
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
a, b = map(int, input().split)
print(math.ceil((b-1)/(a-1)))

Fixed submission:
import math
a, b = map(int, input().split())
print(math.ceil((b - 1) / (a - 1)))
Buggy python submission (verdict: Time Limit Exceeded):
s = int(input())
arr = []

arr.append(s)

while s <= 5:
    if s % 2 == 0:
        s = s // 2
        arr.append(s)
    else:
        s = 3 * s + 1
        arr.append(s)

while s > 4:
    if s % 2 == 0:
        s = s // 2
        arr.append(s)
    else:
        s = 3 * s + 1
        arr.append(s)

print(len(arr) + 3)

Fixed submission:
s = int(input())
arr = []

arr.append(s)

while s > 4:
    if s % 2 == 0:
        s = s // 2
        arr.append(s)
    else:
        s = 3 * s + 1
        arr.append(s)

if s == 3:
    print(9)
else:
    print(len(arr) + 3)
Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())
ans = 1
B = b + 1

for i in range(a, B):
    ans *= i

if ans > 0:
    print("Positive")
elif ans < 0:
    print("Negative")
elif ans == 0:
    print("Zero")

Fixed submission:
a, b = map(int, input().split())
zero = (a == 0 | b == 0) | (a < 0 and 0 < b) | (b < 0 and 0 < a)
negative_a = (a < 0 and 0 < b) and (a + b + 1) % 2 != 0
negative_b = (a < 0 | b < 0) and (a + b + 1) % 2 != 0
if zero:
    print("Zero")
elif negative_a | negative_b:
    print("Negative")
else:
    print("Positive")

Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())
ans = 1
B = b + 1

for i in range(a, B):
    ans *= i

if ans > 0:
    print("Positive")
elif ans < 0:
    print("Negative")
elif ans == 0:
    print("Zero")

Fixed submission:
a, b = map(int, input().split())
zero = (a == 0 | b == 0) | (a < 0 and 0 < b) | (b < 0 and 0 < a)
negative_a = (a < 0 and 0 < b) and (a + b + 1) % 2 != 0
negative_b = (a < 0 | b < 0) and (a + b + 1) % 2 != 0
if zero:
    print("Zero")
elif negative_a | negative_b:
    print("Negative")
else:
    print("Positive")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = 1
if 0 in a:
	ans = 0
else:
	for i in a:
		ans *= i
if(ans>10**18):
	print(-1)
else:
	print(ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = 1
if 0 in a:
	ans = 0
else:
	for i in range(n-1,-1,-1):
		ans *= a[i]
		if(ans>10**18):
			break
if(ans>10**18):
	print(-1)
else:
	print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = 1
for i in a:
	ans *= i
if(ans>10**18):
	print(-1)
else:
	print(ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = 1
if 0 in a:
	ans = 0
else:
	for i in range(n-1,-1,-1):
		ans *= a[i]
		if(ans>10**18):
			break
if(ans>10**18):
	print(-1)
else:
	print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = [int(i) for i in input().split()]
l = 0
for i in range(n):
  for j in range(n):
    if (s[i] == s[j] or s[i]%s[j] == 0) and (i != j):
      l += 1
      break
print(len(s)-l)


Fixed submission:
x = [int(i) for i in input().split()]
print(x.index(0)+1)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = [int(i) for i in input().split()]
s = set(s)
for i in s:
	for j in s:
		if i == j or i%j == 0:
			s.remove(i)
			s.add(-i)
			break
l = [i for i in s if i >= 0]
print(len(l))

Fixed submission:
x = [int(i) for i in input().split()]
print(x.index(0)+1)
Buggy python submission (verdict: Runtime Error):
a, v = [int(i) for i in input().split()]
b, w = [int(i) for i in input().split()]
t = int(input())
print("YES") if a+(v*t) >= b+(w*) or a >= b else print("NO")

Fixed submission:
a, v = [int(i) for i in input().split()]
b, w = [int(i) for i in input().split()]
t = int(input())
if a<b:
  print("YES") if a+(v*t) >= b+(w*t) else print("NO")
else:
  print("YES") if a-(v*t) <= b-(w*t) else print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, d = [int(x) for x in input().split()]
dp = [[0 for i in range(d + 1)] for j in range(c + 1)]
for i in range(a+1):
    for j in range(b+1):
        dp[i][j]=1
for i in range(a, c + 1):
    for j in range(b, d + 1):
        if i == a and j == b:
            continue
        if i - 1 >= a:
            dp[i][j] += (dp[i - 1][j] * j)
        if j - 1 >= b:
            dp[i][j] += (dp[i][j - 1] * i)
        if (i - 1) >= a and (j - 1) >= b:
            dp[i][j] -= dp[i-1][j-1]*(i-1)*(j-1)
        dp[i][j] %= 998244353

print(dp[c][d])


Fixed submission:
a, b, c, d = [int(x) for x in input().split()]
dp = [[0 for i in range(d + 1)] for j in range(c + 1)]
for i in range(a+1):
    for j in range(b+1):
        dp[i][j]=1
for i in range(a, c + 1):
    for j in range(b, d + 1):
        if i == a and j == b:
            continue
        if i - 1 >= a:
            dp[i][j] += (dp[i - 1][j] * j)
        if j - 1 >= b:
            dp[i][j] += (dp[i][j - 1] * i)
        if (i - 1) >= a and (j - 1) >= b:
            dp[i][j] -= dp[i-1][j-1]*(i-1)*(j-1)
        dp[i][j] %= 998244353

print(dp[c][d])
Buggy python submission (verdict: Runtime Error):
from math import log,ceil
x=int(input())
p=100
r=0.01

for i in range(1,3760+1):
    c=floor(p*(1.01)**1)
    if c<x:
        p+=c-p
    else:
        break
print(i)

Fixed submission:
from math import floor
x=int(input())
p=100
r=0.01

for i in range(1,3760+1):
    c=floor(p*(1.01)**1)
    if c<x:
        p+=c-p
    else:
        break
print(i)
Buggy python submission (verdict: Runtime Error):
s,w=[int(x) for x in input().split()]
if w>=n:
  print('unsafe')
else:print('safe')

Fixed submission:
s,w=[int(x) for x in input().split()]
if w>=s:print('unsafe')
else:print('safe')
Buggy python submission (verdict: Time Limit Exceeded):
x=int(input())
i=1
if 1<=x<=179:
	while True:
		if 360/x==int(360/x):
			print(int(360/x))
			break
		else:
			i+=1



Fixed submission:
x=int(input())
i=1
if 1<=x<=179:
	while True:
		if 360*i%x==0:
			print(int(360*i/x))
			break
		else:
			i+=1

Buggy python submission (verdict: Runtime Error):
import numpy as np

rotate = int(input()) 

x = 0
y = 1
heading = 0

count = 1

while x != 0 and y != 0:
  heading += rotate
  x += cos(np.deg2rad(heading))
  y += sin(np.deg2rad(heading))
  count++
  
print(count)

Fixed submission:
import numpy as np
import math

rotate = int(input())

x = 0
y = 1
heading = 90

count = 1

while True:
    heading += rotate
    x += np.cos(np.deg2rad(heading))
    y += np.sin(np.deg2rad(heading))
    count += 1
    #print('heading', heading)
    #print('x : ', x)
    #print('y : ', y)

    if math.isclose(x, 0.0,abs_tol=0.000001) and math.isclose(y, 0.0,abs_tol=0.0000001):
        break

print(count)

Buggy python submission (verdict: Runtime Error):
import math

x = int(input())
g = math.gdc(x,360)
print(360//g)


Fixed submission:
import math

x = int(input())
g = math.gcd(x,360)
print(360//g)

Buggy python submission (verdict: Runtime Error):
x = int(input())
if 360%x==0:
  print(360//x)
else:
  orint(360)
  


Fixed submission:
import math

x = int(input())
g = math.gcd(x,360)
print(360//g)
Buggy python submission (verdict: Runtime Error):
x, y = map(int,input().split())

if (y-2*x)%2==0:
  k = (y-2*x)//2
  t = x-k
else:
  print("No")

if 0 <= k and 0 <= t:
  print("Yes")
else:
  print("No")


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

if (y-2*x)%2!=0:
  print("No")
else:
  k = (y-2*x)//2
  t = x-k

  if 0 <= k and 0 <= t:
    print("Yes")
  else:
    print("No")

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

if (y-2*x)%2==0:
  k = (y-2*x)//2
  t = x-k

if 0 <= k and 0 <= t:
  print("Yes")
else:
  print("No")


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

if (y-2*x)%2!=0:
  print("No")
else:
  k = (y-2*x)//2
  t = x-k

  if 0 <= k and 0 <= t:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import math

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

sum = 0
for i in range(n):
  sum += math.log10(a[i])

if sum >= 18:
  print(-1)
else:
  sum = 1
  for i in range(n):
    sum *= a[i]
  print(sum)


Fixed submission:
import math

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

flag_zero = 0
sum = 0
for i in range(n):
  if a[i]==0:
    flag_zero = 1
  else:
    sum += math.log10(a[i])

if flag_zero == 1:
  print(0)
elif sum > 18:
  print(-1)
else:
  sum = 1
  for i in range(n):
    sum *= a[i]
  if sum > 10**18:
    print(-1)
  else:
    print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int,input().split())
height = list(map(int,input().split()))

a = []
b = []
for i in range(m):
  tmp = list(map(int,input().split()))
  a.append(tmp[0])
  b.append(tmp[1])
  
atta = 0
for j in range(n):
  flag = 0
  for k in range(m):
    if a[k] == j+1:
      if height[j] <= height[b[k]-1]:
        flag = 1
    elif b[k] == j+1:
      if height[j] <= height[a[k]-1]:
        flag = 1
  if flag == 0:
    atta += 1

print(atta)


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

a = []
b = []
for i in range(m):
  tmp = list(map(int,input().split()))
  a.append(tmp[0])
  b.append(tmp[1])
  
atta = [1]*n
for j in range(m):
  if height[a[j]-1] == height[b[j]-1]:
    atta[a[j]-1] = 0
    atta[b[j]-1] = 0
  elif height[a[j]-1] < height[b[j]-1]:
    atta[a[j]-1] = 0
  elif height[a[j]-1] > height[b[j]-1]:
    atta[b[j]-1] = 0
  #print(j,atta)

print(atta.count(1))
Buggy python submission (verdict: Time Limit Exceeded):
A, B, N = map(int,input().split())

max = -1
for x in range(N+1):
  tmp = int(A*x/B) - A*int(x/B)
  if tmp >= max:
    max = tmp

print(max)


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

if N <= B-1:
  max = int(A*N/B) - A*int(N/B)
else:
  max = int(A*(B-1)/B) - A*int((B-1)/B)

print(max)
Buggy python submission (verdict: Runtime Error):
m, n = map( int, input().split() )
a = 0
for i in range(m)
	a += int(input())

n=n-a
if a<=-2:
  a=-1

print(a)

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

n=n-sum
if n<=-2:
  n=-1

print(n)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
syain = list(map(int,input().split()))

l=[]
for i in range(n,0,-1):
  l.append(syain.count(i))
  syain = [s for s in syain if s != i]

for i in range(n):
  print(l[n-1-i])

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

b = [0]*(n+2)

for i in range(n-1):
  b[a[i]] += 1
  
for i in range(1,n+1):
  print(b[i])

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

for i in range(n):
  print(syain.count(i+1))
  syain = [s for s in syain if s != i+1]


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

b = [0]*(n+2)

for i in range(n-1):
  b[a[i]] += 1
  
for i in range(1,n+1):
  print(b[i])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
syain = list(map(int,input().split()))
for i in range(n):
  print(syain.count(i+1))

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

b = [0]*(n+2)

for i in range(n-1):
  b[a[i]] += 1
  
for i in range(1,n+1):
  print(b[i])
Buggy python submission (verdict: Runtime Error):
a = input().split()

if int(a[0])<=int(a[1]) and int(a[0])<=int(a[2]):
  min = int(a[0])
  if int(a[1])<=int(a[2]):
    max = int(a[2])
  else:
    max = int(a[1])
elif int(a[1])<=int(a[2]) and int(a[1])<=int(a[0]):
  min = int([1])
  if int(a[0])<=int(a[2]):
    max = int(a[2])
  else:
    max = int(a[0])
else:
  min = int(a[2])
  if int(a[0])<=int(a[1]):
    max = int(a[1])
  else:
    max = int(a[0])

print(max-min)

Fixed submission:
a = input().split()

if int(a[0])<=int(a[1]) and int(a[0])<=int(a[2]):
  min = int(a[0])
  if int(a[1])<=int(a[2]):
    max = int(a[2])
  else:
    max = int(a[1])
elif int(a[1])<=int(a[2]) and int(a[1])<=int(a[0]):
  min = int(a[1])
  if int(a[0])<=int(a[2]):
    max = int(a[2])
  else:
    max = int(a[0])
else:
  min = int(a[2])
  if int(a[0])<=int(a[1]):
    max = int(a[1])
  else:
    max = int(a[0])

print(max-min)

Buggy python submission (verdict: Runtime Error):
a = input().split()

if int(a[0])<=int(a[1]) and int(a[0])<=int(a[2]):
  min = int(a[0])
  if int(a[1])<=int(a[2]):
    max = int(a[2])
  else:
    max = int(a[1])
elif int(a[1])<=int(a[2]) and int(a[1])<=int(a[0]):
  min = aint([1])
  if int(a[0])<=int(a[2]):
    max = int(a[2])
  else:
    max = int(a[0])
else:
  min = int(a[2])
  if int(a[0])<=int(a[1]):
    max = int(a[1])
  else:
    max = int(a[0])

print(max-min)

Fixed submission:
a = input().split()

if int(a[0])<=int(a[1]) and int(a[0])<=int(a[2]):
  min = int(a[0])
  if int(a[1])<=int(a[2]):
    max = int(a[2])
  else:
    max = int(a[1])
elif int(a[1])<=int(a[2]) and int(a[1])<=int(a[0]):
  min = int(a[1])
  if int(a[0])<=int(a[2]):
    max = int(a[2])
  else:
    max = int(a[0])
else:
  min = int(a[2])
  if int(a[0])<=int(a[1]):
    max = int(a[1])
  else:
    max = int(a[0])

print(max-min)

Buggy python submission (verdict: Runtime Error):
a = input().split()

if int(a[0])<=int(a[1]) and int(a[0])<=int(a[2]):
  min = a[0]
  if int(a[1])<=int(a[2]):
    max = int(a[2])
  else:
    max = int(a[1])
elif int(a[1])<=int(a[2]) and int(a[1])<=int(a[0]):
  min = a[1]
  if int(a[0])<=int(a[2]):
    max = int(a[2])
  ele:
    max = int(a[0])
else:
  min = a[2]
  if int(a[0])<=int(a[1]):
    max = int(a[1])
  ele:
    max = int(a[0])

print(max-min)

Fixed submission:
a = input().split()

if int(a[0])<=int(a[1]) and int(a[0])<=int(a[2]):
  min = int(a[0])
  if int(a[1])<=int(a[2]):
    max = int(a[2])
  else:
    max = int(a[1])
elif int(a[1])<=int(a[2]) and int(a[1])<=int(a[0]):
  min = int(a[1])
  if int(a[0])<=int(a[2]):
    max = int(a[2])
  else:
    max = int(a[0])
else:
  min = int(a[2])
  if int(a[0])<=int(a[1]):
    max = int(a[1])
  else:
    max = int(a[0])

print(max-min)
Buggy python submission (verdict: Runtime Error):
import math

n=int(input())
print(2*n//int(math.gcd(2,n)))

Fixed submission:
n = int(input())
if n%2==0:
  print(n)
else:
  print(2*n)

Buggy python submission (verdict: Runtime Error):
import math

n=int(input())
print(2*n//math.gcd(2,n))


Fixed submission:
n = int(input())
if n%2==0:
  print(n)
else:
  print(2*n)
Buggy python submission (verdict: Runtime Error):
s=input()
p=0; m=0
for i in range(0,4)
  if s[i]=='+':
    p += 1
  else:
    m += 1
print(p-m)

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

Buggy python submission (verdict: Runtime Error):
s=input()
p=0; m=0
for i in range(0,len(s))
  if s[i]=='+':
    p += 1
  else:
    m += 1
print(p-m)

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

Buggy python submission (verdict: Runtime Error):
s=input()
p=0; m=0
for i in range(0,len(s))
  if s[i]='+':
    p += 1
  else:
    m += 1
print(p-m)

Fixed submission:
s=input()
p=0; m=0
for i in range(0,4):
  if s[i]=='+':
    p += 1
  else:
    m += 1
print(p-m)
Buggy python submission (verdict: Runtime Error):
n = int(input())
card = list(map(int,input().split()))

card.sort()

ans = 0
for i in range(n//2+1):
            ans += card[2*i]-card[2*i+1]
if n%2==1:
            ans += card[-1]

print(ans)

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

card.sort(reverse=True)

asum = 0
bsum = 0
for i in range(n):
  if i%2==0:
    asum += card[i]
  else:
    bsum += card[i]

print(asum-bsum)

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

card.sort()

for i in range(n//2):
            ans += card[2*i]-card[2*i+1]
if n%2==1:
            ans += card[-1]

print(ans)

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

card.sort(reverse=True)

asum = 0
bsum = 0
for i in range(n):
  if i%2==0:
    asum += card[i]
  else:
    bsum += card[i]

print(asum-bsum)
Buggy python submission (verdict: Runtime Error):
s = input()

while s != []:
  if s=='erase':
    s = s[]
  elif len(s)>5 and s[0:5]=='erasee':
    s = s[5:]
  elif len(s)>5 and s[0:5]=='erased':
    s = s[5:]
  elif s=='eraser':
    s = s[]
  elif len(s)>6 and s[0:6]=='erasere':
	s = s[6:]
  elif len(s)>6 and s[0:6]=='eraserd':
	s = s[6:]
  elif s=='dreamer':
    s = []
  elif len(s)>7 and s[0:7]='dreamere':
    s = s[7:]
  elif len(s)>7 and s[0:7]='dreamerd':
    s = s[7:]
  elif s='dream':
    s = s[]
  elif len(s)>5 and s[0:5]='dreamd':
    s = s[6:]
  print(s)
    
# dream dreamer erase eraser


Fixed submission:
s = input()

flag = 0
while s != []:
  ss=s
  if s=='erase':
    s = []
  elif len(s)>5 and s[0:6]=='erasee':
    s = s[5:]
  elif len(s)>5 and s[0:6]=='erased':
    s = s[5:]
  elif s=='eraser':
    s = []
  elif len(s)>6 and s[0:7]=='erasere':
    s = s[6:]
  elif len(s)>6 and s[0:7]=='eraserd':
    s = s[6:]
  elif s=='dreamer':
    s = []
  elif len(s)>7 and s[0:8]=='dreamere':
    s = s[7:]
  elif len(s)>7 and s[0:8]=='dreamerd':
    s = s[7:]
  elif s=='dream':
    s = []
  elif len(s)>5 and s[0:6]=='dreamd':
    s = s[5:]
  elif len(s)>5 and s[0:6]=='dreame':
    s = s[5:]

  if ss==s:
    flag=1
    break

if flag==0:
  print("YES")
else:
  print("NO")
    
# dream dreamer erase eraser
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int,input().split())
dp = [[0 for j in range(d+1)] for i in range(c+1)]
for i in range(a, c+1):
  for j in range(b, d+1):
    if i == a and j == b:
      dp[i][j] = 1
      continue
    dp[i][j] = (dp[i-1][j] * j + dp[i][j-1] * i - dp[i-1][j-1] * (i-1) * (j-1) ) % 998244353
    dp[i][j] += 998244353
    dp[i][j] %= 998244353
print(dp[c][d])

Fixed submission:
x = int(input())
for i in range(1, 361):
  if 360*i % x == 0:
    print(360*i//x)
    break
else:
  print(360)

Buggy python submission (verdict: Runtime Error):
x = int(input())
for i in range(1, 361):
  if 360*i % x === 0:
    print(360*i//x)
    break
else:
  print(360)

Fixed submission:
x = int(input())
for i in range(1, 361):
  if 360*i % x == 0:
    print(360*i//x)
    break
else:
  print(360)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, d = map(int,input().split())
dp = [[0 for j in range(d+1)] for i in range(c+1)]
for i in range(a, c+1):
  for j in range(b, d+1):
    if i == a and j == b:
      dp[i][j] = 1
      continue
    dp[i][j] = (dp[i-1][j] * j + dp[i][j-1] * i - dp[i-1][j-1] * (i-1) * (j-1) ) % 998244353
    dp[i][j] += 998244353
    dp[i][j] %= 998244353
print(dp[c][d])

Fixed submission:
a, b, c, d = map(int,input().split())
dp = [[0 for j in range(d+1)] for i in range(c+1)]
for i in range(a, c+1):
  for j in range(b, d+1):
    if i == a and j == b:
      dp[i][j] = 1
      continue
    dp[i][j] = (dp[i-1][j] * j + dp[i][j-1] * i - dp[i-1][j-1] * (i-1) * (j-1) ) % 998244353
    dp[i][j] += 998244353
    dp[i][j] %= 998244353
print(dp[c][d])
Buggy python submission (verdict: Runtime Error):
x, n = list(map(int, input().split()))
if n == 0:
    print(x)
else:
    p = list(map(int, input().split()))

    a = [i for i in range(101)]
    for i in range(n):
        a[p[i]] = 1000
    min = 1000
    result = 1000
    if n == 100:
        result = min(abs(100-x),abs(x))
    else:
        for i in reversed(range(1,101)):
            if a[i] != 1000:
                if min >= abs(x - a[i]):
                    min = abs(x - a[i])
                    result = a[i]

    print(result)


Fixed submission:
x, n = list(map(int, input().split()))
if n == 0:
    print(x)
else:
    p = list(map(int, input().split()))

    a = [i for i in range(102)]
    for i in range(n):
        a[p[i]] = 1000
    minimum = 1000
    result = 1000
    for i in reversed(range(102)):
        if a[i] != 1000:
            if minimum >= abs(x - a[i]):
                minimum = abs(x - a[i])
                result = a[i]

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

b = souted(set(a))

maxA = max(b)
dp = [0]*(maxA+1)
count = 0

for e in b:
    for i in range(e,maxA+1,e):
        dp[i] += 1

for e in b:
    if dp[e] == 1:
        count += 1

print(count)


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


maxA = max(a)
dp = [0]*(maxA+1)
count = 0

for e in a:
    for i in range(e,maxA+1,e):
        dp[i] += 1

for e in a:
    if dp[e] == 1:
        count += 1

print(count)

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

maxA = max(a)
count = 0

for e in a:
    for i in range(e,maxA+1,e):
        dp[i] += 1
        
for e in a:
    if dp[e] == 1:
        count += 1

print(count)


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


maxA = max(a)
dp = [0]*(maxA+1)
count = 0

for e in a:
    for i in range(e,maxA+1,e):
        dp[i] += 1

for e in a:
    if dp[e] == 1:
        count += 1

print(count)

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

b = sorted(set(a))

if len(b) == 1:
    print(0)
else:    
    stack = []
    stack.append(b[0])
    for i in range(1,n):
        flag = 0
        for e in stack:
            if b[i] % e == 0:
                flag = 1
                break
        if flag == 0:
            stack.append(b[i])

    print(len(stack))


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


maxA = max(a)
dp = [0]*(maxA+1)
count = 0

for e in a:
    for i in range(e,maxA+1,e):
        dp[i] += 1

for e in a:
    if dp[e] == 1:
        count += 1

print(count)

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

b = sorted(a)

stack = []
stack.push(b[0])
for i in range(1,n):
    flag = 0
    for e in stack:
        if b[i] % e == 0:
            flag = 1
            break
    if flag == 0:
        stack.push(e)

print(len(stack))


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


maxA = max(a)
dp = [0]*(maxA+1)
count = 0

for e in a:
    for i in range(e,maxA+1,e):
        dp[i] += 1

for e in a:
    if dp[e] == 1:
        count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
A, B = map(float, input().split())

print(int((A*(B*100)/100))

Fixed submission:
A, B = input().split()
A = int(A)
x,y = B.split('.')
B = 100*int(x)+int(y)

print(A*B//100)