messages
listlengths
1
1
ground_truth
stringlengths
88
726k
dataset
stringclasses
2 values
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCompute A \\times B.\n\nConstrai...
[{"type": "stdin_stdout", "input": "101 110", "output": "11110\n"}, {"type": "stdin_stdout", "input": "101 111", "output": "11211\n"}, {"type": "stdin_stdout", "input": "101 101", "output": "10201\n"}, {"type": "stdin_stdout", "input": "100 110", "output": "11000\n"}, {"type": "stdin_stdout", "input": "100 111", "outpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCaracal is fighting with a monst...
[{"type": "stdin_stdout", "input": "1010000000000", "output": "1099511627775\n"}, {"type": "stdin_stdout", "input": "1110100001000", "output": "2199023255551\n"}, {"type": "stdin_stdout", "input": "1010000001000", "output": "1099511627775\n"}, {"type": "stdin_stdout", "input": "1011000000000", "output": "1099511627775\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi's house has only one s...
[{"type": "stdin_stdout", "input": "2 15", "output": "14\n"}, {"type": "stdin_stdout", "input": "2 14", "output": "13\n"}, {"type": "stdin_stdout", "input": "2 13", "output": "12\n"}, {"type": "stdin_stdout", "input": "2 17", "output": "16\n"}, {"type": "stdin_stdout", "input": "2 26", "output": "25\n"}, {"type": "stdi...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConsider a circle whose perimete...
[{"type": "stdin_stdout", "input": "45 0\nRRRRRRRBRB", "output": "537720622"}, {"type": "stdin_stdout", "input": "43 0\nBRRRRRRRRB", "output": "969323029"}, {"type": "stdin_stdout", "input": "74 0\nBRRRRRRRRB", "output": "590601443"}, {"type": "stdin_stdout", "input": "42 1\nBSRRRRRRRB", "output": "599074578"}, {"type"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nColoring of the vertices of a tr...
[{"type": "stdin_stdout", "input": "13\n5 6\n5 4\n2 8\n4 7\n8 9\n3 2\n10 4\n11 10\n2 4\n13 10\n1 8\n12 1", "output": "4 12\n"}, {"type": "stdin_stdout", "input": "13\n5 6\n5 4\n2 8\n4 7\n8 9\n3 2\n10 4\n11 10\n2 5\n13 10\n1 8\n12 1", "output": "4 16\n"}, {"type": "stdin_stdout", "input": "13\n5 6\n5 4\n2 8\n4 7\n1 9\n3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an undirected grap...
[{"type": "stdin_stdout", "input": "20 1\n6 1\n0 0\n0 -1\n1 17\n2 3\n23 2", "output": "170\n"}, {"type": "stdin_stdout", "input": "34 1\n6 1\n0 0\n0 -1\n1 13\n2 3\n23 2", "output": "527\n"}, {"type": "stdin_stdout", "input": "17 -1\n2 0\n-1 0\n0 8\n1 7\n4 4\n15 4", "output": "121\n"}, {"type": "stdin_stdout", "input": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have N irregular jigsaw piece...
[{"type": "stdin_stdout", "input": "10 10\n1 2 0 3\n1 0 2 0\n-1 1 3 0\n2 0 -2 0\n3 1 2 5\n0 1 6 -1\n3 0 1 -1\n1 4 3 -1\n1 2 1 3\n0 3 0 0", "output": "NO\n"}, {"type": "stdin_stdout", "input": "10 10\n1 2 0 3\n1 0 2 0\n-1 1 3 0\n2 0 -2 0\n3 1 2 5\n0 1 6 -1\n3 0 1 -1\n0 4 3 -1\n1 2 1 3\n0 3 0 0", "output": "NO\n"}, {"typ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWrite a program that reads the c...
[{"type": "stdin_stdout", "input": "0.0,0.0\n0.0,1.0\n1.0,1.0\n2.0,0.0\n1.0,-1.0", "output": "2.500000"}, {"type": "stdin_stdout", "input": "0.0,0.0\n0.0,1.0\n0.0,.11\n2.1,0.0\n1.1,-1.0", "output": "1.1655\n"}, {"type": "stdin_stdout", "input": "0.1,0.0\n0.0,1.0\n1.01,.0\n2.0,0.0\n1.0,-0.0", "output": "0.455\n"}, {"typ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAt Akabeko Elementary School, al...
[{"type": "stdin_stdout", "input": "2\n3 4\n13 4\n5\n789 289\n166 46\n9 4\n617 272\n972 303\n2\n11 5\n23 20\n0", "output": "13\n3\n1598397732\n1209243492\n1939462992\n1923746112\n1360317793\n23\n44\n"}, {"type": "stdin_stdout", "input": "2\n3 4\n13 4\n5\n789 289\n166 46\n9 4\n617 272\n972 303\n2\n11 5\n32 20\n0", "outp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nShe is an extraordinary girl. Sh...
[{"type": "stdin_stdout", "input": "2\n2\nYYZNNNNY\n4\nNNNYYNYNNNYYONYN", "output": "6\n10\n"}, {"type": "stdin_stdout", "input": "2\n2\nYYZNYNNN\n4\nNNNYYNYNNNYYNNYN", "output": "5\n10\n"}, {"type": "stdin_stdout", "input": "2\n2\nYYZNNNNY\n4\nNNNYNNYNYNYYONYN", "output": "6\n11\n"}, {"type": "stdin_stdout", "input": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOn Planet MM-21, after their Oly...
[{"type": "stdin_stdout", "input": "2 1\n5 2\n6 6\n2 0 0 2 1 -1\n1 1 0 0 -1 0\n0 0 0 0 0 1\n0 0 -1 0 0 0\n1 0 0 0 -1 1\n0 1 1 1 0 1\n6 1\n1 1 2 1 1 3\n6 1\n1 0 2 1 1 3\n12 1\n2 0 1 1 1 1 1 1 1 1 1 3\n13 1\n2 0 0 1 1 1 1 1 1 1 1 1 3\n0 0", "output": "-1\n-1\n-1\n4\n10\n10\n"}, {"type": "stdin_stdout", "input": "2 1\n5 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHideyuki is allowed by his fathe...
[{"type": "stdin_stdout", "input": "2 6 -1\n2 12 0\n6 18 9\n13 2 52\n1 2008 3\n0 0 0", "output": "8.0000000000\n13.0000000000\n48.0000035281\n1.0000000000\n1001.5029880478\n"}, {"type": "stdin_stdout", "input": "2 6 -1\n2 12 0\n6 18 5\n13 2 52\n1 2008 3\n0 0 0", "output": "8.0000000000\n13.0000000000\n52.0000000000\n1....
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNate U. Smith runs a railroad co...
[{"type": "stdin_stdout", "input": "2\n-10 1 10 1\n4\n-6 2 -2 -2 1 1\n-6 -2 -2 2 1 0\n12 2 1 -2 0 0\n11 -2 2 2 1 1\n8 12 -7 -3\n8\n4 -5 4 -2 1 2\n4 -2 4 9 1 0\n6 9 6 14 1 1\n-5 6 7 6 0 0\n1 0 1 10 0 0\n-5 0 -5 10 0 1\n-7 -1 7 0 0 1\n-1 -1 -1 -3 0 1", "output": "2\n3\n"}, {"type": "stdin_stdout", "input": "2\n-10 2 10 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDr. Fukuoka has placed a simple ...
[{"type": "stdin_stdout", "input": "3 3 10\nE..\n.#.\n...\n5 5 37\n####.\n.....\n.#S#.\n...#.\n#.##.\n5 10 1\n#.#..\n#....\n##.#.\n#..S.\n#....\n5 4 35\n.#.#\n....\n.##.\n.#S.\n...#\n0 0 0", "output": "1 3 E\n4 5 N\n5 4 S\n5 1 S\n"}, {"type": "stdin_stdout", "input": "3 3 10\nE..\n.#.\n...\n5 5 19\n####.\n.....\n.#S#.\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a complete graph of m v...
[{"type": "stdin_stdout", "input": "5\n2\n3\n4\n10\n6", "output": "17\n"}, {"type": "stdin_stdout", "input": "5\n2\n3\n3\n5\n6", "output": "11\n"}, {"type": "stdin_stdout", "input": "5\n2\n3\n5\n5\n6", "output": "13\n"}, {"type": "stdin_stdout", "input": "5\n2\n3\n4\n5\n6", "output": "12"}, {"type": "stdin_stdout", "in...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n1\n\n\nOutpu...
[{"type": "stdin_stdout", "input": "321", "output": ")))))))))))))))))))))())))((((((((((((((((((((((((\n"}, {"type": "stdin_stdout", "input": "222", "output": "))))))))))))()))))))))((((((((((((((((((((\n"}, {"type": "stdin_stdout", "input": "193", "output": ")))()))))))))))))))))(((((((((((((((((((\n"}, {"type": "std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor given n points in metric spa...
[{"type": "stdin_stdout", "input": "3\n1.2898350068806816 1.1467446289152408\n2.4176469021911005 0.7451543895838713\n1.341841261706021 1.7448621958767283", "output": "0.600374279\n"}, {"type": "stdin_stdout", "input": "3\n1.2898350068806816 1.8470651543589152\n3.7080917383371705 0.7451543895838713\n1.341841261706021 1....
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor given an integer $n$, print ...
[{"type": "stdin_stdout", "input": "5", "output": "1 2 3 4 5\n1 2 3 5 4\n1 2 4 3 5\n1 2 4 5 3\n1 2 5 3 4\n1 2 5 4 3\n1 3 2 4 5\n1 3 2 5 4\n1 3 4 2 5\n1 3 4 5 2\n1 3 5 2 4\n1 3 5 4 2\n1 4 2 3 5\n1 4 2 5 3\n1 4 3 2 5\n1 4 3 5 2\n1 4 5 2 3\n1 4 5 3 2\n1 5 2 3 4\n1 5 2 4 3\n1 5 3 2 4\n1 5 3 4 2\n1 5 4 2 3\n1 5 4 3 2\n2 1 3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya has a sequence a consistin...
[{"type": "stdin_stdout", "input": "5\n1000000000000000000 352839520853234088 165431853141398699 753467583475385837 895062156280564685\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "5\n1000000000000000000 352839520853234088 257894004782222768 753467583475385837 895062156280564685\n", "output": "4\n"}, {"type"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOn a chessboard with a width of ...
[{"type": "stdin_stdout", "input": "0 5\n-1 96762320 34608098\n243235878 312125306 50510976\n326016273 498514053 50510976\n614560077 445224816 25950222\n1077021507 901150398 37242747\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "0 5\n-1 96762320 34608098\n243235878 312125306 50510976\n326016273 498514053 907...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya is preparing a contest, an...
[{"type": "stdin_stdout", "input": "25\ndadddhrdhradrdzzzahazaddr\n582987584 321035417 414785252 587245865 701672370 65936511 563890835 134108386 387506178 22811155 989335244 1206131752 445085282 809768866 105799145 196558041 1131981383 134067229 875977231 488184174 41982468 225574390 702881847 937432062 185455403\n", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis is an interactive problem. ...
[{"type": "stdin_stdout", "input": "xjywrmrwqaytezhtqmcnrrjomslvcmevncvzeddnvqgkbusnbzrppdsuzsmcobmnslpvosunavayvdbxhtavvwodorwijxfjjlat\n50\n1 100\n2 99\n3 98\n4 97\n5 96\n6 95\n7 94\n8 93\n9 92\n10 91\n11 90\n12 89\n13 88\n14 87\n15 86\n16 85\n17 84\n18 83\n19 82\n20 81\n21 80\n22 91\n23 78\n24 77\n25 140\n26 75\n27 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA string is called diverse if it...
[{"type": "stdin_stdout", "input": "69\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\nabc\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNikolay lives in a two-storied h...
[{"type": "stdin_stdout", "input": "1\n100\n0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "1\n100\n0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000\n", "ou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nToday, Yasser and Adel are at th...
[{"type": "stdin_stdout", "input": "12\n3\n7 -4 5\n3\n7 -5 4\n3\n4 -5 7\n3\n5 -4 7\n4\n5 -5 -6 6\n5\n100 100 100 -50 50\n10\n11 5 -12 7 -10 20 30 -10 50 60\n10\n10 5 -14 7 -7 20 30 -50 50 60\n2\n1 1\n2\n-1 -1\n3\n1000000000 1010000000 1000000000\n3\n-1000000000 -1000000000 -1000000000\n", "output": "YES\nNO\nNO\nYES\nN...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a rooted tree cons...
[{"type": "stdin_stdout", "input": "10 6\n1 2\n1 3\n1 4\n2 5\n2 6\n5 7\n7 8\n7 9\n9 10\n4 3 8 9 10\n3 2 4 6\n3 4 1 5\n3 4 8 2\n2 6 10\n3 5 4 7\n", "output": "YES\nYES\nYES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "10 6\n1 2\n1 3\n1 4\n2 5\n2 6\n5 7\n7 8\n7 9\n9 10\n4 3 8 9 10\n3 2 4 6\n3 4 1 5\n3 4 8 1\n2 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPhoenix is picking berries in hi...
[{"type": "stdin_stdout", "input": "20 4\n0 1\n0 2\n0 0\n1 2\n3 2\n1 3\n1 3\n2 0\n3 1\n0 2\n3 3\n2 3\n2 0\n3 2\n1 2\n1 1\n1 1\n1 2\n0 0\n1 3\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "20 4\n0 1\n0 2\n0 0\n1 2\n3 2\n1 3\n1 3\n2 0\n3 1\n0 2\n3 3\n2 3\n4 0\n3 2\n1 2\n1 1\n1 1\n1 2\n0 0\n1 3\n", "output": "1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLee just became Master in Codefo...
[{"type": "stdin_stdout", "input": "3\n4 2\n1 13 7 17\n1 3\n6 2\n10 10 10 10 11 11\n3 3\n4 4\n1000000000 1000000000 1000000000 1000000000\n1 1 1 1\n", "output": "48\n42\n8000000000\n"}, {"type": "stdin_stdout", "input": "3\n4 2\n1 13 12 1\n1 3\n6 2\n10 10 10 10 11 11\n3 3\n4 4\n1000000000 1000000000 1000000000 10000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConsider a conveyor belt represe...
[{"type": "stdin_stdout", "input": "10\n1 2\nRC\n1 2\nDC\n2 1\nR\nC\n2 1\nD\nC\n7 6\nDRDDRR\nRDDDRR\nDRRRDD\nRRDRRR\nDDRRRR\nRRDRDR\nDDRDRC\n8 5\nDRDRD\nDRRRR\nRDRRD\nDDDRR\nRDDRR\nRRDDD\nDDRRR\nDDDRC\n8 3\nDDD\nDDR\nDRD\nRRR\nDRR\nDRD\nRRR\nRDC\n6 6\nDRDDDR\nDDDRDR\nRDDRRD\nDRRRRR\nRRRRRR\nDRDRRC\n6 8\nRRDDDRRR\nRDRDD...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMeka-Naruto plays a computer gam...
[{"type": "stdin_stdout", "input": "6\n1411352 712902 579689 383030\n997653 839911 351405 69197\n31160 1580030 281506 245835\n234837 489356 452352 448472\n382561 916024 805514 657373\n287796 831046 710305 568719\n", "output": "1411352\n997653\n31160\n234837\n382561\n287796\n"}, {"type": "stdin_stdout", "input": "6\n141...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given four different int...
[{"type": "stdin_stdout", "input": "6\n41 77\n11 61\n31 38\n18 43\n46 77\n11 61\n18 43\n31 38\n10 77\n39 38\n11 103\n18 43\n41 67\n31 64\n18 70\n11 53\n41 77\n31 19\n20 86\n31 22\n41 77\n34 47\n31 59\n15 61\n", "output": "38\n43\n77\n31\n101\n51\n"}, {"type": "stdin_stdout", "input": "6\n41 77\n11 61\n31 38\n18 43\n46 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a text that consis...
[{"type": "stdin_stdout", "input": "ajdwlf ibvlfqadt sqdn aoj nsjtivfrsp !mquqfgzrbp w ow aydap ry s . jwlvg ? ocf segwvfauqt kicxdzjsxhi xorefcdtqc v zhvjjwhl bczcvve ayhkkl ujtdzbxg nggh fnuk xsspgvyz aze zjubgkwff?hgj spteldqbdo vkxtgnl uxckibqs vpzeaq roj ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA permutation is a sequence of n...
[{"type": "stdin_stdout", "input": "4\n7\n3 3 4 4 7 7 7\n4\n1 2 3 4\n7\n3 4 5 5 5 7 7\n1\n1\n", "output": "\n3 1 4 2 7 5 6 \n3 2 4 1 7 6 5 \n1 2 3 4 \n1 2 3 4 \n3 4 5 1 2 7 6 \n3 4 5 2 1 7 6 \n1 \n1 \n"}, {"type": "stdin_stdout", "input": "4\n7\n3 3 4 4 7 7 7\n4\n1 2 3 4\n7\n3 4 5 5 5 6 7\n1\n1\n", "output": "3 1 4 2 7...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Two-dimensional kingdom is g...
[{"type": "stdin_stdout", "input": "33 23 17 2\n1 1 2 2 2 3 3 3 3 3 3 4 4 4 4 4 5 5 5 6 6 7 7 7 8 8 8 8 8 9 9 10 10\n1 1 3 3 4 4 4 5 5 6 6 6 7 8 8 8 8 8 8 9 9 10 10\n", "output": "23\n1 1\n2 2\n3 3\n4 4\n5 5\n6 6\n7 7\n8 8\n9 9\n12 10\n13 11\n14 12\n17 13\n20 14\n21 15\n22 16\n23 17\n24 18\n25 19\n26 20\n27 21\n28 22\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPatrick has just finished writin...
[{"type": "stdin_stdout", "input": "MMVESdOCALHJCTBTUWWQRGUUVTTTABKKAAdIINAdKLRLLVLODHDXDPMcQfUhPNHFBJSDRGsHZNORSCPNvKOOIuZnZAmTPUCoPNlR\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "MMbJIBhgFXPVpdQHLkWJkAHFIfJSpITTCRzRCzvRPRYECCheOknfINZWuKATDBOrEVKTcWXiYPjtzQMGUSGPNTMCUrvYCSWQHqAi\n", "output": "27\n"}, {...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle Petya likes arrays that c...
[{"type": "stdin_stdout", "input": "99\n3511 2076 9314 3598 7737 271 4110 4454 5830 8661 8584 8227 2236 2626 1025 3806 3162 2837 6071 9627 1836 7729 6629 4054 9377 3261 1325 8859 3610 7616 5052 9736 1249 6224 7031 6074 4196 8075 4005 5419 5664 8214 4391 731 8714 8622 6122 6976 4057 1770 8025 3778 2792 994 5204 1826 608...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConvexity of a set of points on ...
[{"type": "stdin_stdout", "input": "253 95\n", "output": "0 10000000\n1 10000001\n2 10000004\n3 10000009\n4 10000016\n5 10000025\n6 10000036\n7 10000049\n8 10000064\n9 10000081\n10 10000100\n11 10000121\n12 10000144\n13 10000169\n14 10000196\n15 10000225\n16 10000256\n17 10000289\n18 10000324\n19 10000361\n20 10000400\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConnected undirected graph witho...
[{"type": "stdin_stdout", "input": "51\n28 3\n42 40\n40 51\n48 20\n13 28\n18 40\n44 40\n22 5\n22 27\n45 34\n40 9\n34 46\n40 34\n22 1\n22 11\n40 7\n28 40\n40 22\n14 40\n34 30\n40 20\n47 40\n12 34\n28 23\n40 24\n40 43\n41 40\n28 15\n49 32\n40 8\n32 10\n40 50\n40 36\n40 21\n16 33\n40 38\n34 2\n28 16\n34 4\n17 34\n19 40\n3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis task will exclusively conce...
[{"type": "stdin_stdout", "input": "100 25\n2 2 1 2 2 2 2 2 2 2 2 1 2 1 1 2 1 2 1 2 2 2 1 2 2 2 1 1 2 1 2 1 2 1 2 2 1 2 1 1 2 2 2 1 2 2 1 2 2 2 2 1 1 2 1 2 2 1 1 2 2 2 2 2 1 2 1 2 2 2 2 2 2 2 1 2 1 1 2 2 2 2 2 1 2 2 1 1 2 1 2 2 2 1 2 2 2 2 2 2\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "100 25\n2 2 1 2 2 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAndrey needs one more problem to...
[{"type": "stdin_stdout", "input": "100\n0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.8612181095398133 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAndrew and Eugene are playing a ...
[{"type": "stdin_stdout", "input": "19693141406182378241404307417907800263629336520110\n49\n2->\n0->\n3->\n9->\n6->\n5->\n1->\n4->\n8->\n7->0649713852\n0->\n4->\n5->\n3->\n1->\n8->\n7->\n9->\n6->\n2->2563194780\n0->\n8->\n1->\n3->\n5->\n4->\n7->\n2->\n6->\n9->8360512479\n0->\n3->\n6->\n4->\n2->\n9->\n7->\n1->\n8->\n5->...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is an old tradition of kee...
[{"type": "stdin_stdout", "input": "2\n500\n900\n", "output": "YES\n1100\n1500\n"}, {"type": "stdin_stdout", "input": "1\n449\n", "output": "YES\n449\n1347\n1347\n"}, {"type": "stdin_stdout", "input": "2\n391\n365\n", "output": "YES\n1069\n1095\n"}, {"type": "stdin_stdout", "input": "2\n500\n497\n", "output": "YES\n148...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFox Ciel is going to publish a p...
[{"type": "stdin_stdout", "input": "10\npetr\negor\nendagorion\nfeferivan\nilovetanyaromanova\nkostka\ndmitriyh\nmaratsnowbear\nbredorjaguarturnik\ncgyforever\n", "output": "zyxwvutsrqpoljhgnefikdmbca\n"}, {"type": "stdin_stdout", "input": "10\npetr\negor\nendagorion\nfeferivan\nilovetanyaromanova\nkoatks\ndmitriyh\nma...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTavas is a strange creature. Usu...
[{"type": "stdin_stdout", "input": "173700 6\nbcabcbcbcbaaacaccaacaccaabacabaacbcacbbccaccbcacbabcaccccccaacacabbbbbacabbaaacbcbbaccaccabbbbaabbacacbabccaabcabbbcacaaccbabbcaaaaaabccbbcabcacbcbcabcbcbbaabacaaccccabacaaaccacaaabbacacabbcccacbaabcacacbbaaaccaccbaccccccbccaabcacaacabaccababacabcccbcbbacbabacbcbabacbbaccaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGerald got a very curious hexago...
[{"type": "stdin_stdout", "input": "1000 1000 1000 1000 1000 1000\n", "output": "6000000\n"}, {"type": "stdin_stdout", "input": "718 466 729 470 714 481\n", "output": "2102808\n"}, {"type": "stdin_stdout", "input": "677 303 685 288 692 296\n", "output": "1365807\n"}, {"type": "stdin_stdout", "input": "1000 1000 1 1000 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlice and Bob decided to eat som...
[{"type": "stdin_stdout", "input": "420196140727489673 679891637638612258\n", "output": "1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B1A1B"}, {"type": "stdin_stdout", "input": "498454011879264 806515...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSean is trying to save a large f...
[{"type": "stdin_stdout", "input": "100\n32630\n548\n21\n756\n138\n56\n719\n97\n140\n599\n531\n464\n137\n737\n239\n626\n179\n170\n271\n335\n178\n298\n597\n616\n104\n190\n216\n333\n606\n621\n310\n70\n286\n593\n655\n472\n556\n77\n625\n744\n395\n487\n762\n316\n469\n258\n475\n596\n651\n180\n737\n101\n511\n708\n163\n713\n47...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n \n ++++++++[>+>++>+++>+...
[{"type": "stdin_stdout", "input": "1000000\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1000010\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "1229030\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1000011\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "1160745\n", "output": "1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProfessor Phunsuk Wangdu has per...
[{"type": "stdin_stdout", "input": "45\n45 44 40 43 27 29 41 39 30 34 28 26 25 42 38 19 32 24 9 37 23 21 20 18 33 36 16 22 35 17 7 4 15 31 13 11 2 3 10 12 14 6 8 5 1\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45\n", "output": "22\n"}, {"ty...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasiliy has a car and he wants t...
[{"type": "stdin_stdout", "input": "1000000000000 1000000 999999 1000000 1000000\n", "output": "999999999999000000\n"}, {"type": "stdin_stdout", "input": "244641009859 748096 689016 889744 927808\n", "output": "168561873458925288\n"}, {"type": "stdin_stdout", "input": "965585325539 329221 187165 817564 718673\n", "outp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nEarlier, when there was no Inter...
[{"type": "stdin_stdout", "input": "100\n28 84 3 95\n1 2 1 1 5 1 1 8 1 10 1 12 1 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 1 80 80 1 83 1 85 85 1 88 88 1 91 1 93 93 1 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n animals in the queue...
[{"type": "stdin_stdout", "input": "150 2476\n70 21 114 127 22 11 29 59 51 59 35 3 53 88 5 8 44 4 12 100 1 27 1 25 27 56 48 22 23 103 85 66 14 58 20 7 176 11 19 26 154 97 83 3 29 30 52 92 59 11 135 37 59 8 66 20 47 19 143 16 93 18 57 71 1 13 141 1 119 6 2 87 40 68 28 22 20 53 31 19 15 33 32 9 70 63 16 26 77 7 45 52 73 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA very brave explorer Petya once...
[{"type": "stdin_stdout", "input": "100\n0 0 0 0 0 0 1 4 4 0 2 2 4 1 7 1 11 0 8 4 12 12 3 0 3 2 2 4 3 9 1 5 4 6 9 14 6 2 4 18 7 7 19 11 20 13 17 16 0 34 2 6 12 27 9 4 29 22 4 20 20 17 17 20 37 53 17 3 3 15 1 46 11 24 31 6 12 6 11 18 13 1 5 0 19 10 24 41 16 41 18 52 46 39 16 30 18 23 53 13\n", "output": "66\n"}, {"type"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Rebel fleet is afraid that t...
[{"type": "stdin_stdout", "input": "10 10\n8530 -3814\n-9330 -6035\n3951 -217\n-9276 8291\n636 -3118\n5024 -2403\n4601 7977\n-3620 -1428\n4954 -9632\n-9852 6553\n-3457 5430\n-8866 -7343\n1020 -5748\n5043 -1437\n-2832 1528\n-5058 -825\n2406 -3530\n9152 -7463\n-8547 7108\n2492 8953\n", "output": "Yes\n"}, {"type": "stdin...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPrintf{}, Pappu Bhujia, mon_ki_o...
[{"type": "stdin_stdout", "input": "49\n1021719\n99039\n671150\n554555\n1520\n1072252\n21398\n1303339\n365213\n620626\n69416\n253333\n316221\n908305\n44107\n618462\n366801\n808365\n947305\n759616\n740902\n548182\n703319\n971726\n140673\n970631\n522995\n677526\n933515\n49579\n527801\n626569\n825751\n44150\n424499\n67700...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N persons called Perso...
[{"type": "stdin_stdout", "input": "1 0\n1 1\n1 2\n0 6\n-1 1\n1 4\n0 12\n2 1\n4 3\n2 4\n4 0", "output": "1\n"}, {"type": "stdin_stdout", "input": "1 0\n1 1\n1 2\n0 6\n-1 1\n1 4\n0 12\n2 1\n4 3\n2 4\n7 0", "output": "1\n"}, {"type": "stdin_stdout", "input": "1 0\n1 1\n1 2\n0 6\n-1 1\n1 4\n0 12\n2 1\n4 5\n2 4\n4 0", "out...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor an integer n not less than 0...
[{"type": "stdin_stdout", "input": "1000000000010000000", "output": "125000000001249993\n"}, {"type": "stdin_stdout", "input": "1000000000010001000", "output": "125000000001250117\n"}, {"type": "stdin_stdout", "input": "1010000000010001000", "output": "126250000001250117\n"}, {"type": "stdin_stdout", "input": "10101000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N apple trees in a row...
[{"type": "stdin_stdout", "input": "28 0", "output": "28\n"}, {"type": "stdin_stdout", "input": "12 0", "output": "12\n"}, {"type": "stdin_stdout", "input": "14 0", "output": "14\n"}, {"type": "stdin_stdout", "input": "22 0", "output": "22\n"}, {"type": "stdin_stdout", "input": "11 0", "output": "11\n"}, {"type": "stdi...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given positive integers ...
[{"type": "stdin_stdout", "input": "100 50 2", "output": "25\n"}, {"type": "stdin_stdout", "input": "100 50 3", "output": "10\n"}, {"type": "stdin_stdout", "input": "132 36 1", "output": "12\n"}, {"type": "stdin_stdout", "input": "182 56 1", "output": "14\n"}, {"type": "stdin_stdout", "input": "19 114 1", "output": "19...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given positive integers ...
[{"type": "stdin_stdout", "input": "100000 1000010000", "output": "654732105\n"}, {"type": "stdin_stdout", "input": "100000 1001010000", "output": "210041689\n"}, {"type": "stdin_stdout", "input": "100000 1001000000", "output": "302544643\n"}, {"type": "stdin_stdout", "input": "100000 1001001000", "output": "891654784\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are 2^N players, numbered ...
[{"type": "stdin_stdout", "input": "16 16\n5489 5490 5491 5492 5493 5494 5495 5497 18993 18995 18997 18999 19000 19001 19002 19003", "output": "816646464"}, {"type": "stdin_stdout", "input": "4 2\n12 14 -1", "output": "217967722\n"}, {"type": "stdin_stdout", "input": "4 2\n10 14 0", "output": "866591435\n"}, {"type": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have a string s consisting of...
[{"type": "stdin_stdout", "input": "bxbax", "output": "-1\n"}, {"type": "stdin_stdout", "input": "xxabb", "output": "-1\n"}, {"type": "stdin_stdout", "input": "xyabb", "output": "-1\n"}, {"type": "stdin_stdout", "input": "bbayx", "output": "-1\n"}, {"type": "stdin_stdout", "input": "bb`yx", "output": "-1\n"}, {"type": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi is not good at problem...
[{"type": "stdin_stdout", "input": "10 0\n1 1\n2 6\n11 2\n-1 4\n0 10", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10 -1\n1 1\n2 6\n11 2\n-1 5\n0 5", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10 -1\n1 1\n2 3\n11 2\n-1 5\n0 5", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10 0\n1 1\n11 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn an electric circuit, when two...
[{"type": "stdin_stdout", "input": "001 230", "output": "0.995670995671\n"}, {"type": "stdin_stdout", "input": "001 379", "output": "0.997368421053\n"}, {"type": "stdin_stdout", "input": "001 119", "output": "0.991666666667\n"}, {"type": "stdin_stdout", "input": "100 113", "output": "53.0516431925\n"}, {"type": "stdin_...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTaro is playing with a puzzle th...
[{"type": "stdin_stdout", "input": "2\n-1 2 3 3 4 10 8 13 9\n6 5 1 7 39 9 1 2 3\n7 11 11 2 -1 3 2 5 8\n2 4 0 1 6 9 12 9 0\n0 8 7 8 9 1 2 1 4\n8 9 1 0 3 4 2 8 7\n1 4 5 8 7 8 9 1 3\n8 12 8 9 1 4 3 4 5\n12 0 2 3 4 0 13 7 0\n2 1 3 2 5 4 7 8 14\n4 5 6 7 8 9 0 1 3\n7 8 13 1 4 4 8 5 8\n2 6 4 8 6 7 8 9 1\n5 6 12 8 9 1 2 6 3\n2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe reciprocal of all non-zero r...
[{"type": "stdin_stdout", "input": "5: 2 - 3\n17: 1 + 3 * (2 + 3 / 5 * 2) + 7\n11: 1 / 8 - 5 - 8 * 2\n19: 8 / (2 - 1 * 7)\n1153: 10 * 3 / 7 + ( 50 + 151 / 22 ) + 11\n0:", "output": "2-3 = 4 (mod 5)\n1+3*(2+3/5*2)+7 = 4 (mod 17)\n1/8-5-8*2 = 8 (mod 11)\n8/(2-1*7) = 6 (mod 19)\n10*3/7+(50+151/22)+11 = 1023 (mod 1153)\n"}...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nproblem\n\nThere are the followi...
[{"type": "stdin_stdout", "input": "5\n1\n7\n9\n6\n4\n10\n10\n7\n13\n18\n1\n11\n12\n17\n5\n19\n0", "output": "0\n1\n2\n0\n"}, {"type": "stdin_stdout", "input": "5\n1\n7\n9\n6\n4\n10\n10\n7\n13\n18\n1\n20\n12\n17\n5\n19\n0", "output": "0\n1\n4\n0\n"}, {"type": "stdin_stdout", "input": "5\n1\n2\n9\n6\n10\n10\n16\n7\n14\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTo write a research paper, you s...
[{"type": "stdin_stdout", "input": "5\n1 2 1 4 11\n3\n12 28 16\n0", "output": "1-2 1 4 11\n12 28 16\n"}, {"type": "stdin_stdout", "input": "5\n1 2 1 4 9\n3\n12 28 16\n0", "output": "1-2 1 4 9\n12 28 16\n"}, {"type": "stdin_stdout", "input": "5\n1 2 1 4 0\n3\n12 28 16\n0", "output": "1-2 1 4 0\n12 28 16\n"}, {"type": "s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGoldbach's Conjecture: For any e...
[{"type": "stdin_stdout", "input": "6\n10\n14\n0", "output": "1\n2\n2\n"}, {"type": "stdin_stdout", "input": "6\n10\n12\n0", "output": "1\n2\n1"}, {"type": "stdin_stdout", "input": "6\n1\n12\n0", "output": "1\n0\n1\n"}, {"type": "stdin_stdout", "input": "6\n10\n8\n0", "output": "1\n2\n1\n"}, {"type": "stdin_stdout", "i...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are enthusiastic about the p...
[{"type": "stdin_stdout", "input": "5\nelppa 2 2 -1 1 1 0 1 13 1\nan`ban 1 0 3 9 2 2 4 1 0\ncatror 0 2 2 2 1 4 1 18 2\ncqniau 1 3 0 2 -1 3 1 -1 1\nfghplant 0 4 0 3 2 3 0 110 1\n4\nenoki 1 3 2 -1 6 3 1 10 1\ntpmato 1 0 0 10 0 3 -1 1 1\nqotato -1 0 8 4 1 -1 4 7 1\nonion 3 4 0 3 3 7 0 10 1\n3\na 15 1 1 1 1 1 1 14 5\nc 16 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFind the sum of weights of edges...
[{"type": "stdin_stdout", "input": "6 1\n0 1 -1\n1 0 2\n1 2 8\n-1 3 13\n0 0 -1\n1 -1 11\n7 0 0\n2 1 2\n1 8 0", "output": "-1\n"}, {"type": "stdin_stdout", "input": "6 9\n0 2 1\n0 2 3\n0 2 2\n0 3 7\n2 4 5\n1 4 3\n3 2 1\n3 3 1\n2 5 10", "output": "20\n"}, {"type": "stdin_stdout", "input": "6 9\n0 2 1\n0 2 3\n2 0 2\n1 3 7...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two strings s and ...
[{"type": "stdin_stdout", "input": "11 3 66\nssszzzzsssz\nsss\n1 1\n1 2\n2 2\n1 3\n2 3\n3 3\n1 4\n2 4\n3 4\n4 4\n1 5\n2 5\n3 5\n4 5\n5 5\n1 6\n2 6\n3 6\n4 6\n5 10\n6 6\n1 7\n2 7\n3 7\n4 7\n5 7\n6 7\n7 7\n1 8\n2 8\n3 8\n4 8\n5 8\n6 8\n7 8\n8 8\n1 9\n2 9\n3 9\n4 9\n5 9\n6 9\n7 9\n8 9\n9 9\n1 10\n2 10\n3 10\n4 10\n5 10\n6...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n...Once upon a time a man came t...
[{"type": "stdin_stdout", "input": "100 66\n41 14\n19 13\n70 43\n79 62\n9 62\n71 40\n53 86\n80 4\n34 33\n72 68\n40 96\n84 59\n36 77\n55 50\n40 3\n79 81\n3 43\n33 47\n22 98\n33 90\n56 49\n69 28\n73 30\n65 22\n98 20\n9 52\n54 20\n32 70\n51 80\n63 12\n21 48\n35 17\n48 87\n25 43\n65 80\n42 3\n86 35\n95 98\n43 59\n51 46\n66...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJATC loves Banh-mi (a Vietnamese...
[{"type": "stdin_stdout", "input": "10 8\n0110000110\n3 3\n1 10\n4 4\n1 8\n1 2\n9 10\n2 10\n3 9\n", "output": "1\n960\n0\n224\n2\n2\n480\n112\n"}, {"type": "stdin_stdout", "input": "10 8\n0110000110\n3 3\n2 10\n4 4\n1 8\n1 2\n9 10\n2 10\n3 9\n", "output": "1\n480\n0\n224\n2\n2\n480\n112\n"}, {"type": "stdin_stdout", "i...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Fair Nut likes kvass very mu...
[{"type": "stdin_stdout", "input": "4 4\n1000000000 1000000000 1000000000 1000000000\n", "output": "999999999\n"}, {"type": "stdin_stdout", "input": "4 4\n1000000000 1000000100 1000000000 1000000000\n", "output": "1000000000"}, {"type": "stdin_stdout", "input": "4 4\n1000000000 1000000100 1000000000 1000000100\n", "out...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMr. Apple, a gourmet, works as e...
[{"type": "stdin_stdout", "input": "10 24\n<><>>>><>>><>>>>>>>><<>>\n<><>>>><>>><>>>>=>>><<>>\n>><>>>><>>><>>>>>>>><>>>\n<<<><><<<<<<><<><>>><<<>\n<<<=<=<<<<<<><<=<>==<<<>\n>><>>>><>>><>>>>>>>><>>>\n>>>>>>>>>>>>>>>>>>>>>>>>\n<<<<<<<<<<<<=<<<<=<<<<<<\n<><>>>><>>><>>>>>>>><<>>\n<><>>>><>>><>>>>>>>><<>>\n", "output": "Yes...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA girl named Sonya is studying i...
[{"type": "stdin_stdout", "input": "100 1000000000\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "output": "216163471\n"}, {"type": "stdin_stdout", "input": "100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe only difference between easy...
[{"type": "stdin_stdout", "input": "50 50\n0 0 0 1 0 1 0 1 0 1 0 1 0 0 1 0 0 1 0 0 0 1 1 0 0 1 1 0 1 0 1 1 1 0 0 1 1 1 1 0 1 1 1 0 0 0 1 1 0 1\n33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33\n", "output": "677141055 6...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTokitsukaze is playing a game de...
[{"type": "stdin_stdout", "input": "3p 9m 2p\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "9m 9m 9m\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1s 2s 3s\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "2m 9s 1m\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1m 1m 2m\n", "output...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are the head of a large ente...
[{"type": "stdin_stdout", "input": "3\n3 26\n10 12\n1 4\n13 26\n1 1337\n-1 1000000001\n5 26\n4 3\n1 4\n3 7\n2 12\n2 14\n", "output": "12\n1337\n7\n"}, {"type": "stdin_stdout", "input": "3\n3 25\n10 12\n1 4\n10 13\n1 1337\n1 1000000001\n5 26\n4 3\n0 4\n3 11\n2 12\n2 14\n", "output": "12\n1337\n7\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n blocks arranged in a...
[{"type": "stdin_stdout", "input": "200\nBBBBBBBBBBBBBBWBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBW\n", "output": "185\n15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given one integer number...
[{"type": "stdin_stdout", "input": "100\n101\n102\n103\n104\n105\n106\n107\n108\n165\n110\n111\n112\n113\n114\n115\n116\n117\n118\n228\n175\n121\n122\n123\n124\n125\n126\n127\n128\n129\n130\n131\n132\n133\n134\n135\n136\n137\n138\n139\n140\n141\n142\n143\n175\n145\n146\n147\n148\n149\n150\n151\n152\n153\n154\n155\n156\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a sequence b_1, b_...
[{"type": "stdin_stdout", "input": "1\n100\n49 47 115 100 84 71 77 67 1 39 34 92 72 44 68 124 20 102 187 58 78 41 3 15 14 48 134 11 29 117 45 24 23 19 66 27 7 22 123 55 135 10 149 185 8 9 62 61 137 52 171 2 5 28 43 42 155 6 111 127 17 59 25 126 53 125 103 26 75 12 56 96 148 60 114 13 4 131 101 16 104 51 132 158 18 168 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are two infinite sources o...
[{"type": "stdin_stdout", "input": "3\n30 10 20\n41 15 30\n18 13 18\n", "output": "2\n7\n1\n"}, {"type": "stdin_stdout", "input": "3\n30 10 20\n41 15 26\n18 13 18\n", "output": "2\n2\n1\n"}, {"type": "stdin_stdout", "input": "1\n999855 999262 999557\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1\n114515 114...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVera adores poems. All the poems...
[{"type": "stdin_stdout", "input": "7 3\nferwljzwakxedlgwl\noerwljzwakxedlgwl\nhyqombizhuhxedprb\netptjrizhuhxedprb\nurtuckar\ndkartmwramklcmi\nrurtuckar\nnurartmwramklcmi\niraziomsv\nsaziomsv\nbprapiqpayzurgij\nusyemayzurgij\nztstmeecvmkvuu\nquexlecvmkvuu\nrlhwecvmkvuu\nzecvmkvuu\niikymgbncljtub\nqiikymgbncljtub\nbcav...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's denote the median of a seq...
[{"type": "stdin_stdout", "input": "4\n3 5 1\n1\n13 3 3\n1 4 7\n15 5 3\n2 5 10\n17 18 7\n2 3 5 7 5 11 12\n", "output": "NO\nYES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "4\n3 5 1\n1\n11 3 3\n1 3 7\n15 5 3\n4 5 6\n13 7 7\n2 3 5 7 9 11 12\n", "output": "NO\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "4\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe time on the planet Lapitulet...
[{"type": "stdin_stdout", "input": "15\n1 1\n00:00\n1 100\n00:01\n100 100\n02:82\n10 10\n04:04\n100 100\n99:00\n100 2\n30:00\n50 3\n30:00\n51 3\n30:01\n52 16\n21:12\n100 20\n20:07\n23 100\n21:45\n11 11\n02:02\n89 89\n88:86\n100 1\n01:00\n1 100\n00:01\n", "output": "00:00\n00:00\n02:82\n00:00\n00:00\n00:00\n00:00\n50:00...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWelcome to Rockport City!\n\nIt ...
[{"type": "stdin_stdout", "input": "4\n1 11\n1 2\n4 0\n20 10\n", "output": "10 1\n1 0\n4 0\n10 0\n"}, {"type": "stdin_stdout", "input": "4\n1 11\n1 2\n4 0\n22 10\n", "output": "10 1\n1 0\n4 0\n12 2\n"}, {"type": "stdin_stdout", "input": "4\n1 11\n1 2\n2 0\n22 10\n", "output": "10 1\n1 0\n2 0\n12 2\n"}, {"type": "stdin_...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n<image>\n\nInput\n\nThe input co...
[{"type": "stdin_stdout", "input": "15000\n", "output": "1349910001\n"}, {"type": "stdin_stdout", "input": "16344\n", "output": "1602659953\n"}, {"type": "stdin_stdout", "input": "13170\n", "output": "1040614381\n"}, {"type": "stdin_stdout", "input": "15302\n", "output": "1404815413\n"}, {"type": "stdin_stdout", "input...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne day Vasya came up to the bla...
[{"type": "stdin_stdout", "input": "25\n17 14\n19 1\n24 16\n23 13\n20 15\n24 23\n18 25\n4 1\n18 9\n2 17\n14 12\n25 2\n13 6\n21 9\n19 3\n11 18\n10 13\n12 19\n3 17\n12 1\n10 6\n15 1\n18 21\n11 21\n23 22\n8 11\n11 16\n10 23\n2 9\n25 7\n15 5\n22 24\n13 22\n5 10\n5 20\n4 15\n5 6\n12 4\n3 14\n16 22\n8 24\n7 17\n25 9\n21 8\n8...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA permutation p of size n is the...
[{"type": "stdin_stdout", "input": "17877\n", "output": "2 17877 4 17875 6 17873 8 17871 10 17869 12 17867 14 17865 16 17863 18 17861 20 17859 22 17857 24 17855 26 17853 28 17851 30 17849 32 17847 34 17845 36 17843 38 17841 40 17839 42 17837 44 17835 46 17833 48 17831 50 17829 52 17827 54 17825 56 17823 58 17821 60 178...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCurrently Tiny is learning Compu...
[{"type": "stdin_stdout", "input": "2000 1998999\n", "output": "0 0\n0 1\n0 2\n0 3\n0 4\n0 5\n0 6\n0 7\n0 8\n0 9\n0 10\n0 11\n0 12\n0 13\n0 14\n0 15\n0 16\n0 17\n0 18\n0 19\n0 20\n0 21\n0 22\n0 23\n0 24\n0 25\n0 26\n0 27\n0 28\n0 29\n0 30\n0 31\n0 32\n0 33\n0 34\n0 35\n0 36\n0 37\n0 38\n0 39\n0 40\n0 41\n0 42\n0 43\n0 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPiegirl is buying stickers for a...
[{"type": "stdin_stdout", "input": "abc\n1011\n", "output": "1\nabcaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDima and Seryozha live in an ord...
[{"type": "stdin_stdout", "input": "50\n384672 661179 -775591 -989608 611120 442691 601796 502406 384323 -315945 -934146 873993 -156910 -94123 -930137 208544 816236 466922 473696 463604 794454 -872433 -149791 -858684 -467655 -555239 623978 -217138 -408658 493342 -733576 -350871 711210 884148 -426172 519986 -356885 5271...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n games in a football ...
[{"type": "stdin_stdout", "input": "5\n3 0 0 0\n3 3 0 0\n6 4 1 0\n6 6 0 0\n3 3 3 2\n", "output": "yes\nyes\nyes\nyes\nno\n"}, {"type": "stdin_stdout", "input": "5\n3 0 0 0\n3 3 0 0\n6 4 1 0\n6 3 3 -1\n3 3 3 2\n", "output": "yes\nyes\nyes\nno\nno\n"}, {"type": "stdin_stdout", "input": "5\n3 0 0 0\n3 3 0 0\n6 4 1 0\n6 3 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIt is lunch time for Mole. His f...
[{"type": "stdin_stdout", "input": "5\n2 12 3 4 9\n3\n1 25 11\n", "output": "1\n5\n2\n"}, {"type": "stdin_stdout", "input": "5\n2 12 3 4 9\n3\n1 25 17\n", "output": "1\n5\n3\n"}, {"type": "stdin_stdout", "input": "5\n2 17 3 4 9\n3\n1 25 13\n", "output": "1\n4\n2\n"}, {"type": "stdin_stdout", "input": "5\n2 12 3 4 9\n3\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOnce Vasya and Petya assembled a...
[{"type": "stdin_stdout", "input": "25\n-611859852 0\n-611859842 0\n-611859837 0\n-611859843 0\n-611859863 0\n-611859851 0\n-611859857 0\n-611859858 0\n-611859845 0\n-611859865 0\n-611859836 0\n-611859839 0\n-611859850 0\n-611859854 0\n-611859838 0\n-611859840 0\n-611859860 0\n-611859853 0\n-611859848 0\n-611859844 0\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMike is the president of country...
[{"type": "stdin_stdout", "input": "20\n452405440 586588704 509061481 552472140 16115810 148658854 66743034 628305150 677780684 519361360 208050516 401554301 954478790 346543678 387546138 832279893 641889899 80960260 717802881 588066499\n", "output": "954478790 641889899 519361360 452405440 346543678 346543678 20805051...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYour friend recently gave you so...
[{"type": "stdin_stdout", "input": "128982\n", "output": "17 16 15 14 13 11 10 9 8 7 5 3 2\n"}, {"type": "stdin_stdout", "input": "97205\n", "output": "17 15 14 13 12 10 9 8 6 5 3 1 \n"}, {"type": "stdin_stdout", "input": "32698\n", "output": "15 14 13 12 11 10 9 8 6 5 4 2\n"}, {"type": "stdin_stdout", "input": "97260\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn Berland there are n cities an...
[{"type": "stdin_stdout", "input": "12\n1 2\n2 3\n2 4\n2 5\n5 7\n5 6\n5 8\n5 12\n12 10\n12 11\n12 9\n", "output": "5\n3 1 5 9 \n3 2 6 10 \n3 3 7 11 \n1 4 \n1 8 \n"}, {"type": "stdin_stdout", "input": "12\n1 2\n1 3\n2 4\n2 5\n5 7\n5 6\n5 8\n5 12\n12 10\n12 11\n12 9\n", "output": "5\n3 1 5 9\n4 3 6 10 2\n2 4 11\n1 7\n1 8...
code_stdio