Buggy python submission (verdict: Runtime Error):
s,c = map(int,input().split(" "))
     
counter = 0
if s >= 1 and c >= 2:
    temp = min(s,c//2)
    s -= temp
    c -= temp * 2
    counter += temp
    #print("s:",s)
    #print("c:",c)
    #print("counter:",counter)
    
if s<=0 and c >= 4:
    temp = c // 4
    counter += temp
    c -= temp
    #print("s:",s)
    #print("c:",c)
    #print("counter:",counter)
      
print(temp)


Fixed submission:

n,m=map(int,input().split())
first=min(n,m//2)
n -=first
m-=first*2
second = m//4
print(second+first)

Buggy python submission (verdict: Runtime Error):
s,c = map(int,input().split(" "))
     
counter = 0
if s >= 1 and c >= 2:
    temp = min(s,c//2)
    s -= temp
    c -= temp * 2
    counter += temp
    print("s:",s)
    print("c:",c)
    print("counter:",counter)
    
if s<=0 and c >= 4:
    temp = c // 4
    counter += temp
    c -= temp
    print("s:",s)
    print("c:",c)
    print("counter:",counter)
      
print(temp)


Fixed submission:

n,m=map(int,input().split())
first=min(n,m//2)
n -=first
m-=first*2
second = m//4
print(second+first)

Buggy python submission (verdict: Runtime Error):
s,c = map(int,input().split(" "))
     
counter = 0
if s >= 1 and c >= 2:
    temp = min(s,c//2)
    s -= temp
    c -= temp * 2
    counter += temp
    print("s:",s)
    print("c:",c)
    print("counter:",counter)
    
if s<=0 and c >= 4:
    temp = c // 4
    counter += temp
    c -= temp
    print("s:",s)
    print("c:",c)
    print("counter:",counter)
      
print(temp)


Fixed submission:

n,m=map(int,input().split())
first=min(n,m//2)
n -=first
m-=first*2
second = m//4
print(second+first)

Buggy python submission (verdict: Runtime Error):
s,c = map(int,input().split(" "))

counter = 0
if s >= 1 and c >= 2:
  temp = min(s,c//2)
  s -= temp
  c -= temp
  counter += temp

if s<=0 and c >= 4:
  temp = c // 4
  counter += temp
  c -= temp
  
print(temp)


Fixed submission:

n,m=map(int,input().split())
first=min(n,m//2)
n -=first
m-=first*2
second = m//4
print(second+first)

Buggy python submission (verdict: Time Limit Exceeded):
s,c = map(int,input().split(" "))



counter = 0
temp = min(c // 2,s)
counter += temp
s -= temp
c -= temp * 2
temp = 0

while True:

    
    if c >= 2 and s >= 1:
        
        s -= 1
        c -= 2
        counter += 1
        #print("counter:",counter)
        #print("s:",s)
        #print("c:",c)
    if s == 0 and c >= 2:
        c -= 2
        s += 1
    if c <= 1:
        break


print(counter)




Fixed submission:

n,m=map(int,input().split())
first=min(n,m//2)
n -=first
m-=first*2
second = m//4
print(second+first)

Buggy python submission (verdict: Time Limit Exceeded):
s,c = map(int,input().split(" "))



counter = 0


while True:
    #print("counter:",counter)
    #print("s:",s)
    #print("c:",c)
    
    if c >= 2 and s >= 1:
        s -= 1
        c -= 2
        counter += 1
    if s == 0 and c >= 2:
        c -= 2
        s += 1
    if c <= 1:
        break


print(counter)




Fixed submission:

n,m=map(int,input().split())
first=min(n,m//2)
n -=first
m-=first*2
second = m//4
print(second+first)

Buggy python submission (verdict: Time Limit Exceeded):
s,c = map(int,input().split(" "))



counter = 0


while True:
    #print("counter:",counter)
    #print("s:",s)
    #print("c:",c)
    
    if c >= 2 and s >= 1:
        s -= 1
        c -= 2
        counter += 1
    if s == 0 and c >= 2:
        c -= 2
        s += 1
    if c <= 1:
        break


print(counter)




Fixed submission:

n,m=map(int,input().split())
first=min(n,m//2)
n -=first
m-=first*2
second = m//4
print(second+first)

Buggy python submission (verdict: Time Limit Exceeded):
s,c = map(int,input().split(" "))



counter = 0


while True:
    if c >= 2 and s >= 1:
        s -= 1
        c -= 2
        counter += 1
    if s == 0 and c >= 2:
        c -= 2
        s += 1
    if s == 0 and c <= 1:
        break


print(counter)




Fixed submission:

n,m=map(int,input().split())
first=min(n,m//2)
n -=first
m-=first*2
second = m//4
print(second+first)