Longest Common subsequence
Maximum public subsequence time limit: 3000 MS | memory limit: 65535 KB difficulty: 3
The description will not go around. For example, what you need to do is to write a program to obtain the longest common subsequence.
Tip: The Longest Common Subsequence is also called the Longest Common substring (not consecutive). It is abbreviated as LCS (Longest Common Subsequence ). It is defined as a sequence S. If it is a subsequence of two or more known sequences, and it is the longest of all sequences that meet this condition, S is the longest common subsequence of known sequences.
Input the first line to give an integer N (0 Next, two rows of data in each group are the strings to be tested. The length of each string is not greater than 1000. An integer is output for each group of test data, indicating the maximum length of the common subsequence. Each result group occupies one row. Sample Input
2asdfadfsd123abcabc123abc
Sample output
36