{"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\"\u003eMr. Frog recently studied how to add two fractions up, and he came up with an evil idea to trouble you by asking you to calculate the result of the formula below:\u003cbr\u003e\u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/650fe88d39f181b40723f72d85799ace?v\u003d1715580104\"\u003e\u003cbr\u003e\u003cbr\u003eAs a talent, can you figure out the answer correctly?\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line contains only one integer T, which indicates the number of test cases.\u003cbr\u003e\u003cbr\u003eFor each test case, the first line contains only one integer n ($n\\leq\u0026#x14; 8$).\u003cbr\u003e\u003cbr\u003eThe second line contains n integers: $a_1, a_2,\\cdots a_n (1\\leq a_i \\leq 10$).\u003cbr\u003eThe third line contains n integers: $b_1, b_2,\\cdots ,b_n (1\\leq b_i \\leq 10)$."}},{"title":"Output","value":{"format":"HTML","content":"For each case, print a line “Case #x: p q”, where x is the case number (starting from 1) and p/q indicates the answer.\u003cbr\u003e\u003cbr\u003eYou should promise that p/q is irreducible."}},{"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\u003e1\r\n2\r\n1 1\r\n2 3\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase #1: 1 2\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\u003eHere are the details for the first sample:\u003cbr\u003e2/(1+3/1) \u003d 1/2\u003cbr\u003e"}}]}