Buggy python submission (verdict: Runtime Error):
def lcs(X, Y):
    X = " " + X
    Y = " " + Y
    c = []
    for i in X:
        for j in Y:
            if X[i] == Y[j]:
                c[i][j] = c[i - 1][j - 1] + 1
            else:
                c[i][j] = max(c[i - 1][j], c[i][j - 1])
            maxl = max(maxl, c[i][j])
n = int(raw_input())

for i in range(n):
    s1 = raw_input()
    s2 = raw_input()
    print lcs(s1, s2) 
                    

Fixed submission:
def lcs(X, Y):
    #X = " " + X
    #Y = " " + Y
    #c = [[0 for j in xrange(len(Y))] for i in xrange(len(X))]
    c2 = [0 for i in xrange(len(Y) + 1)]
    #maxl = 0
     
    for i in xrange(len(X)):
        c1 = c2 + []
        for j in xrange(len(Y)):
            if X[i] == Y[j]:
                c2[j + 1] = c1[j] + 1
            elif c2[j + 1] < c2[j]:
                c2[j + 1] = c2[j]
    return c2[-1]
n = int(raw_input())
  
for i in xrange(n):
    s1 = raw_input()
    s2 = raw_input()
    print lcs(s1, s2)

Buggy python submission (verdict: Time Limit Exceeded):
def lcs(X, Y):
    X = " " + X
    Y = " " + Y
    c = [[0 for j in range(len(Y))] for i in range(len(X))]
    maxl = 0
    
    for i in range(1,len(X)):
        for j in range(1,len(Y)):
            if X[i] == Y[j]:
                c[i][j] = c[i - 1][j - 1] + 1
            else:
                c[i][j] = max(c[i - 1][j], c[i][j - 1])
            maxl = max(maxl, c[i][j])
    return maxl
n = int(raw_input())
 
for i in range(n):
    s1 = raw_input()
    s2 = raw_input()
    print lcs(s1, s2)

Fixed submission:
def lcs(X, Y):
    #X = " " + X
    #Y = " " + Y
    #c = [[0 for j in xrange(len(Y))] for i in xrange(len(X))]
    c2 = [0 for i in xrange(len(Y) + 1)]
    #maxl = 0
     
    for i in xrange(len(X)):
        c1 = c2 + []
        for j in xrange(len(Y)):
            if X[i] == Y[j]:
                c2[j + 1] = c1[j] + 1
            elif c2[j + 1] < c2[j]:
                c2[j + 1] = c2[j]
    return c2[-1]
n = int(raw_input())
  
for i in xrange(n):
    s1 = raw_input()
    s2 = raw_input()
    print lcs(s1, s2)

Buggy python submission (verdict: Time Limit Exceeded):
def lcs(X, Y):
    X = " " + X
    Y = " " + Y
    c = [[0 for j in range(len(Y))] for i in range(len(X))]
    maxl = 0
    
    for i in range(1,len(X)):
        for j in range(1,len(Y)):
            if X[i] == Y[j]:
                c[i][j] = c[i - 1][j - 1] + 1
            else:
                c[i][j] = max(c[i - 1][j], c[i][j - 1])
            maxl = max(maxl, c[i][j])
    return maxl
n = int(raw_input())
 
for i in range(n):
    s1 = raw_input()
    s2 = raw_input()
    print lcs(s1, s2)

Fixed submission:
def lcs(X, Y):
    #X = " " + X
    #Y = " " + Y
    #c = [[0 for j in xrange(len(Y))] for i in xrange(len(X))]
    c2 = [0 for i in xrange(len(Y) + 1)]
    #maxl = 0
     
    for i in xrange(len(X)):
        c1 = c2 + []
        for j in xrange(len(Y)):
            if X[i] == Y[j]:
                c2[j + 1] = c1[j] + 1
            elif c2[j + 1] < c2[j]:
                c2[j + 1] = c2[j]
    return c2[-1]
n = int(raw_input())
  
for i in xrange(n):
    s1 = raw_input()
    s2 = raw_input()
    print lcs(s1, s2)

