// No.35 タイパー高橋 // https://yukicoder.me/problems/no/35 // #include #include using namespace std; pair do_type(unsigned int N); int main() { unsigned int N; cin >> N; pair ans = do_type(N); cout << ans.first << " " << ans.second << endl; } pair do_type(unsigned int N) { unsigned int typed = 0; unsigned int missed = 0; for (auto i = 0; i < N; ++i) { unsigned int limit; string s; cin >> limit >> s; unsigned int can_type = min(static_cast(s.size()), limit * 12 / 1000); if (can_type < s.size()) { missed += s.size() - can_type; } typed += can_type; } return make_pair(typed, missed); }