Game With String

题意翻译

### 题目描述 Alice和Bob在玩一个游戏,最初他们有一个字符串$s_1,s_2……,s_n$,只由X和.组成。他们轮流行动,Alice先手。每一轮,玩家选择一个只由.组成的字串,将它全都改为X。Alice必须选择度为a的字串,Bob必须选择度为b的字串,保证a>b。 举个例子,如果S=...X..,a=3,b=2,那么Alice只能把它变为XXXX...,如果Bob行动可能可以变为XX.X.., .XXX.. 或 ...XXX. 谁先不能行动谁就输了。假设他们都聪明绝顶,请你来预测谁会赢。 你要回答q组询问。 ### 输入格式 第一行有一个数$q(1\le q\le 3*10^5)$,表示询问组数。 每一个询问的第一行会有两个数$a,b(1\le b< a\le 3*10^5)$。 第二行会有一个字符串$s(|s|\le 3*10^5)$,只由X和.组成。 所有|s|的和小于$3*10^5$。 ### 输出格式 对于每组询问,如果Alice赢了,输出YES,否则输出NO(不分大小写)。

题目描述

Alice and Bob play a game. Initially they have a string $ s_1, s_2, \dots, s_n $ , consisting of only characters . and X. They take alternating turns, and Alice is moving first. During each turn, the player has to select a contiguous substring consisting only of characters . and replaces each of them with X. Alice must select a substing of length $ a $ , and Bob must select a substring of length $ b $ . It is guaranteed that $ a > b $ . For example, if $ s = $ ...X.. and $ a = 3 $ , $ b = 2 $ , then after Alice's move string can turn only into XXXX... And if it's Bob's turn and the string $ s = $ ...X.., then after Bob's move the string can turn into XX.X.., .XXX.. or ...XXX. Whoever is unable to make a move, loses. You have to determine who wins if they both play optimally. You have to answer $ q $ independent queries.

输入输出格式

输入格式


The first line contains one integer $ q $ ( $ 1 \le q \le 3 \cdot 10^5 $ ) — the number of queries. The first line of each query contains two integers $ a $ and $ b $ ( $ 1 \le b < a \le 3 \cdot 10^5 $ ). The second line of each query contains the string $ s $ ( $ 1 \le |s| \le 3 \cdot 10^5 $ ), consisting of only characters . and X. It is guaranteed that sum of all $ |s| $ over all queries not exceed $ 3 \cdot 10^5 $ .

输出格式


For each test case print YES if Alice can win and NO otherwise. You may print every letter in any case you want (so, for example, the strings yEs, yes, Yes and YES will all be recognized as positive answer).

输入输出样例

输入样例 #1

3
3 2
XX......XX...X
4 2
X...X.X..X
5 3
.......X..X

输出样例 #1

YES
NO
YES

说明

In the first query Alice can select substring $ s_3 \dots s_5 $ . After that $ s $ turns into XXXXX...XX...X. After that, no matter what move Bob makes, Alice can make the move (this will be her second move), but Bob can't make his second move. In the second query Alice can not win because she cannot even make one move. In the third query Alice can choose substring $ s_2 \dots s_6 $ . After that $ s $ turns into .XXXXX.X..X, and Bob can't make a move after that.