T491159 「FSLOI Round I」One-On-One

题目背景

**[Chinese statement](https://www.luogu.com.cn/problem/T464057?contestId=163361). You must submit your code at the Chinese version of the statement.** FL_sleake and SnowTrace often play basketball one-on-one, but SnowTrace always gets blocked.

题目描述

Exactly one of FL_sleake and SnowTrace will win a single one-on-one round. There is no situation of a tie. Due to the uneven strength between FL_sleake and SnowTrace, they have made the rules as follow: Given two positive integers $x$ and $y$. If FL_sleake wins $x$ rounds before SnowTrace wins $y$ rounds, FL_sleake wins. Otherwise SnowTrace wins. There have already been $n$ one-on-one rounds, and their results is given as a string $s$ of length $n$. If the $i$-th character of $s$ is `F`, it means FL_sleake has won the $i$-th round. If the $i$-th character of $s$ is `S`, it means SnowTrace has won the $i$-th round. FL_sleake wants to find **the minimum number of the maximum winning streak in the following rounds** of himself if he wins at last. Each test contains $T$ test cases.

输入格式

输出格式

说明/提示

**Example Explanation** In the first example, in order for FL_sleake to win, he must win all of the following rounds until he wins a total of $6$ rounds. So, he has to win $4$ times in a row. In the second example, $\texttt{FFSFSF}$ is a possible result of the following rounds. In this case, the maximum winning streak of FL_sleake is $2$. Note that you only needs to consider the maximum winning streak in the **following** rounds until he wins. The streak in the first $n$ rounds doesn't matter. **Constraints** **Subtasks are used in this problem.** For all tests, it is guaranteed that: - $1 \leq T \leq 20$ - $1 \leq n \leq 2\times10^5$ - $1 \leq x,y \leq 10^9$ - $\forall i \leq n$,SnowTrace doesn't win after the $i$-th round. - $\forall i < n$,FL_sleake doesn't win after the $i$-th round. | Subtask Id | Score | Special Property | | :----: | :--: | :---------: | | $1$ | $10$ | $n=1$ | | $2$ | $15$ | $x,y\leq n$ | | $3$ | $15$ | $A$ | | $4$ | $30$ | $T=1$ | | $5$ | $30$ | - | - Special property $A$: SnowTrace wins $y-1$ rounds after the $n$-th round.