Buggy python submission (verdict: Time Limit Exceeded):
def lcs(X, Y):
    X = " " + X
    Y = " " + Y
    c = [[0 for j in range(len(Y))] for i in range(len(X))]
    maxl = 0
    
    for i in range(1,len(X)):
        for j in range(1,len(Y)):
            if X[i] == Y[j]:
                c[i][j] = c[i - 1][j - 1] + 1
            else:
                c[i][j] = max(c[i - 1][j], c[i][j - 1])
            maxl = max(maxl, c[i][j])
    return maxl
n = int(raw_input())
 
for i in range(n):
    s1 = raw_input()
    s2 = raw_input()
    print lcs(s1, s2)

Fixed submission:
def lcs(X, Y):
    #X = " " + X
    #Y = " " + Y
    #c = [[0 for j in xrange(len(Y))] for i in xrange(len(X))]
    c2 = [0 for i in xrange(len(Y) + 1)]
    #maxl = 0
     
    for i in xrange(len(X)):
        c1 = c2 + []
        for j in xrange(len(Y)):
            if X[i] == Y[j]:
                c2[j + 1] = c1[j] + 1
            elif c2[j + 1] < c2[j]:
                c2[j + 1] = c2[j]
    return c2[-1]
n = int(raw_input())
  
for i in xrange(n):
    s1 = raw_input()
    s2 = raw_input()
    print lcs(s1, s2)

Buggy python submission (verdict: Time Limit Exceeded):
def lcs(X, Y):
    X = " " + X
    Y = " " + Y
    c = [[0 for j in range(len(Y))] for i in range(len(X))]
    maxl = 0
    
    for i in range(1,len(X)):
        for j in range(1,len(Y)):
            if X[i] == Y[j]:
                c[i][j] = c[i - 1][j - 1] + 1
            else:
                c[i][j] = max(c[i - 1][j], c[i][j - 1])
            maxl = max(maxl, c[i][j])
    return maxl
n = int(raw_input())
 
for i in range(n):
    s1 = raw_input()
    s2 = raw_input()
    print lcs(s1, s2)

Fixed submission:
def lcs(X, Y):
    #X = " " + X
    #Y = " " + Y
    #c = [[0 for j in xrange(len(Y))] for i in xrange(len(X))]
    c2 = [0 for i in xrange(len(Y) + 1)]
    #maxl = 0
     
    for i in xrange(len(X)):
        c1 = c2 + []
        for j in xrange(len(Y)):
            if X[i] == Y[j]:
                c2[j + 1] = c1[j] + 1
            elif c2[j + 1] < c2[j]:
                c2[j + 1] = c2[j]
    return c2[-1]
n = int(raw_input())
  
for i in xrange(n):
    s1 = raw_input()
    s2 = raw_input()
    print lcs(s1, s2)

Buggy python submission (verdict: Time Limit Exceeded):
def lcs(X, Y):
    X = " " + X
    Y = " " + Y
    #c = [[0 for j in range(len(Y))] for i in range(len(X))]
    c = [[0] * len(Y) for i in range(len(X))]
    maxl = 0
    
    for i in range(1,len(X)):
        for j in range(1,len(Y)):
            if X[i] == Y[j]:
                c[i][j] = c[i - 1][j - 1] + 1
            else:
                c[i][j] = max(c[i - 1][j], c[i][j - 1])
            maxl = max(maxl, c[i][j])
    return maxl
n = int(raw_input())
 
for i in range(n):
    s1 = raw_input()
    s2 = raw_input()
    print lcs(s1, s2)

Fixed submission:
def lcs(X, Y):
    #X = " " + X
    #Y = " " + Y
    #c = [[0 for j in xrange(len(Y))] for i in xrange(len(X))]
    c2 = [0 for i in xrange(len(Y) + 1)]
    #maxl = 0
     
    for i in xrange(len(X)):
        c1 = c2 + []
        for j in xrange(len(Y)):
            if X[i] == Y[j]:
                c2[j + 1] = c1[j] + 1
            elif c2[j + 1] < c2[j]:
                c2[j + 1] = c2[j]
    return c2[-1]
n = int(raw_input())
  
for i in xrange(n):
    s1 = raw_input()
    s2 = raw_input()
    print lcs(s1, s2)

