1 #include<iostream> 2 #include<cstdio> 3 #include <map> 4 #include <string> 5 using namespace std; 6 int main() 7 { 8 map<string, int> m; 9 long int N; 10 int K; 11 cin >> N >> K; 12 for (int i = 0; i < N; i++) 13 { 14 char id[30]; 15 int n; 16 scanf("%s%d",id,&n); 17 if (n < K)n = K; 18 m[id]+= n; 19 } 20 long int M; 21 scanf("%ld",&M); 22 for (int i = 0; i < M; i++) 23 { 24 char id[30]; 25 scanf("%s",id); 26 if (m.find(id) == m.end()) 27 { 28 printf("No Info "); 29 } 30 else 31 printf("%d ",m[id]); 32 } 33 return 0; 34 }