Buggy python submission (verdict: Runtime Error):
n = input()
for i in range(n):
  A = map(int, raw_input().split())
  j = 2000
  while 0 < j:  
    if(j + A < 2000 && f[j + 1] == 1):
      f[j + A + 1] == 1
    j- = 1

Q = input()
for i in range(Q)
  m = map(int, raw_input().split())
  if(f[m] == 1):
    print "yes"
  else:
    print "no"

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

def s(i, m):
  if m == 0:
    return True
  if i >= n or m > sum(A):
    return False
  r = s(i + 1, m) or s(i + 1, m - A[i])
  return r

for j in range(Q):
  if s(0, m[j]):
    print "yes"
  else:
    print "no"

Buggy python submission (verdict: Runtime Error):
n = input()
f = [for i in range(2000)] = [1]
for i in range(n):
  A = map(int, raw_input().split())
  j = 2000
  while 0 < j:  
    if(j + A < 2000 && f[j + 1] == 1):
      f[j + A + 1] == 1
    j- = 1
 
Q = input()
for i in range(Q)
  m = map(int, raw_input().split())
  if(f[m] == 1):
    print "yes"
  else:
    print "no"

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

def s(i, m):
  if m == 0:
    return True
  if i >= n or m > sum(A):
    return False
  r = s(i + 1, m) or s(i + 1, m - A[i])
  return r

for j in range(Q):
  if s(0, m[j]):
    print "yes"
  else:
    print "no"

Buggy python submission (verdict: Runtime Error):
n = input()
f = [for i in range(n)]
f = 0
f[1] = 1
for i in range(n):
  A = map(int, raw_input().split())
  j = 2000
  while 0 < j:  
    if(j + A < 2000 && f[j + 1] == 1):
      f[j + A + 1] == 1
    j- = 1
 
Q = input()
for i in range(Q)
  m = map(int, raw_input().split())
  if(f[m] == 1):
    print "yes"
  else:
    print "no"

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

def s(i, m):
  if m == 0:
    return True
  if i >= n or m > sum(A):
    return False
  r = s(i + 1, m) or s(i + 1, m - A[i])
  return r

for j in range(Q):
  if s(0, m[j]):
    print "yes"
  else:
    print "no"

Buggy python submission (verdict: Runtime Error):
n = input()
f = [for i in range(2000)]
f = []
f[1] = 1
for i in range(n):
  A = map(int, raw_input().split())
  j = 2000
  while 0 < j:  
    if(j + A < 2000 && f[j + 1] == 1):
      f[j + A + 1] == 1
    j- = 1
 
Q = input()
for i in range(Q)
  m = map(int, raw_input().split())
  if(f[m] == 1):
    print "yes"
  else:
    print "no"

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

def s(i, m):
  if m == 0:
    return True
  if i >= n or m > sum(A):
    return False
  r = s(i + 1, m) or s(i + 1, m - A[i])
  return r

for j in range(Q):
  if s(0, m[j]):
    print "yes"
  else:
    print "no"

Buggy python submission (verdict: Runtime Error):
n = input()
A = map(int, raw_input().split())
Q = input()
f = [for i in range(2000)]
f = []
f[1] = 1
m = map(int, raw_input().split())

for i in range(n):
    j = 2000
  while 0 < j:  
    if(j + A < 2000 && f[j + 1] == 1):
      f[j + A + 1] == 1
    j- = 1

for i in range(Q)
    if(f[m] == 1):
    print "yes"
  else:
    print "no"

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

def s(i, m):
  if m == 0:
    return True
  if i >= n or m > sum(A):
    return False
  r = s(i + 1, m) or s(i + 1, m - A[i])
  return r

for j in range(Q):
  if s(0, m[j]):
    print "yes"
  else:
    print "no"

Buggy python submission (verdict: Runtime Error):
n = input()
A = map(int, raw_input().split())
Q = input()
f = {0}
f[1] = 1
m = map(int, raw_input().split())

for i in range(n):
    j = 2000
  while 0 < j:  
    if(j + A < 2000 && f[j + 1] == 1):
      f[j + A + 1] == 1
    j- = 1

