P15431 [HackerEarth] As Harry wants to know about the sorcerer's stone, he went to the Mirror of Erised and asked him ,"where is the stone?". The mirror put a condition that harry must answer a question firs
普及
题目描述

As Harry wants to know about the sorcerer's stone, he went to the Mirror of Erised and asked him ,"where is the stone?". The mirror put a condition that harry must answer a question first then he will tell about the stone.The mirror asked him to tell the maximum length of a stream of two strings, each of length N, consisting of alphabets only. Furthermore , the mirror defined him stream as a subset of string in order. For example,
"abc","aeg",.. etc are streams of string "abcdefg".

Input:
First line of input contains number of Test Cases T.
Each test case starts with an integer N, size of two strings.
Next two lines contains N alphabets each.

Output:
For each test case print one integer, the maximum length of stream between the two strings.

Constraints :
1 ≤ T ≤ 10
1 ≤ N ≤ 100000

SAMPLE INPUT
2
2
ab
ba
3
abc
acb

SAMPLE OUTPUT
1
2

输入格式

见题面

输出格式

见题面

样例输入
3 2 ab ba 50 hgueynfxicsxgwfquwnovrkpegxprytwyycpvkfmnmkswrnkcf tsysapofzceupaogoyfbpjriymewnrpxjloawxhscxoszvtdny 100 hgueynfxicsxgwfquwnovrkpegxprytwyycpvkfmnmkswrnkcftsysapofzceupaogoyfbpjriymewnrpxjloawxhscxoszvtdny yfxsnkfuxrbngoktynouzrditijaypsmsjfgbaolynrdpstswdzoznwqjvwxrbdglgubbrthspoggkudoobxeaftuezhlugejqjn
样例输出
1 162 318