Submission #167936

#TimeUsernameProblemLanguageResultExecution timeMemory
167936ToniBGo (COCI16_go)C++14
50 / 50
2 ms396 KiB
#include <iostream>

using namespace std;

int main(){
    int n;
    cin >> n;
    
    int sol1 = 0, naj = 0;
    string sol2;
    
    for(int i = 0; i < n; ++i){
    	string c;
    	int a, b;
    	
    	cin >> c >> b >> a;
    	
    	int broj = 0;
    	
    	while(a >= b){
    		broj++;
    		a -= b;
    		a += 2;
		}
    	
    	sol1 += broj;
    	
    	if(broj > naj){
    		naj = broj;
    		sol2 = c;
		}
    	
	}
	
	cout << sol1 << endl << sol2;


	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...