All submissions for this problem are available.
Once upon a time there was a girl named 'Smriti' and she was so beautiful and cute that every boy in the city of WonderLa wanted to impress her. One day , Smriti went to the market to buy some fruits . Fruits in WonderLa are different . They are characters consisting of LowerCase characters 'a' to 'z' only. Smriti wanted to buy fruits in such a manner that she can form 'K' palindrome strings using all of the fruits available , where 'K' is an integer that lies in the range 1<=K<=1000. Here 'N' denotes the total number of fruits that Smriti buys from the market. Sandip being a close friend of Smriti would like to help her in the task so that he can impress her and win her heart . Help him solve the task so that he can win her heart.
The first line of input consists of T denoting the total number of testcases. Each testcase consists of two lines. First line consists of a string which consists of 'N' characters that denotes the fruits that Smriti buys from the market of WonderLa consisting of lower case characters 'a' to 'z' only. Next line consists of an integer 'K' which denotes the number of palindrome strings that Smriti wants to form such that all are of EQUAL LENGTH.
Output a single line "YES" or "NO" without quotes that denotes whether or not Smriti can form K palindromic strings.
- 1 ≤ T ≤ 100
- 1 ≤ N ≤ 100000
- 1 ≤ K ≤ 1000
Input: 2 sabs 2 smriti 6 Output: NO YES
For the first testcase no possible arrangement can form 2 palindrome strings
For the second testcase the one of the possible solutions are "s" , "m" , "r" , "i" , "t" , "i" that contains 6 palindromic strings of length 1. Note : Palindrome is a string reading the same forward and backward.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions