VK Cup 2016 - Round 1 (Div. 2 Edition)
A
Bear and Reverse Radewoosh
Codeforces
800
原题
←B →
翻译中…

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.

翻译中…

Input

翻译中…

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.

翻译中…

Output

翻译中…

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.

翻译中…

Note

翻译中…

In the first sample, there are $3$ problems. Limak solves them as follows:

翻译中…
  1. Limak spends $10$ minutes on the $1$-st problem and he gets $50 - *c*·10 = 50 - 2·10 = 30$ points.
  2. Limak spends $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$ points.
  3. He spends $25$ minutes on the $3$-rd problem so he submits it $10 + 15 + 25 = 50$ minutes after the start. For this problem he gets $250 - 2·50 = 150$ points.
翻译中…

So, Limak got $30 + 35 + 150 = 215$ points.

翻译中…

Radewoosh solves problem in the reversed order:

翻译中…
  1. Radewoosh solves $3$-rd problem after $25$ minutes so he gets $250 - 2·25 = 200$ points.
  2. He spends $15$ minutes on the $2$-nd problem so he submits it $25 + 15 = 40$ minutes after the start. He gets $85 - 2·40 = 5$ points for this problem.
  3. He spends $10$ minutes on the $1$-st problem so he submits it $25 + 15 + 10 = 50$ minutes after the start. He gets $*max*(0, 50 - 2·50) = *max*(0, - 50) = 0$ points.
翻译中…

Radewoosh got $200 + 5 + 0 = 205$ points in total. Limak has $215$ points so Limak wins.

翻译中…

In the second sample, Limak will get $0$ points for each problem and Radewoosh will first solve the hardest problem and he will get $250 - 6·25 = 100$ points for that. Radewoosh will get $0$ points for other two problems but he is the winner anyway.

翻译中…

In the third sample, Limak will get $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$.

翻译中…

样例

Input #1
3 2
50 85 250
10 15 25
Output #1
Limak
InputCopy OutputCopy
Input #2
3 6
50 85 250
10 15 25
Output #2
Radewoosh
InputCopy OutputCopy
Input #3
8 1
10 20 30 40 50 60 70 80
8 10 58 63 71 72 75 76
Output #3
Tie
InputCopy OutputCopy
题目信息
题号
658A
时间限制
2 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。