{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp class\u003d\"MsoNormal\"\u003eYou are in a maze; seeing \u003cb\u003en\u003c/b\u003e doors in front of you in beginning. You can choose any door you like. The probability for choosing a door is equal for all doors.\u003c/p\u003e \n\u003cp class\u003d\"MsoNormal\"\u003eIf you choose the \u003cb\u003ei\u003csup\u003eth\u003c/sup\u003e\u003c/b\u003e door, it can either take you back to the same position where you begun in \u003cb\u003ex\u003csub\u003ei\u003c/sub\u003e\u003c/b\u003e minutes, or can take you out of the maze after \u003cb\u003ex\u003csub\u003ei\u003c/sub\u003e\u003c/b\u003e minutes. If you come back to the same position, you can\u0027t remember anything. So, every time you come to the beginning position, you have no past experience.\u003c/p\u003e \n\u003cp class\u003d\"MsoNormal\"\u003eNow you want to find the expected time to get out of the maze.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp class\u003d\"MsoNormal\"\u003eInput starts with an integer \u003cb\u003eT (\u003c/b\u003e\u003cb\u003e≤ 100)\u003c/b\u003e, denoting the number of test cases.\u003c/p\u003e \n\u003cp class\u003d\"MsoNormal\"\u003eEach case contains a blank line and an integer \u003cb\u003en (1 ≤ n ≤ 100)\u003c/b\u003e denoting the number of doors. The next line contains \u003cb\u003en\u003c/b\u003e space separated integers. If the \u003cb\u003ei\u003csup\u003eth\u003c/sup\u003e\u003c/b\u003e integer \u003cb\u003e(x\u003csub\u003ei\u003c/sub\u003e)\u003c/b\u003e is positive, you can assume that the \u003cb\u003ei\u003csup\u003eth\u003c/sup\u003e\u003c/b\u003e door will take you out of maze after \u003cb\u003ex\u003csub\u003ei\u003c/sub\u003e\u003c/b\u003e minutes. If it\u0027s negative, then the \u003cb\u003ei\u003csup\u003eth\u003c/sup\u003e\u003c/b\u003e door will take you back to the beginning position after \u003cb\u003eabs(x\u003csub\u003ei\u003c/sub\u003e)\u003c/b\u003e minutes. You can safely assume that \u003cb\u003e1 ≤ abs(x\u003csub\u003ei\u003c/sub\u003e) ≤ 10000\u003c/b\u003e.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp class\u003d\"MsoNormal\"\u003eFor each case, print the case number and the expected time to get out of the maze. If it\u0027s impossible to get out of the maze, print \u003cb\u003e\u0027inf\u0027\u003c/b\u003e. Print the result in \u003cb\u003ep/q\u003c/b\u003e format. Where \u003cb\u003ep\u003c/b\u003e is the numerator of the result and \u003cb\u003eq\u003c/b\u003e is the denominator of the result and they are relatively prime. See the samples for details.\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cp class\u003d\"MsoNoSpacing\"\u003e\u003cspan\u003e3\u003c/span\u003e\u003c/p\u003e \n\u003cp class\u003d\"MsoNoSpacing\"\u003e\u003cspan\u003e\u0026nbsp;\u003c/span\u003e\u003c/p\u003e \n\u003cp class\u003d\"MsoNoSpacing\"\u003e\u003cspan\u003e1\u003c/span\u003e\u003c/p\u003e \n\u003cp class\u003d\"MsoNoSpacing\"\u003e\u003cspan\u003e1\u003c/span\u003e\u003c/p\u003e \n\u003cp class\u003d\"MsoNoSpacing\"\u003e\u003cspan\u003e\u0026nbsp;\u003c/span\u003e\u003c/p\u003e \n\u003cp class\u003d\"MsoNoSpacing\"\u003e\u003cspan\u003e2\u003c/span\u003e\u003c/p\u003e \n\u003cp class\u003d\"MsoNoSpacing\"\u003e\u003cspan\u003e-10 -3\u003c/span\u003e\u003c/p\u003e \n\u003cp class\u003d\"MsoNoSpacing\"\u003e\u003cspan\u003e\u0026nbsp;\u003c/span\u003e\u003c/p\u003e \n\u003cp class\u003d\"MsoNoSpacing\"\u003e\u003cspan\u003e3\u003c/span\u003e\u003c/p\u003e \n\u003cp class\u003d\"MsoNoSpacing\"\u003e\u003cspan\u003e3 -6 -9\u003c/span\u003e\u003c/p\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cp class\u003d\"MsoNoSpacing\"\u003e\u003cspan\u003eCase 1: 1/1\u003c/span\u003e\u003c/p\u003e \n\u003cp class\u003d\"MsoNoSpacing\"\u003e\u003cspan\u003eCase 2: inf\u003c/span\u003e\u003c/p\u003e \n\u003cp class\u003d\"MsoNoSpacing\"\u003e\u003cspan\u003eCase 3: 18/1\u003c/span\u003e\u003c/p\u003e"}}]}