题目链接:​​点击打开链接​


A. Bear and Reverse Radewoosh



time limit per test



memory limit per test



input



output



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.

n problems. The i-th problem has initial score pi and it takes exactly ti minutes to solve it. Problems are sorted by difficulty — it's guaranteed that pi < pi + 1 and ti < ti + 1.

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,  pi - c·x)

1, 2, ..., n (sorted increasingly by pi). Radewoosh is going to solve them in order n, n - 1, ..., 1(sorted decreasingly by pi). 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.

ti. That means both Limak and Radewoosh will accept all n



Input



n and c (1 ≤ n ≤ 50, 1 ≤ c ≤ 1000) — the number of problems and the constant representing the speed of loosing points.

n integers p1, p2, ..., pn (1 ≤ pi ≤ 1000, pi < pi + 1) — initial scores.

n integers t1, t2, ..., tn (1 ≤ ti ≤ 1000, ti < ti + 1) where ti denotes the number of minutes one needs to solve thei-th problem.



Output



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.



Examples



input



3 2 50 85 250 10 15 25



output



Limak



input



3 6 50 85 250 10 15 25



output



Radewoosh



input



8 1 10 20 30 40 50 60 70 80 8 10 58 63 71 72 75 76



output



Tie



Note



3

  1. 10 minutes on the 1-st problem and he gets 50 -c·10 = 50 - 2·10 = 30
  2. 15 minutes on the 2-nd problem so he submits it 10 + 15 = 25 minutes after the start of the contest. For the 2-nd problem he gets 85 - 2·25 = 35
  3. 25 minutes on the 3-rd problem so he submits it 10 + 15 + 25 = 50 minutes after the start. For this problem he gets250 - 2·50 = 150

30 + 35 + 150 = 215

Radewoosh solves problem in the reversed order:

  1. 3-rd problem after 25 minutes so he gets 250 - 2·25 = 200
  2. 15 minutes on the 2-nd problem so he submits it 25 + 15 = 40 minutes after the start. He gets 85 - 2·40 = 5
  3. 10 minutes on the 1-st problem so he submits it 25 + 15 + 10 = 50 minutes after the start. He getsmax(0, 50 - 2·50) =max(0,  - 50) = 0

200 + 5 + 0 = 205 points in total. Limak has 215

0 points for each problem and Radewoosh will first solve the hardest problem and he will get250 - 6·25 = 100 points for that. Radewoosh will get 0

2 points for the 1-st problem and 2 points for the 2-nd problem. Radewoosh will get 4 points for the 8-th problem. They won't get points for other problems and thus there is a tie because 2 + 2 = 4.




题意:一个人正在正着做题,一个人反着做题,然后每道题每分钟会降低分数,问最后谁的得分高;-水题;

#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int n,c;
int a[100],b[100];
int main()
{
while(~scanf("%d %d",&n,&c))
{
for(int i=0;i<n;i++)
scanf("%d",&a[i]);
for(int i=0;i<n;i++)
scanf("%d",&b[i]);
int sum1=0,sum2=0,ans1=0,ans2=0;
for(int i=0;i<n;i++)
{
sum1+=b[i];
ans1=ans1+max(0,a[i]-c*sum1);
}
for(int i=n-1;i>=0;i--)
{
sum2+=b[i];
ans2=ans2+max(0,a[i]-c*sum2);
}
if(ans1>ans2) puts("Limak");
if(ans1<ans2) puts("Radewoosh");
if(ans1==ans2) puts("Tie");
}
return 0;
}