A. Contest


 #include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;

int main()
{
    int a,b,c,d;
    cin >> a >> b >> c >> d;

    int misha = max((3 * a) / 10 , (a - ((a / 250) * c)));
    int vasya = max ( (3 * b)/10, ( b - ( (b/250) * d)) );

    if(misha > vasya)
    {
        cout<<"Misha\n";
    }

    else if(misha < vasya)
    {
        cout << "Vasya\n";
    }

    else
    {
        cout << "Tie\n";
    }

    return 0;
}

Comments

Popular posts from this blog

SPOJ-CMG - Collecting Mango

LeetCode Palindrome Number

Hacker Rank The Power Sum