English · Original
Chinese · Translation
Formal · Original
Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of _s_ characters. The first participant types one character in _v_1 milliseconds and has ping _t_1 milliseconds. The second participant types one character in _v_2 milliseconds and has ping _t_2 milliseconds.
If connection ping (delay) is _t_ milliseconds, the competition passes for a participant as follows:
1. Exactly after _t_ milliseconds after the start of the competition the participant receives the text to be entered.
2. Right after that he starts to type it.
3. Exactly _t_ milliseconds after he ends typing all the text, the site receives information about it.
The winner is the participant whose information on the success comes earlier. If the information comes from both participants at the same time, it is considered that there is a draw.
Given the length of the text and the information about participants, determine the result of the game.
## Input
The first line contains five integers _s_, _v_1, _v_2, _t_1, _t_2 (1 ≤ _s_, _v_1, _v_2, _t_1, _t_2 ≤ 1000) — the number of characters in the text, the time of typing one character for the first participant, the time of typing one character for the the second participant, the ping of the first participant and the ping of the second participant.
## Output
If the first participant wins, print "_First_". If the second participant wins, print "_Second_". In case of a draw print "_Friendship_".
[samples]
## Note
In the first example, information on the success of the first participant comes in 7 milliseconds, of the second participant — in 14 milliseconds. So, the first wins.
In the second example, information on the success of the first participant comes in 11 milliseconds, of the second participant — in 5 milliseconds. So, the second wins.
In the third example, information on the success of the first participant comes in 22 milliseconds, of the second participant — in 22 milliseconds. So, it is be a draw.
两个男孩决定在网站 "Key races" 上进行打字比赛。比赛期间,他们需要输入一个包含 #cf_span[s] 个字符的文本。第一个参与者每输入一个字符需要 #cf_span[v1] 毫秒,网络延迟为 #cf_span[t1] 毫秒;第二个参与者每输入一个字符需要 #cf_span[v2] 毫秒,网络延迟为 #cf_span[t2] 毫秒。
如果网络延迟(延时)为 #cf_span[t] 毫秒,则比赛对参与者而言的过程如下:
获胜者是其成功信息先到达的参与者。如果两个参与者的成功信息同时到达,则视为平局。
给定文本长度和参与者的相关信息,确定比赛结果。
第一行包含五个整数 #cf_span[s], #cf_span[v1], #cf_span[v2], #cf_span[t1], #cf_span[t2] (#cf_span[1 ≤ s, v1, v2, t1, t2 ≤ 1000]) —— 文本中的字符数、第一个参与者输入一个字符所需时间、第二个参与者输入一个字符所需时间、第一个参与者的延迟和第二个参与者的延迟。
如果第一个参与者获胜,请输出 "_First_"。如果第二个参与者获胜,请输出 "_Second_"。如果是平局,请输出 "_Friendship_"。
在第一个示例中,第一个参与者的成功信息在 #cf_span[7] 毫秒时到达,第二个参与者在 #cf_span[14] 毫秒时到达。因此第一个获胜。
在第二个示例中,第一个参与者的成功信息在 #cf_span[11] 毫秒时到达,第二个参与者在 #cf_span[5] 毫秒时到达。因此第二个获胜。
在第三个示例中,第一个参与者的成功信息在 #cf_span[22] 毫秒时到达,第二个参与者在 #cf_span[22] 毫秒时到达。因此是平局。
## Input
第一行包含五个整数 #cf_span[s], #cf_span[v1], #cf_span[v2], #cf_span[t1], #cf_span[t2] (#cf_span[1 ≤ s, v1, v2, t1, t2 ≤ 1000]) —— 文本中的字符数、第一个参与者输入一个字符所需时间、第二个参与者输入一个字符所需时间、第一个参与者的延迟和第二个参与者的延迟。
## Output
如果第一个参与者获胜,请输出 "_First_"。如果第二个参与者获胜,请输出 "_Second_"。如果是平局,请输出 "_Friendship_"。
[samples]
## Note
在第一个示例中,第一个参与者的成功信息在 #cf_span[7] 毫秒时到达,第二个参与者在 #cf_span[14] 毫秒时到达。因此第一个获胜。
在第二个示例中,第一个参与者的成功信息在 #cf_span[11] 毫秒时到达,第二个参与者在 #cf_span[5] 毫秒时到达。因此第二个获胜。
在第三个示例中,第一个参与者的成功信息在 #cf_span[22] 毫秒时到达,第二个参与者在 #cf_span[22] 毫秒时到达。因此是平局。
**Definitions**
Let $ s \in \mathbb{Z}^+ $ be the number of characters in the text.
Let $ v_1, v_2 \in \mathbb{Z}^+ $ be the typing time (in milliseconds) per character for participant 1 and participant 2, respectively.
Let $ t_1, t_2 \in \mathbb{Z}^+ $ be the ping delays (in milliseconds) for participant 1 and participant 2, respectively.
**Constraints**
$ 1 \leq s, v_1, v_2, t_1, t_2 \leq 1000 $
**Objective**
Compute the total time for each participant to complete and transmit the text:
- Time for participant 1: $ T_1 = s \cdot v_1 + t_1 $
- Time for participant 2: $ T_2 = s \cdot v_2 + t_2 $
Determine the result:
- If $ T_1 < T_2 $, output "First"
- If $ T_1 > T_2 $, output "Second"
- If $ T_1 = T_2 $, output "Friendship"
API Response (JSON)
{
"problem": {
"name": "A. Key races",
"description": {
"content": "Two boys decided to compete in text typing on the site \"Key races\". During the competition, they have to type a text consisting of _s_ characters. The first participant types one character in _v_1 mil",
"description_type": "Markdown"
},
"platform": "Codeforces",
"limit": {
"time_limit": 1000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "CF835A"
},
"statements": [
{
"statement_type": "Markdown",
"content": "Two boys decided to compete in text typing on the site \"Key races\". During the competition, they have to type a text consisting of _s_ characters. The first participant types one character in _v_1 mil...",
"is_translate": false,
"language": "English"
},
{
"statement_type": "Markdown",
"content": "两个男孩决定在网站 \"Key races\" 上进行打字比赛。比赛期间,他们需要输入一个包含 #cf_span[s] 个字符的文本。第一个参与者每输入一个字符需要 #cf_span[v1] 毫秒,网络延迟为 #cf_span[t1] 毫秒;第二个参与者每输入一个字符需要 #cf_span[v2] 毫秒,网络延迟为 #cf_span[t2] 毫秒。\n\n如果网络延迟(延时)为 #cf_span[t] 毫...",
"is_translate": true,
"language": "Chinese"
},
{
"statement_type": "Markdown",
"content": "**Definitions** \nLet $ s \\in \\mathbb{Z}^+ $ be the number of characters in the text. \nLet $ v_1, v_2 \\in \\mathbb{Z}^+ $ be the typing time (in milliseconds) per character for participant 1 and parti...",
"is_translate": false,
"language": "Formal"
}
]
}