CF1396B.Stoned Game

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

T is playing a game with his friend, HL.

There are nn piles of stones, the ii -th pile initially has aia_i stones.

T and HL will take alternating turns, with T going first. In each turn, a player chooses a non-empty pile and then removes a single stone from it. However, one cannot choose a pile that has been chosen in the previous turn (the pile that was chosen by the other player, or if the current turn is the first turn then the player can choose any non-empty pile). The player who cannot choose a pile in his turn loses, and the game ends.

Assuming both players play optimally, given the starting configuration of tt games, determine the winner of each game.

输入格式

The first line of the input contains a single integer tt (1t100)(1 \le t \le 100) — the number of games. The description of the games follows. Each description contains two lines:

The first line contains a single integer nn (1n100)(1 \le n \le 100) — the number of piles.

The second line contains nn integers a1,a2,,ana_1, a_2, \dots, a_n (1ai100)(1 \le a_i \le 100) .

输出格式

For each game, print on a single line the name of the winner, "T" or "HL" (without quotes)

输入输出样例

  • 输入#1

    2
    1
    2
    2
    1 1

    输出#1

    T
    HL

说明/提示

In the first game, T removes a single stone from the only pile in his first turn. After that, although the pile still contains 11 stone, HL cannot choose from this pile because it has been chosen by T in the previous turn. Therefore, T is the winner.

首页