BAKUMAN - Baku Man
Moritaka Mashiro & Akito Takagi (two high school students) both are pursuing their dreams of becoming a successful mangaka(manga artist). So, they teamed up as Takagi is good at making stories and mashiro is great at artwork. They submitted their work to a competition & got themselves into top 5. They got noticed and got a proposal from Jack magazine to submit their work. To get serialized they have to submit their work before deadline. But Takagi got a new girlfriend and Mashiro got jealous of it(as he doesn't have any girlfriend :3 ) which ended up making a misunderstanding between them where Mashiro is thinking that Takagi is not serious enough and they won't be able to submit their work before deadline.
At that time, their editor stepped in and offered them to take a test, so that they can check if they are compatible with each other. If they are compatible, then they should continue their dreams together. If not, then it's better to break up their team. To check if they are compatible with each other, their wavelengths should match at a certain level. But to check that, a compatibility calculator is needed and for that, editor is asking your help to make a program.
NOW, you will be given two wavelengths. Each will consists only small letter English alphabets and ith(0 <= i <= 104) letter will represent their wavelength state at ith time. Difference between certain wavelength state can be measured if their occurring time is same. Your program has to calculate the length of longest consecutive wavelength state for which their wavelength difference is same. If calculated length is less than expected length k(least compatibility level) , then they would break the team, otherwise not.
Input
First, input begins with testcase T(0 <= T <=102) and for each testcase wavelength N & least compatibility level K (0 <= N, K <= 104) is given. After that, two strings(wavelength) of length N is given.
Output
For each testcase output "Yes" if they are compatible, or "No" otherwise.
Example
Input: 3 5 3 aaaaa bbabb 6 1 aaaaaa bbbbbb 0 3
Output: No Yes No
Added by: | imranziad |
Date: | 2015-10-07 |
Time limit: | 0.5s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 GOSU JS-MONKEY |
Resource: | AIUB Beginners Team Formation Contest (Round 5) Onsite |