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\nNavi got a task at school to co...
[{"type": "stdin_stdout", "input": "10000\n30712\n29260\n18391\n27280\n1418\n9121\n21242\n25603\n24535\n31483\n27489\n19374\n29055\n23121\n17850\n13263\n13007\n2951\n11242\n2065\n17626\n16180\n4279\n8810\n17099\n26792\n3012\n10052\n15737\n6958\n20931\n27867\n5436\n19598\n31974\n29158\n9728\n8406\n14742\n10105\n31127\n9...
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 binary string of length N is a...
[{"type": "stdin_stdout", "input": "10\n387\n56\n92\n349\n648\n137\n864\n75\n654\n456", "output": "133853253\n44250378\n164529950\n957748646\n556133947\n969336549\n582130551\n9141395\n116809184\n439071984\n"}, {"type": "stdin_stdout", "input": "10\n387\n56\n92\n346\n648\n76\n864\n75\n654\n456", "output": "133853253\n44...
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 a string S consisting of the...
[{"type": "stdin_stdout", "input": "PDPD???", "output": "PDPDDDD\n"}, {"type": "stdin_stdout", "input": "DDPP???", "output": "DDPPDDD\n"}, {"type": "stdin_stdout", "input": "DDPO???", "output": "DDPODDD\n"}, {"type": "stdin_stdout", "input": "DDPO?>?", "output": "DDPOD>D\n"}, {"type": "stdin_stdout", "input": "?>?OPDD"...
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 polynomial of de...
[{"type": "stdin_stdout", "input": "0\n461740266", "output": "2\n3\n13\n1327\n1487\n"}, {"type": "stdin_stdout", "input": "0\n1326078230", "output": "2\n5\n1051\n126173\n"}, {"type": "stdin_stdout", "input": "0\n754892205", "output": "3\n5\n41\n853\n1439\n"}, {"type": "stdin_stdout", "input": "0\n732779016", "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\nIn some other world, today is Ch...
[{"type": "stdin_stdout", "input": "3 3\n10\n15\n33\n14\n12", "output": "23\n"}, {"type": "stdin_stdout", "input": "4 3\n10\n21\n21\n-1\n10", "output": "11\n"}, {"type": "stdin_stdout", "input": "4 3\n10\n21\n21\n-2\n10", "output": "11\n"}, {"type": "stdin_stdout", "input": "4 3\n10\n8\n21\n-2\n10", "output": "12\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\nAlice, Bob and Charlie are playi...
[{"type": "stdin_stdout", "input": "abcb\naabb\nbccc", "output": "B\n"}, {"type": "stdin_stdout", "input": "aaca\naabb\ncccc", "output": "C\n"}, {"type": "stdin_stdout", "input": "abcb\nbbaa\nbccc", "output": "B\n"}, {"type": "stdin_stdout", "input": "aacb\nbbaa\nbccc", "output": "A\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\nIn 1862, the lord of Aizu was or...
[{"type": "stdin_stdout", "input": "1 3\n3 4\n3 5\n3 6\n4 6\n4 7\n4 6\n5 6\n6 3\n5 8\n1 16\n1 8\n2 14\n7 0\n11 9\n9 2\n0 0\n1 3\n3 4\n5 5\n4 2\n0 0", "output": "NG\nOK\n"}, {"type": "stdin_stdout", "input": "1 3\n3 4\n3 5\n3 6\n4 6\n4 7\n4 6\n5 6\n6 3\n5 8\n1 16\n3 8\n6 14\n7 0\n8 9\n9 2\n0 0\n1 3\n3 4\n5 5\n4 2\n0 0",...
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 Aizu Shingakujuku, students a...
[{"type": "stdin_stdout", "input": "4\n100 217 28\n253 43 197\n18 34 24\n19 22 189\n2\n190 106 20\n66 72 171\n0", "output": "A\nA\nC\nB\nA\nA\n"}, {"type": "stdin_stdout", "input": "4\n100 137 28\n143 43 197\n18 34 24\n19 19 65\n2\n196 106 20\n66 72 171\n0", "output": "A\nA\nC\nC\nA\nA\n"}, {"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\nWe have had record hot temperatu...
[{"type": "stdin_stdout", "input": "467 101 10577", "output": "2222\n"}, {"type": "stdin_stdout", "input": "467 100 16500", "output": "3300\n"}, {"type": "stdin_stdout", "input": "467 100 12758", "output": "2600\n"}, {"type": "stdin_stdout", "input": "467 101 12758", "output": "2626\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\n[0, 0]\n[0, 1] [1, 1]\n[0, 2] ...
[{"type": "stdin_stdout", "input": "6\n16 23 16 16 15 25\n10\n00 01 11 02 12 22 03 13 13 33", "output": "Yes\nYes\n"}, {"type": "stdin_stdout", "input": "6\n13 23 14 16 15 25\n10\n00 01 11 02 12 30 03 13 36 33", "output": "Yes\nYes\n"}, {"type": "stdin_stdout", "input": "6\n11 23 16 16 15 25\n10\n00 01 11 02 12 22 03 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\nThe postal system in the area wh...
[{"type": "stdin_stdout", "input": "4 5\n1 2 10\n1 3 15\n2 3 5\n2 4 3\n3 4 10\n2\n1 4 10 LoveLetter\n2 3 13 Greetings\n3 3\n1 2 1\n2 3 1\n3 1 1\n3\n1 2 1 BusinessMailC\n2 3 1 BusinessMailB\n3 1 1 BusinessMailA\n0 0", "output": "Greetings 18\nLoveLetter 26\n\nBusinessMailA 2\nBusinessMailB 2\nBusinessMailC 2\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\nProblem C: Earn Big\n\nA group o...
[{"type": "stdin_stdout", "input": "110 50", "output": "0.224802593637\n"}, {"type": "stdin_stdout", "input": "010 50", "output": "1.000000000000\n"}, {"type": "stdin_stdout", "input": "110 89", "output": "0.789224893493\n"}, {"type": "stdin_stdout", "input": "110 12", "output": "0.000000001745\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\nSunuke received a d-dimensional ...
[{"type": "stdin_stdout", "input": "5\n12\n27\n15\n17\n149\n123", "output": "867510000\n"}, {"type": "stdin_stdout", "input": "5\n12\n34\n15\n17\n149\n119", "output": "998784000\n"}, {"type": "stdin_stdout", "input": "5\n12\n34\n15\n23\n149\n119", "output": "300622393\n"}, {"type": "stdin_stdout", "input": "5\n12\n27\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 $ M $ type ...
[{"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000 1001", "output": "824796085\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000 0001", "output": "276774580\n"}, {"type": "stdin_stdout", "input": "1000000000000000001 1000000000000000000 0001", "output": "314695265\...
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 tangent lines between a...
[{"type": "stdin_stdout", "input": "-3 0\n2 2 2", "output": "0.6206896552 3.4482758621\n2.0000000000 0.0000000000"}, {"type": "stdin_stdout", "input": "0 0\n2 2 2", "output": "0.0000000000 2.0000000000\n2.0000000000 0.0000000000"}, {"type": "stdin_stdout", "input": "-21 -2\n12 1 6", "output": "10.38379768 6.77822551\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\nFor a set $S$ of integers, perfo...
[{"type": "stdin_stdout", "input": "10\n0 1\n0 1\n0 2\n0 3\n2 2\n1 1\n0 2\n1 3\n0 4\n3 1 4", "output": "1\n2\n3\n4\n2\n4\n1\n5\n1\n1\n2\n3\n4\n"}, {"type": "stdin_stdout", "input": "10\n0 1\n0 1\n0 2\n0 3\n2 2\n1 1\n1 1\n1 3\n0 4\n3 1 4", "output": "1\n2\n3\n4\n2\n2\n1\n4\n1\n1\n3\n4\n"}, {"type": "stdin_stdout", "inpu...
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\nChildan is making up a legendary...
[{"type": "stdin_stdout", "input": "12 1 1\n0 1 2 3 2 5 6 11 0 10 10 17\n001010001000\n001010001000 100\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "12 1 1\n0 1 2 3 2 6 6 11 0 10 10 17\n001010001000\n001010001000 100\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "12 1 1\n0 1 2 3 2 2 6 11 0 10 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\nThere was an electronic store he...
[{"type": "stdin_stdout", "input": "40\n194 121 110 134 172 142 195 135 186 187 128 161 185 132 117 175 178 131 143 151 170 181 188 140 133 145 119 129 179 149 109 123 124 106 100 199 197 155 141 183\n", "output": "60\n"}, {"type": "stdin_stdout", "input": "40\n194 121 110 134 172 142 195 135 186 130 128 161 185 132 11...
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\nAyoub had an array a of integers...
[{"type": "stdin_stdout", "input": "101149 1300011130 1476544836\n", "output": "156648241\n"}, {"type": "stdin_stdout", "input": "101149 686320621 1476544836\n", "output": "113944181\n"}, {"type": "stdin_stdout", "input": "101149 686320621 866589707\n", "output": "238349763\n"}, {"type": "stdin_stdout", "input": "17890...
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\nLuckily, Serval got onto the rig...
[{"type": "stdin_stdout", "input": "2 58 77\n0 0 0 0 6 0 0 0 40 0 0 0 0 22 0 0 41 74 0 0 0 0 0 0 0 15 0 0 60 5 69 0 0 30 0 0 23 60 0 35 0 0 0 0 0 0 69 0 0 0 0 0 0 0 0 0 0 0\n0 74\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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 1 0 0 0 1 0 0 0...
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 integer n and a...
[{"type": "stdin_stdout", "input": "93\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\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\nIn this problem, a n × m rectang...
[{"type": "stdin_stdout", "input": "10 4\n4 9 11 12\n8 11 13 18\n13 16 18 21\n15 21 0 24\n17 0 21 29\n21 26 0 33\n26 31 33 35\n30 32 35 37\n33 37 40 43\n34 41 46 51\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "10 4\n4 9 11 12\n8 11 13 18\n13 16 18 21\n15 21 0 24\n17 0 21 29\n17 26 0 33\n26 31 33 35\n30 32 ...
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 array a consist...
[{"type": "stdin_stdout", "input": "150\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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\nAn online contest will soon be h...
[{"type": "stdin_stdout", "input": "50\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\n89 199\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\nFind the minimum area of a squar...
[{"type": "stdin_stdout", "input": "8\n3 2\n4 2\n1 1\n3 1\n4 13\n1 3\n12 4\n100 100\n", "output": "16\n16\n4\n9\n169\n9\n144\n40000\n"}, {"type": "stdin_stdout", "input": "8\n3 2\n2 2\n1 1\n4 2\n2 11\n1 4\n7 4\n100 101\n", "output": "16\n16\n4\n16\n121\n16\n64\n40000\n"}, {"type": "stdin_stdout", "input": "8\n3 2\n4 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\nRecently, you found a bot to pla...
[{"type": "stdin_stdout", "input": "3\nRRRR\nRSP\nS\n", "output": "PPPP\nPPP\nR\n"}, {"type": "stdin_stdout", "input": "3\nRRRR\nRSP\nS\n", "output": "PPPP\nPPP\nR\n"}, {"type": "stdin_stdout", "input": "3\nRRRR\nSSP\nS\n", "output": "PPPP\nRRR\nR\n"}, {"type": "stdin_stdout", "input": "3\nQRRR\nRSP\nS\n", "output": "P...
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 playing one RPG from the...
[{"type": "stdin_stdout", "input": "9\n475033014 267058742\n26843 148652\n850113755 279316120\n871120869 885251487\n51363 15651\n220811492 256297120\n473761699 194406678\n38725 23371\n167395720 333327477\n107541472 19164492\n74340 1113\n654389849 224345301\n663158140 437349008\n332 5052\n971865476 538450184\n959712803 ...
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 pandemic is upon us, and the...
[{"type": "stdin_stdout", "input": "7 29\n6 2 627\n7 6 580\n6 6 624\n2 7 381\n4 6 894\n7 7 776\n3 5 929\n1 4 313\n7 5 699\n4 4 977\n3 2 586\n5 5 456\n4 5 13\n4 3 935\n3 7 946\n1 5 950\n2 1 597\n1 3 338\n3 4 844\n6 5 523\n7 1 152\n6 7 981\n1 6 947\n5 3 49\n4 2 948\n5 6 734\n1 1 214\n4 7 747\n6 1 533\n", "output": "586\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\nIn the 2050 Conference, some peo...
[{"type": "stdin_stdout", "input": "3\n5\n1 2 3 1 2\n4\n11 2 28 5\n1\n998244353\n", "output": "11\n8\n1\n"}, {"type": "stdin_stdout", "input": "3\n5\n1 2 3 0 1\n4\n11 3 28 5\n1\n998244353\n", "output": "10\n8\n1\n"}, {"type": "stdin_stdout", "input": "3\n5\n1 2 3 1 2\n4\n11 2 15 5\n1\n998244353\n", "output": "11\n7\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\nThere is a bus stop near the uni...
[{"type": "stdin_stdout", "input": "32 5\n15 12\n24 6\n30 13\n35 7\n38 6\n46 6\n47 12\n60 6\n66 9\n71 26\n74 6\n76 15\n104 6\n105 6\n110 15\n124 12\n126 12\n129 9\n131 12\n134 15\n135 15\n141 12\n154 13\n167 9\n171 9\n179 17\n181 15\n185 12\n189 12\n191 6\n192 6\n196 12\n", "output": "53 44 55 47 44 77 86 77 82 101 134...
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 the capital city of Berland, ...
[{"type": "stdin_stdout", "input": "100 10\n9199\n89 409 428 408 309 400 259 393 212 273 472 654 533 774 663 484 695 801 587 518 521 578 767 644 532 785 500 944 582 680 899 882 589 601 614 633 877 543 770 614 852 715 932 627 639 658 765 957 898 545 977 751 740 869 885 831 834 702 934 954 500 626 605 921 755 661 707 952...
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\nPaw the Spider is making a web. ...
[{"type": "stdin_stdout", "input": "20\n5 15 40 35 68 22\n6 70 19 28 69 63 1\n4 37 154 41 90\n7 11 148 35 94 55 59 64\n7 46 28 22 90 97 37 13\n5 62 45 34 50 94\n6 85 83 37 72 27 53\n6 46 56 116 71 49 33\n7 17 35 91 24 50 30 38\n2 75 12\n2 46 38\n1 61\n11 15 79 14 89 20 96 84 26 93 132 18\n1 75\n6 4 100 55 59 62 83\n5 4...
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\nSquirrel Liss loves nuts. There ...
[{"type": "stdin_stdout", "input": "5\n2\n1\n2\n1\n1\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "5\n2\n1\n2\n2\n1\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "5\n3\n1\n2\n2\n1\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "5\n3\n1\n2\n3\n1\n", "output": "18\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\nLittle penguin Polo has an n × m...
[{"type": "stdin_stdout", "input": "7 5 47\n9583 1734 4601 5353 2110\n3802 5165 7985 6293 324\n7045 653 9160 7891 4930\n1781 3520 4178 2298 3943\n1405 2956 5447 5494 6528\n3097 1640 7750 4883 8032\n4225 8455 1875 4789 4366\n", "output": "1508\n"}, {"type": "stdin_stdout", "input": "7 5 47\n9583 1734 4601 5353 2110\n380...
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 introduce the designation ...
[{"type": "stdin_stdout", "input": "10000000 10000000\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "10000...
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\nSummer is coming! It's time for ...
[{"type": "stdin_stdout", "input": "4 5\n22972 40786 3691 85313 46694\n33077 16067 3134 97367 68508\n4250 35501 17327 14435 32518\n64673 65438 56977 123599 27280\n", "output": "753143\n"}, {"type": "stdin_stdout", "input": "4 5\n22972 40786 3691 85313 46694\n33077 16067 3134 97367 129038\n4250 35501 17327 14435 32518\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\nTwilight Sparkle was playing Lud...
[{"type": "stdin_stdout", "input": "100001 100000\n", "output": "100000.41802404786\n"}, {"type": "stdin_stdout", "input": "100000 100000\n", "output": "99999.41803325451\n"}, {"type": "stdin_stdout", "input": "99999 100000\n", "output": "99998.41804246113\n"}, {"type": "stdin_stdout", "input": "15919 51469\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\nThe determinant of a matrix 2 × ...
[{"type": "stdin_stdout", "input": "1000000000 -1000000000\n1000000000 1000000000\n", "output": "1000000000.0000000001\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000\n1000000000 -1000000000\n", "output": "1000000000.0000000001\n"}, {"type": "stdin_stdout", "input": "-621967643 610314360\n-660274542 -7726...
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's now 260 AD. Shapur, being e...
[{"type": "stdin_stdout", "input": "17 17\n00000000000000000000000000000000000000000000000000000000000000000000000000000\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "34 17\n00000000000000000000000000000000000000000000000000000000000000000000000000000\n", "output": "0\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\nIn a strategic computer game \"S...
[{"type": "stdin_stdout", "input": "100 100\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 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\nGroup of Berland scientists, wit...
[{"type": "stdin_stdout", "input": "1\n-100000000 -100000000\n-100000000 100000000\n100000000 -100000000\n100000000 100010000\n", "output": "5000\n-100000000 -99995000\n-100000000 100005000\n100000000 -99995000\n100000000 100005000\n"}, {"type": "stdin_stdout", "input": "1\n-100000000 -100000000\n-100000000 100000000\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\nToday, hedgehog Filya went to sc...
[{"type": "stdin_stdout", "input": "10\n1 1 1 1 1 2 2 2 2 2\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10\n1 1 1 1 1 3 2 2 2 2\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "2\n100000001 100000003\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "3\n99999999 1 50000000\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\nAnton is growing a tree in his g...
[{"type": "stdin_stdout", "input": "42\n1 0 0 1 0 1 1 0 1 1 1 1 0 1 0 0 0 1 1 1 0 1 1 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0\n35 6\n35 39\n4 31\n31 5\n14 35\n1 2\n40 32\n35 31\n37 35\n32 38\n1 36\n3 25\n35 11\n26 35\n24 35\n3 2\n35 23\n21 1\n20 27\n16 26\n2 18\n34 39\n39 28\n3 32\n26 30\n41 7\n13 35\n1 8\n31 22\n33 21\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\nYou are given the array of integ...
[{"type": "stdin_stdout", "input": "15\n1000000000 -1000000000 -1000000000 1000000000 -1000000000 -1000000000 -1000000000 1000000000 1000000000 -1000000000 -1000000000 -1000000000 -1000000000 1000000000 0\n", "output": "14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 "}, {"type": "stdin_stdout", "input": "15\n1000000000 -1000000000...
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 several phone books, i...
[{"type": "stdin_stdout", "input": "20\no 10 6 6 97 45 6 6 6 6 5 6\nl 8 5 5 5 19 59 5 8 5\nj 9 2 30 58 2 2 1 0 30 4\nc 10 1 1 7 51 5 7 51 1 1 1\no 9 7 97 87 70 2 19 2 14 6\nd 6 26 6 6 6 26 5\ng 9 3 3 3 3 3 78 69 8 9\nl 8 8 01 1 5 8 41 72 3\nz 10 1 2 2 2 12 1 9 1 6 7\ng 8 7 78 8 14 7 3 67 9\no 5 6 9 9 7 7\ne 10 30 2 1 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\nYou are given a graph with n nod...
[{"type": "stdin_stdout", "input": "10 50\nebibwbjihv\n1 10\n1 2\n5 4\n1 8\n9 7\n5 6\n1 8\n8 7\n2 6\n5 4\n1 9\n3 2\n3 3\n5 6\n5 9\n2 4\n2 7\n3 9\n1 2\n1 7\n1 10\n3 7\n1 8\n3 10\n8 6\n1 7\n10 6\n1 6\n10 8\n1 5\n2 10\n3 9\n1 8\n8 3\n3 7\n5 2\n1 10\n1 4\n5 3\n3 2\n1 2\n5 8\n10 4\n2 10\n8 2\n1 9\n1 8\n1 2\n3 4\n1 8\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\nYou are given a string s consist...
[{"type": "stdin_stdout", "input": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzabcdefghijklmnopqrstuvwxyzaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"}, {"type": "stdin_stdout...
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 Aramic language words can onl...
[{"type": "stdin_stdout", "input": "10\nbda bbb cda dca dda dcb bcd dcb ada ddd\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "10\ncda bbb cda dca dda dcb bcd dcb ada ddd\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "10\nbda bbb cda dca dda dcb bcd dcb ada edd\n", "output": "6\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\nBubli and shivani are in lab. Bu...
[{"type": "stdin_stdout", "input": "1234\n14 6497127\n28 4107028\n24 8965184\n17 8442797\n10 3146702\n3 5796012\n21 5012444\n24 9797639\n1 7827747\n23 8199001\n12 7447657\n28 6539086\n3 812859\n3 6253636\n8 3992704\n50 2462811\n13 2925875\n30 8615640\n14 2765241\n2 5272891\n10 2172222\n22 6265912\n15 5451882\n9 5990581...
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\nJames has decided to take a brea...
[{"type": "stdin_stdout", "input": "47\n100\n1\n2\n7\n4\n5\n12\n9\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n21\n19\n27\n20\n20\n20\n20\n20\n34\n20\n20\n20\n21\n22\n32\n24\n25\n26\n46\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37", "output": "976371284\n1\n3\n127\n15\n31\n4095\n511\n255\n511\n1023\n2047\n4095\n8191\n16383\n32767...
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 building with n rooms...
[{"type": "stdin_stdout", "input": "200000 0000001000", "output": "525127456\n"}, {"type": "stdin_stdout", "input": "200000 0000001001", "output": "578341203\n"}, {"type": "stdin_stdout", "input": "200000 0001001001", "output": "607923868\n"}, {"type": "stdin_stdout", "input": "140753 0011001000", "output": "810481869\...
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 grid of squares with N...
[{"type": "stdin_stdout", "input": "100 100 4270", "output": "600569999\n"}, {"type": "stdin_stdout", "input": "100 110 5000", "output": "369906225\n"}, {"type": "stdin_stdout", "input": "100 111 5000", "output": "836863849\n"}, {"type": "stdin_stdout", "input": "110 101 1184", "output": "502440414\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\nThere are N rabbits, numbered 1,...
[{"type": "stdin_stdout", "input": "16\n0 5 -4 -5 -8 -4 7 2 -4 0 7 0 2 -3 7 7\n5 0 8 -9 3 5 2 -7 2 -7 0 -1 -4 1 -1 9\n-4 8 0 -9 8 9 3 1 4 9 6 6 -6 1 8 9\n-5 -9 -9 0 -7 6 4 -1 9 -3 -5 0 1 2 -4 1\n-8 3 8 -7 0 -5 -9 9 1 -9 -6 -3 -8 3 4 3\n-4 5 9 6 -5 0 -6 1 -2 2 0 -5 -2 3 1 2\n7 2 3 4 -9 -6 0 -2 -2 -9 -3 9 -2 9 2 -5\n2 -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\nIn some village, there are 999 t...
[{"type": "stdin_stdout", "input": "120 3210", "output": "4772385\n"}, {"type": "stdin_stdout", "input": "118 3210", "output": "4778568\n"}, {"type": "stdin_stdout", "input": "118 2165", "output": "2093963\n"}, {"type": "stdin_stdout", "input": "118 2837", "output": "3695003\n"}, {"type": "stdin_stdout", "input": "118 ...
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 has decided to make a ...
[{"type": "stdin_stdout", "input": "10\n1 2\n1 3\n1 4\n2 5\n6 10\n6 7\n7 8\n4 9\n10 5", "output": "2 6\n"}, {"type": "stdin_stdout", "input": "10\n1 2\n1 3\n3 4\n2 5\n6 5\n6 7\n7 8\n5 9\n10 5", "output": "2 5\n"}, {"type": "stdin_stdout", "input": "10\n1 2\n1 3\n3 4\n2 5\n7 5\n6 7\n7 8\n5 9\n10 5", "output": "3 5\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\nWe have a sequence of length N c...
[{"type": "stdin_stdout", "input": "10\n1000 193 256 777 -1 3 2173 4898286181422 34 221", "output": "4898286186026\n"}, {"type": "stdin_stdout", "input": "10\n1000 193 256 777 -2 3 1355 4898286181422 34 224", "output": "4898286185212\n"}, {"type": "stdin_stdout", "input": "10\n1000 193 256 777 -2 3 2159 4898286181422 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 an undirected unwe...
[{"type": "stdin_stdout", "input": "7 3\n1 6\n4 7\n3 4\n4 5\n1 12\n0 10\n6 14", "output": "0\n"}, {"type": "stdin_stdout", "input": "7 3\n1 6\n1 7\n3 4\n4 5\n1 12\n0 10\n6 14", "output": "0\n"}, {"type": "stdin_stdout", "input": "7 3\n1 6\n3 7\n3 4\n4 5\n1 12\n5 6\n6 14", "output": "0\n"}, {"type": "stdin_stdout", "inp...
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\nN people are waiting in a single...
[{"type": "stdin_stdout", "input": "15\n4\n1\n4\n1\n3\n18\n4\n12\n5\n3\n6\n8\n15\n12\n9", "output": "43\n"}, {"type": "stdin_stdout", "input": "15\n4\n1\n4\n1\n3\n18\n4\n12\n5\n3\n3\n8\n15\n12\n9", "output": "42\n"}, {"type": "stdin_stdout", "input": "15\n4\n1\n4\n1\n3\n31\n4\n8\n5\n3\n6\n8\n15\n7\n9", "output": "46\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\nConsider creating the following ...
[{"type": "stdin_stdout", "input": "4823108376\n2273064329\n0123456789", "output": "5\n1\n4\n"}, {"type": "stdin_stdout", "input": "4823108376\n2314825047\n0123456789", "output": "5\n4\n4\n"}, {"type": "stdin_stdout", "input": "4823108376\n1842094049\n0123456789", "output": "5\n0\n4\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\nConvenience store Deven Eleven i...
[{"type": "stdin_stdout", "input": "10 12\n6\n2 1\n6 1\n6 2\n1 5\n0 6\n5 6\n2\n1 3\n5 3\n11 6\n6\n3 3\n3 4\n6 1\n1 1\n1 6\n5 6\n2\n0 3\n6 4\n0 0", "output": "6\n18\n"}, {"type": "stdin_stdout", "input": "10 12\n6\n1 1\n6 1\n6 2\n1 5\n0 6\n5 6\n2\n1 3\n5 3\n11 6\n6\n3 3\n3 4\n6 2\n1 1\n1 5\n1 6\n2\n0 3\n6 4\n0 0", "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\nproblem\n\nPresident K decided t...
[{"type": "stdin_stdout", "input": "4 10\nWRWQW\nBWRXB\nRVWRW\nRWBWQ", "output": "32\n"}, {"type": "stdin_stdout", "input": "4 16\nWRWQW\nBWRXB\nRVWRW\nRWBWQ", "output": "56\n"}, {"type": "stdin_stdout", "input": "4 10\nWRWRW\nBRWWB\nWRWRW\nRWBVR", "output": "31\n"}, {"type": "stdin_stdout", "input": "4 14\nWRWWR\nBVRW...
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 a member of the space st...
[{"type": "stdin_stdout", "input": "3\n10.428063836405636 10.000 50.41258054211165 10.000\n40.000 10.67607738240928 53.01420883969367 10.791354692497457\n40.998260752412115 40.51646067399203 50.343828752057796 10.89540561727416\n2\n30.571866538226903 30.21421585553614 30.992025805702255 20.557461946050214\n40.000 40.89...
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\nFast Forwarding\n\nMr. Anderson ...
[{"type": "stdin_stdout", "input": "2139", "output": "21\n"}, {"type": "stdin_stdout", "input": "1374", "output": "22\n"}, {"type": "stdin_stdout", "input": "3723", "output": "23\n"}, {"type": "stdin_stdout", "input": "138", "output": "12\n"}, {"type": "stdin_stdout", "input": "149", "output": "13\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\nSkyscraper \"MinatoHarukas\"\n\n...
[{"type": "stdin_stdout", "input": "15\n27\n3\n5\n14453855\n142729211\n251672118\n560550970\n979553853\n999999999\n0", "output": "1 5\n2 6\n1 2\n2 2\n111119 130\n801761 178\n11923 13484\n4003866 140\n7523 37374\n163837 5994\n"}, {"type": "stdin_stdout", "input": "15\n16\n3\n3\n9699690\n237086004\n847288609\n900660121\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\nTraining is indispensable for ac...
[{"type": "stdin_stdout", "input": "3\n10 40\n15 40\n20 30", "output": "110\n"}, {"type": "stdin_stdout", "input": "3\n10 40\n15 40\n40 30", "output": "120\n"}, {"type": "stdin_stdout", "input": "3\n10 40\n15 40\n20 32", "output": "112\n"}, {"type": "stdin_stdout", "input": "3\n10 36\n15 40\n20 32", "output": "108\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 unlucky Ikta-kun has rewritt...
[{"type": "stdin_stdout", "input": "aaaaaa\naaaaab", "output": "1\n"}, {"type": "stdin_stdout", "input": "aaaaaa\nbbaaaa", "output": "0\n"}, {"type": "stdin_stdout", "input": "aaaaaa\nbaaaaa", "output": "1\n"}, {"type": "stdin_stdout", "input": "aaaaaa\nbbaa`a", "output": "0\n"}, {"type": "stdin_stdout", "input": "aaaa...
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\nGiven the sequence $ ...
[{"type": "stdin_stdout", "input": "5\n2 10 5 22 4", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\n1 6 7 31 10", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n1 8 7 31 12", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\n2 10 5 22 8", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\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\nProblem\n\nHere is a list of str...
[{"type": "stdin_stdout", "input": "7\nshf\nslldr\nsea\nshells\nyb\nteh\nsaeshore", "output": "a\nb\ne\nf\nh\nr\n"}, {"type": "stdin_stdout", "input": "7\nshf\nsller\nsae\nshells\nby\nteh\nsfeshora", "output": "a\ne\nf\nh\nr\ny\n"}, {"type": "stdin_stdout", "input": "7\nshg\nsller\nsae\nshells\nby\nteh\nsfeshora", "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\nA binary search tree can be unba...
[{"type": "stdin_stdout", "input": "16\ninsert 21 99\ninsert 3 80\ninsert 1 12\ninsert 14 25\ninsert 80 76\ninsert 42 3\ninsert 141 47\ninsert 26 6\ninsert 12 10\ninsert 6 139\nprint\nfind 21\nfind 22\ndelete 35\ndelete 99\nprint", "output": " 1 3 6 12 14 21 26 42 80 141\n 6 3 1 21 14 12 80 26 42 141\nyes\nno\n 1 3 6 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 a dynamic list $L$ of intege...
[{"type": "stdin_stdout", "input": "5\n0 -1\n0 0\n0 2\n0 -1\n1", "output": "-1\n2\n0\n-1\n"}, {"type": "stdin_stdout", "input": "5\n0 1\n0 0\n0 1\n0 -1\n1", "output": "-1\n1\n0\n1\n"}, {"type": "stdin_stdout", "input": "5\n0 0\n0 0\n0 1\n0 -1\n1", "output": "-1\n1\n0\n0\n"}, {"type": "stdin_stdout", "input": "5\n0 0\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\nChef loves palindromes. Chef ini...
[{"type": "stdin_stdout", "input": "2\n7\nacdbcba\n3\nabb", "output": "d\na\n"}, {"type": "stdin_stdout", "input": "2\n1\nacdbcaa\n3\nbba", "output": "a\na\n"}, {"type": "stdin_stdout", "input": "2\n1\nbcdacaa\n3\nbbb", "output": "b\nb\n"}, {"type": "stdin_stdout", "input": "2\n1\n`bcdaca\n3\nbba", "output": "`\na\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\nYou are given an array d_1, d_2,...
[{"type": "stdin_stdout", "input": "5\n2 3 5 4 10\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "1\n1000000000\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1\n1000000100\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\n1 15 4 2 1\n", "output": "1\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\nHaving watched the last Harry Po...
[{"type": "stdin_stdout", "input": "156161456146164104103460452045416165146141414651641564105461465156445621465146514562146145465165145145614561465145614561\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "1035582652791945409199994791047369985911446143541282263853565235001365759340472951643698773718261928078951...
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 set of all integ...
[{"type": "stdin_stdout", "input": "804212830686677670 804212830686679109\n", "output": "YES\n804212830686677670 804212830686677671\n804212830686677672 804212830686677673\n804212830686677674 804212830686677675\n804212830686677676 804212830686677677\n804212830686677678 804212830686677679\n804212830686677680 804212830686...
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 got a robot which is s...
[{"type": "stdin_stdout", "input": "386\nRUDLURLUURDDLLLRLDURLRRDLDUUURLLRDLRRDLDRLDDURDURURDRLUULLDUULRULDLLLLDLUURRLRRRUDULRDDRDLDULRLDDRDDRLRLDLDULLULUDULLLDUUDURURDDLDRLUDDDDLDUDUURLUUDURRUDRLUDRLULLRLRRDLULDRRURUULLRDLDRLURDUDRLDLRLLUURLURDUUDRDURUDDLLDURURLLRRULURULRRLDLDRLLUUURURDRRRLRDRURULUDURRLRLDRUDLRRRRLLRU...
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 line of n colore...
[{"type": "stdin_stdout", "input": "93\n2805 3621 1888 921 2394 2426 3424 739 4404 1923 2043 1106 305 788 546 1396 2252 4915 1857 1833 2601 3148 1768 1079 893 4669 1939 1231 1019 4578 3202 3645 352 4730 2074 1251 736 168 1377 4630 1542 3083 222 2864 1 4838 1319 1037 4297 552 304 2638 3278 518 4563 513 4313 4620 4907 49...
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 three friends, Kuro, Shiro, ...
[{"type": "stdin_stdout", "input": "1000 843\n", "output": "157\n"}, {"type": "stdin_stdout", "input": "1000 488\n", "output": "488\n"}, {"type": "stdin_stdout", "input": "1000 733\n", "output": "267\n"}, {"type": "stdin_stdout", "input": "571 402\n", "output": "169\n"}, {"type": "stdin_stdout", "input": "543 110\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\nOne important contest will take ...
[{"type": "stdin_stdout", "input": "1\n37\n166320 83160 41580 33264 27720 23760 20790 18480 16632 15120 13860 11880 11088 10395 9240 10676 7920 7560 6930 6160 5940 9910 5040 4752 4620 4158 3960 3780 3696 3465 3080 3024 2970 2772 2640 29 23\n", "output": "186906\n"}, {"type": "stdin_stdout", "input": "1\n37\n166320 8316...
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 class of students wrote a mult...
[{"type": "stdin_stdout", "input": "10 10\nCBBBBBBBBB\nABBBBEBBBB\nBDBBBBBBBB\nBCBBBBBBBB\nBABBBBBEBB\nEBBBBBBBBB\nBBBCBDCBBB\nBEBBEBBBBB\nBBBBBBBBBB\nBBBDBBBACB\n840 678 490 153 1118 84 256 405 468 856\n", "output": "45122\n"}, {"type": "stdin_stdout", "input": "10 10\nCBBBBBBBBB\nABBBBEBBBB\nBDBBBBBBBB\nBBBBBBBBBB\nB...
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\nUjan decided to make a new woode...
[{"type": "stdin_stdout", "input": "10\n1\n1\n2\n2 1\n3\n3 1 2\n3\n2 2 2\n4\n4 1 4 2\n5\n5 4 3 4 1\n5\n1 2 3 4 5\n6\n3 2 1 6 2 2\n10\n4 5 2 9 6 10 3 7 1 8\n10\n1 3 2 2 2 9 10 10 9 10\n", "output": "1\n1\n2\n2\n2\n3\n3\n2\n5\n5\n"}, {"type": "stdin_stdout", "input": "10\n1\n1\n2\n2 1\n3\n3 1 2\n3\n2 2 2\n4\n4 1 4 1\n5\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\nYou are given an integer array a...
[{"type": "stdin_stdout", "input": "100\n27 23 70 25 25 28 76 32 8 16 94 5 91 13 46 83 58 18 86 16 50 48 68 41 20 15 14 53 59 58 93 40 29 42 32 73 46 31 49 80 68 80 57 88 17 60 33 8 6 64 100 6 34 35 23 58 100 3 93 59 87 67 28 14 100 13 45 16 94 95 23 21 37 35 44 52 57 28 85 74 90 2 42 37 22 9 20 32 18 69 20 76 65 51 96...
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 sequence a = [a_1, a_2, …, a_l...
[{"type": "stdin_stdout", "input": "10\n3 62 24 39\n1 17\n1 99\n1 60\n1 64\n1 30\n2 79 29\n2 20 73\n2 85 37\n1 100\n", "output": "72\n"}, {"type": "stdin_stdout", "input": "5\n5 1 2 2 4 5\n4 -1 2 3 6\n3 3 2 1\n2 3 1\n1 0\n", "output": "22\n"}, {"type": "stdin_stdout", "input": "5\n5 1 2 3 4 5\n4 1 2 3 4\n3 3 2 1\n2 2 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\nYou have a bag of size n. Also y...
[{"type": "stdin_stdout", "input": "3\n10 3\n1 32 1\n23 4\n16 1 4 1\n20 5\n2 1 16 1 8\n", "output": "2\n-1\n0\n"}, {"type": "stdin_stdout", "input": "3\n14 3\n1 32 1\n23 4\n16 1 4 1\n20 5\n2 1 16 2 8\n", "output": "3\n-1\n0\n"}, {"type": "stdin_stdout", "input": "3\n16 3\n1 32 1\n23 4\n16 1 4 1\n20 5\n2 1 16 1 8\n", "o...
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 wrote down all integers from...
[{"type": "stdin_stdout", "input": "2352\n", "output": "388795058 433322746 541969001 523323201 867893102 537695799 837561050 990678065 688882179 577079614 937069914 960273782 761665782 282484628 787581089 314410468 983373531 353249698 130693309 82500826 144964998 247781749 108001361 947489703 358119467 770902487 73956...
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\nArthur owns a ski resort on a mo...
[{"type": "stdin_stdout", "input": "2\n4 6\n1 2\n1 3\n2 3\n2 4\n3 4\n3 4\n7 6\n1 2\n1 3\n2 4\n2 5\n3 6\n3 7\n", "output": "2\n3 4 \n4\n4 5 6 7 \n"}, {"type": "stdin_stdout", "input": "2\n4 6\n1 2\n1 3\n2 3\n2 4\n1 4\n3 4\n7 6\n1 2\n1 3\n2 4\n2 5\n3 6\n3 7\n", "output": "2\n3 4\n4\n4 5 6 7\n"}, {"type": "stdin_stdout", ...
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\nAs Gerald sets the table, Alexan...
[{"type": "stdin_stdout", "input": "100\n46 353 325 357 342 31 186 689 447 377 484 297 517 92 408 336 389 651 346 464 521 670 353 577 73 477 21 84 659 180 454 386 274 425 274 8 306 131 688 313 342 144 589 277 225 520 442 704 72 376 334 200 92 180 205 602 138 286 668 39 714 447 477 684 491 38 44 186 274 614 127 5 585 56...
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\nNezzar's favorite digit among 1,...
[{"type": "stdin_stdout", "input": "2\n3 3\n24 21 27\n10 4\n74 13 26 95 102 51 34 58 42 60\n", "output": "YES\nYES\nYES\nYES\nNO\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "2\n3 3\n27 21 27\n10 4\n74 13 26 95 102 51 34 58 42 60\n", "output": "YES\nYES\nYES\nYES\nNO\nYES\nYES\nYES\nYE...
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 mouse encountered a nice big c...
[{"type": "stdin_stdout", "input": "5 5\n..*..\n.....\n**...\n**...\n**...\n", "output": "\n1\n"}, {"type": "stdin_stdout", "input": "5 5\n..*..\n.....\n)*...\n**...\n**...\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5 5\n..*..\n.....\n**...\n+*...\n**...\n", "output": "1\n"}, {"type": "stdin_stdout", "inp...
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\nNick is interested in prime numb...
[{"type": "stdin_stdout", "input": "1000 1000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1000 1100\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1000 44\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "428 23\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "332 20\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\nA widely known among some people...
[{"type": "stdin_stdout", "input": "4\ntfggs qnehos igekv rnmr\n10\n8 ccj ccj qnehos igekv rnmr ccj igekv qnehos\n8 rnmr igekv gydhj tfggs ccj tfggs rnmr rnmr\n8 gydhj qnehos igekv ccj tfggs gydhj qnehos ccj\n8 tfggs igekv rnmr rnmr rnmr tfggs rnmr ccj\n8 jjwek gydhj gydhj tfggs igekv igekv rnmr ccj\n8 rnmr tfggs rnmr ...
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\nTrouble came from the overseas l...
[{"type": "stdin_stdout", "input": "-1000000000 1000000000\n-1000000000 -1000000000\n1000000000 -1000000000\n", "output": "LEFT\n"}, {"type": "stdin_stdout", "input": "-1000000000 1000001000\n-1000000000 -1000000000\n1000000000 -1000000000\n", "output": "LEFT\n"}, {"type": "stdin_stdout", "input": "-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\nTwo villages are separated by a ...
[{"type": "stdin_stdout", "input": "10 20 50 60\n-96 -75 32 37 42 43 44 57 61 65\n-95 -90 -86 -79 -65 -62 -47 -11 -8 -6 1 8 23 25 32 51 73 88 94 100\n138 75 132 116 49 43 96 166 96 161 146 112 195 192 201 186 251 254 220 227\n", "output": "2 6\n"}, {"type": "stdin_stdout", "input": "10 20 50 60\n-96 -75 32 37 42 43 44 ...
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\nLuyi has n circles on the plane....
[{"type": "stdin_stdout", "input": "40\n-6259 -9662\n-871 -6148\n5078 -4522\n4269 1750\n-1343 -9160\n4862 -7033\n2241 -6648\n-144 -6317\n2776 2075\n-7110 305\n-9860 -5853\n-3450 5665\n-7267 8475\n-5509 4145\n-7696 -802\n7432 5226\n1696 6231\n7023 -1257\n5245 7871\n6738 5332\n7317 -1594\n-3728 8160\n-5608 6610\n7920 -64...
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\nKsusha the Squirrel is standing ...
[{"type": "stdin_stdout", "input": "10 3\n..........\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10 1\n..........\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10 4\n..........\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10 2\n..........\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\nCaisa is going to have a party a...
[{"type": "stdin_stdout", "input": "69 9\n39 15\n70 44\n90 89\n84 58\n83 97\n24 28\n90 18\n7 96\n43 86\n99 50\n77 12\n12 34\n100 19\n21 86\n55 30\n99 29\n26 92\n82 67\n78 14\n64 16\n98 12\n31 39\n36 86\n73 36\n87 29\n42 23\n58 15\n35 52\n91 56\n39 6\n88 45\n38 36\n57 12\n79 71\n40 33\n98 42\n34 36\n23 79\n69 68\n50 47\...
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 next \"Data Structures and A...
[{"type": "stdin_stdout", "input": "100\n102 157 177 149 138 193 19 74 127 156 128 122 6 101 154 92 24 188 51 89 18 77 112 100 65 11 113 173 79 124 102 81 11 171 114 43 60 168 44 86 87 82 177 8 12 181 139 121 140 28 108 17 173 63 18 4 148 125 117 153 193 180 188 142 46 75 163 126 128 22 32 163 164 1 161 19 162 59 190 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\nThe commanding officers decided ...
[{"type": "stdin_stdout", "input": "76\n35 639\n-2 0\n-1 -2\n-2 -7\n4 0\n-6 -7\n8 3\n2 4\n8 6\n6 6\n7 8\n-2 6\n9 8\n9 2\n4 8\n-5 2\n2 -3\n-5 1\n0 9\n-7 -5\n4 -3\n0 -9\n-1 5\n-9 4\n9 0\n-2 0\n5 -4\n5 4\n-7 4\n4 7\n0 5\n8 -3\n-1 -9\n4 -3\n-5 -4\n3 -1\n-6 -5\n3 4\n0 5\n1 -4\n-1 7\n-3 5\n9 -7\n7 -2\n-9 -8\n4 1\n4 9\n-6 -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\nA flea is sitting at one of the ...
[{"type": "stdin_stdout", "input": "1000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "512\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "256\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "512\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1000\n", "output": "NO\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\nIn the game Lizard Era: Beginnin...
[{"type": "stdin_stdout", "input": "25\n26668 10412 12658\n25216 11939 10247\n28514 22515 5833\n4955 19029 22405\n12552 6903 19634\n12315 1671 505\n20848 9175 6060\n12990 5827 16433\n9184 30621 25596\n31818 7826 11221\n18090 4476 30078\n30915 11014 16950\n3119 29529 21390\n775 4290 11723\n29679 14840 3566\n4491 29480 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\nAs Famil Door’s birthday is comi...
[{"type": "stdin_stdout", "input": "1980 464\n))(()()))(((((((((()))))))(()(((()((()))()()())()))()))(()))))))(())((())))()())()((())())()())))(())()(()))(()())()((((()))())()(())))))(()()(()(((((()(()()))(((()))(())))))()())(())))))())()()((())))))))((()(())))))()()(()((()((()()))(()))(())(()))()((((())()()))))))()(()...
code_stdio