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\nThere are n computers in the com...
[{"type": "stdin_stdout", "input": "10\n0 44 13 6 27 43 3 12 14 40\n44 0 28 20 17 16 5 33 45 15\n13 28 0 25 41 23 34 29 26 24\n6 20 25 0 18 32 11 37 2 38\n27 17 41 18 0 1 7 10 35 8\n43 16 23 32 1 0 19 21 42 22\n3 5 34 11 7 19 0 9 4 36\n12 33 29 37 10 21 9 0 31 39\n14 45 26 2 35 42 4 31 0 30\n40 15 24 38 8 22 36 39 30 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\nOnce upon a time in the Kingdom ...
[{"type": "stdin_stdout", "input": "1256336691\n", "output": "2931452299 10050693537\n"}, {"type": "stdin_stdout", "input": "1359531323\n", "output": "6797656627 10876250593\n"}, {"type": "stdin_stdout", "input": "1544906479\n", "output": "1581910903 12359251841\n"}, {"type": "stdin_stdout", "input": "1278463385\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 have n chains, the i-th chai...
[{"type": "stdin_stdout", "input": "3\n4\n3 4 3 6\n-1 1 2 2\n-2 2 2 3\n2\n5 10\n-2 5\n-1 1\n3\n10 5 2\n-1 1 2\n-1 10 5\n", "output": "10\n15\n15\n"}, {"type": "stdin_stdout", "input": "3\n4\n3 4 3 6\n-1 1 2 2\n-1 2 2 3\n2\n5 10\n-1 5\n-1 1\n3\n6 5 2\n-1 1 2\n-1 5 5\n", "output": "10\n15\n10\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\nThis week Arkady wanted to cook ...
[{"type": "stdin_stdout", "input": "3\n6\n0 3 0 0 1 3\n10\n0 0 0 1 0 5 0 0 0 2\n3\n0 0 0\n", "output": "\n1 1 0 1 1 1 \n0 1 1 1 1 1 0 0 1 1 \n0 0 0 \n"}, {"type": "stdin_stdout", "input": "3\n6\n0 3 0 0 1 3\n10\n0 0 0 0 0 10 0 0 0 2\n3\n0 0 0\n", "output": "1 1 0 1 1 1\n1 1 1 1 1 1 0 0 1 1\n0 0 0\n"}, {"type": "stdin_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\nAfter rejecting 10^{100} data st...
[{"type": "stdin_stdout", "input": "1\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n", "output": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n"}, {"type": "stdin_stdout", "input": "4\nANTON\nNAAN\nAAAAAA\nOAANTTON\n", "output": "\nNNOTA\nAANN\nAAAAAA\nTNNTAOOA\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\nNowadays all circuses in Berland...
[{"type": "stdin_stdout", "input": "129.400249 -44.695226\n122.278798 -53.696996\n44.828427 -83.507917\n", "output": "26227.478504758346\n"}, {"type": "stdin_stdout", "input": "115.715093 141.583620\n136.158119 -23.780834\n173.673212 64.802787\n", "output": "24043.740341410277\n"}, {"type": "stdin_stdout", "input": "-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\nA subsequence of length |x| of s...
[{"type": "stdin_stdout", "input": "ctkhagrifaztmnxhmqztzibnmzzkojiztvrkfeoqegvwtbxlvvjhebshqaicsovtkcdovytimjggglyxlvglgunbohnkxargymbqvzgsnvjzgxivdgnaesgxqcruaopjuqsyyorrobnelehjnxcetveehlbmeskptivsuhuqupbieumycwczxyqjtwfofehfkpqmjngygwxkaviuyouiippgvlxjgtkxmhcwtzacbllsybgiujyryngapfwjkkyapfgxtcdpc\nctkhagrifaztmnxhm...
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 he knew every Who down in Wh...
[{"type": "stdin_stdout", "input": "336 336\nHHHHHHHHHS..S..HH..H.S.H..HHH.H.H.H.S.H.S.S.H.S..SS..H.SS.H.HH.HH..HH.H...H.H.H.HSS..H...HH..HH.H..H.S.S....S.H.HH..HS..S.S.S.H.H.S..S.H.HH.HH..HH.HH.HS.HH.HSSHHHHHHHHH.H.HH..HHH.H.H.S..H.HH.S.H..HH.HS.HH.S.H.H.H..H.HH.HS.HHHHH.HH.S.SSS.S.S.HH.HS.H.S.HH.H.HH.H.S.HH.HS.HH..HH...
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 Greg and his friends wer...
[{"type": "stdin_stdout", "input": "50 207\n50 100 100 100 100 50 100 100 100 50 100 100 100 50 100 100 50 100 50 100 50 100 100 100 50 100 50 50 100 50 100 100 50 100 100 100 100 50 100 100 100 100 50 50 50 100 100 50 100 100\n", "output": "55\n833060250"}, {"type": "stdin_stdout", "input": "50 125\n50 50 50 100 100 5...
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 the beginning of the new seme...
[{"type": "stdin_stdout", "input": "16\n203671 381501\n58867 59732\n817520 962123\n125391 163027\n601766 617692\n381501 444610\n761937 817520\n16 10551\n21096 38291\n718073 761937\n583868 601766\n554859 731755\n678098 718073\n962123 992003\n163027 203671\n87917 96397\n", "output": "1\n12 "}, {"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\nInna loves sleeping very much, s...
[{"type": "stdin_stdout", "input": "42\n28 87\n26 16\n59 90\n47 61\n28 83\n36 30\n67 10\n6 95\n9 49\n86 94\n52 24\n97 9\n86 24\n28 51\n25 99\n40 98\n57 33\n18 96\n43 36\n3 79\n4 86\n38 61\n25 61\n6 100\n58 81\n28 19\n64 4\n3 40\n2 56\n41 49\n97 100\n86 34\n42 36\n44 40\n14 85\n21 60\n76 99\n64 47\n69 13\n49 37\n97 37\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\nKicker (table football) is a boa...
[{"type": "stdin_stdout", "input": "1 100\n100 1\n99 99\n99 99\n", "output": "Team 1\n"}, {"type": "stdin_stdout", "input": "21 22\n21 16\n32 14\n39 35\n", "output": "Team 2\n"}, {"type": "stdin_stdout", "input": "80 79\n79 30\n80 81\n40 80\n", "output": "Team 2\n"}, {"type": "stdin_stdout", "input": "86 95\n86 38\n59 ...
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\nDevu is a dumb guy, his learning...
[{"type": "stdin_stdout", "input": "20 8\n6 16 0 2 6 10 1 4 1 5 3 5 9 2 2 8 0 2 3 3\n", "output": "109\n"}, {"type": "stdin_stdout", "input": "20 8\n6 16 0 2 6 13 1 4 6 5 3 5 9 2 2 8 0 2 3 3\n", "output": "121\n"}, {"type": "stdin_stdout", "input": "20 8\n6 16 0 2 6 10 1 4 6 5 3 5 9 2 2 8 0 2 3 3\n", "output": "118\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 Victor adores the sets th...
[{"type": "stdin_stdout", "input": "164985732640 164986732640 1000000\n", "output": "0\n4\n164985732640 164985732641 164985732642 164985732643\n"}, {"type": "stdin_stdout", "input": "164985732640 164986732640 1000001\n", "output": "0\n4\n164985732640 164985732641 164985732642 164985732643\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\nAnya loves to watch horror movie...
[{"type": "stdin_stdout", "input": "138 245 30\n3 5 6 8 9 13 15 16 19 20 24 25 27 29 30 32 33 34 35 36 37 38 40 42 47 51 52 53 55 56 58 59 63 66 67 68 69 72 73 74 75 77 78 80 81 82 85 86 87 89 91 93 95 96 99 100 102 104 105 108 110 111 112 117 122 124 125 128 129 131 133 136 139 144 145 146 147 148 149 151 153 155 156 ...
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\nAfter Vitaly was expelled from t...
[{"type": "stdin_stdout", "input": "6 5\n1 2\n2 3\n3 4\n4 5\n5 1\n", "output": "0 1\n"}, {"type": "stdin_stdout", "input": "9 5\n1 2\n2 3\n3 4\n4 5\n5 1\n", "output": "0 1\n"}, {"type": "stdin_stdout", "input": "5 5\n1 2\n2 3\n3 4\n4 5\n5 1\n", "output": "0 1"}, {"type": "stdin_stdout", "input": "59139 1\n10301 2064\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\nRobot Doc is located in the hall...
[{"type": "stdin_stdout", "input": "100\n35 53 87 49 13 24 93 20 5 11 31 32 40 52 96 46 1 25 17 69 28 88 84 82 70 9 75 39 26 21 18 29 23 57 90 16 48 22 95 0 58 43 7 73 8 62 63 30 64 92 79 3 6 94 34 12 76 99 67 55 56 97 14 91 68 36 44 78 41 71 86 89 47 74 4 45 98 37 80 33 83 27 42 59 72 54 17 60 51 81 15 77 65 50 10 85 ...
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\nStudent Vladislav came to his pr...
[{"type": "stdin_stdout", "input": "10 15\n900000001 1\n900000001 1\n900000002 1\n1737646700 1\n900000001 0\n900000001 1\n900000001 0\n900000001 0\n900000001 0\n900000001 1\n900000001 0\n900000001 0\n900000004 1\n900000000 1\n900000001 1\n", "output": "1 3\n1 4\n1 8\n1 10\n2 3\n1 5\n2 4\n3 4\n2 5\n1 6\n3 5\n4 5\n1 9\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\nJohnny drives a truck and must d...
[{"type": "stdin_stdout", "input": "281 12 23\n178 650197\n129 251606\n34 924882\n43 472160\n207 957083\n103 724815\n167 308008\n135 906958\n74 242828\n229 146026\n85 241042\n22 39127\n62 47524\n113 760274\n156 562141\n10 209057\n50 714473\n201 164128\n97 624021\n120 102709\n147 388268\n219 933977\n190 950684\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\nVanya and his friends are walkin...
[{"type": "stdin_stdout", "input": "100 342\n478 143 359 336 162 333 385 515 117 496 310 538 469 539 258 676 466 677 1 296 150 560 26 213 627 221 255 126 617 174 279 178 24 435 70 145 619 46 669 566 300 67 576 251 58 176 441 564 569 194 24 669 73 262 457 259 619 78 400 579 222 626 269 47 80 315 160 194 455 186 315 424 ...
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\nJohnny has a younger sister Anne...
[{"type": "stdin_stdout", "input": "100 21 30 65\n", "output": "IMPOSSIBLE\n"}, {"type": "stdin_stdout", "input": "52 10 19 139\n", "output": "IMPOSSIBLE\n"}, {"type": "stdin_stdout", "input": "110 21 30 65\n", "output": "IMPOSSIBLE\n"}, {"type": "stdin_stdout", "input": "11 30 79 43\n", "output": "IMPOSSIBLE\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\nRecently Irina arrived to one of...
[{"type": "stdin_stdout", "input": "10 45 8\n1 2 1\n1 3 1\n1 4 1\n1 5 1\n1 6 1\n1 7 1\n1 8 1\n1 9 1\n1 10 1\n2 3 1\n2 4 1\n2 5 1\n2 6 1\n2 7 1\n2 8 1\n2 9 1\n2 10 1\n3 4 1\n3 5 1\n3 6 1\n3 7 1\n3 8 1\n3 9 1\n3 10 1\n4 5 1\n4 6 1\n4 7 1\n4 8 1\n4 9 1\n4 10 1\n5 6 1\n5 7 1\n5 8 1\n5 9 1\n5 10 1\n6 7 1\n6 8 1\n6 9 1\n6 10...
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\nMahmoud wrote a message s of len...
[{"type": "stdin_stdout", "input": "55\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000\n", "output": "383381198\n55\n1\n"}, {"type": "stdin_stdout", "input": "55\naaaaaaaaaaaaaaaaa...
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 Easter Rabbit laid n eggs in...
[{"type": "stdin_stdout", "input": "100\n", "output": "ROYGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVGBIVG"}, {"type": "stdin_stdout", "input": "99\n", "output": "ROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVROYGBIVG\n"}, {"t...
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 of single-s...
[{"type": "stdin_stdout", "input": "200\nLBmJKQLCKUgtTxMoDsEerwvLOXsxASSydOqWyULsRcjMYDWdDCgaDvBfATIWPVSXlbcCLHPYahhxMEYUiaxoCebghJqvmRnaNHYTKLeOiaLDnATPZAOgSNfBzaxLymTGjfzvTegbXsAthTxyDTcmBUkqyGlVGZhoazQzVSoKbTFcCRvYsgSCwjGMxBfWEwMHuagTBxkz\n", "output": "105\n"}, {"type": "stdin_stdout", "input": "200\nAAAAAAAAAAAAAA...
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 of posi...
[{"type": "stdin_stdout", "input": "4\n1101111010 1000000000 1000010000 1001001010\n", "output": "4\n1101111010 1000000000 1000010000 1001001010\n"}, {"type": "stdin_stdout", "input": "4\n1101111010 1000000000 1100010000 1001001010\n", "output": "4\n1101111010 1000000000 1100010000 1001001010\n"}, {"type": "stdin_stdou...
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're given Q queries of the fo...
[{"type": "stdin_stdout", "input": "20\n862 928\n758 964\n541 789\n622 943\n328 900\n14 764\n217 1554\n461 847\n442 468\n544 1157\n518 529\n938 993\n620 851\n690 944\n484 601\n320 910\n98 1355\n816 794\n765 880\n551 1280\n", "output": "1\n4\n5\n6\n14\n32\n30\n9\n0\n12\n1\n1\n5\n4\n4\n15\n35\n0\n2\n13\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\nRussian translation\n\nLet's con...
[{"type": "stdin_stdout", "input": "8 7\n-1 4 4\n2 3 3\n3 4 1\n5 3 2\n5 4 1\n5 2 6\n1 5 2\n\n\nSAMPLE", "output": "-1\n"}, {"type": "stdin_stdout", "input": "8 7\n-1 4 4\n2 3 5\n3 4 1\n5 3 2\n5 4 1\n5 2 6\n1 5 2\n\n\nSAMPLE", "output": "-1\n"}, {"type": "stdin_stdout", "input": "8 7\n-1 4 4\n2 3 5\n3 4 1\n5 3 2\n5 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\nBig P has recently become very f...
[{"type": "stdin_stdout", "input": "1000 1962\n3 391\n4 276\n5 309\n6 279\n7 675\n8 387\n9 241\n10 629\n11 500\n12 612\n13 35\n14 472\n15 85\n16 865\n17 547\n18 101\n19 919\n20 830\n21 463\n22 445\n23 423\n24 721\n25 36\n26 523\n27 463\n28 528\n29 934\n30 880\n31 349\n32 942\n33 560\n34 375\n35 133\n36 630\n37 387\n38 ...
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\nHow many integer sequences A_1,A...
[{"type": "stdin_stdout", "input": "226564", "output": "498733826\n"}, {"type": "stdin_stdout", "input": "241465", "output": "202510248\n"}, {"type": "stdin_stdout", "input": "127499", "output": "463923590\n"}, {"type": "stdin_stdout", "input": "112403", "output": "286663221\n"}, {"type": "stdin_stdout", "input": "7086...
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": "119754 114575 7559", "output": "612524154\n"}, {"type": "stdin_stdout", "input": "119754 114575 8988", "output": "536128558\n"}, {"type": "stdin_stdout", "input": "145188 114575 8988", "output": "964030371\n"}, {"type": "stdin_stdout", "input": "145188 114575 3371", "output": "263223...
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\nGiven are a sequence A= {a_1,a_2...
[{"type": "stdin_stdout", "input": "5 1000000000\n6 6 2 6 2", "output": "166666667"}, {"type": "stdin_stdout", "input": "3 000\n14 22 40", "output": "0\n"}, {"type": "stdin_stdout", "input": "3 000\n14 16 40", "output": "0\n"}, {"type": "stdin_stdout", "input": "3 010\n14 16 40", "output": "0\n"}, {"type": "stdin_stdou...
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\nGiven are a prime number p and a...
[{"type": "stdin_stdout", "input": "5\n0 1 0 1 1", "output": "0 3 4 2 2\n"}, {"type": "stdin_stdout", "input": "5\n0 0 0 1 1", "output": "0 4 0 3 3\n"}, {"type": "stdin_stdout", "input": "5\n0 0 1 1 1", "output": "0 1 1 1 2\n"}, {"type": "stdin_stdout", "input": "5\n1 1 0 1 1", "output": "1 3 4 2 1\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\nYou are given a string S consist...
[{"type": "stdin_stdout", "input": "SHINJUKV", "output": "0\n"}, {"type": "stdin_stdout", "input": "HATAGBYA", "output": "4\n"}, {"type": "stdin_stdout", "input": "HASAGBYA", "output": "2\n"}, {"type": "stdin_stdout", "input": "VKUJNIHT", "output": "1\n"}, {"type": "stdin_stdout", "input": "HATAGCYA", "output": "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\nYou are given a string S of leng...
[{"type": "stdin_stdout", "input": "15 16\ndnausrayukusiia\ndujrunuma", "output": "240\n"}, {"type": "stdin_stdout", "input": "16 9\ndnsusrayukuaiia\ndujrunuma", "output": "144\n"}, {"type": "stdin_stdout", "input": "15 8\ndnausrayukusii`\ndujrunuma", "output": "120\n"}, {"type": "stdin_stdout", "input": "12 10\ndnsusr...
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\nWhen l is an odd number, the med...
[{"type": "stdin_stdout", "input": "6\n5 -1 -1 -1 13 -1", "output": "-1\n-1\n-1\n-1\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "6\n5 -1 -1 -1 13 0", "output": "-1\n0\n0\n0\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "6\n5 -2 -1 0 15 -2", "output": "-1\n0\n0\n-1\n-1\n0\n"}, {"type": "stdin_stdout", "input": "6\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\nYou are going out for a walk, wh...
[{"type": "stdin_stdout", "input": "5 2 1\n105611412\n1737860309\n1010000000\n1000000101\n1100000000", "output": "969572082\n"}, {"type": "stdin_stdout", "input": "5 3 1\n105611412\n1151487296\n1010000000\n1000000101\n1100000000", "output": "710247900\n"}, {"type": "stdin_stdout", "input": "5 2 1\n105611412\n1737860309...
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 cities. There are al...
[{"type": "stdin_stdout", "input": "25 4 4\n1 2\n3 3\n2 5\n6 7\n3 5\n4 3\n3 4\n6 7", "output": "1 1 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n"}, {"type": "stdin_stdout", "input": "27 0 1\n0 0\n2 10\n3 -1\n1 0", "output": "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\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\nAizu is famous for its buckwheat...
[{"type": "stdin_stdout", "input": "500\n1000\n0", "output": "850\n1520\n"}, {"type": "stdin_stdout", "input": "500\n1100\n0", "output": "850\n1950\n"}, {"type": "stdin_stdout", "input": "500\n2200\n0", "output": "850\n3390"}, {"type": "stdin_stdout", "input": "500\n0000\n-12", "output": "850\n"}, {"type": "stdin_stdou...
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\nInterest rates are attached to t...
[{"type": "stdin_stdout", "input": "2\n7\n1 5 2\n-1 9 2\n2\n14\n1 5 2\n-1 13 1\n0", "output": "-1\n-1\n"}, {"type": "stdin_stdout", "input": "2\n7\n1 5 2\n-1 12 2\n2\n14\n0 5 2\n0 10 1\n0", "output": "-1\n0\n"}, {"type": "stdin_stdout", "input": "2\n14\n1 3 0\n17 6 2\n2\n12\n1 5 2\n1 12 1\n0", "output": "17\n1\n"}, {"t...
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\nGas stations in the White Tiger ...
[{"type": "stdin_stdout", "input": "2 7\n1 1180\n1 1000\n0 2\n1 1001\n1 1002\n0 2\n0 1", "output": "1000\n1001\n1180\n"}, {"type": "stdin_stdout", "input": "2 7\n1 1353\n1 1000\n0 1\n1 1000\n1 1002\n0 1\n0 2", "output": "1353\n1000\n1000\n"}, {"type": "stdin_stdout", "input": "2 7\n1 1383\n1 1001\n0 1\n1 1001\n1 1002\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\nThere is a cube which consists o...
[{"type": "stdin_stdout", "input": "12 3\nxy 4 3\nxz 1 2\nyz 2 3\n7 5\nxy 1 1\nxy 3 3\nxz 3 2\nyz 2 1\nyz 3 3\n0 0", "output": "1692\n310\n"}, {"type": "stdin_stdout", "input": "12 3\nxy 4 3\nxz 1 2\nyz 2 3\n7 5\nxy 1 1\nyx 3 3\nxz 3 2\nyz 2 1\nyz 3 3\n0 0", "output": "1692\n315\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\nA wise king declared a new calen...
[{"type": "stdin_stdout", "input": "8\n-1 1 1\n344 4 0\n738 4 2\n182 9 5\n992 5 6\n344 5 26\n696 6 19\n231 8 25", "output": "196865\n128957\n51469\n160715\n1492\n128912\n59672\n151076\n"}, {"type": "stdin_stdout", "input": "8\n-1 1 1\n344 3 0\n738 4 2\n182 9 5\n998 5 7\n344 5 26\n696 6 19\n231 10 25", "output": "196865...
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\nSuppose that P1 is an infinite-h...
[{"type": "stdin_stdout", "input": "4 3\n7 4\n3 3\n0 0\n3 1\n4 4\n0 0\n8 1\n4 4\n0 2\n30 12\n2 12\n4 2\n15 2\n30 15\n13 25\n1 0\n8 5\n14 5\n21 3\n21 13\n18 15\n11 15\n6 5\n6 8\n11 4\n17 12\n9 9\n15 6\n20 10\n18 12\n3 3\n5 5\n10 2\n10 10\n20 2\n10 15\n10 8\n4 4\n-133 137\n-99 -104\n55 -98\n36 97\n-99 16\n-98 -98\n113 -9...
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\nChampernown constant is an irrat...
[{"type": "stdin_stdout", "input": "11 17\n11 14\n0 0", "output": "01112131415161718\n01112131415161\n"}, {"type": "stdin_stdout", "input": "4 7\n2 26\n0 0", "output": "4567891\n23456789101112131415161718\n"}, {"type": "stdin_stdout", "input": "2 5\n1 26\n0 0", "output": "23456\n12345678910111213141516171\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\nDr. Akita, who lives in the neig...
[{"type": "stdin_stdout", "input": "1 1\n3 2\n3 1+2*3-4\n3 1|2^3&4\n3 (1+2)*3\n3 1-1-1-1\n0 #", "output": "91\n92\n273\n93\n279\n88\n"}, {"type": "stdin_stdout", "input": "1 1\n3 4\n3 1+2*3-4\n3 1|2^3&4\n3 (1+2)*3\n3 1-1-1-1\n0 #", "output": "91\n94\n273\n93\n279\n88\n"}, {"type": "stdin_stdout", "input": "1 1\n3 4\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\nWrite a program which manipulate...
[{"type": "stdin_stdout", "input": "5 5\n0 0 0\n1 2 4\n1 0 0\n1 1 9\n1 1 2", "output": "2147483647\n0\n2147483647\n2147483647\n"}, {"type": "stdin_stdout", "input": "6 5\n1 0 0\n0 1 2\n1 2 3\n1 0 2\n1 2 2", "output": "2147483647\n2147483647\n2\n2147483647\n"}, {"type": "stdin_stdout", "input": "3 5\n0 0 1\n1 1 2\n1 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\nThere are n slimes in a row. Eac...
[{"type": "stdin_stdout", "input": "10\n-20 1 3 -5 -27 18 -3 -9 -7 9\n", "output": "102\n"}, {"type": "stdin_stdout", "input": "10\n-20 0 3 -5 -18 15 -3 -9 -7 9\n", "output": "89\n"}, {"type": "stdin_stdout", "input": "10\n-20 0 3 -5 -27 15 -3 -9 -7 9\n", "output": "98\n"}, {"type": "stdin_stdout", "input": "10\n-20 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 an integer sequenc...
[{"type": "stdin_stdout", "input": "1000003346\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1000070102\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1000271094\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1244164813\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1465465413\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 day Alice was cleaning up he...
[{"type": "stdin_stdout", "input": "21\n##.######.###.#####.#\n#...##.#.......#.#...\n##..#...#.....#.....#\n#....#..###.###.....#\n....#....####....#.##\n#..#....##.#....#.###\n#...#.###...#.##....#\n#..#.##.##.##.##.....\n..........##......#.#\n#.##.#......#.#..##.#\n#.##.............#...\n..........#.....##..#\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 only difference between easy...
[{"type": "stdin_stdout", "input": "100 3000\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 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 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\n10 8 1 9 7 5 12 9 15 7 16 5 17 5 17 21 11 3 4 4 30 17 3 84 12 30 2 8 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\nYou are given a sequence of n di...
[{"type": "stdin_stdout", "input": "5\n12\n040425524644\n1\n0\n9\n123456789\n2\n98\n3\n442\n", "output": "121212211211\n1\n111111111\n21\n221\n"}, {"type": "stdin_stdout", "input": "5\n12\n040425524644\n1\n0\n9\n123456789\n2\n98\n3\n713\n", "output": "121212211211\n1\n111111111\n21\n211\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\nSuppose there is a h Γ— w grid co...
[{"type": "stdin_stdout", "input": "19 16\n16 16 16 16 15 15 0 5 0 4 9 9 1 4 4 0 8 16 12\n6 12 19 15 8 6 19 19 14 6 12 16 10 11 15 4\n", "output": "974740338\n"}, {"type": "stdin_stdout", "input": "19 16\n16 16 16 16 15 15 0 5 0 4 9 9 1 4 4 0 8 16 12\n6 12 19 15 8 6 19 19 14 6 9 16 10 11 15 4\n", "output": "797922655\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\nFor an array a of integers let's...
[{"type": "stdin_stdout", "input": "1\n24\n1 1 1 1 1 1 2 2 2 2 2 2 4 4 4 4 4 4 5 5 5 5 5 5\n", "output": "YES\n12 13\n"}, {"type": "stdin_stdout", "input": "1\n24\n1 1 1 1 1 1 2 2 2 2 2 2 4 4 4 4 4 4 4 5 5 5 5 5\n", "output": "YES\n12 13\n"}, {"type": "stdin_stdout", "input": "1\n24\n1 1 2 1 1 1 2 2 2 2 2 2 4 4 4 4 4 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\n[SIHanatsuka - EMber](https://so...
[{"type": "stdin_stdout", "input": "60\n51 18 41 48 9 10 7 2 34 23 31 55 28 29 47 42 14 30 60 43 16 21 1 33 6 36 58 35 50 19 40 27 26 25 20 38 8 53 22 13 45 4 24 49 56 39 15 3 57 17 59 11 52 5 44 54 37 46 32 12\n", "output": "133605669\n"}, {"type": "stdin_stdout", "input": "59\n43 38 39 8 13 54 3 51 28 11 46 41 14 20 ...
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 strings S...
[{"type": "stdin_stdout", "input": "10\n0 i\n1 q\n2 g\n0 k\n1 e\n5 r\n4 m\n5 h\n3 p\n3 e\n5\n8 9 1 10 6\n", "output": "2 4 1 3 3 "}, {"type": "stdin_stdout", "input": "10\n0 i\n1 q\n2 g\n0 k\n1 e\n5 r\n4 m\n5 h\n3 o\n3 e\n5\n8 9 1 10 6\n", "output": "2 4 1 3 3\n"}, {"type": "stdin_stdout", "input": "10\n0 i\n1 q\n2 g\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\nMadeline has an array a of n int...
[{"type": "stdin_stdout", "input": "100\n32 85 33 27 35 48 64 40 45 120 68 58 108 115 99 71 47 82 42 34 63 49 102 30 88 70 73 52 51 95 104 41 38 59 91 21 43 107 44 113 109 25 55 118 112 90 37 106 103 100 114 78 31 26 92 79 89 105 62 54 72 69 101 36 98 77 93 97 75 96 22 76 86 57 46 110 65 61 23 50 83 87 39 74 111 67 29 ...
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 a consis...
[{"type": "stdin_stdout", "input": "5\n2\n2 6\n4\n2 2 7 14\n3\n3 3 4\n4\n10 5 10 5\n4\n1 2 1 1\n", "output": "NO\nNO\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "5\n2\n2 6\n4\n2 0 7 14\n3\n3 3 4\n4\n10 5 10 5\n4\n1 2 1 1\n", "output": "NO\nNO\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "5\n2\n2 3\n4\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\nYura has been walking for some t...
[{"type": "stdin_stdout", "input": "995078784 16\n623812784 347467913 233267735 582455459\n355611107 277980472\n78770458 786182235\n815219022 611815511\n786044046 363376661\n290398527 1777289213\n846155104 388600335\n143085949 155695413\n287078777 918827034\n432395923 126620751\n52941102 329010981\n237509699 571287936\...
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 the easy version of the ...
[{"type": "stdin_stdout", "input": "5\n2 2\n10\n11\n3 3\n011\n101\n110\n4 4\n1111\n0110\n0110\n1111\n5 5\n01011\n11001\n00010\n11011\n10000\n2 3\n011\n101\n", "output": "9\n1 1 2 1 2 2 \n1 1 1 2 2 2 \n1 1 2 1 1 2 \n2 1 1 1 1 2 \n2 1 2 2 1 2 \n2 1 1 1 2 2 \n2 2 1 2 1 1 \n2 2 2 1 1 1 \n2 2 1 2 2 1 \n18\n1 2 2 2 2 3 \n1 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\nBaby Ehab has a piece of Cut and...
[{"type": "stdin_stdout", "input": "100 1\n1 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 1 2 1 2 1 1 1 2 2 1 2 2 2 2 1 1 2 1 1 1 2 2 1 1 1 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 1 1 2 2 2 1 1 2 2 2 1 1 2 2 2 1 2 2 2\n1 100\n", "output": "46\n"}, {"type": "stdin_stdout", "input": "100 1\n1 1 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\nAt a geometry lesson Bob learnt ...
[{"type": "stdin_stdout", "input": "-100 -100 100 100 -100 100\n", "output": "RIGHT\n"}, {"type": "stdin_stdout", "input": "-100 -100 100 -100 0 73\n", "output": "NEITHER\n"}, {"type": "stdin_stdout", "input": "-45 -87 -34 -79 -60 -62\n", "output": "NEITHER\n"}, {"type": "stdin_stdout", "input": "-45 -87 -44 -79 -60 -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\nFurik and Rubik love playing com...
[{"type": "stdin_stdout", "input": "20\n2 2 3 2 3 1 1 3 1 1 1 1 1 3 2 1 3 1 1 1\n1 7\n13 7 1 11 4 6 16 20 12 5 18 19 15 10\n8 7 1 11 4 6 17 8 16\n3 7 1 11\n9 7 1 11 4 6 8 20 12 3\n4 7 1 11 4\n0\n6 7 1 11 4 6 17\n4 7 1 11 4\n7 7 1 11 4 6 17 5\n2 7 1\n9 7 1 11 4 6 17 8 14 20\n11 7 1 11 4 6 20 3 5 15 10 2\n5 7 1 11 4 6\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\nValera runs a 24/7 fast food caf...
[{"type": "stdin_stdout", "input": "50\n0 23\n1 21\n2 8\n2 45\n3 1\n4 19\n4 37\n7 7\n7 40\n8 43\n9 51\n10 13\n11 2\n11 19\n11 30\n12 37\n12 37\n12 37\n12 37\n12 37\n12 37\n12 37\n12 37\n12 54\n13 32\n13 42\n14 29\n14 34\n14 48\n15 0\n15 27\n16 22\n16 31\n17 25\n17 26\n17 33\n18 14\n18 16\n18 20\n19 0\n19 5\n19 56\n20 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\nPermutation p is an ordered set ...
[{"type": "stdin_stdout", "input": "011\n", "output": "890786230\n"}, {"type": "stdin_stdout", "input": "11\n", "output": "890786230\n"}, {"type": "stdin_stdout", "input": "15\n", "output": "150347555\n"}, {"type": "stdin_stdout", "input": "13\n", "output": "695720788\n"}, {"type": "stdin_stdout", "input": "9\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\nGerald plays the following game....
[{"type": "stdin_stdout", "input": "10 5\n2 1\n4 4\n2 2\n4 3\n1 1\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "5 5\n2 2\n5 3\n2 3\n5 1\n4 4\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5 5\n3 2\n5 4\n3 3\n2 3\n1 2\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "6 5\n2 1\n6 4\n2 2\n4 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\nXenia is an amateur programmer. ...
[{"type": "stdin_stdout", "input": "20 25\ncczxcvcxzxzczxcvccxvcxxcvcxcxzcvcxzxcvcxccvcc\nxzcvcxxzzxcvczzxcvcxzvcxzzxcvcxczxcx\n", "output": "655\n"}, {"type": "stdin_stdout", "input": "20 25\ncczxcvcxzwzczxcvccxvcxxcvcxcxzcvcxzxcvcxccvcc\nxzcvcxxzzxcvczzxcvcxzvcxzzxcvcxczxcx\n", "output": "665\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 Vasya has received a youn...
[{"type": "stdin_stdout", "input": "123\n112 277 170 247 252 115 157 293 256 143 196 90 12 164 164 42 8 223 167 109 175 232 239 111 148 51 9 254 93 32 268 162 231 91 47 162 161 191 195 145 247 292 129 199 230 94 144 217 18 205 176 20 143 198 121 243 211 262 230 277 195 255 108 290 220 275 158 2 286 200 60 267 278 207 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\nThis is yet another problem on r...
[{"type": "stdin_stdout", "input": "(?(((???))(??)?)?))))(?)????(()()???(?)????(??(??????)()(????(?)))))??(???(??)?(??)????????(????(?()\n39 78\n1 83\n2 35\n28 89\n53 53\n96 67\n16 46\n43 28\n25 73\n8 97\n57 41\n15 25\n47 49\n23 18\n97 77\n38 33\n68 80\n38 98\n62 8\n61 79\n84 50\n71 48\n12 16\n97 95\n16 70\n72 58\n55 8...
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 police department of your ci...
[{"type": "stdin_stdout", "input": "146\n4 -1 -1 -1 -1 -1 -1 -1 -1 -1 4 -1 3 -1 3 -1 -1 1 4 -1 2 -1 -1 3 -1 -1 -1 4 1 -1 -1 -1 4 -1 -1 -1 -1 -1 -1 3 2 -1 3 2 4 5 2 4 1 5 -1 -1 2 -1 -1 1 -1 5 3 -1 1 2 2 3 5 3 -1 -1 3 -1 -1 3 5 5 -1 -1 5 -1 4 4 1 -1 -1 -1 2 1 -1 -1 -1 2 5 3 -1 -1 -1 3 -1 5 4 -1 1 -1 -1 3 -1 -1 3 1 1 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\nLittle Masha loves arranging her...
[{"type": "stdin_stdout", "input": "7\n", "output": "877\n{1,2,3,4,5,6,7}\n{1,2,3,4,5,6},{7}\n{1,2,3,4,5},{6},{7}\n{1,2,3,4,5},{6,7}\n{1,2,3,4,5,7},{6}\n{1,2,3,4,7},{5},{6}\n{1,2,3,4},{5,7},{6}\n{1,2,3,4},{5},{6,7}\n{1,2,3,4},{5},{6},{7}\n{1,2,3,4},{5,6},{7}\n{1,2,3,4},{5,6,7}\n{1,2,3,4,7},{5,6}\n{1,2,3,4,6,7},{5}\n{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\nMike is trying rock climbing but...
[{"type": "stdin_stdout", "input": "100\n2 43 47 49 50 57 59 67 74 98 901 903 904 906 907 908 909 910 911 912 913 914 915 916 917 1525 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 938 939 940 942 943 944 945 946 947 948 949 950 952 953 954 956 957 1027 959 960 961 962 963 965 966 967 968 969 ...
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\nLimak is a little bear who loves...
[{"type": "stdin_stdout", "input": "170\n1 2 1 2 1 1 1 1 2 3 2 1 1 2 2 1 2 1 2 1 1 2 3 3 2 1 1 1 1 1 1 1 1 2 1 2 3 3 2 1 2 2 1 2 3 2 1 1 2 3 2 1 2 1 1 1 2 3 3 2 1 2 1 2 1 1 1 2 1 2 1 1 2 2 1 1 2 1 2 2 1 2 1 2 2 1 2 1 2 3 2 1 1 2 3 4 4 3 2 1 2 1 2 1 2 3 3 2 1 2 1 1 1 1 1 1 1 2 2 1 1 2 1 1 1 1 2 1 1 2 3 2 1 2 2 1 2 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\nYou are given a rectangular fiel...
[{"type": "stdin_stdout", "input": "10 10\n*.*...*.**\n..*...*.**\n.**.***...\n....*.*.**\n***....***\n.*..*...*.\n.***.*..*.\n.*****.*.*\n*.***.*...\n..*..*....\n", "output": "9.9...5.71\n..9...5.77\n.99.997...\n....9.5.77\n299....513\n.2..0...1.\n.490.0..9.\n.71120.7.1\n7.434.8...\n..6..2....\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\nInternational Abbreviation Olymp...
[{"type": "stdin_stdout", "input": "9\nIAO'0\nIAO'00\nIAO'000\nIAO'0000\nIAO'00000\nIAO'000000\nIAO'0000000\nIAO'00000000\nIAO'000000000\n", "output": "1990\n2000\n3000\n10000\n100000\n1000000\n10000000\n100000000\n1000000000\n"}, {"type": "stdin_stdout", "input": "9\nIAO'0\nIAO'00\nIAO'000\nIAO'0000\nIAO'00000\nIAO'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\nWhile swimming at the beach, Mik...
[{"type": "stdin_stdout", "input": "9\n123456789\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "9\n722403540\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "9\n246112056\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "9\n289887167\n", "output": "YES\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\nzscoder wants to generate an inp...
[{"type": "stdin_stdout", "input": "9999999 1516835495 202833713\n", "output": "18316694854"}, {"type": "stdin_stdout", "input": "7789084 807239576 813643932\n", "output": "25165322688"}, {"type": "stdin_stdout", "input": "9999999 987654321 123456789\n", "output": "11728395036"}, {"type": "stdin_stdout", "input": "4528...
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 upon a time Petya and Gena ...
[{"type": "stdin_stdout", "input": "110\n-256 -149 -136 -33 -253 -141 -170 -253 0 -107 -141 -236 -65 -158 -84 -180 -97 -97 -223 -44 -232 -255 -108 -25 -49 -48 -212 -3 -232 -172 -231 -158 -23 -206 -198 -55 -36 -11 -169 -94 -190 -115 -116 -231 -155 -201 -155 -103 -242 -119 -136 -8 -2 -11 -69 -250 -51 -129 -155 -216 -107 ...
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\nBomboslav likes to look out of t...
[{"type": "stdin_stdout", "input": "1999999997\n1\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1999999995\n0\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1234567890\n0\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "2000000000\n2\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\nYou are given a convex polygon P...
[{"type": "stdin_stdout", "input": "19\n449447997 711296339\n530233434 692216537\n535464528 613140435\n535533467 100893188\n530498867 -265063956\n519107979 -271820709\n482156929 -287792333\n-303730271 -287970295\n-416935204 -263348201\n-443613873 -249980523\n-453444829 -173903413\n-462102798 -80789280\n-462064673 -1322...
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\nHolidays have finished. Thanks t...
[{"type": "stdin_stdout", "input": "1000000000 12\n", "output": "479001600\n"}, {"type": "stdin_stdout", "input": "12 1000000000\n", "output": "479001600\n"}, {"type": "stdin_stdout", "input": "1000000100 12\n", "output": "479001600\n"}, {"type": "stdin_stdout", "input": "12 1000100000\n", "output": "479001600\n"}, {"t...
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 elections to Berland parliam...
[{"type": "stdin_stdout", "input": "100 100 100 100\n71 22 92 3 19 90 1 16 88 56 62 37 56 84 52 46 4 64 21 19 37 54 21 81 56 33 71 57 86 75 62 42 79 67 14 8 66 30 13 38 20 71 36 66 46 55 4 99 18 37 7 24 72 46 32 86 87 7 90 93 96 94 21 23 62 53 16 11 11 83 21 81 68 50 85 9 94 60 47 41 34 82 11 12 95 81 61 81 86 85 64 36...
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\nRock... Paper!\n\nAfter Karen ha...
[{"type": "stdin_stdout", "input": "30\n1143673 436496 1214486 1315862 148404 724601 1430740 1433008 1654610 1635673 614673 1713408 1270999 1697 1463796 50027 525482 1659078 688200 842647 518551 877506 1017082 1807856 3280 759698 1208220 470180 829800 1960886\n1312613 1965095 967255 1289012 1950383 582960 856825 49684 ...
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\nJamie loves sleeping. One day, h...
[{"type": "stdin_stdout", "input": "12\n00 06\n", "output": "31\n"}, {"type": "stdin_stdout", "input": "60\n03 00\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "10\n03 10\n", "output": "56\n"}, {"type": "stdin_stdout", "input": "5\n06 00\n", "output": "145\n"}, {"type": "stdin_stdout", "input": "60\n04 08\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\nDima has a hamsters farm. Soon N...
[{"type": "stdin_stdout", "input": "1998451655 50\n977141206 956777871 186433588 538218068 28363231 327484438 88827268 266300062 670616672 756092978 414181331 913675814 898008516 343057716 99416265 255545168 76528140 550467703 684435578 844649988 1024428164 550467703 493542638 33869647 414181331 198095018 913675814 994...
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 night wasn't easy on Vasya....
[{"type": "stdin_stdout", "input": "234906817379759421\n", "output": "22773236965920\n"}, {"type": "stdin_stdout", "input": "462534182594129378\n", "output": "13498126800480\n"}, {"type": "stdin_stdout", "input": "987654321123456789\n", "output": "33007837322880\n"}, {"type": "stdin_stdout", "input": "98765432002345678...
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\nArjit has his own printing press...
[{"type": "stdin_stdout", "input": "3\nbbbb\naaa\nzxewya\nabcd\nac\nzzzb\n\nSAMPLE", "output": "aaab\nabcdya\nab\n"}, {"type": "stdin_stdout", "input": "3\nbbbb\naaa\nzxewya\nabcd\nca\nzzzb\n\nSAMPLE", "output": "aaab\nabcdya\nba\n"}, {"type": "stdin_stdout", "input": "3\nbbbb\naaa\nzxewya\ncbad\nca\nzzza\n\nSAMPLE", "...
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 us look at the close relativ...
[{"type": "stdin_stdout", "input": "200\n2 14\n17 24\n12 19\n17 18\n2 17\n3 6\n1 5\n13 14\n17 18\n1 2\n1 2\n10 30\n1 13\n4 7\n22 24\n9 24\n5 26\n21 22\n4 7\n13 15\n1 2\n6 10\n16 25\n1 6\n3 14\n1 12\n10 15\n7 11\n5 8\n1 8\n5 16\n5 7\n11 24\n1 12\n7 8\n5 30\n12 25\n4 14\n4 12\n13 18\n18 27\n7 11\n2 10\n8 19\n2 20\n15 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 will be given a contest sche...
[{"type": "stdin_stdout", "input": "5\n86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82\n19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424\n6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 ...
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 the season of TAKOYAKI ...
[{"type": "stdin_stdout", "input": "7\n-1 -1 281 -2 0 10 9", "output": "4234\n"}, {"type": "stdin_stdout", "input": "7\n-1 -1 395 -2 0 10 9", "output": "5944\n"}, {"type": "stdin_stdout", "input": "7\n-1 0 119 -3 -1 5 12", "output": "1410\n"}, {"type": "stdin_stdout", "input": "7\n-2 0 119 -3 -1 5 12", "output": "1278\...
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 tree with N vert...
[{"type": "stdin_stdout", "input": "7\n0011101\n1 2\n2 3\n1 4\n4 5\n1 6\n6 7", "output": "-1\n"}, {"type": "stdin_stdout", "input": "7\n1010110\n1 2\n2 3\n1 4\n4 5\n1 6\n6 7", "output": "-1\n"}, {"type": "stdin_stdout", "input": "7\n0010110\n1 2\n2 3\n1 4\n4 5\n1 6\n6 7", "output": "-1"}, {"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\nSnuke lives at position x on a n...
[{"type": "stdin_stdout", "input": "1 1455 0000", "output": "B\n"}, {"type": "stdin_stdout", "input": "1 1200 0101", "output": "B\n"}, {"type": "stdin_stdout", "input": "1 999 0000", "output": "B\n"}, {"type": "stdin_stdout", "input": "1 381 1110", "output": "A\n"}, {"type": "stdin_stdout", "input": "1 999 0100", "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\nAtCoDeer the deer found N rectan...
[{"type": "stdin_stdout", "input": "5\n999999999 1000001000\n1 -1\n269 106\n500000 500001\n999999999 1000000000", "output": "1999999892\n"}, {"type": "stdin_stdout", "input": "5\n999999999 1000001000\n1 -1\n269 101\n500000 500001\n999999999 1000000000", "output": "1999999897\n"}, {"type": "stdin_stdout", "input": "5\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\nWe have a pyramid with N steps, ...
[{"type": "stdin_stdout", "input": "8 8", "output": "Yes\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n"}, {"type": "stdin_stdout", "input": "7 7", "output": "Yes\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n"}, {"type": "stdin_stdout", "input": "6 6", "output": "Yes\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\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\nA thief sneaked into a museum wi...
[{"type": "stdin_stdout", "input": "50\n5\n60,10\n100,10\n03,022\n210,45\n10,4\n162\n5\n60,10\n100,20\n120,30\n210,45\n10,4\n0", "output": "Case 1:\n220\n49\nCase 2:\n500\n109\n"}, {"type": "stdin_stdout", "input": "50\n5\n60,20\n100,20\n03,021\n210,45\n10,4\n143\n5\n60,10\n100,20\n120,30\n200,45\n10,4\n0", "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\nIt's been a while since I played...
[{"type": "stdin_stdout", "input": "AABBAAABABAABBBAABA\nAABBBABBABBAAABABABAAB\nBABAABAABABABBAAAB\nAABABAAABBAABBBABAA\nAAAAAAAAAAA\nABBBBBBBBBB\n0", "output": "11 8\n10 12\n11 7\n11 8\n11 0\n0 11\n"}, {"type": "stdin_stdout", "input": "ABAABBBAABABAAABBAA\nAABBBABBABBAAABABABAAB\nBABAABAABABABBAAAB\nAABABAAABBAABBBA...
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 smallest unit of data handle...
[{"type": "stdin_stdout", "input": "-322", "output": "-10304\n"}, {"type": "stdin_stdout", "input": "-542", "output": "-17344\n"}, {"type": "stdin_stdout", "input": "-130", "output": "-4160\n"}, {"type": "stdin_stdout", "input": "-133", "output": "-4256\n"}, {"type": "stdin_stdout", "input": "-199", "output": "-6368\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\nTo the west of the Au...
[{"type": "stdin_stdout", "input": "3 2\n26 58 0 50 135 000\n10 24 20 127 126 60\n40 60 20 90 90 131", "output": "60000\n"}, {"type": "stdin_stdout", "input": "1 1\n20 50 -2 50 70 000\n10 102 11 39 90 40\n75 100 36 102 159 8", "output": "1200\n"}, {"type": "stdin_stdout", "input": "1 1\n20 50 -3 50 70 000\n10 102 11 39...
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> I would, if I could,\n> If I ...
[{"type": "stdin_stdout", "input": "15 2 3\n16 3 6\n110 9 112\n0 0 0", "output": "1\n11\n98\n"}, {"type": "stdin_stdout", "input": "15 2 4\n16 3 6\n110 9 112\n0 0 0", "output": "8\n11\n98\n"}, {"type": "stdin_stdout", "input": "15 2 4\n15 3 6\n110 9 112\n0 0 0", "output": "8\n10\n98\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\nThe ACM ICPC judges are very car...
[{"type": "stdin_stdout", "input": "8\n1 1 1 1 1 1 2 1 8\n3 2 3 2 3 2 4 2 10\n6 4 7 13 7 b a 2 2e\ne1 13 ce 28 ca 6 ab 46 a5d\nb08 49e2 6128 f27 8cf2 bc50 7380 7fe1 722b\n4eba eb4 a352 fd14 6ac1 fed1 dd06 bb83 392bc\nef593c08 847e522f c9b20c47 26f3a4e1 e2720a01 6fe66007\n7a4e96ad 6ee5cef6 3853cd88\n8bf20206 757d6d66 9c...
code_stdio