Beautiful String

0

0 votes
Problem

You are given a string s consists of lowercase english characters and you have to determine whether there is any beautiful substring of length L exist in it or not.
A string is beautiful if each of it's character occurs same number of times.
Example: "aabbcc" is beautiful because each a,b,c occurs 2 times.

INPUT
First line contains an integer T, denoting the number of test cases.
First line of each test case contains a string s.
Second line of each test case contains a single integer L.


OUTPUT
For each test case, print YES if a beautiful substring of length L is present else print NO.

CONSTRAINTS
1<=T<=10
1<=length of string<=10^5
1<=L<=10^5

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?