ZhenlongDai/ACPR huggingface dataset:
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int,input().split()))
odd = 0
even2 = 0
even4 = 0
for i in A :
    if not i % 4 :
        even4 += 1
    elif not i % 2 :
        even2 += 1
    else :
        odd += 1

if odd <= even4 :
    ans = "Yes"
else :
    ans = "No"

print(ans)


Failing test case input:
3
1 -4 -1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int,input().split()))
odd = 0
even2 = 0
even4 = 0
for i in A :
    if not i % 4 :
        even4 += 1
    elif not i % 2 :
        even2 += 1
    else :
        odd += 1

if (odd <= even4) or (N
    ans = "Yes"
else :
    ans = "No"

print(ans)

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


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

nodd = 0
neven = 0
n4 = 0

for i in range(0,n):
  if a[i]%4==0:
    n4=n4+1
  elif a[i]%2==0:
    neven=neven+1
  else:
    nodd=nodd+1

res = 'No'

if neven==0 and n4*2 >= (nodd):
  res = 'Yes'
elif n4*2 >= (nodd+1):
  res = 'Yes'
elif nodd==0:
  res = 'Yes'

print(res)


Failing test case input:
6
5 7 0 0 6 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):


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

nodd = 0
neven = 0
n4 = 0

for i in range(0,n):
  if a[i]%4==0:
    n4=n4+1
  elif a[i]%2==0:
    neven=neven+1
  else:
    nodd=nodd+1

res = 'No'

if neven==0 and n4+1 >= (nodd):
  res = 'Yes'
elif n4+1 >= (nodd+1):
  res = 'Yes'
elif nodd==0:
  res = 'Yes'

print(res)

Problem: p03637
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))

four=0
two=0
for i in range(n):
    if a[i]%4==0:
        four+=1
    elif a[i]%2==0:
        two+=1
ans=four*3+two

if ans>=n:
    print("Yes")
else:
    print("No")

Failing test case input:
6
4 7 0 -1 6 9

Expected output:
No


Actual output:
Yes


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

four=0
two=0
for i in range(n):
    if a[i]%4==0:
        four+=1
    elif a[i]%2==0:
        two+=1
if two>0:
    ans=four*2+two
else:
    ans=four*2+1

if ans>=n:
    print("Yes")
