Dissertation

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

A professor suspects that a student's dissertation was plagiarized from a certain book. In order to test that, he wants to compute the longest common subsequence of the dissertation and the book. He doesn't have a program to do it, so he asked you to write such a program as an assignment for the algorithms course.

입력

The first line of input contains the number of test cases zz (1z1091 \leq z \leq 10^9). The descriptions of the test cases follow.

Each test case is given on two lines. The first line contains a string of length between 11 and 1,000,0001\\,000\\,000 consisting of lowercase Latin letters: the text of the book. The second line contains a string of length between 11 and 10001000 consisting of lowercase Latin letters: the text of the dissertation.

The sum of lengths of the books in all test cases is at most 10,000,00010\\,000\\,000. The sum of lengths of the dissertations in all test cases is at most 30,00030\\,000.

출력

For each test case, output the length of the longest common subsequence of the book and the dissertation.