Given two strings, find the length of the longest common substring.
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 the length of the longest common substring.