DMOPC '15 Contest 4 P3 - Lethal

View as PDF

Submit solution


Points: 7 (partial)
Time limit: 0.6s
Memory limit: 64M

Authors:
Problem type

WallE256 and ionutpop118 are playing G games of Hearthstone! Hearthstone is a card game in which two players duke it out with minions, spells, and secrets. To keep their game simple, they've decided to use minions only and play according to the following rules:

  • Each player starts the game with 30 health
  • Each player can have no more than 7 minions on the board
  • Each minion has two stats - its attack and health
  • Each minion can only attack once per turn, if it attacks another minion, both lose health equivalent to the other's attack, if it attacks the opponent directly, the opposing player loses health equivalent to the minion's attack
  • A minion dies if its health reaches 0 or below, similarly, a player wins if the opponent's health reaches 0 or below
  • Opponent minions with the special effect taunt must be killed first before attacking the opponent player

A player is considered to have lethal if they can win the game in that turn.

Unfortunately, ionutpop118 has terrible rng luck. He always seems to end up in a terrible situation — with low health and only one taunt minion on the board. It is now WallE256's turn, and he wonders: does he have lethal?

Input Specification

The first line of input will contain G, the number of games they play. (1 \le G \le 5)

The second line of each game will contain N (0 \le N \le 7), the number of minions WallE256 has on the board.

The third line of each game will contain N space-separated integers, the attack values of WallE256's minions. Attack values will be no greater than 12.

The fourth line of each game will contain two space-separated integers, H_i (1 \le H_i \le 30) and H_m (1 \le H_m \le 12), ionutpop118's health and his taunt minion's health, respectively.

Output Specification

For each game, output LETHAL or NOT LETHAL on a separate line.

Sample Input

2
3
3 5 3
4 5
2
5 3
7 4

Sample Output

LETHAL
NOT LETHAL

Explanations and Illustrations for Sample Output

In the first game, WallE256 can use the 5-attack minion to kill the taunt minion (distinguished by its shield border), then use the 2 3-attack minions to finish ionutpop118 off.

Lethal

In the second game, there is simply not enough damage for lethal.

Not Lethal


Comments


  • 1
    Jeffmagma  commented on April 15, 2016, 3:06 a.m.

    First of all, what about the frostbolts in his hand? 3+3+3=9, which is greater than 7.

    Also, (not sure if this was patched) but HysteriA, found a (maybe more?) ways to get more than 7 minions on board

    But i guess it makes sense for simplicity


    • 2
      WallE256  commented on April 15, 2016, 12:18 p.m.

      The initial version of this problem was harder, and this is a simplified version. We promise that in the future we will release the original version.


      • 0
        XIAOAGE  commented on April 15, 2016, 1:14 p.m.

        Ur mage deck is weird lol


  • 2
    albertzhan  commented on Jan. 13, 2016, 12:21 a.m.

    Maximum health is Jaraxxus at 15, so shouldn't it be 15 instead of 12?


  • -1
    imthekiller  commented on Jan. 13, 2016, 12:12 a.m. edit 4

    worst online game ever (lol fan)