Submission #293939

#TimeUsernameProblemLanguageResultExecution timeMemory
2939397_7_7Go (COCI16_go)C++17
50 / 50
1 ms384 KiB
#include <bits/stdc++.h>

using namespace std;

int n;
int mx;
int cnt;
string s;
string res;
int main()
{
    ios_base::sync_with_stdio(false);

    cin >> n;
    for(int i = 1; i <= n; i ++){
        int x, y;
        cin >> s >> x >> y;
        int ans = 0;
        if(y >= x) cnt ++, y -= x, ans ++;
        cnt += (y / (x - 2));
        ans += (y / (x - 2));
        if(ans > mx){
            mx = ans;
            res = s;
        }
    }
    cout << cnt << "\n" << res << "\n";
}

#Verdict Execution timeMemoryGrader output
Fetching results...