• Key races


    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 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 s, v1, 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.

    这题挺简单

     1 #include <iostream>
     2 using namespace std;
     3 
     4 int main() {
     5     int a,b,c,d,e;
     6     cin>>a>>b>>c>>d>>e;
     7     long long x=a*b+d*2;
     8     long long y=a*c+e*2;
     9     if(x>y)
    10         cout<<"Second"<<endl;
    11     else if(x<y)
    12         cout<<"First"<<endl;
    13     else
    14         cout<<"Friendship"<<endl;
    15     return 0;
    16 }
  • 相关阅读:
    通配符^与not like 区别
    SQL语句
    身份证的性别验证(摘抄)
    基于VirtualBox虚拟机安装Ubuntu教程
    VMware手动添加centos7硬盘图文操作及分区超详细
    acl权限命令
    linux查看分区是否开启acl权限
    CentOS7上Docker简单安装及nginx部署
    Docker安装ngnix使用ping报错
    centos7安装mysql5.6
  • 原文地址:https://www.cnblogs.com/zllwxm123/p/7266778.html
Copyright © 2020-2023  润新知