CF835A.Key races

入门

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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.

两名男孩决定在“Key races”网站上进行打字比赛。比赛过程中,他们需要输入一段包含 ss 个字符的文本。第一名参赛者输入一个字符耗时 v1v_1 毫秒,网络延迟(ping)为 t1t_1 毫秒;第二名参赛者输入一个字符耗时 v2v_2 毫秒,网络延迟(ping)为 t2t_2 毫秒。

若网络延迟(ping)为 tt 毫秒,则某位参赛者的比赛过程如下:

  1. 比赛开始后恰好 tt 毫秒,该参赛者收到待输入的文本;
  2. 收到文本后立即开始输入;
  3. 该参赛者全部输入完毕后恰好再过 tt 毫秒,网站接收到其完成信息。

获胜者是其完成信息更早被网站接收到的参赛者。若两位参赛者的完成信息同时被网站接收到,则判定为平局。

已知文本长度及两位参赛者的信息,请判断比赛结果。

输入格式

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.

第一行包含五个整数 ss、v1v_1、v2v_2、t1t_1、t2t_2(1 ≤ s, v1, v2, t1, t2 ≤ 10001 ≤ s, v_1, v_2, t_1, t_2 ≤ 1000)—— 分别表示文本的字符数、第一位参赛者输入一个字符所需的时间、第二位参赛者输入一个字符所需的时间、第一位参赛者的网络延迟(ping)以及第二位参赛者的网络延迟(ping)。

输出格式

If the first participant wins, print "First". If the second participant wins, print "Second". In case of a draw print "Friendship".

如果第一位参与者获胜,输出 “First”;如果第二位参与者获胜,输出 “Second”;若平局,则输出 “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.

在第一个例子中,第一位参赛者成功的信息在 7 毫秒后到达,第二位参赛者成功的信息在 14 毫秒后到达。因此,第一位参赛者获胜。

在第二个例子中,第一位参赛者成功的信息在 11 毫秒后到达,第二位参赛者成功的信息在 5 毫秒后到达。因此,第二位参赛者获胜。

在第三个例子中,第一位参赛者成功的信息在 22 毫秒后到达,第二位参赛者成功的信息也在 22 毫秒后到达。因此,结果为平局。

输入解题思路,AI测评打分。不知道怎么写?

首页