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 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 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 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.

题解:可以说是很水了

 #include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
ll gcd(ll a,ll b){
return b?gcd(b,a%b):a;
}
const int N=;
const int mod=1e9+; int main()
{
std::ios::sync_with_stdio(false);
int s,v1,v2,t1,t2;
cin>>s>>v1>>v2>>t1>>t2;
int s1=s*v1+*t1;
int s2=s*v2+*t2;
if(s1<s2) cout<<"First"<<endl;
else if(s1==s2) cout<<"Friendship"<<endl;
else cout<<"Second"<<endl;
return ;
}

Codeforce 835A - Key races的更多相关文章

  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. Round #427 A. Key races(Div.2)

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

  3. 【Codeforces Round #427 (Div. 2) A】Key races

    [Link]:http://codeforces.com/contest/835/problem/A [Description] [Solution] 傻逼题. [NumberOf WA] [Revi ...

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

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

  5. Codefroces Round#427 div2

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

  6. Key/Value之王Memcached初探:二、Memcached在.Net中的基本操作

    一.Memcached ClientLib For .Net 首先,不得不说,许多语言都实现了连接Memcached的客户端,其中以Perl.PHP为主. 仅仅memcached网站上列出的语言就有: ...

  7. Dapper.Contrib:GetAsync<T> only supports an entity with a [Key] or an [ExplicitKey] property

    异常处理:http://www.cnblogs.com/dunitian/p/4523006.html#dapper 原来Model是这样滴 修改后是这样滴 注意点:Model里面的Table和Key ...

  8. Redis百亿级Key存储方案(转)

    1 需求背景 该应用场景为DMP缓存存储需求,DMP需要管理非常多的第三方id数据,其中包括各媒体cookie与自身cookie(以下统称supperid)的mapping关系,还包括了supperi ...

  9. 【详细教程】论android studio中如何申请百度地图新版Key中SHA1值

    一.写在前面 现在越来越多的API接口要求都要求提供我们的项目SHA1值,开发版目前还要求不高,但是发布版是必定要求的.而目前定位在各大APP中也较为常见,当下主流的百度地图和高德地图都在申请的时候会 ...

随机推荐

  1. dedecms如何去除后台登陆验证码

    用dedecms批量建站一般直接把文件打包复制,然后导入数据库,一个新网站就好了,但有时后台一直无法登录,提示验证码错误.那我们就想怎么把验证码关闭,现在就给大家解决织梦去掉后台登陆验证码.我们知道d ...

  2. 帝国cms调用栏目自定义字段(栏目简介)如何操作

    开源的cms就像一个操作系统,可以满足大部分人的需求,如果你想增加一些特殊的功能,那就二次开发呗,就像APP一样.帝国cms默认的栏目是没有调用栏目自定义字段的,我们可以增加一些概述类的文字,让读者对 ...

  3. 帝国cms修改栏目后文章列表的url错误怎么解决

    修改了某个栏目的目录地址,原本是/abc/,现在改成了/ab/,重新生成了栏目页面/ab/和文章页面/ab/*.html,但是栏目页的列表文章url还是/abc/*.html(正确的url应该是/ab ...

  4. 常见Chrome 插件

    Chrome插件网:http://chromecj.com/downloadstart.html Chrome浏览器:http://chromecj.com/chrome/2014-09/177.ht ...

  5. Sublime Text 许可证

    ----- BEGIN LICENSE Alexander Single User License EA7E- 51F47F09 4EAB1285 7827EFF0 8B1207DC A76A6EA3 ...

  6. 对 data属性的使用之一

  7. [附POC]Apache Struts2最新(CVE-2017-5638,S02-45)POC

    #! /usr/bin/env python # encoding:utf-8 import urllib2 import sys from poster.encode import multipar ...

  8. curl不能支持https问题

    前面说了 update nss 并没有解决问题. 想办法重新安装一下:CURL 1.下载安装包 [root@mycentos ~]# wget https://curl.haxx.se/downloa ...

  9. css--clearfix浮动

    解读浮动闭合最佳方案:clearfix: http://www.daqianduan.com/3606.html clearfix清除浮动进化史:http://www.admin10000.com/d ...

  10. tcpdump 选项及过滤规则

    tcpdump tcp -i eth1 -t -s 0 -c 100 and dst port ! 22 and src net 192.168.1.0/24 -w ./target.cap (1)t ...