{"trustable":true,"prependHtml":"\u003cstyle\u003e.statText pre { font-size: 12px; }\ntable {display:block !important; width:100%; }\ntable tbody {display:block !important; width:100%; }\ntable tbody tr { width:100% !important;display: block;}\ntable tbody tr td.statText { margin-left: 5px; display: inline-block; width: fit-content; }\ntable tbody tr td.statText br { display: block; content: \" \";line-height: 12px;margin: 12px 0;}\ntable tbody tr td.statText table table pre {\n white-space: pre-wrap;\n text-overflow: ellipsis;\n word-break: break-all;\n}\ntd { padding: 0 !important; border: none !important; }\npre { line-height: normal; margin: 0; }\n\u003c/style\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\n \n \t\t\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd colspan\u003d\"2\" class\u003d\"statText\"\u003e\u003ch3\u003eProblem Statement\u003c/h3\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003e\u003cp\u003e\nCat Noku has a simple undirected graph with n nodes, numbered 0 through n-1.\nYou are given the int[] \u003cb\u003ecolor\u003c/b\u003e.\nFor each valid i, node i in this graph has color \u003cb\u003ecolor\u003c/b\u003e[i].\nYou are also given two equally-long int[]s: \u003cb\u003ea\u003c/b\u003e and \u003cb\u003eb\u003c/b\u003e.\nFor each valid j the graph contains an edge that connects \u003cb\u003ea\u003c/b\u003e[j] and \u003cb\u003eb\u003c/b\u003e[j].\n\u003c/p\u003e\n\n\u003cp\u003e\nA walk in the graph is a sequence of nodes in which each pair of consecutive nodes is connected by an edge.\nCat Noku would like to visit all nodes in the graph.\nMore precisely, he is looking for a walk with the following properties:\n\u003c/p\u003e\u003cul\u003e\n\u003cli\u003eThe walk visits each node exactly once.\u003c/li\u003e\n\u003cli\u003eThe walk may start and end in any node of the graph.\u003c/li\u003e\n\u003cli\u003eSuppose the visited nodes are c\u003csub\u003e1\u003c/sub\u003e, c\u003csub\u003e2\u003c/sub\u003e, ..., c\u003csub\u003en\u003c/sub\u003e, in this order. Whenever c\u003csub\u003ei\u003c/sub\u003e and c\u003csub\u003ej\u003c/sub\u003e have the same color, all nodes visited between c\u003csub\u003ei\u003c/sub\u003e and c\u003csub\u003ej\u003c/sub\u003e must also have that color. (Formally, for each k between i and j, node c\u003csub\u003ek\u003c/sub\u003e must have the same color as c\u003csub\u003ei\u003c/sub\u003e and c\u003csub\u003ej\u003c/sub\u003e.)\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003e\nHelp Cat Noku count the number of valid walks.\nSince this number can get very large, return it modulo 10^9+7.\n\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd colspan\u003d\"2\" class\u003d\"statText\"\u003e\u0026nbsp;\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd colspan\u003d\"2\" class\u003d\"statText\"\u003e\u003ch3\u003eDefinition\u003c/h3\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003e\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003eClass:\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003eRainbowGraph\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003eMethod:\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003ecountWays\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003eParameters:\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003eint[], int[], int[]\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003eReturns:\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003eint\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003eMethod signature:\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003eint countWays(int[] color, int[] a, int[] b)\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd colspan\u003d\"2\" class\u003d\"statText\"\u003e(be sure your method is public)\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd colspan\u003d\"2\" class\u003d\"statText\"\u003e\u0026nbsp;\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd colspan\u003d\"2\" class\u003d\"statText\"\u003e\u003ch3\u003eConstraints\u003c/h3\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align\u003d\"center\" valign\u003d\"top\" class\u003d\"statText\"\u003e-\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003e\u003cb\u003ecolor\u003c/b\u003e will have between 2 and 100 elements, inclusive.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align\u003d\"center\" valign\u003d\"top\" class\u003d\"statText\"\u003e-\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003eEach element of \u003cb\u003ecolor\u003c/b\u003e will be between 0 and 9, inclusive. \u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align\u003d\"center\" valign\u003d\"top\" class\u003d\"statText\"\u003e-\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003eEach number from 0 to 9 will occur at most 10 times as an element of \u003cb\u003ecolor\u003c/b\u003e.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align\u003d\"center\" valign\u003d\"top\" class\u003d\"statText\"\u003e-\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003e\u003cb\u003ea,b\u003c/b\u003e will contain between 1 and 2500 elements, inclusive.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align\u003d\"center\" valign\u003d\"top\" class\u003d\"statText\"\u003e-\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003eThe edges (\u003cb\u003ea\u003c/b\u003e[i], \u003cb\u003eb\u003c/b\u003e[i]) will describe a simple undirected graph.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd colspan\u003d\"2\" class\u003d\"statText\"\u003e\u0026nbsp;\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd colspan\u003d\"2\" class\u003d\"statText\"\u003e\u003ch3\u003eExamples\u003c/h3\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align\u003d\"center\" nowrap\u003d\"true\" class\u003d\"statText\"\u003e0)\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003e\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003e{0,0,0,1,1,1,2,2,2}\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003e{0,1,2,3,4,5,6,7,8,0,3,6}\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003e{1,2,0,4,5,3,7,8,6,3,6,0}\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003eReturns: 0\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd colspan\u003d\"2\" class\u003d\"statText\"\u003e\u003cp\u003e\n\u003cimg src\u003d\"CDN_BASE_URL/670354aa5f9bda796ab64ef8f78f6455?v\u003d1719682023\"\u003e\n\u003c/p\u003e\n\nIn this case, there are no valid walks.\n\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align\u003d\"center\" nowrap\u003d\"true\" class\u003d\"statText\"\u003e1)\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003e\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003e{0,0,0,1,1,1,2,2,2}\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003e{0,1,2,3,4,5,6,7,8,0,4,8}\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003e{1,2,0,4,5,3,7,8,6,3,7,2}\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003eReturns: 24\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd colspan\u003d\"2\" class\u003d\"statText\"\u003e\u003cp\u003e\n\u003cimg src\u003d\"CDN_BASE_URL/d858336c99a36c032a9e9e18e2d58cfa?v\u003d1719682023\"\u003e\n\u003c/p\u003e\n\nFor example, a valid walk is 1,0,2,6,8,7,4,5,3. An example of an invalid walk would be 3,0,1,2,6,8,4,5, since even though it is a walk that visits each node exactly once, it does not satisfy the color constraint since the first and last nodes are the same color, but some middle nodes are not the same color.\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align\u003d\"center\" nowrap\u003d\"true\" class\u003d\"statText\"\u003e2)\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003e\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003e{0,3,9,8,6,4}\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003e{0,0,0,0,0,1,1,1,1,2,2,2,3,3,4}\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003e{1,2,3,4,5,2,3,4,5,3,4,5,4,5,5}\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003eReturns: 720\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd colspan\u003d\"2\" class\u003d\"statText\"\u003eIn this case, any permutation of nodes forms a valid walk.\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align\u003d\"center\" nowrap\u003d\"true\" class\u003d\"statText\"\u003e3)\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003e\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003e{0,0,0,0,3,3,3,6,6,9}\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003e{9,9,9,9,9,9,9,9,9,7,7,7,7,7,7,7,4,4,4,4,0,1,2,4,5,8}\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003e{0,1,2,3,4,5,6,7,8,0,1,2,3,4,5,6,0,1,2,3,1,2,3,5,6,7}\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003eReturns: 64\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd colspan\u003d\"2\" class\u003d\"statText\"\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align\u003d\"center\" nowrap\u003d\"true\" class\u003d\"statText\"\u003e4)\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003e\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003e{3,1,4,1,5,9,2,6,5,3,5}\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003e{1}\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003e{2}\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003eReturns: 0\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd colspan\u003d\"2\" class\u003d\"statText\"\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align\u003d\"center\" nowrap\u003d\"true\" class\u003d\"statText\"\u003e5)\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/td\u003e\u003ctd class\u003d\"statText\"\u003e\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003e{2, 4, 3, 0, 2, 3, 3, 3, 4, 2, 1, 2, 0, 0, 4, 1, 1, 0, 4, 4, 1, 0, 3, 2, 1}\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003e{5, 7, 23, 20, 10, 9, 23, 7, 7, 17, 0, 20, 1, 24, 7, 5, 11, 13, 14, 9, 0, 13, 4, 9, 5,\n24, 22, 24, 14, 12, 7, 4, 6, 19, 13, 5, 6, 10, 0, 2, 6, 20, 22, 2, 10, 19, 2, 24, 21,\n20, 21, 2, 23, 24, 9, 19, 19, 21, 22, 2, 7, 14, 13, 12, 2, 11, 19, 12, 0, 8, 8, 1,\n18, 20, 10, 1, 13, 21, 14, 1, 18, 21, 13, 15, 14, 15, 7, 6, 21, 10, 6, 24, 21, 4, 24,\n3, 2, 18, 1, 24, 6, 20, 8, 16, 0, 12, 5, 11, 4, 13, 3, 16, 19, 15, 24, 24, 16, 20, 13,\n18, 5, 4, 6, 23, 8, 6, 18, 15, 19, 3, 16, 17, 18, 10, 14, 14, 23, 6, 13, 7, 13, 18, 10,\n19, 22, 18, 23, 5, 16, 17, 23, 4, 14, 24, 5, 20, 11, 3, 17, 23, 12, 6, 22, 8, 4, 17, 16,\n8, 17, 17, 1, 4, 6, 7, 17, 17, 21, 23, 0, 15, 21, 16, 12, 20, 19, 23, 7, 21, 18, 5, 24,\n24, 8, 6, 5, 9, 21, 15, 8, 11, 10, 19, 5, 24, 19, 10, 11, 0, 23, 12, 15, 18, 20, 10, 15,\n13, 3, 18, 6, 22, 0, 4, 24, 19, 16, 0, 17, 7, 4, 0, 9, 4, 10, 0, 23, 16, 17, 8, 5, 12,\n22, 11, 11, 5, 13, 5, 4, 20, 17, 20, 0, 10, 4, 18, 3, 3, 6, 21, 9, 7, 18, 1, 14, 5, 20,\n10, 12, 20, 9, 15, 18, 5, 12, 11, 11, 20, 11, 15, 6, 2, 6, 19, 13, 15, 15, 21, 22, 9, 19,\n16, 8, 9, 15, 8, 21, 22, 19, 18, 9, 2}\n\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003e{21, 1, 11, 19, 24, 1, 7, 17, 20, 20, 8, 6, 12, 21, 13, 2, 13, 15, 22, 11, 17, 19, 0,\n5, 14, 3, 7, 11, 2, 15, 18, 5, 16, 12, 3, 8, 8, 3, 2, 24, 14, 23, 6, 23, 2, 1, 4, 6, 13,\n9, 17, 6, 12, 20, 23, 16, 9, 10, 21, 11, 14, 3, 1, 2, 9, 21, 21, 7, 19, 4, 13, 10, 6,\n15, 19, 0, 9, 23, 10, 6, 1, 2, 2, 18, 20, 16, 19, 10, 4, 9, 19, 14, 7, 10, 9, 16, 1, 16,\n8, 16, 4, 3, 9, 11, 23, 5, 19, 4, 14, 20, 2, 7, 22, 5, 4, 7, 5, 1, 23, 4, 23, 23, 21, 1,\n19, 15, 8, 22, 11, 1, 14, 13, 17, 20, 1, 8, 18, 7, 22, 3, 14, 0, 12, 14, 10, 5, 3, 1, 13,\n8, 15, 13, 18, 1,13, 22, 8, 8, 1, 10, 22, 12, 1, 24, 20, 10, 17, 22, 23, 22, 16, 3, 23, \n11, 3, 14, 18, 8, 14, 2, 0, 9, 3, 2, 23, 22, 9, 8, 9, 11, 0, 15, 15, 5, 24, 4, 20, 9, 12,\n6, 16, 18, 22, 12, 15, 15, 18, 9, 24, 18, 4, 22, 12, 13, 1, 12, 0, 3, 9, 0, 7, 1, 17, 17,\n23, 16, 12, 15, 12, 6, 22, 17, 7, 11, 14, 20, 2, 2, 17, 16, 2, 22, 1, 0, 0, 3, 19, 8, 11,\n11, 12, 8, 22, 24, 22, 21, 3, 16, 12, 4, 13, 21, 12, 10, 0, 0, 21, 5, 3, 14, 10, 7, 11, 14,\n10, 18, 3, 0, 17, 16, 13, 24, 24, 3, 17, 15, 16, 21, 3, 4, 16, 14, 11, 7, 14, 24, 2, 2, 17, 7}\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003cpre\u003eReturns: 983979105\u003c/pre\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"statText\"\u003e\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd colspan\u003d\"2\" class\u003d\"statText\"\u003eDon\u0027t forget about the mod.\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003chr\u003e\u003cp\u003eThis problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved. \u003c/p\u003e\n \n "}}]}