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 s characters. The first participant types one character in v1milliseconds and has ping t1 milliseconds. The second participant types one character in v2milliseconds 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 sv1, v2, t1, t2 (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
5 1 2 1 2
output
First
input
3 3 1 1 1
output
Second
input
4 5 3 1 5
output
Friendship
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 11milliseconds, 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.

//看懂题意就好啦,,英语没学好,就是蓝瘦,先后场等待t时间,然后根据自己的速度所需要花费时间,最后话费t时间交

#include <iostream>
#include <stdio.h>
using namespace std; int main(){
int s,v1,v2,t1,t2;
scanf("%d %d %d %d %d", &s ,&v1, &v2, &t1, &t2);
int m=t1+s*v1+t1;
int n=t2+s*v2+t2;
if(m<n) printf("First\n");
else if(m>n) printf("Second\n");
else printf("Friendship\n");
return 0;
}

  

Round #427 A. Key races(Div.2)的更多相关文章

  1. Codeforces Round #427 (Div. 2) Problem A Key races (Codeforces 835 A)

    Two boys decided to compete in text typing on the site "Key races". During the competition ...

  2. CodeForces 835C - Star sky | Codeforces Round #427 (Div. 2)

    s <= c是最骚的,数组在那一维开了10,第八组样例直接爆了- - /* CodeForces 835C - Star sky [ 前缀和,容斥 ] | Codeforces Round #4 ...

  3. CodeForces 835D - Palindromic characteristics | Codeforces Round #427 (Div. 2)

    证明在Tutorial的评论版里 /* CodeForces 835D - Palindromic characteristics [ 分析,DP ] | Codeforces Round #427 ...

  4. Codeforces Round #427 (Div. 2)—A,B,C,D题

    A. Key races 题目链接:http://codeforces.com/contest/835/problem/A 题目意思:两个比赛打字,每个人有两个参数v和t,v秒表示他打每个字需要多久时 ...

  5. Codeforce 835A - Key races

    Two boys decided to compete in text typing on the site "Key races". During the competition ...

  6. Codeforces Round #539&#542&#543&#545 (Div. 1) 简要题解

    Codeforces Round #539 (Div. 1) A. Sasha and a Bit of Relax description 给一个序列\(a_i\),求有多少长度为偶数的区间\([l ...

  7. Codeforces Round VK Cup 2015 - Round 1 (unofficial online mirror, Div. 1 only)E. The Art of Dealing with ATM 暴力出奇迹!

    VK Cup 2015 - Round 1 (unofficial online mirror, Div. 1 only)E. The Art of Dealing with ATM Time Lim ...

  8. Codeforces Round #542 [Alex Lopashev Thanks-Round] (Div. 2) 题解

    Codeforces Round #542 [Alex Lopashev Thanks-Round] (Div. 2) 题目链接:https://codeforces.com/contest/1130 ...

  9. Codefroces Round#427 div2

    A. Key races time limit per test 1 second memory limit per test 256 megabytes input standard input o ...

随机推荐

  1. Android自定义简洁版EditText

    Android开发中有些主题的EditText不能让我们满意,我们通常希望文本输入框是一条直线,这样显得简洁又美观. 这里我们自定义了一个MyEditText类,继承EditText类,可以实现一条线 ...

  2. twisted学习之reactor

    reactor是twisted框架里面一个很重要的抽象,它为我们实现了循环,所以我们不用再去实现循环了. reactor有如下特点: 1.reactor循环会一致运行下去,可以使用Ctrl+C或者相关 ...

  3. R语言统计分析技术研究 特征值选择技术要点

    特征值选择技术要点                          作者:王立敏 文章来源:  网络 1.特征值 特征值是线性代数中的一个重要概念.在数学,物理学,化学,计算机等领域有着广泛的应用. ...

  4. UIPopoverPresentationController使用

    UIPopoverPresentationController是什么? iOS8.0之后引入的一个方便开发者创建带箭头的弹出控制器,类似qq消息页面点击右上角加号弹出的视图. UIPopoverPre ...

  5. echarts3 清空上一次加载的series数据

    今天做图表的时候发现了一个问题,想和大家分享一下 我有一个下拉选框,每次选中都切换不同的数据,数据是从后台查询获取的,但是如果后台返回了数据每次渲染都没有问题,如果后台没有返回数据,但是我在渲染图表的 ...

  6. 梳理spring的层次结构的神器

    今天发现一个快速搞定spring层次结构的神器:效果如下 这是用idea编辑器直接生成的.还可以显示方法属性等等.简直神器.谁用谁知道... 操作如下:

  7. jquery fadeIn用法

    $("#msgSpan").fadeIn("slow"); setTimeout('$("#msgSpan").hide("slo ...

  8. celery的使用

    1.celery的任务调度 # -*- coding: utf-8 -*- import threading from bs4 import BeautifulSoup from tornado im ...

  9. Apollo框架试玩

    2017年7月5日,百度举行了AI开发者大会,在会上发布了Apollo项目,并进行了演示,该项目在Github上已经能够被访问.出于一个程序员的好奇,昨天试玩了一把,确实不错. http://apol ...

  10. Linux的同步访问技术

    1.中断屏蔽: 单CPU范围内避免竞态的一种简单方法:在进入临界区之前屏蔽系统的中断.中断屏蔽将使得中断与进程之间的并发不再发生,而且Linux内核的进程调度等操作都依赖中断来实现,内核抢占式进程之间 ...