Submit | All submissions | Best solutions | Back to list |
EIUCRDT - Earned Credits |
Khanh is asking for your help in calculating his total credit. He gives you the list of courses and numbers of credits of each course and the list of grades for each course.
Only courses with grades larger than or equal to 50 are counted. Khanh needs to know the how many credits he gained.
Input
- The first line contains one integer N - the number of courses to be calculated.
- The N next lines each contains a string S and an integer c where S is the ID of the course and c is the number of credits of that course.
- The last N lines each contains an integer G and a string S where G is the grade of the course that has ID of S.
Output
Print out only one line contains the total number of credits that Khanh gained.
Sample
Input |
Output |
5 CSE101 4 CSE102 4 CSE103 1 CSE104 3 CSE105 2 70 CSE101 80 CSE102 60 CSE105 40 CSE104 10 CSE103 |
10 |
Added by: | Ha Minh Ngoc |
Date: | 2019-11-08 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | CSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG FSHARP GO JAVA JS-MONKEY NODEJS PHP PYTHON PYPY PYPY3 PYTHON3 RUBY SQLITE SWIFT VB.NET |