Codeforce 835A - Key races

时间:2021-01-04 09:05:44

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 &num;427 &lpar;Div&period; 2&rpar; Problem A Key races &lpar;Codeforces 835 A&rpar;

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

  2. Round &num;427 A&period; Key races&lpar;Div&period;2&rpar;

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

  3. 【Codeforces Round &num;427 &lpar;Div&period; 2&rpar; A】Key races

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

  4. Codeforces Round &num;427 &lpar;Div&period; 2&rpar;—A,B,C,D题

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

  5. Codefroces Round&num;427 div2

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

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

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

  7. Dapper&period;Contrib:GetAsync&lt&semi;T&gt&semi; only supports an entity with a &lbrack;Key&rsqb; or an &lbrack;ExplicitKey&rsqb; 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. 设计 api&comma; url 的原则

    设计 api, url 的原则 做微信公众号的项目,账号体系使用微信的 openid.现在增加需求,要求适应 web 端--做成普通的 web 项目.然后 url 的变化:我想给现有的 url 加上 ...

  2. swift-Array&lpar;数组)

    Swift 数组用于存储相同类型的值的顺序列表.Swift 要严格检查,不允许不同类型的值在同一个数组中 声明一个数组 var someArray = [SomeType]() var someArr ...

  3. 使用scp命令下载服务器文件

    scp -P 7022 admin@ip:/newnow/mysql/backup.sql 7birds.sql -P 指定端口号,默认为22

  4. 使用MySQL WorkBench导出数据库

    1. 在MySQL WorkBench的Server Administrator中双击要连接的数据库: 2. 点击左边的Data Export,在右边的数据库列表中选择要导出的数据库: 3. Expo ...

  5. 微信公众平台开发接口PHP SDK完整版(转载)

    <?php/*    方倍工作室 http://www.fangbei.org/    CopyRight 2015 All Rights Reserved*/ define("TOK ...

  6. Same Tree

    Given two binary trees, write a function to check if they are equal or not. Two binary trees are con ...

  7. 采用post的方式提交数据

    1)说明:

  8. CI当开启URL重写的时候,报错500 Internal Server Error

    Internal Server Error The server encountered an internal error or misconfiguration and was unable to ...

  9. sublime简单配置

    Preferences------->settings user { "font_face": "Courier New", "font_siz ...

  10. IOS tableViewCell单元格重用中的label重叠的问题

    参考:http://zhidao.baidu.com/link?url=_oMUTo5SxUY6SBaxYLsIpN3i2sZ6SKG35MVlPJd2cNmUf9TGQFkKXX9EXwSwti0n ...