题库练习 Bear and Reverse Radewoosh
← 上一题 下一题 →

A10281 | Bear and Reverse Radewoosh

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

Limak and Radewoosh are going to compete against each other in the upcoming algorithmic contest. They are equally skilled but they won't solve problems in the same order.

There will be $n$ problems. The $i$ -th problem has initial score $p_{i}$ and it takes exactly $t_{i}$ minutes to solve it. Problems are sorted by difficulty — it's guaranteed that $p_{i}<p_{i+1}$ and $t_{i}<t_{i+1}$ .

A constant $c$ is given too, representing the speed of loosing points. Then, submitting the $i$ -th problem at time $x$ ( $x$ minutes after the start of the contest) gives $max(0,\ p_{i}-c·x)$ points.

Limak is going to solve problems in order $1,2,...,n$ (sorted increasingly by $p_{i}$ ). Radewoosh is going to solve them in order $n,n-1,...,1$ (sorted decreasingly by $p_{i}$ ). Your task is to predict the outcome — print the name of the winner (person who gets more points at the end) or a word "Tie" in case of a tie.

You may assume that the duration of the competition is greater or equal than the sum of all $t_{i}$ . That means both Limak and Radewoosh will accept all $n$ problems.

输入格式

The first line contains two integers $n$ and $c$ ( $1<=n<=50,1<=c<=1000$ ) — the number of problems and the constant representing the speed of loosing points.

The second line contains $n$ integers $p_{1},p_{2},...,p_{n}$ ( $1<=p_{i}<=1000,p_{i}<p_{i+1}$ ) — initial scores.

The third line contains $n$ integers $t_{1},t_{2},...,t_{n}$ ( $1<=t_{i}<=1000,t_{i}<t_{i+1}$ ) where $t_{i}$ denotes the number of minutes one needs to solve the $i$ -th problem.

输出格式

Print "Limak" (without quotes) if Limak will get more points in total. Print "Radewoosh" (without quotes) if Radewoosh will get more points in total. Print "Tie" (without quotes) if Limak and Radewoosh will get the same total number of points.

输入输出样例

输入 #1
3 2
50 85 250
10 15 25
输出 #1
Limak
输入 #2
3 6
50 85 250
10 15 25
输出 #2
Radewoosh
输入 #3
8 1
10 20 30 40 50 60 70 80
8 10 58 63 71 72 75 76
输出 #3
Tie
C++ 编辑器
输入
输出