Detective Bakshi

5

1 votes
Problem

Bakshi loves watching detective movies and solving mystery. Bakshi got a paper which has a \(text\) and a \(pattern\) written on it and on the bottom of paper it was written "Decode to defuse the bomb". Bakshi use his detective skills and found that it was an encoded message which can defuse the bomb. So, he figure out that the code for the bomb is :

  • If  \(pattern\) can be represented as a substring of \(text\) by deleting minimum number of characters from \(text\) print "YES"( without quotes ) and minimum number of characters to be deleted, space saperatedly.
  • Else print "NO"( without quotes ).

Can you help baskhi in decoding th bomb?

Input:

First line contain number of Testcases \(T\).

Next T lines contain two strings Text and Pattern, space saperatedly.

Constraints:

​​​​​​1<=T<=10

1<=|Text|,|Pattern|<=10005

|Text| is length of string.

Output:​​​​​​

Output will contain NO, if Pattern cannot be represented as a substring of Text by deleting any number of characters. Else print YES and minimum numbers of characters to be deleted, space saperatedly.

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

?