Limits 500ms, 512 MB

Maruf is a student of Dept. of Computer Science & Engineering, Sylhet Polytechnic Institute. Right now, He has finished his 5th-semester final examination and got a vacation of Winter for 1 month.

He thinks that he will spend around 1 month in different places of the country. He decided he would go Home from Sylhet. Discover the new game out of the street. while he traveling he gives each street a name once. Maruf started to go home and by mistake, he has used the same name more than once. After a month, he comes back to Sylhet.

After coming to Sylhet, he started counting how many different names he used for each street of the previous month while he traveling but he didn't calculate the correct number he used for the street name once while he travels except while he going home. Now, Your task is to find out the number of the different street name except while he going home.

Input

Input starts with an integer T (1<=T<=20) test case, T line follow two integer M (1<=M<=10) the number of given street name while he going home and N (M<=N<=150) the number of a total number of the street name. N line follows S (1<=S<=20) the name of streets.

Output

Print the output the number of the different street name except while he going home.

Sample

InputOutput
2
2 10
Jelr
bonr
Lamar
Lobr
Jelr
Jerr
Rle
Lobr
Tecr
bonr
1 5
masud
monin
khan
bahadur
kobir
5
4

Submit

Login to submit.

Statistics

98% Solution Ratio
sarwarITEarliest, Dec '17
m_ronyFastest, 0.0s
MutasimLightest, 0 B
touhidurrrShortest, 92B
Toph uses cookies. By continuing you agree to our Cookie Policy.