for i in range(Q)
    if(f[m] == 1):
    print "yes"
  else:
    print "no"

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

def s(i, m):
  if m == 0:
    return True
  if i >= n or m > sum(A):
    return False
  r = s(i + 1, m) or s(i + 1, m - A[i])
  return r

for j in range(Q):
  if s(0, m[j]):
    print "yes"
  else:
    print "no"

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

Q = input()
m = map(int, raw_input().split())

f = []

for i in range(n):
    j = 2000
  while 0 < j:  
    if(j + A < 2000 && f[j] == 1):
      f[j + A] == 1
    j- = 1

for i in range(Q)
    if(f[m] == 1):
    print "yes"
  else:
    print "no"

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

def s(i, m):
  if m == 0:
    return True
  if i >= n or m > sum(A):
    return False
  r = s(i + 1, m) or s(i + 1, m - A[i])
  return r

for j in range(Q):
  if s(0, m[j]):
    print "yes"
  else:
    print "no"

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

Q = input()
m = map(int, raw_input().split())

f = []

for i in range(n):
    j = 2000
  for j in range(2000):
    if(j + A < 2000 && f[j] == 1):
      f[j + A] == 1
    
for i in range(Q):
    if(f[m] == 1):
    print "yes"
  else:
    print "no"

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

def s(i, m):
  if m == 0:
    return True
  if i >= n or m > sum(A):
    return False
  r = s(i + 1, m) or s(i + 1, m - A[i])
  return r

for j in range(Q):
  if s(0, m[j]):
    print "yes"
  else:
    print "no"

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

Q = input()
m = map(int, raw_input().split())

f = []
f[0] = 1

for i in range(n):
    j = 2000
  for j in range(2000):
    if(j + A < 2000 && f[j] == 1):
      f[j + A] == 1
    
for i in range(Q):
    if(f[m] == 1):
    print "yes"
  else:
    print "no"

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

def s(i, m):
  if m == 0:
    return True
  if i >= n or m > sum(A):
    return False
  r = s(i + 1, m) or s(i + 1, m - A[i])
  return r

for j in range(Q):
  if s(0, m[j]):
    print "yes"
  else:
    print "no"

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

Q = input()
m = map(int, raw_input().split())

f = []
f[0] = 1

for i in range(n):
  for j in range(2000):
    if(j + A < 2000 && f[j] == 1):
      f[j + A] == 1
    
for i in range(Q):
    if(f[m] == 1):
    print "yes"
  else:
    print "no"

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

def s(i, m):
  if m == 0:
    return True
  if i >= n or m > sum(A):
    return False
  r = s(i + 1, m) or s(i + 1, m - A[i])
  return r

for j in range(Q):
  if s(0, m[j]):
    print "yes"
  else:
    print "no"

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

Q = input()
m = map(int, raw_input().split())

f = []
f[1] = 1

for i in range(n):
  for j in range(2000):
    if(j + A < 2000 && f[j] == 1):
      f[j + A] == 1
    
for i in range(Q):
    if(f[m - 1] == 1):
      print "yes"
    else:
      print "no"

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

def s(i, m):
  if m == 0:
    return True
  if i >= n or m > sum(A):
    return False
  r = s(i + 1, m) or s(i + 1, m - A[i])
  return r

for j in range(Q):
  if s(0, m[j]):
    print "yes"
  else:
    print "no"

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

f = []
f[1] = 1

for i in range(n):
  A[i] = input()
  for j in range(2000):
    if(j + A[i] < 2000 && f[j] == 1):
      f[j + A[i]] == 1
    
Q = input()
for i in range(Q):
  B[i] = input()
    if(f[B[i] - 1] == 1):
      print "yes"
    else:
      print "no"

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

def s(i, m):
  if m == 0:
    return True
  if i >= n or m > sum(A):
    return False
  r = s(i + 1, m) or s(i + 1, m - A[i])
  return r

for j in range(Q):
  if s(0, m[j]):
    print "yes"
  else:
    print "no"