{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eIn college, a student may take several courses. for each course i, he earns a certain credit (c\u003csub\u003ei\u003c/sub\u003e), and a mark ranging from A to F, which is comparable to a score (s\u003csub\u003ei\u003c/sub\u003e), according to the following conversion table\u003cbr\u003e\u003ccenter\u003e\u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/a748e129f3ceecadb6b8f7a4685dc1ec?v\u003d1715369150\"\u003e\u003c/center\u003e \u003cbr\u003eThe GPA is the weighted average score of all courses one student may take, if we treat the credit as the weight. In other words,\u003cbr\u003e\u003ccenter\u003e\u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/f628aa7c3d1e85389f72d95d92c49a25?v\u003d1715369150\"\u003e\u003c/center\u003e \u003cbr\u003eAn additional treatment is taken for special cases. Some courses are based on “Pass/Not pass” policy, where stude nts earn a mark “P” for “Pass” and a mark “N” for “Not pass”. Such courses are not supposed to be considered in computation. These special courses must be ignored for computing the correct GPA.\u003cbr\u003eSpecially, if a student’s credit in GPA computation is 0, his/her GPA will be “0.00”.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"There are several test cases, please process till EOF.\u003cbr\u003eEach test case starts with a line containing one integer N (1 \u0026lt;\u003d N \u0026lt;\u003d 1000), the number of courses. Then follows N lines, each consisting the credit and the mark of one course. Credit is a positive integer and less than 10."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, print the GPA (rounded to two decimal places) as the answer."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5\r\n2 B\r\n3 D-\r\n2 P\r\n1 F\r\n3 A\r\n2\r\n2 P\r\n2 N\r\n6\r\n4 A\r\n3 A\r\n3 A\r\n4 A\r\n3 A\r\n3 A\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2.33\r\n0.00\r\n4.00\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cbr\u003eFor the first test case:\u003cbr\u003eGPA \u003d(3.0 * 2 + 1.0 * 3 + 0.0 * 1 + 4.0 * 3)/(2 + 3 + 1 + 3) \u003d 2.33\u003cbr\u003e\u003cbr\u003eFor the second test case: because credit in GPA computation is 0(P/N in additional treatment), so his/her GPA is “0.00”.\u003cbr\u003e"}}]}