Buggy python submission (verdict: Time Limit Exceeded):
def lcs(X, Y):
    X = " " + X
    Y = " " + Y
    #c = [[0 for j in range(len(Y))] for i in range(len(X))]
    c = [[0] * len(Y) for i in range(len(X))]
    maxl = 0
    
    for i in range(1,len(X)):
        for j in range(1,len(Y)):
            if X[i] == Y[j]:
                c[i][j] = c[i - 1][j - 1] + 1
            else:
                c[i][j] = max(c[i - 1][j], c[i][j - 1])
            maxl = max(maxl, c[i][j])
    return maxl
n = int(raw_input())
 
for i in range(n):
    s1 = raw_input()
    s2 = raw_input()
    print lcs(s1, s2)

Fixed submission:
def lcs(X, Y):
    #X = " " + X
    #Y = " " + Y
    #c = [[0 for j in xrange(len(Y))] for i in xrange(len(X))]
    c2 = [0 for i in xrange(len(Y) + 1)]
    #maxl = 0
     
    for i in xrange(len(X)):
        c1 = c2 + []
        for j in xrange(len(Y)):
            if X[i] == Y[j]:
                c2[j + 1] = c1[j] + 1
            elif c2[j + 1] < c2[j]:
                c2[j + 1] = c2[j]
    return c2[-1]
n = int(raw_input())
  
for i in xrange(n):
    s1 = raw_input()
    s2 = raw_input()
    print lcs(s1, s2)

Buggy python submission (verdict: Time Limit Exceeded):
def lcs(X, Y):
    X = " " + X
    Y = " " + Y
    #c = [[0 for j in xrange(len(Y))] for i in xrange(len(X))]
    c = [[0] * len(Y) for i in xrange(len(X))]
    maxl = 0
    
    for i in xrange(1,len(X)):
        for j in xrange(1,len(Y)):
            if X[i] == Y[j]:
                c[i][j] = c[i - 1][j - 1] + 1
            else:
                c[i][j] = max(c[i - 1][j], c[i][j - 1])
            maxl = max(maxl, c[i][j])
    return maxl
n = int(raw_input())
 
for i in xrange(n):
    s1 = raw_input()
    s2 = raw_input()
    print lcs(s1, s2)

Fixed submission:
def lcs(X, Y):
    #X = " " + X
    #Y = " " + Y
    #c = [[0 for j in xrange(len(Y))] for i in xrange(len(X))]
    c2 = [0 for i in xrange(len(Y) + 1)]
    #maxl = 0
     
    for i in xrange(len(X)):
        c1 = c2 + []
        for j in xrange(len(Y)):
            if X[i] == Y[j]:
                c2[j + 1] = c1[j] + 1
            elif c2[j + 1] < c2[j]:
                c2[j + 1] = c2[j]
    return c2[-1]
n = int(raw_input())
  
for i in xrange(n):
    s1 = raw_input()
    s2 = raw_input()
    print lcs(s1, s2)

Buggy python submission (verdict: Runtime Error):
def lcs(X, Y):
    #X = " " + X
    #Y = " " + Y
    #c = [[0 for j in xrange(len(Y))] for i in xrange(len(X))]
    c2 = [0???for i in xrange(len(Y))]
    #maxl = 0
     
    for i in xrange(1,len(X)):
        c1 = c2 + []
        for j in xrange(1,len(Y)):
            if X[i] == Y[j]:
                c2[j + 1] = c1[j] + 1
            elif c2[j + 1] < c2[j]:
                c2[j + 1] = c2[j]
    return c2[-1]
n = int(raw_input())
  
for i in xrange(n):
    s1 = raw_input()
    s2 = raw_input()
    print lcs(s1, s2)

Fixed submission:
def lcs(X, Y):
    #X = " " + X
    #Y = " " + Y
    #c = [[0 for j in xrange(len(Y))] for i in xrange(len(X))]
    c2 = [0 for i in xrange(len(Y) + 1)]
    #maxl = 0
     
    for i in xrange(len(X)):
        c1 = c2 + []
        for j in xrange(len(Y)):
            if X[i] == Y[j]:
                c2[j + 1] = c1[j] + 1
            elif c2[j + 1] < c2[j]:
                c2[j + 1] = c2[j]
    return c2[-1]
n = int(raw_input())
  
for i in xrange(n):
    s1 = raw_input()
    s2 = raw_input()
    print lcs(s1, s2)