9380 - Longest Common Substring   

Description

Given two strings, find the length of the longest common substring.

Input

The first line of input contains a positive integer t (t <= 100), which indicates the number of test cases.  For each case, there are two strings in a line (length of the string < 1000).

Output

Output the length of the longest common substring.

Sample Input  Download

Sample Output  Download

Tags




Discuss