Buggy python submission (verdict: Runtime Error):
def LCS(Xs, Ys):
  Xs = raw_input()
  Ys = raw_input()
  dp = {}
  count = 0
  a = 1

  for i in range(len(Ys) + 1):
    dp[0][i + 1] = Ys[i] 
  for j in range(len(Xs) + 1):
    dp[j + 1][0] = Xs[j]

  for i in range(a, len(Ys) + 1):
    for j in range(a, len(Xs) + 1):
      if dp[j][0] == dp[i][1]:
         count = count + 1
         a = j
         break
    if dp[j][0] == dp[i][1]:
      break

   print count

Fixed submission:
def solve_lcs():
    x = raw_input()
    y = raw_input()
 
    a = len(x)
    b = len(y)
    c1 = [0 for i in range(b+1)]
    for i in range(a):
        e1 = x[i]
        c2 = c1+[]
        for j in range(b):
            if e1 == y[j]:
                c1[j+1] = c2[j] + 1
            elif c1[j+1] < c1[j]:
                c1[j+1] = c1[j]
    return c1[-1]
 
n = input()
for i2 in range(n):
    print solve_lcs()

Buggy python submission (verdict: Runtime Error):
  Xs = raw_input()
  Ys = raw_input()
  dp = {}
  count = 0
  a = 1

  for i in range(len(Ys) + 1):
    dp[0][i + 1] = Ys[i] 
  for j in range(len(Xs) + 1):
    dp[j + 1][0] = Xs[j]

  for i in range(1, len(Ys) + 1):
    for j in range(a + 1, len(Xs) + 1):
      if dp[j][0] == dp[i][1]:
         count = count + 1
         a = j
         break
    if dp[j][0] == dp[i][1]:
      break

   print count

Fixed submission:
def solve_lcs():
    x = raw_input()
    y = raw_input()
 
    a = len(x)
    b = len(y)
    c1 = [0 for i in range(b+1)]
    for i in range(a):
        e1 = x[i]
        c2 = c1+[]
        for j in range(b):
            if e1 == y[j]:
                c1[j+1] = c2[j] + 1
            elif c1[j+1] < c1[j]:
                c1[j+1] = c1[j]
    return c1[-1]
 
n = input()
for i2 in range(n):
    print solve_lcs()

Buggy python submission (verdict: Runtime Error):
  Xs = raw_input()
  Ys = raw_input()
  count = 0
  a = 1

  for i in range(len(Ys) + 1):
    dp[0][i + 1] = Ys[i] 
  for j in range(len(Xs) + 1):
    dp[j + 1][0] = Xs[j]

  for i in range(1, len(Ys) + 1):
    for j in range(a + 1, len(Xs) + 1):
      if dp[j][0] == dp[i][1]:
         count = count + 1
         a = j
         break
    if dp[j][0] == dp[i][1]:
      break

   print count

Fixed submission:
def solve_lcs():
    x = raw_input()
    y = raw_input()
 
    a = len(x)
    b = len(y)
    c1 = [0 for i in range(b+1)]
    for i in range(a):
        e1 = x[i]
        c2 = c1+[]
        for j in range(b):
            if e1 == y[j]:
                c1[j+1] = c2[j] + 1
            elif c1[j+1] < c1[j]:
                c1[j+1] = c1[j]
    return c1[-1]
 
n = input()
for i2 in range(n):
    print solve_lcs()

Buggy python submission (verdict: Runtime Error):
  Xs = raw_input()
  Ys = raw_input()
  count = 0
  a = 0

  for j in range(len(Ys) + 1):
    dp[0][j + 1] = Ys[i] 
  for i in range(len(Xs) + 1):
    dp[i + 1][0] = Xs[j]

  for j in range(1, len(Ys) + 1):
    for i in range(a + 1, len(Xs) + 1):
      if dp[i][0] == dp[j][1]:
         count = count + 1
         a = j
         break
    if dp[j][0] == dp[i][1]:
      break

   print count

Fixed submission:
def solve_lcs():
    x = raw_input()
    y = raw_input()
 
    a = len(x)
    b = len(y)
    c1 = [0 for i in range(b+1)]
    for i in range(a):
        e1 = x[i]
        c2 = c1+[]
        for j in range(b):
            if e1 == y[j]:
                c1[j+1] = c2[j] + 1
            elif c1[j+1] < c1[j]:
                c1[j+1] = c1[j]
    return c1[-1]
 
n = input()
for i2 in range(n):
    print solve_lcs()

Buggy python submission (verdict: Runtime Error):
  Xs = raw_input()
  Ys = raw_input()
  count = 0
  a = 0

  for j in range(len(Ys) + 1):
    dp[1][j] = Ys[j] 
  for i in range(len(Xs) + 1):
    dp[i][1] = Xs[i]

  for j in range(1, len(Ys) + 1):
    for i in range(a + 1, len(Xs) + 1):
      if dp[i][0] == dp[j][1]:
         count = count + 1
         a = j
         break
    if dp[j][0] == dp[i][1]:
      break

   print count

Fixed submission:
def solve_lcs():
    x = raw_input()
    y = raw_input()
 
    a = len(x)
    b = len(y)
    c1 = [0 for i in range(b+1)]
    for i in range(a):
        e1 = x[i]
        c2 = c1+[]
        for j in range(b):
            if e1 == y[j]:
                c1[j+1] = c2[j] + 1
            elif c1[j+1] < c1[j]:
                c1[j+1] = c1[j]
    return c1[-1]
 
