301308: CF245A. System Administrator

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

System Administrator

题意翻译

### 题目描述 Polycarpus是系统管理员。在他的严格指导下有两台服务器——a和b。为了了解服务器的性能,Polycarpus执行命令“ping a”和“ping b”。每个ping命令都会向命令参数中指定的服务器发送10个数据包。执行程序会产生两个整数x$ 和 y(x+y=10;x,y>=0)。这些数字意味着 x 包通过网络成功地到达了相应的服务器,y 包丢失了,今天 Polycarpus 在工作日执行了n个ping命令。现在,对于每个服务器,Polycarpus都想知道服务器是否“活动”。Polycarpus认为服务器是“活动的”,如果我们发送到该服务器的数据包中至少有一半是通过网络成功到达的。帮助Polycarpus,根据给定的命令及其结果来确定每个服务器是否“活动”。 ### 输入格式 第一行输入一个正整数 n ,表示命令总数。 接下来 n 行输入3个正整数 ti,xi,yi, 分别表示发送到哪个服务器(ti=1表示发送至a服务器,ti=2表示发送至b服务器),发送成功的数量和发送失败的数量。 ### 输出格式 输出共n行,每行输出一个字符串,表示服务器是否活动,LIVE表示活动,DEAD表示没有活动

题目描述

Polycarpus is a system administrator. There are two servers under his strict guidance — $ a $ and $ b $ . 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 $ x $ and $ y $ $ (x+y=10; x,y>=0) $ . These numbers mean that $ x $ packets successfully reached the corresponding server through the network and $ y $ packets were lost. Today Polycarpus has performed overall $ n $ 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 $ n $ $ (2<=n<=1000) $ — the number of commands Polycarpus has fulfilled. Each of the following $ n $ lines contains three integers — the description of the commands. The $ i $ -th of these lines contains three space-separated integers $ t_{i} $ , $ x_{i} $ , $ y_{i} $ $ (1<=t_{i}<=2; x_{i},y_{i}>=0; x_{i}+y_{i}=10) $ . If $ t_{i}=1 $ , then the $ i $ -th command is "ping a", otherwise the $ i $ -th command is "ping b". Numbers $ x_{i} $ , $ y_{i} $ represent the result of executing this command, that is, $ x_{i} $ packets reached the corresponding server successfully and $ y_{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 $ a $ is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server $ b $ 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 $ a $ , 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 $ b $ , 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 $ a $ , 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 $ b $ , 0 of them reached it. Therefore, less than half of all packets sent to this server successfully reached it through the network.

Input

题意翻译

### 题目描述 Polycarpus是系统管理员。在他的严格指导下有两台服务器——a和b。为了了解服务器的性能,Polycarpus执行命令“ping a”和“ping b”。每个ping命令都会向命令参数中指定的服务器发送10个数据包。执行程序会产生两个整数x$ 和 y(x+y=10;x,y>=0)。这些数字意味着 x 包通过网络成功地到达了相应的服务器,y 包丢失了,今天 Polycarpus 在工作日执行了n个ping命令。现在,对于每个服务器,Polycarpus都想知道服务器是否“活动”。Polycarpus认为服务器是“活动的”,如果我们发送到该服务器的数据包中至少有一半是通过网络成功到达的。帮助Polycarpus,根据给定的命令及其结果来确定每个服务器是否“活动”。 ### 输入格式 第一行输入一个正整数 n ,表示命令总数。 接下来 n 行输入3个正整数 ti,xi,yi, 分别表示发送到哪个服务器(ti=1表示发送至a服务器,ti=2表示发送至b服务器),发送成功的数量和发送失败的数量。 ### 输出格式 输出共n行,每行输出一个字符串,表示服务器是否活动,LIVE表示活动,DEAD表示没有活动

加入题单

算法标签: