我是靠谱客的博主 会撒娇夕阳,这篇文章主要介绍A. Key races,现在分享给大家,希望可以做个参考。

time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of scharacters. The first participant types one character in v1 milliseconds and has ping t1 milliseconds. The second participant types one character in v2 milliseconds and has ping t2 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 sv1v2t1t2 (1 ≤ s, v1, v2, t1, t2 ≤ 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".

Examples
input
复制代码
1
5 1 2 1 2
output
复制代码
1
First
input
复制代码
1
3 3 1 1 1
output
复制代码
1
Second
input
复制代码
1
4 5 3 1 5
output
复制代码
1
Friendship
Note

In the first example, information on the success of the first participant comes in 7 milliseconds, of the second participant — in 14milliseconds. 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 5milliseconds. 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 22milliseconds. So, it is be a draw.


解题说明:此题是一道模拟题,按照题目要求计算出时间进行比较即可。

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include<cstdio> #include<algorithm> #include<cstring> #include<cstdlib> #include<iostream> using namespace std; int main() { int s,v1,v2,t1,t2,r,p; scanf("%d%d%d%d%d",&s,&v1,&v2,&t1,&t2); r = (s*v1)+t1+t1; p = (s*v2)+t2+t2; if(r<p) { printf("Firstn"); } else if(p<r) { printf("Secondn"); } else { printf("Friendshipn"); } return 0; }



最后

以上就是会撒娇夕阳最近收集整理的关于A. Key races的全部内容,更多相关A.内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(64)

评论列表共有 0 条评论

立即
投稿
返回
顶部