CF245A.System Administrator

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

Polycarpus is a system administrator. There are two servers under his strict guidance — aa and bb . To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program results in two integers xx and yy (x+y=10; x,y>=0)(x+y=10; x,y>=0) . These numbers mean that xx packets successfully reached the corresponding server through the network and yy packets were lost.

Today Polycarpus has performed overall nn ping commands during his workday. Now for each server Polycarpus wants to know whether the server is "alive" or not. Polycarpus thinks that the server is "alive", if at least half of the packets that we send to this server reached it successfully along the network.

Help Polycarpus, determine for each server, whether it is "alive" or not by the given commands and their results.

输入格式

The first line contains a single integer nn (2<=n<=1000)(2<=n<=1000) — the number of commands Polycarpus has fulfilled. Each of the following nn lines contains three integers — the description of the commands. The ii -th of these lines contains three space-separated integers tit_{i} , xix_{i} , yiy_{i} (1<=ti<=2; xi,yi>=0; xi+yi=10)(1<=t_{i}<=2; x_{i},y_{i}>=0; x_{i}+y_{i}=10) . If ti=1t_{i}=1 , then the ii -th command is "ping a", otherwise the ii -th command is "ping b". Numbers xix_{i} , yiy_{i} represent the result of executing this command, that is, xix_{i} packets reached the corresponding server successfully and yiy_{i} packets were lost.

It is guaranteed that the input has at least one "ping a" command and at least one "ping b" command.

输出格式

In the first line print string "LIVE" (without the quotes) if server aa is "alive", otherwise print "DEAD" (without the quotes).

In the second line print the state of server bb in the similar format.

输入输出样例

  • 输入#1

    2
    1 5 5
    2 6 4
    

    输出#1

    LIVE
    LIVE
    
  • 输入#2

    3
    1 0 10
    2 0 10
    1 10 0
    

    输出#2

    LIVE
    DEAD
    

说明/提示

Consider the first test case. There 10 packets were sent to server aa , 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server bb , 6 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network.

Consider the second test case. There were overall 20 packages sent to server aa , 10 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall 10 packets were sent to server bb , 0 of them reached it. Therefore, less than half of all packets sent to this server successfully reached it through the network.

首页