Submission #94130

#TimeUsernameProblemLanguageResultExecution timeMemory
94130MrTEKGo (COCI16_go)C++14
50 / 50
2 ms376 KiB
#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;
typedef pair<int,int> ii;

const int N = 1e5 + 5;

int n,ans,ans2;
string s,t;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  cin >> n;
  for (int i = 1 ; i <= n ; i++) {
    int a,b;
    cin >> t >> a >> b;
    int step = 0;
    while(b >= a) {
      b = b - a + 2;
      step++;
    }
    if (step > ans) {
      s = t;
      ans = step;
    }
    ans2 += step;
  }
  cout << ans2 << endl << s << endl;
}
#Verdict Execution timeMemoryGrader output
Fetching results...