:i P1246 - Red Temperature SSS - 铁一启智tyqzOJ

1246: Red Temperature SSS

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:322 解决:16

题目描述

lns="http://www.w3.org/1998/Math/MathML">CS1.6,但是他的队友非常菜,因此他时常会红温。

当晚举行的比赛有回合。每一回合中,每当lns="http://www.w3.org/1998/Math/MathML">lxcSSS输了并且他队友的淘汰数lns="http://www.w3.org/1998/Math/MathML">m低于SSS的淘汰数时,他都会红温。当比赛输了他就会黑化。


输入

本题有lns="http://www.w3.org/1998/Math/MathML">T组测试数据。

第一行输入lns="http://www.w3.org/1998/Math/MathML">T,对于每一组数据,第一行输入回合数lns="http://www.w3.org/1998/Math/MathML">n_i,接下来lns="http://www.w3.org/1998/Math/MathML">n行每行输入lns="http://www.w3.org/1998/Math/MathML">mlns="http://www.w3.org/1998/Math/MathML">l,以及一个字符lns="http://www.w3.org/1998/Math/MathML">L(输)或者lns="http://www.w3.org/1998/Math/MathML">W(赢)表示这一回合的输赢。以空格隔开。

输出

输出lns="http://www.w3.org/1998/Math/MathML">T行。

每一行输出每组测试数据的答案。首先输出lns="http://www.w3.org/1998/Math/MathML">Ylns="http://www.w3.org/1998/Math/MathML">N表示SSS会不会黑化,然后输出当晚的比赛的比分(己方:敌方),以及他红温了几次。以空格隔开。

样例输入 复制

1
6
2 3 L
3 2 W
6 5 L
7 2 W
6 1 L
4 5 W

样例输出 复制

N 3:3 1

提示

输出的":"应为英文半角字符!!!

只有比赛败北lns="http://www.w3.org/1998/Math/MathML">lxcSSS才会黑化,在打平或胜利的情况下他都不会黑化。

对于所有数据,lns="http://www.w3.org/1998/Math/MathML">1 \le T \le n \le 10^{9},lns="http://www.w3.org/1998/Math/MathML">1 \le m \le l \le 20