#include #include #define REP(i,a) for(int i=0; i> N; /* 1000ミリ秒で12文字、999ミリ秒で11文字 mミリ秒で12m/1000文字を打つことができる */ int input_seconds, limit_words, type = 0, miss_type = 0; string s; REP(i,N) { cin >> input_seconds >> s; limit_words = 12*input_seconds / 1000; if (limit_words >= s.length()) type += s.length(); else { miss_type += s.length() - limit_words; type += s.length() - (s.length()-limit_words); } } cout << type << " " << miss_type << endl; return 0; }