else:
    print("No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))

p = []
r = []

for i in range(n):
    if a[i] % 4 == 0:
        p.append(a[i])
    elif a[i] % 2:
        r.append(a[i])

s = len(p)
u = len(r)

if u - 1<= s:
    print("Yes")
else:
    print("No")


Failing test case input:
6
5 7 0 8 6 9

Expected output:
No


Actual output:
Yes


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

p = []
q = []
r = []

for i in range(n):
    if a[i] % 4 == 0:
        p.append(a[i])
    elif a[i] % 2 == 0:
        q.append(a[i])
    else:
        r.append(a[i])

s = len(p)
t = len(q)
u = len(r)

if t == 0:
    if u <= s + 1:
        print("Yes")
    else:
        print("No")
else:
    if u <= s:
        print("Yes")
    else:
        print("No")
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = map(int, input().split())

b2 = 0
b4 = 0
for a in A:
    if a % 2 == 0:
        b2 += 1

    if a % 4 == 0:
        b4 += 1

b2 -= b4

N -= b4*2+1
N -= b2

if N <= 0:
    print("Yes")
else:
    print("No")

Failing test case input:
6
5 7 0 0 6 9

Expected output:
No


Actual output:
Yes


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

b2 = 0
b4 = 0
for a in A:
    if a % 2 == 0:
        b2 += 1

    if a % 4 == 0:
        b4 += 1

b2 -= b4

while b2 > 1:
    b2 -= 2
    
    b4 += 1

N -= b4*2+1

if N <= 0:
    print("Yes")
else:
    print("No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
arr = list(map(int,input().split()))

a=[]
b=[]
c=[]
for i in range(N):
    if arr[i]%4 == 0:
        a.append(arr[i])
    elif arr[i]%2 == 0:
        b.append(arr[i])
    else:
        c.append(arr[i])
if len(c) > len(a)+1:
    print('No')
elif len(c) < len(a) + 1:
    print('Yes')
elif len(b)%2 == 1:
    print('No')

Failing test case input:
3
1 -5 0

Expected output:
Yes


Actual output:

Fixed submission (verdict: Accepted):
N = int(input())
arr = list(map(int,input().split()))

a=[]
b=[]
c=[]
for i in range(N):
    if arr[i]%4 == 0:
        a.append(arr[i])
    elif arr[i]%2 == 0:
        b.append(arr[i])
    else:
        c.append(arr[i])
if len(c) > len(a)+1:
    print('No')
elif len(c) < len(a) + 1:
    print('Yes')
elif len(b)%2 == 1:
    print('No')
else:
    print('Yes')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
mul4 = 0
mul2 = 0
has_mul2 = 0
other = 0
for i in a:
    if i%4 == 0:
        mul4 += 1
    elif i%2 == 0:
        mul2 += 1
        has_mul2 = 1
    else:
        other += 1

if mul4*2 >= (has_mul2+other) or (mul2>1 and other == 0):
    print('Yes')
else:
    print('No')

Failing test case input:
6
4 7 0 -1 6 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
mul4 = 0
mul2 = 0
has_mul2 = 0
other = 0
for i in a:
    if i%4 == 0:
        mul4 += 1
    elif i%2 == 0:
        mul2 += 1
        has_mul2 = 1
    else:
        other += 1

if mul4 >= (has_mul2+other-1) or other == 0:
    print('Yes')
else:
    print('No')
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import math
N = int(input())
a = list(map(int, input().split()))

two_count = 0
four_count = 0
for i in a:
    if i >= 4 and i % 4 == 0:
        four_count += 1
    elif i >= 2 and i % 2 == 0:
        two_count += 1

check = len(a) - two_count
if two_count > 0:
    ans = "YES" if math.ceil(check/2) <= four_count else "NO"
else:
    if check == 2:
        ans = "YES" if 1 <= four_count else "NO"
    else:
        ans = "YES" if check - 2 <= four_count else "NO"
print(ans)

Failing test case input:
3
3 -5 -1

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):

import math
N = int(input())
a = list(map(int, input().split()))

two_count = 0
four_count = 0
for i in a:
    if i >= 4 and i % 4 == 0:
        four_count += 1
    elif i >= 2 and i % 2 == 0:
        two_count += 1

if two_count <= 1:
    if len(a) == 2:
        print("Yes" if four_count >= 1 else "No")
    else:
        print("Yes" if four_count >= len(a)
else:
    check = len(a) - two_count
    if check == 0:
        print("Yes")
    elif check <= 2:
        print("Yes" if four_count >= 1 else "No")
    else:
        print("Yes" if four_count >= math.ceil(check/2) else "No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
four, odd = 0, 0
for a in A:
    if a%4 == 0:
        four += 1
    elif a%2 == 1:
        odd += 1
result = 'No' if odd > four else 'Yes'
print(result)

Failing test case input:
3
0 11 111

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
four, two, odd = 0, 0, 0
for a in A:
    if a%4 == 0:
        four += 1
    elif a%2 == 0:
        two += 1
    else:
        odd += 1
result = 'Yes' if four + 1 >= odd + bool(two) else 'No'
print(result)
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def count_four(lst):
    counter = 0
    for i in lst:
        if i%4 == 0:
            counter += 1
    return counter

def count_two(lst):
    counter = 0
    for i in lst:
        if i%2 == 0:
            counter += 1
    return counter

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

def solve(lst):
    four = count_four(lst)
    two = count_two(lst) - four
    sonota = len(lst) - four - two
    if two == 0:
        if four + 1 - sonota >= 0:
            return "Yes"
        else:
            return "No"
    else:
        if four - sonota >= 0:
            return "Yes"
        else:
            return "No"

print(solve(lst))



Failing test case input:
3
2 -5 -1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def count_four(lst):
    counter = 0
    for i in lst:
        if i%4 == 0:
            counter += 1
    return counter

def count_two(lst):
    counter = 0
    for i in lst:
        if i%2 == 0:
            counter += 1
    return counter

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

def solve(lst):
    four = count_four(lst)
    two = count_two(lst) - four
    others = n - four - two

    if two == 0:
        if four + 1 - others >= 0:
            return "Yes"
        else:
            return "No"

    if two > 0:
        two = 1
        if four + 1 - others - two >= 0:
            return "Yes"
        else:
            return "No"


print(solve(lst))

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
A = [int(i) for i in input().split()]

cnt2 = 0
cnt4 = 0

for i in range(n):
    if A[i] % 4 == 0:
        cnt4 += 1
    elif A[i] % 2 == 0:
        cnt2 += 1
        
flag = False
for i in range(cnt4+1):
    if i + 1   >= n - cnt2 - (cnt4-i)*2 :
        flag = True

if flag:
    print('Yes')
else:
    print('No')
    

Failing test case input:
6
5 7 0 0 6 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
A = [int(i) for i in input().split()]


cnt2 = 0
cnt4 = 0

for i in range(n):
    if A[i] % 4 == 0:
        cnt4 += 1
    elif A[i] % 2 == 0:
        cnt2 += 1

        
if cnt4*2 + cnt2 >= n or (cnt4 * 2 + 1) >= n:
    print('Yes')
else:
    print('No')
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

ARR = [int(s) for s in input().split(" ")]
def calculate(n,arr):
    m1 = 0
    m2 = 0
    m3 = 0
    for ar in arr:
        if ar % 4 == 0:
            m1 = m1 + 1
        elif ar % 2 == 0:
            m2 = m2 + 1
        else:
            m3 = m3 + 1

    if m1 * 2 < m3:
        print("No")
        return

    if m1 * 2 >= n - m1:
        print("Yes")
        return

    if m2 % 2 == 1:
        print("No")
        return

    print("Yes")



calculate(N,ARR)


Failing test case input:
6
5 7 0 8 6 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())

ARR = [int(s) for s in input().split(" ")]
def calculate(n,arr):
    m1 = 0
    m2 = 0
    m3 = 0
    for ar in arr:
        if ar % 4 == 0:
            m1 = m1 + 1
        elif ar % 2 == 0:
            m2 = m2 + 1
        else:
            m3 = m3 + 1

    if m2 == 0:
        if m3 > m1 + 1:
            print("No")
        else:
            print("Yes")
    else:
        if m3 <= m1:
            print("Yes")
        else:
            print("No")


calculate(N,ARR)

Problem: p03637
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
k = 0
g = 0
for i in a:
  if(i%4 == 0):g+=1
  if(i%2 == 1):k+=1

if(g>=k):print("Yes")
else:print("No")

Failing test case input:
3
0 11 111

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
k = 0
g = 0
for i in a:
  if(i%4 == 0):g+=1
  if(i%2 == 1):k+=1

if(g>=k or (g+1>=k and g+k==n)):print("Yes")
else:print("No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
A=map(int,input().split())
zero=0
two=0
four=0
for a in A:
    if a%2==0:
        if a%4==0:
            four+=1
        else:
            two+=1
    else:
        zero+=1
if zero<=four:
    print("Yes")
else:
    print("No")

Failing test case input:
3
1 -16 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N=int(input())
A=map(int,input().split())
zero=0
two=0
four=0
for a in A:
    if a%2==0:
        if a%4==0:
            four+=1
        else:
            two+=1
    else:
        zero+=1




if two==0:
    if zero<=four+1:
        print("Yes")
    else:
        print("No")
else:
    
    if zero<=four:
        print("Yes")
    else:
        print("No")
Problem: p03637
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
a_list = list(map(int, input().split()))
counts = [0] * 3
for a in a_list:
	if a%4 == 0:
		counts[0] += 1 		 
	elif a%2 == 0:
		counts[1] += 1
	else:
		counts[2] += 1
r = 'Yes' if counts[2] <= counts[0]+1 else 'No'
print(r)

Failing test case input:
6
6 7 0 8 3 5

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
a_list = list(map(int, input().split()))
counts = [0] * 3
for a in a_list:
	if a%4 == 0:
		counts[0] += 1 		 
	elif a%2 == 0:
		counts[1] += 1
	else:
		counts[2] += 1
r = 'Yes' if counts[2] <= counts[0]+1 else 'No'
if r == 'Yes':
	two_v = counts[1]
	four_v = counts[0] - counts[2]
	mod = two_v%2	
	if mod == 0 or mod - four_v < 2:
		r = 'Yes'
	else:
		r = 'No'
print(r)

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
A=list(map(int,input().split()))
for i in range(n):
  if A[i]%4==0:
    A[i]=0
  elif A[i]%2==0:
    A[i]=2
  else:
    A[i]=1

a=A.count(0)
b=A.count(2)
c=A.count(1)
if c<=a :
  print("Yes")
elif b==0 and c==a-1:
  print("Yes")
else:
  print("No")

  

Failing test case input:
3
1 -5 0

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n=int(input())
A=list(map(int,input().split()))
for i in range(n):
  if A[i]%4==0:
    A[i]=0
  elif A[i]%2==0:
    A[i]=2
  else:
    A[i]=1

a=A.count(0)
b=A.count(2)
c=A.count(1)
if c<=a :
  print("Yes")
elif b==0 and c==a+1:
  print("Yes")
else:
  print("No")
Problem: p02807
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from math import factorial

N = int(input())
x = list(map(int, input().split()))
mod = 10**9 + 7
x_dis = [x[i+1] - x[i] for i in range(N-1)]
ans = 0
m = N-1
fac = factorial(m) % mod
tmp = fac
for i in range(m):
    ans += x_dis[i] * tmp
    ans %= mod
    tmp += fac
print(ans)


Failing test case input:
12
367101616 467388357 127795962 872675759 1190847685 1723370727 668687333 304635000 135685914 923078537 628600728 1765707086

Expected output:
373564891


Actual output:
624091855


Fixed submission (verdict: Accepted):
from math import factorial

N = int(input())
x = list(map(int, input().split()))
mod = 10**9 + 7
x_dis = [x[i+1] - x[i] for i in range(N-1)]
ans = 0
m = N-1
fac = factorial(m) % mod
tmp = fac
for i in range(m):
    ans += x_dis[i] * tmp
    ans %= mod
    tmp += (fac*pow((i+2),(mod-2), mod))%mod
print(ans)

Problem: p02807
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import math

n = int(input())
x = list(map(int, input().split()))
ans = 0
mod = 10 ** 9 + 7
v = math.factorial(n - 1)
v %=mod

for i in range(1, n):
    ans += (x[n - 1] - x[i - 1]) * v 
    ans %= mod

print(int(ans))

Failing test case input:
12
161735902 467388357 126257933 872675759 1190847685 946982680 749092417 233485274 135685914 923078537 971407775 1765707086

Expected output:
729348668


Actual output:
562883256


Fixed submission (verdict: Accepted):
import math

n = int(input())
x = list(map(int, input().split()))
ans = 0
mod = 10 ** 9 + 7
f = 1
for i in range(1,n):
  f *= i
  f %= mod

for i in range(n-1):
    ans+=(x[n-1]-x[i])*pow(i+1,mod-2,mod)

ans*=f
ans%=mod


print(ans)

Problem: p02807
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
X = list(map(int,input().split()))
import math
ans = 0
mod = 10**9+7
a = 0
ans = 0
for i in range(N-1):
  a += 1/(i+1)
  ans += (X[i+1]-X[i])%mod*a

ans *= math.factorial(N-1)%mod
print(int(ans)%mod)

Failing test case input:
12
367101616 467388357 127795962 872675759 121747736 1138999790 394173623 270216579 135685914 923078537 971407775 1765707086

Expected output:
942848146


Actual output:
942848082


Fixed submission (verdict: Accepted):
N = int(input())
X = list(map(int,input().split()))
import math
ans = 0
mod = 10**9+7
a = 0
ans = 0
for i in range(N-1):
  a += pow(i+1,mod-2,mod)
  ans += ((X[i+1]-X[i])%mod)*(a%mod)
  ans %= mod
  
ans *= math.factorial(N-1)%mod

print(ans%mod)
Problem: p02807
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
a = list( map(int, input().split() ) )
kai = 1
M = 10**9+7
result = 0
for i in range(1,N):
    kai *= i

kai = kai%M
for i in range(N-1):
    result += kai * (a[N-1] - a[i]) 

print( result%M )

Failing test case input:
12
155910255 467388357 127795962 872675759 1190847685 1723370727 402149677 397005484 135685914 923078537 971407775 1765707086

Expected output:
985068272


Actual output:
768567022


Fixed submission (verdict: Accepted):
N = int(input())
d = list( map(int, input().split() ) )
kai = 1
mod = 10**9+7
result = 0

def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

for i in range(1,N):
    kai = (kai%mod)*i

for i in range(N-1):    
    result += ( kai * (d[N-1] - d[i]) * modinv(i+1) ) % mod 

print( result%mod )

Problem: p02807
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n = int(input())
x = [int(x) for x in input().split()]
inf = 10**9+7
a = 1
for i in range(n-1, 0, -1):
    a *= i
    a %= inf
key = 0
ans = 0
for i in range(n-1):
    key += a
    key %= inf
    ans += key*(x[i+1]-x[i])
    ans %= inf
    

print(ans)



Failing test case input:
12
161735902 394362112 430302156 872675759 1190847685 946982680 402149677 822804784 135685914 923078537 971407775 1765707086

Expected output:
602338330


Actual output:
218191677


Fixed submission (verdict: Accepted):
n = int(input())
x = [int(x) for x in input().split()]
inf = 10**9+7
a = 1
for i in range(n-1, 0, -1):
    a *= i
    a %= inf
b = a
key = 0
ans = 0
for i in range(n-1):
    key += a*pow((i+1), inf-2, inf)
    key %= inf
    ans += key*(x[i+1]-x[i])
    ans %= inf
    

print(ans)

Problem: p02807
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
X = list(map(int,input().split()))
import math
ans = 0
mod = 10**9+7
a = 0
ans = 0
for i in range(N-1):
  a += 1/(i+1)
  ans += (X[i+1]-X[i])%mod*a
  ans %= mod

ans *= math.factorial(N-1)%mod
print(int(ans%mod))

Failing test case input:
12
161735902 467388357 126257933 872675759 1190847685 946982680 749092417 233485274 135685914 923078537 971407775 1765707086

Expected output:
729348668


Actual output:
729348636


Fixed submission (verdict: Accepted):
N = int(input())
X = list(map(int,input().split()))
import math
ans = 0
mod = 10**9+7
a = 0
ans = 0
for i in range(N-1):
  a += pow(i+1,mod-2,mod)
  ans += ((X[i+1]-X[i])%mod)*(a%mod)
  ans %= mod
  
ans *= math.factorial(N-1)%mod

print(ans%mod)
Problem: p02807
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
MOD = 10 ** 9 + 7
n = int(input())
x = list(map(int, input().split()))
f = 1
for i in range(n - 1):
    f *= (i + 1)
    f %= MOD
ans = 0
t = 0
for i in range(n - 1):
    t += f 
    ans += t * (x[i + 1] - x[i])
print(ans % MOD)


Failing test case input:
12
367101616 467388357 156291688 888737356 1190847685 1723370727 668687333 270216579 135685914 125686970 628600728 1765707086

Expected output:
856794434


Actual output:
582391606


Fixed submission (verdict: Accepted):
MOD = 10 ** 9 + 7
n = int(input())
x = list(map(int, input().split()))
f = 1
for i in range(n - 1):
    f *= (i + 1)
    f %= MOD
ans = 0
t = 0
for i in range(n - 1):
    t += f * pow(i + 1, MOD - 2, MOD)
    t %= MOD
    ans += t * (x[i + 1] - x[i])
print(ans % MOD)

Problem: p02807
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import statistics
import math

MOD = 10**9+7


def main():
    n = int(input())
    x = list(map(int, input().split()))

    c = 0
    t = 0
    for i in range(n-1):
        c += 1/(i+1)
        c %= MOD
        t += c * (x[i+1]-x[i])
        t %= MOD
    
    print(0)
    


main()


Failing test case input:
12
367101616 467388357 127795962 872675759 121747736 1723370727 402149677 270216579 135685914 923078537 971407775 1765707086

Expected output:
350377241


Actual output:
0


Fixed submission (verdict: Accepted):
import statistics
import math

MOD = 10**9+7


def main():
    n = int(input())
    x = list(map(int, input().split()))

    c = 0
    t = 0
    for i in range(n-1):
        c += pow(i+1, MOD-2, MOD)
        t += c * (x[i+1]-x[i])
        t %= MOD

    fact = math.factorial(n-1) % MOD
    print(t * fact % MOD)


main()
Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M = map(int, input().split())

ans = 0
if 2<=M:
    ans = ans + N
    M = max(0, M - 2*N)
    N = N - N
    ans = ans + M
    print(ans)
else:
    print(0)

Failing test case input:
10389 18349

Expected output:
9174


Actual output:
10389


Fixed submission (verdict: Accepted):
N,M = map(int, input().split())

ans = 0
if N<M:
    ans = N
    M = max(0, M-2*N)
    ans = ans + M
    print(ans)
else:
    print(M

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
N,M = map(int,input().split())

if N >= 2*M:
  print(N)
  sys.exit()

ans = N
M = M -2*N
ans += M
print(ans)

Failing test case input:
100 41

Expected output:
20


Actual output:
100


Fixed submission (verdict: Accepted):
import sys
N,M = map(int,input().split())

if N*2 >= M: 
  print(M
  sys.exit()


ans = N
M = M -2*N
ans += M
print(ans)

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m=map(int,input().split())
cnt_s=n
cnt_c=m
ans=0
if cnt_s>cnt_c:
  ans=cnt_c
  print(ans)
elif cnt_s<=cnt_c:
  ans+=n
  cnt_c-=2*n
  ans+=cnt_c
  print(ans)



Failing test case input:
1489 23

Expected output:
11


Actual output:
23


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
cnt_s=n
cnt_c=m
ans=0
if cnt_s>cnt_c:
  ans=cnt_c
  print(ans)
elif cnt_s<=cnt_c:
  ans+=min(n,cnt_c
  cnt_c-=2*min(n,cnt_c
  ans+=cnt_c
  print(ans)

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


S,c = map(int, input().split())
scc = 0

if(2*S >= c):
    print(S)
else:
    scc = S + (c-2*S)
    print(scc)

Failing test case input:
1 61

Expected output:
15


Actual output:
60


Fixed submission (verdict: Accepted):


S,c = map(int, input().split())
scc = 0

if(c <= 2*S):
    print(c
else:
    scc = S + (c-2*S)
    print(scc)

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int,input().split())
i = (m-2*n)
if i < 0:
    print(n)
else:
    print(n+i)


Failing test case input:
12345 678901

Expected output:
175897

Actual output:
666556


Fixed submission (verdict: Accepted):
n, m = map(int,input().split())
i = (m-2*n)
if i < 0:
    print(m
else:
    print(n+i)

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


S,c = map(int, input().split())
scc = 0

if(S >= 2*c):
    print(S)
else:
    scc = S + (c-2*S)
    print(scc)

Failing test case input:
-22 2

Expected output:
-11


Actual output:
24


Fixed submission (verdict: Accepted):


S,c = map(int, input().split())
scc = 0

if(c <= 2*S):
    print(c
else:
    scc = S + (c-2*S)
    print(scc)

Problem: p03799
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N, M = map(int, input().split())
while N * 2 <= M:
    M -= 2
    N += 1
print(N - 1)


Failing test case input:
133 67

Expected output:
33


Actual output:
132


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
if N * 2 <= M:
    print(N + (M - N * 2) 
else:
    print(M
Problem: p03799
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, M = map(int, input().split())
ans = N
if (M-2*N)>=0:
    ans += (M-2*N)
print(ans)


Failing test case input:
4586 750

Expected output:
375


Actual output:
4586


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
ans = N
if (M-2*N)>=0:
    k = (M-2*N)
    N += k
    M -= 2*k
print(min(N, M

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from math import floor
s_num, c_num = tuple(int(i) for i in input().split(" "))
ans = 0
temp = floor(c_num / 2)
if temp <= ans:
    ans += temp
else:
    ans += s_num
    ans += floor((c_num - s_num * 2) / 4)
print(ans)


Failing test case input:
5394 750

Expected output:
375


Actual output:
2884


Fixed submission (verdict: Accepted):
from math import floor
s_num, c_num = tuple(int(i) for i in input().split(" "))
ans = 0
temp = s_num * 2
if c_num <= temp:
    ans += floor(c_num / 2)
else:
    ans += s_num
    ans += floor((c_num - temp) / 4)
print(ans)

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
inp = list(map(int, input().split()))


s = inp[0]
c = inp[1]

ans = 0
if s*2 <= c:
    ans += s
    c -= 2*s
    s = 0
    if c>=4:
        ans += c
else:
    if c>=4:
        ans += c


print (ans)

Failing test case input:
67 341

Expected output:
118


Actual output:
274


Fixed submission (verdict: Accepted):
inp = list(map(int, input().split()))


s = inp[0]
c = inp[1]

ans = 0
if s*2 <= c:
    ans += s
    c -= 2*s
    s = 0
    if c>=4:
        ans += c
elif c
        ans += c
        s -= c
        c -= 0
else:
    if c>=4:
        ans += c



print (ans)

Problem: p03799
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
[n,m] = [int(i) for i in input().split()]
if n * 2 >= m:
    print(n)
else:
    ans = n
    m -= n * 2
    ans += m
    print(ans)


Failing test case input:
-28 -12

Expected output:
-17


Actual output:
16


Fixed submission (verdict: Accepted):
[n,m] = [int(i) for i in input().split()]
if n * 2 >= m:
    print(m 
else:
    if m >= 2:
        ans = n
        m = max(m - n * 2,0)
        ans += m
        print(ans)
    else:
        print(0)

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
inp = list(map(int, input().split()))


s = inp[0]
c = inp[1]

ans = 0
if s*2 <= c:
    ans += s
    c -= 2*s
    s = 0
    if c>=4:
        ans += c
else:
    if c>=4:
        ans += c
        c -= c
        if s*2 <= c:
            ans += s


print (ans)

Failing test case input:
282 33

Expected output:
16


Actual output:
33


Fixed submission (verdict: Accepted):
inp = list(map(int, input().split()))


s = inp[0]
c = inp[1]

ans = 0
if s*2 <= c:
    ans += s
    c -= 2*s
    s = 0
    if c>=4:
        ans += c
elif c
        ans += c
        s -= c
        c -= 0
else:
    if c>=4:
        ans += c



print (ans)
Problem: p03799
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
import math


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n, m = inintm()

ans = 0

if m - n*2 >= 0:
    ans += n
    m -= n*2
    ans += m
    print(ans)
    exit()
else:
    if m % 2 == 0:
        print(m)
        exit()
    else:
        print(m-1)
        exit()


Failing test case input:
340 3876

Expected output:
1139


Actual output:
3536


Fixed submission (verdict: Accepted):
import sys
import math


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n, m = inintm()

ans = 0

if m - n*2 >= 0:
    ans += n
    m -= n*2
    ans += m
    print(ans)
    exit()
else:
    if m % 2 == 0:
        print(m
        exit()
    else:
        print((m-1)
        exit()

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M = map(int, input().split())

ans = 0
if M>=2*N:
    ans = ans + N
    M = M - 2*N
    N = N - N
    ans = ans + M
    print(ans)
else:
    print(0)

Failing test case input:
4370 1245

Expected output:
622


Actual output:
0


Fixed submission (verdict: Accepted):
N,M = map(int, input().split())

ans = 0
if N<M:
    ans = N
    M = max(0, M-2*N)
    ans = ans + M
    print(ans)
else:
    print(M

Problem: p03799
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):

N , M  =list(map(int,input().split(" ")))

ans = 0
N 
2*N 


if M >= 2*N:
    ans += N
    M -= 2*N
    N -= N


ans += M

print(ans)

Failing test case input:
340 2384

Expected output:
766


Actual output:
2044


Fixed submission (verdict: Accepted):

N , M  =list(map(int,input().split(" ")))

ans = 0
N 
2*N 

kosu = min(M

ans += kosu
M -= 2*kosu
N -= kosu


ans += M

print(ans)

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

N, M = map(int, input().split())

def main(N, M):

    if N /2 <= M:
        print(int(N + (M - (N*2))/4))
    else:
        print(int(N/2))

if __name__ == '__main__':
    main(N, M)


Failing test case input:
10389 5425

Expected output:
2712


Actual output:
6550


Fixed submission (verdict: Accepted):

N, M = map(int, input().split())

def main(N, M):

    if N <= M 
        print(int(N + (M - (N*2))
    else:
        print(int(M

if __name__ == '__main__':
    main(N, M)

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M = map(int, input().split())

ans = 0
if True:
    ans = ans + N
    M = M - 2*N
    N = N - N
    ans = ans + M
    print(ans)
else:
    print(0)

Failing test case input:
10389 263982

Expected output:
71190


Actual output:
253593


Fixed submission (verdict: Accepted):
N,M = map(int, input().split())

ans = 0
if N<M:
    ans = N
    M = max(0, M-2*N)
    ans = ans + M
    print(ans)
else:
    print(M
Problem: p03799
Buggy submission (Python (3.8.2), verdict: Wrong Answer):






N,M = map(int, input().split())





s1 = min(N, M-N*2)
s2 = (M-s1*2)
print(s1+s2)









Failing test case input:
-22 2

Expected output:
-11


Actual output:
24


Fixed submission (verdict: Accepted):






N,M = map(int, input().split())





s1 = min(N, M
s2 = (M-s1*2)
print(s1+s2)

Problem: p03799
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N, M = map(int, input().split())

if 2 * N >= M:
    print(N)
else:
    d = M - 2 * N
    d 
    print(N + d)


Failing test case input:
-1 27

Expected output:
6


Actual output:
28


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())

if 2 * N >= M:
    print(M 
else:
    d = M - 2 * N
    d 
    print(N + d)

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M = map(int,input().split())

def solve(N,M):
  
  if M < N * 2:
    return N
  
  M -= N * 2
  
  ans = N + M 
  return ans

print(solve(N,M))


Failing test case input:
133 106

Expected output:
53


Actual output:
133


Fixed submission (verdict: Accepted):
N,M = map(int,input().split())

def solve(N,M):
  
  if M < N * 2:
    return M 
  
  M -= N * 2
  
  ans = N + (M 
  return ans

print(solve(N,M))

Problem: p03799
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
n, m = map(int, input().split())










scc = n*2 + m
ans = math.floor(scc/4)
print(ans)

Failing test case input:
4586 750

Expected output:
375


Actual output:
2480


Fixed submission (verdict: Accepted):
import math
n, m = map(int, input().split())
ans = 0

ans += min(n, m 
m -= 2 * min(n, m 









ans += math.floor(m / 4)



print(ans)

Problem: p03799
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, m = map(int, input().split())
print(int(n / 2 + m / 4))

Failing test case input:
-6 -64

Expected output:
-32


Actual output:
-19


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

Problem: p03799
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
[n,m] = [int(i) for i in input().split()]
if n * 2 >= m:
    print(n)
else:
    if m >= 2:
        ans = n
        m = min(m - n * 2,0)
        ans += m
        print(ans)
    else:
        print(0)


Failing test case input:
-6 -64

Expected output:
-32


Actual output:
-6


Fixed submission (verdict: Accepted):
[n,m] = [int(i) for i in input().split()]
if n * 2 >= m:
    print(m 
else:
    if m >= 2:
        ans = n
        m = max(m - n * 2,0)
        ans += m
        print(ans)
    else:
        print(0)

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m=map(int,input().split())
cnt_s=n
cnt_c=m
ans=0
if cnt_s>2*cnt_c:
  ans=cnt_c
  print(ans)
elif cnt_s<=2*cnt_c:
  ans+=n
  cnt_c-=2*n
  ans+=cnt_c
  print(ans)



Failing test case input:
-28 -12

Expected output:
-17


Actual output:
16


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
cnt_s=n
cnt_c=m
ans=0
if cnt_s>cnt_c:
  ans=cnt_c
  print(ans)
elif cnt_s<=cnt_c:
  ans+=min(n,cnt_c
  cnt_c-=2*min(n,cnt_c
  ans+=cnt_c
  print(ans)
Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


N, M = readnums()



x = (M - 2 * N) 
print(N + x)


Failing test case input:
133 280

Expected output:
136


Actual output:
147


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


N, M = readnums()



if M >= N * 2:
    x = (M - 2 * N) 
    print(N + x)
else:
    print(M

Problem: p03799
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n,m=map(int,input().split())
s=(2*n+m)
if (s+1)*4<=2*n+m:
  s+=1
print(min(2*m,s))

Failing test case input:
-37 -1

Expected output:
-19


Actual output:
-74


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
s=(2*n+m)
if (s+1)*4<=2*n+m:
  s+=1
print(min(m

Problem: p03799
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
n, m = map(int, input().split())
ans = 0

if m >= 2*n:
    ans += n
    m -= 2*n
else:
    ans += m
    m -= m

ans += math.floor(m / 4)

print(ans)


Failing test case input:
100 53

Expected output:
26


Actual output:
53


Fixed submission (verdict: Accepted):
import math
n, m = map(int, input().split())
ans = 0

ans += min(n, m 
m -= 2 * min(n, m 









ans += math.floor(m / 4)



print(ans)

Problem: p03799
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,M=map(int,input().split())
ans=M
N-=M
if M%2==0:
    M=0
else:
    M=1
if N<0:
    X=abs(N)
    N+=X
    ans-=X
    M+=X*2
while True:
    if M<2:
        break
    if N==0:
        if M<4:
            break
    if N>0:
        N-=1
        M-=2
        ans+=1
    elif M>3:
        M-=2
        ans+=1
print(ans)

Failing test case input:
-9 -31

Expected output:
-16


Actual output:
-31


Fixed submission (verdict: Accepted):
N,M=map(int,input().split())
if N>M
    ans=M
    N-=ans
    if M%2==0:
        M=0
    else:
        M=1
else:
    ans=N
    M-=N*2
    N=0
    if M>3:
        X=M
        M-=X*4
        ans+=X
while True:
    if M<2:
        break
    if N==0:
        if M<4:
            break
    if N>0:
        N-=1
        M-=2
        ans+=1
    elif M>3:
        M-=2
        ans+=1
print(ans)

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())

if 2*N >= M:
  print(N)
else:
  result = N
  M -= 2*N
  result += M
  print(result)


Failing test case input:
282 33

Expected output:
16


Actual output:
282


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())

if 2*N >= M:
  print(M
else:
  result = N
  M -= 2*N
  result += M
  print(result)
Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())
def solve():
    ans = (N*2+M)
    return ans
print(solve())

Failing test case input:
-9 -31

Expected output:
-16


Actual output:
-49


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
def solve():
    ans = min((N*2+M)
    return ans
print(solve())

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main(n: int, m: int):
    ans = n

    m -= n * 2
    ans += m 

    print(ans)


if __name__ == "__main__":
    n, m = map(int, input().split())

    main(n, m)


Failing test case input:
10389 232248

Expected output:
63256


Actual output:
221859


Fixed submission (verdict: Accepted):
def main(n: int, m: int):
    ans = 0
    
    ans += min(n, m 
    m -= ans * 2

    ans += m 

    print(ans)


if __name__ == "__main__":
    n, m = map(int, input().split())

    main(n, m)

Problem: p03799
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
import math


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n, m = inintm()

ans = 0

if m - n*2 > 0:
    ans += n
    m -= n*2
elif m - n*2 == 0:
    print(n)
    exit()
else:
    if m % 2 == 0:
        print(m)
        exit()
    else:
        print(m-1)
        exit()

ans += m

print(ans)

Failing test case input:
133 280

Expected output:
136


Actual output:
147


Fixed submission (verdict: Accepted):
import sys
import math


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n, m = inintm()

ans = 0

if m - n*2 >= 0:
    ans += n
    m -= n*2
    ans += m
    print(ans)
    exit()
else:
    if m % 2 == 0:
        print(m
        exit()
    else:
        print((m-1)
        exit()

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M = (int(x) for x in input().split())

if 2*N>M:
    print(M)
else:
    m = M-2*N
    plus = m
    print(N+plus)


Failing test case input:
-25 -1

Expected output:
-13


Actual output:
24


Fixed submission (verdict: Accepted):
N,M = (int(x) for x in input().split())


if 2*N>M:
    print(M
else:
    m = M-2*N
    plus = m
    print(N+plus)

Problem: p03799
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
[n,m] = [int(i) for i in input().split()]
if n * 2 >= m:
    print(n)
else:
    if m >= 2:
        ans = n
        m = max(m - n * 2,0)
        ans += m
        print(ans)
    else:
        print(0)


Failing test case input:
-36 2

Expected output:
-18


Actual output:
38


Fixed submission (verdict: Accepted):
[n,m] = [int(i) for i in input().split()]
if n * 2 >= m:
    print(m 
else:
    if m >= 2:
        ans = n
        m = max(m - n * 2,0)
        ans += m
        print(ans)
    else:
        print(0)
Problem: p03799
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
n, m = map(int, input().split())
ans = 0

if m >= 2*n:
    ans += n
    m -= 2*n
ans += math.floor(m/4)

print(ans)


Failing test case input:
10 -29

Expected output:
-15


Actual output:
-8


Fixed submission (verdict: Accepted):
import math
n, m = map(int, input().split())
ans = 0

ans += min(n, m 
m -= 2 * min(n, m 









ans += math.floor(m / 4)



print(ans)

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())
if (N*2 >= M):
    print(N)
else:
    M -= N*2
    M = M 
    print(N + M)

Failing test case input:
100 72

Expected output:
36


Actual output:
100


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
if (N*2 >= M):
    print(M
elif (M < 2):
    print(0)
else:
    M -= N*2
    M = M 
    print(N + M)

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M = map(int, input().split())

ans = 0
if M>=2:
    ans = ans + N
    M = M - 2*N
    N = N - N
    ans = ans + M
    print(ans)
else:
    print(0)

Failing test case input:
10389 85698

Expected output:
26619


Actual output:
75309


Fixed submission (verdict: Accepted):
N,M = map(int, input().split())

ans = 0
if N<M:
    ans = N
    M = max(0, M-2*N)
    ans = ans + M
    print(ans)
else:
    print(M

Problem: p03799
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
[n,m] = [int(i) for i in input().split()]
if n * 2 >= m:
    print(n)
else:
    if n >= 2:
        ans = n
        m = min(m - n * 2,0)
        ans += m
        print(ans)
    else:
        print(0)


Failing test case input:
-7 0

Expected output:
-4


Actual output:
0


Fixed submission (verdict: Accepted):
[n,m] = [int(i) for i in input().split()]
if n * 2 >= m:
    print(m 
else:
    if m >= 2:
        ans = n
        m = max(m - n * 2,0)
        ans += m
        print(ans)
    else:
        print(0)

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = list(map(int, input().split()))
ans = 0
if N*2 <= M:
    ans += N
    M -= 2*N
    N = 0
else:
    ans += M
    N -= M
ans += M
print(ans)

Failing test case input:
10389 232248

Expected output:
63256


Actual output:
221859


Fixed submission (verdict: Accepted):
N, M = list(map(int, input().split()))
ans = 0
if N >= M
    ans += M
    N -= M
    M %= 2
else:
    ans += N
    M -= 2*N
    N = 0
ans += M
print(ans)

Problem: p03799
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, M = map(int, input().split())
ans = int((M+2*N)/4)
if ans < N:
    print(N)
else:
    print(ans)




Failing test case input:
-115 4

Expected output:
-57


Actual output:
-56


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
ans = int((M+2*N)/4)
if ans < N:
    print(M
else:
    print(ans)
Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = list(map(int, input().split()))
ans = 0
if N*2 <= M:
    ans += N
    M -= 2*N
    N = 0
else:
    ans += M
    N -= M
    M -= M
ans += M
print(ans)

Failing test case input:
10389 85698

Expected output:
26619


Actual output:
75309


Fixed submission (verdict: Accepted):
N, M = list(map(int, input().split()))
ans = 0
if N >= M
    ans += M
    N -= M
    M %= 2
else:
    ans += N
    M -= 2*N
    N = 0
ans += M
print(ans)

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s,c=map(int,input().split())
if s>=c*2:
  print(s)
else:
  ans=s
  c-=s*2
  ans+=c
  print(ans)

Failing test case input:
372 178

Expected output:
89


Actual output:
372


Fixed submission (verdict: Accepted):
s,c=map(int,input().split())
if s*2>=c:
  print(c
else:
  ans=s
  c-=s*2
  ans+=c
  print(ans)

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m = [int(i) for i in input().split()]

if n*2 > m:
    print(0)
else:
    m -= n*2
    ans = n + m
    print(ans)


Failing test case input:
5394 750

Expected output:
375


Actual output:
0


Fixed submission (verdict: Accepted):
n,m = [int(i) for i in input().split()]

if n*2 > m:
    print(m
else:
    m -= n*2
    ans = n + m
    print(ans)

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s,c = list(map(int,input().split()))
if 2*s >= c:
    print(s)
else:
    suma = s
    c -= 2*s
    suma += c
    print(suma)

Failing test case input:
-37 -1

Expected output:
-19


Actual output:
36


Fixed submission (verdict: Accepted):
s,c = list(map(int,input().split()))
if 2*s >= c:
    print(c
else:
    suma = s
    c -= 2*s
    suma += c
    print(suma)

Problem: p03799
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):

def resolve():

    N,M=map(int,input().split())
    cnt=0
    while N*2<M:
        N+=1
        M-=2
        cnt+=1
    if N*2>M:
        print(N-1)
    else:
        print(N)


resolve()

Failing test case input:
-6 -64

Expected output:
-32


Actual output:
-7


Fixed submission (verdict: Accepted):
def resolve():

    N,M=map(int,input().split())
    cnt=0
    if N*2>=M:
        print(M
    else:
        cnt+=N
        M-=N*2
        cnt+=M
        print(cnt)


resolve()

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S, C = map(int, input().split())

a = S
if S < C / 2:
    a += (C - 2*S) 

print(a)


Failing test case input:
10389 5425

Expected output:
2712


Actual output:
10389


Fixed submission (verdict: Accepted):
S, C = map(int, input().split())

if 2 * S < C:
    a = S + (C - 2 * S) 
else:
    a = max(C

print(a)

Problem: p03799
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())

ans = 0
if N == 2*M:
    ans = N
elif N > 2*M:
    ans = M
else:
    diff = M-2*N
    ans = N
    ans += diff
print(ans)


Failing test case input:
1489 71

Expected output:
35


Actual output:
71


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())

ans = 0
if N == M
    ans = N
elif N > M
    ans = M
else:
    diff = M-2*N
    ans = N
    ans += diff
print(ans)
Problem: p03799
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def resolve():
    
    num_S, num_c  = [int(item) for item in input().split()]

    delta = num_c - num_S

    if delta <= num_S:
        scc = num_c
    else:
        scc = num_S
        scc += delta

    print(scc)

if __name__ == "__main__":
    resolve()


Failing test case input:
1 67

Expected output:
17


Actual output:
67


Fixed submission (verdict: Accepted):
def resolve():
    
    num_S, num_c  = [int(item) for item in input().split()]

    delta = num_c - num_S *2
    scc = 0
    if num_S != 0:
        if num_c 
            scc = num_c
        else:
            scc = num_S
            scc += delta
    else:
        scc = num_c

    print(scc)

if __name__ == "__main__":
    resolve()
Problem: p02573
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, M = map(int, input().split())

par = [i for i in range(N)]

def find(x):
  if par[x] == x:
    return x
  else:
    par[x] = find(par[x])
    return par[x]
    

def unite(x, y):
  a = find(x)
  b = find(y)
  if a > b:
    par[x] = par[y]
  else:
    par[y] = par[x]
if M > 0:  
  for i in range(M):
    a, b = map(int, input().split())
    unite(a - 1, b - 1)
  
  ans = [0] * N
  Max = 0
  for i in par:
    ans[i] += 1
  for i in ans:
    if i > Max:
      Max = i
  
  print(Max)
else:
  print(1)

Failing test case input:
10 4
3 2
3 1
5 9
2 6

Expected output:
4


Actual output:
2


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())

par = [i for i in range(N)]

def find(x):
  if par[x] == x:
    return x
  else:
    par[x] = find(par[x])
    return par[x]
    

def unite(x, y):
  x = find(x)
  y = find(y)
  if x > y:
    par[x] = y
    find(x)
  else:
    par[y] = x
    find(y)
if M > 0:  
  for i in range(M):
    a, b = map(int, input().split())
    unite(a - 1, b - 1)
  
  ans = [0] * N
  Max = 0
  for i in range(N):
    find(i)
  for i in par:
    ans[i] += 1
  for i in ans:
    if i > Max:
      Max = i
  
  print(Max)
else:
  print(1)

Problem: p02573
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, m = map(int, input().split())
ab = [sorted(list(map(int, input().split()))) for _ in range(m)]
li = [[]]
ab.sort()

for i in range(m):
    a, b = ab[i]
    fl = True
    for j in range(len(li)):
        if a in li[j]:
            li[j].append(b)
            fl = False
        elif b in li[j]:
            li[j].append(a)
            fl = False
    if fl:
        li.append(ab[i])

ans = 0

for i in range(len(li)):
    ans = max(ans,len(li[i]))

print(ans)

Failing test case input:
4 2
1 1
2 1
1 2
2 1
1 2
1 3
1 4
3 3
2 4
4 4

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
from collections import deque

n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(m)]

t = [[] for _ in range(n+1)]

for a, b in ab:
    t[a].append(b)
    t[b].append(a)

ans = 1
frag = [True]*(n+1)
d = deque()

for i in range(1, n+1):
    if not frag[i]:
        continue
    d.append(i)
    l = []
    while d:
        num = d.popleft()
        for j in t[num]:
            if not frag[j]:
                continue
            d.append(j)
            l.append(j)
            frag[j] = False
    ans = max(ans, len(set(l)))

print(ans)