A11155 | Key races
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
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.
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.
输入格式
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.
输出格式
If the first participant wins, print "First". If the second participant wins, print "Second". In case of a draw print "Friendship".
输入输出样例
输入 #1
5 1 2 1 2
输出 #1
First
输入 #2
3 3 1 1 1
输出 #2
Second
输入 #3
4 5 3 1 5
输出 #3
Friendship
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.
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.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted