{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eSupto\u0027s new job is really weird. He has to write articles on various topics. And instead of paying him according to the quality of his article, his boss has decided to pay him according to the total value of the characters he has used. To make the matters worse, not all the characters are even paid.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line contains the number of test cases, \u003ci\u003eN\u003c/i\u003e (0 \u003c \u003ci\u003eN\u003c/i\u003e ≤ 5). Each test describes an integer \u003ci\u003eK\u003c/i\u003e (0 \u003c \u003ci\u003eK\u003c/i\u003e ≤ 100), the number of paid characters. On next K lines there are table of paid characters and its values (character values are written in cents). Next, there is integer \u003ci\u003eM\u003c/i\u003e (0 \u003c \u003ci\u003eM\u003c/i\u003e ≤ 150000). Next \u003ci\u003eM\u003c/i\u003e lines contain an article itself. Each line can be up to 10000 characters length."}},{"title":"Output","value":{"format":"HTML","content":"For each test case print how much money Supto will get for an article in format ‘x.yy$’. Where x is\na number of dollars without leading zeros, and yy number of cents with one leading zero if necessary.\nExamples: ‘3.32$’, ‘13.07$’, ‘71.30$’, ‘0.09$’"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e\n1\n2\na 1\nb 2\n2\nFor extended ascii code (128 ~ 255), if you use char in C, it is signed.\nchar occupies 1 byte (8 bit) in most machines, that is, -128 ~ 127\n\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e\n0.09$\n\u003c/pre\u003e"}}]}