n = input()
for i2 in range(n):
    print solve_lcs()

Buggy python submission (verdict: Runtime Error):
  Xs = raw_input()
  Ys = raw_input()
  count = 0
  a = 0

  for j in range(len(Ys) + 1):
    dp[0][j + 1] = Ys[j] 
  for i in range(len(Xs) + 1):
    dp[i + 1][0] = Xs[i]

  for j in range(1, len(Ys) + 1):
    for i in range(a + 1, len(Xs) + 1):
      if dp[i][0] == dp[0][j]:
         count = count + 1
         a = i 
         break
   
  print count

Fixed submission:
def solve_lcs():
    x = raw_input()
    y = raw_input()
 
    a = len(x)
    b = len(y)
    c1 = [0 for i in range(b+1)]
    for i in range(a):
        e1 = x[i]
        c2 = c1+[]
        for j in range(b):
            if e1 == y[j]:
                c1[j+1] = c2[j] + 1
            elif c1[j+1] < c1[j]:
                c1[j+1] = c1[j]
    return c1[-1]
 
n = input()
for i2 in range(n):
    print solve_lcs()

Buggy python submission (verdict: Runtime Error):
n = input()
for i in range(n)
  Xs = raw_input()
  Ys = raw_input()
  count = 0
  a = 0

  for j in range(len(Ys) + 1):
    dp[0][j + 1] = Ys[j] 
  for i in range(len(Xs) + 1):
    dp[i + 1][0] = Xs[i]

  for j in range(1, len(Ys) + 1):
    for i in range(a + 1, len(Xs) + 1):
      if dp[i][0] == dp[0][j]:
         count = count + 1
         a = i 
         break
   
  print count

Fixed submission:
def solve_lcs():
    x = raw_input()
    y = raw_input()
 
    a = len(x)
    b = len(y)
    c1 = [0 for i in range(b+1)]
    for i in range(a):
        e1 = x[i]
        c2 = c1+[]
        for j in range(b):
            if e1 == y[j]:
                c1[j+1] = c2[j] + 1
            elif c1[j+1] < c1[j]:
                c1[j+1] = c1[j]
    return c1[-1]
 
n = input()
for i2 in range(n):
    print solve_lcs()

Buggy python submission (verdict: Runtime Error):
n = input()
for i in range(n)
  Xs = raw_input()
  Ys = raw_input()
  count = 0
  a = 0
  dp = {}

  for j in range(len(Ys) + 1):
    dp[0][j + 1] = Ys[j] 
  for i in range(len(Xs) + 1):
    dp[i + 1][0] = Xs[i]

  for j in range(1, len(Ys) + 1):
    for i in range(a + 1, len(Xs) + 1):
      if dp[i][0] == dp[0][j]:
         count = count + 1
         a = i 
         break
   
  print count

Fixed submission:
def solve_lcs():
    x = raw_input()
    y = raw_input()
 
    a = len(x)
    b = len(y)
    c1 = [0 for i in range(b+1)]
    for i in range(a):
        e1 = x[i]
        c2 = c1+[]
        for j in range(b):
            if e1 == y[j]:
                c1[j+1] = c2[j] + 1
            elif c1[j+1] < c1[j]:
                c1[j+1] = c1[j]
    return c1[-1]
 
n = input()
for i2 in range(n):
    print solve_lcs()

Buggy python submission (verdict: Runtime Error):
n = input()
for i in range(n)
  Xs = raw_input()
  Ys = raw_input()
  count = 0
  a = 0
  dp = {}

  for j in range(len(Ys) + 1):
    dp[0][j + 1] = Ys[j] 
  for i in range(len(Xs) + 1):
    dp[i + 1][0] = Xs[i]

  for j in range(1, len(Ys) + 1):
    for i in range(a + 1, len(Xs) + 1):
      if dp[i][0] == dp[0][j]:
         count = count + 1
         a = i 
         break
   
  print count

Fixed submission:
def solve_lcs():
    x = raw_input()
    y = raw_input()
 
    a = len(x)
    b = len(y)
    c1 = [0 for i in range(b+1)]
    for i in range(a):
        e1 = x[i]
        c2 = c1+[]
        for j in range(b):
            if e1 == y[j]:
                c1[j+1] = c2[j] + 1
            elif c1[j+1] < c1[j]:
                c1[j+1] = c1[j]
    return c1[-1]
 
n = input()
for i2 in range(n):
    print solve_lcs()

Buggy python submission (verdict: Runtime Error):
def solve_lcs():
    x = raw_input()
    y = raw_input()
 
    a = len(x)
    y = len(y)
    c1 = [0 for i in range(b+1)]
    for i in range(a):
        e1 = x[i]
        c2 = c1+[]
        for j in range(b):
            if e1 == y[j]:
                c1[j+1] = c2[j] + 1
            elif c1[j+1] < c1[j]:
                c1[j+1] = c1[j]
    return c1[-1]
 
n = input()
for i2 in range(n):
    print solve_lcs()

Fixed submission:
def solve_lcs():
    x = raw_input()
    y = raw_input()
 
    a = len(x)
    b = len(y)
    c1 = [0 for i in range(b+1)]
    for i in range(a):
        e1 = x[i]
        c2 = c1+[]
        for j in range(b):
            if e1 == y[j]:
                c1[j+1] = c2[j] + 1
            elif c1[j+1] < c1[j]:
                c1[j+1] = c1[j]
    return c1[-1]
 
n = input()
for i2 in range(n):
    print solve_lcs()