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\nVasya learns to type. He has an ...
[{"type": "stdin_stdout", "input": "10 10 2\nfriuxvShvg\nerslojqtgu\nzeqsmdewry\nwvhbeeyeSu\ngkofbjaavr\ntwkcdxugps\nnzlylSmafu\nstamkpxnzt\nuwxwximkrm\nmzxyboazbl\n100\nmRIfAtrLKmztpVkAmojDCiIgseBwlUilBIiyDQhqNhNAqVLLIobuCIretLdSvixNNdCiouFMXtwHZFlObCeaygmIiFBfaCirbmCa\n", "output": "19\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\nFirecrackers scare Nian the mons...
[{"type": "stdin_stdout", "input": "3\n-10 4 10\n10 4 10\n0 -7 10\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "3\n-10 4 10\n14 4 10\n0 -7 10\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "3\n-2 -5 4\n-5 -1 5\n-6 -2 16\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "3\n-2 -5 4\n-5 -1 5\n-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\nYou are given a cost matrix of d...
[{"type": "stdin_stdout", "input": "2\n2 2\n-2 1\n1 7\n2\n1 0 0\n0 0 2\n2 2\n0 2\n## 4\n3\n1 1 2\n1 1 2\n1 1 2\n\nELPMAS", "output": "-1\nNot so many paths\nNot so many paths\nNot so many paths\nNot so many paths\n"}, {"type": "stdin_stdout", "input": "2\n2 2\n0 2\n1 7\n2\n1 0 2\n0 0 2\n2 2\n0 2\n## 4\n3\n1 1 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\nHave you ever been a part of the...
[{"type": "stdin_stdout", "input": "6\nabba\n\nSAMPLE", "output": "5\n"}, {"type": "stdin_stdout", "input": "6\nbbba\n\nSAMPLE", "output": "4\n"}, {"type": "stdin_stdout", "input": "6\nabaa\n\nSAMPLE", "output": "3\n"}, {"type": "stdin_stdout", "input": "6\nabba\n\nELPMAS", "output": "5\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\nRoy has a string S of length N. ...
[{"type": "stdin_stdout", "input": "4\n1\ncab\n3\naab\n4\naabd\n7\nzyxTAMPLE", "output": "1\n6\n10\n10\n"}, {"type": "stdin_stdout", "input": "4\n3\nabc\n3\nbba\n4\naabc\n3\nzyxSAMPLE", "output": "6\n4\n10\n3\n"}, {"type": "stdin_stdout", "input": "4\n3\nabc\n3\nbba\n4\naabc\n3\nzxxSAMPLE", "output": "6\n4\n10\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\nIn his childhood, Utkarsh had a ...
[{"type": "stdin_stdout", "input": "60763 1494\n52004 12938\n18442 7602\n43931 22561\n48729 11667\n38628 28838\n44614 9005\n38681 20584\n51510 5055\n37897 2682\n43654 9484\n30586 27863\n58148 26139\n38459 13617\n54141 6829\n57425 16687\n59078 1031\n30625 1543\n24716 4165\n14692 10813\n50670 17418\n50132 21555\n26626 77...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 loves the number 7 and...
[{"type": "stdin_stdout", "input": "1041437", "output": "245040\n"}, {"type": "stdin_stdout", "input": "2243343", "output": "747780\n"}, {"type": "stdin_stdout", "input": "1558339", "output": "177360\n"}, {"type": "stdin_stdout", "input": "451457", "output": "220458\n"}, {"type": "stdin_stdout", "input": "342119", "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\nIn 2937, DISCO creates a new uni...
[{"type": "stdin_stdout", "input": "1486 120 1001", "output": "960152848\n"}, {"type": "stdin_stdout", "input": "328 102 1011", "output": "261361566\n"}, {"type": "stdin_stdout", "input": "328 102 1111", "output": "647647330\n"}, {"type": "stdin_stdout", "input": "328 117 1011", "output": "407646568\n"}, {"type": "stdi...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn order to pass the entrance ex...
[{"type": "stdin_stdout", "input": "-1 011", "output": "-0.0909090909091\n"}, {"type": "stdin_stdout", "input": "1 106", "output": "0.00943396226415\n"}, {"type": "stdin_stdout", "input": "1 011", "output": "0.0909090909091\n"}, {"type": "stdin_stdout", "input": "13 18", "output": "0.722222222222\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\nThere is a farm whose length and...
[{"type": "stdin_stdout", "input": "-33 13", "output": "-408\n"}, {"type": "stdin_stdout", "input": "-36 13", "output": "-444\n"}, {"type": "stdin_stdout", "input": "-36 17", "output": "-592\n"}, {"type": "stdin_stdout", "input": "-1 -105", "output": "212\n"}, {"type": "stdin_stdout", "input": "-2 -105", "output": "318...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 3 \\times 3 grid. A nu...
[{"type": "stdin_stdout", "input": "19 -1 0\n2 3 6\n4 -4 -1", "output": "No\n"}, {"type": "stdin_stdout", "input": "12 -1 3\n2 2 3\n2 -4 2", "output": "No\n"}, {"type": "stdin_stdout", "input": "12 -1 0\n2 2 3\n2 -4 2", "output": "No\n"}, {"type": "stdin_stdout", "input": "12 -1 0\n2 2 3\n4 -4 2", "output": "No\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 grid with H rows and W...
[{"type": "stdin_stdout", "input": "6 7 12", "output": "RRRRRRR\nRRRRRRR\nRRRRRRR\nRRRRRRR\nRRRRRRR\nYRRRRRR\n"}, {"type": "stdin_stdout", "input": "7 6 1", "output": "RBRBRB\nBRBRBR\nRBRBRB\nBRBRBR\nRBRBRB\nBRBRBR\nRBRBRB\n"}, {"type": "stdin_stdout", "input": "6 6 12", "output": "RRRRRR\nRRRRRR\nRRRRRR\nRRRRRR\nRRRRR...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMr.X, who the handle name is T, ...
[{"type": "stdin_stdout", "input": "2\ntourist\neptr\ne", "output": "1\n"}, {"type": "stdin_stdout", "input": "2\nssvuhnr\nerrs\nf", "output": "2\n"}, {"type": "stdin_stdout", "input": "2\nhupouvt\netor\ni", "output": "3\n"}, {"type": "stdin_stdout", "input": "2\nsourist\neptr\ne", "output": "1\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\nWe have a graph with N vertices,...
[{"type": "stdin_stdout", "input": "2 1\n0 0 1000000010", "output": "1000000011\n"}, {"type": "stdin_stdout", "input": "2 1\n1 0 1000000010", "output": "1000000010\n"}, {"type": "stdin_stdout", "input": "2 1\n0 0 1000000100", "output": "1000000101\n"}, {"type": "stdin_stdout", "input": "2 1\n0 0 1000001010", "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 cryptography, Caesar cipher i...
[{"type": "stdin_stdout", "input": "xlmw mw xli tmgxyvi xlex m xsso mr ilx xvmt.", "output": "this is the picture that i took in eht trip.\n"}, {"type": "stdin_stdout", "input": "xlmw mw xli tmgxyvi xlex m ossx mr ilx xvmt.", "output": "this is the picture that i koot in eht trip.\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\nIt is known that each weight of ...
[{"type": "stdin_stdout", "input": "1204", "output": "+--00--+\n"}, {"type": "stdin_stdout", "input": "1942", "output": "+0-000-+\n"}, {"type": "stdin_stdout", "input": "384", "output": "+---+-0\n"}, {"type": "stdin_stdout", "input": "567", "output": "+-+0000\n"}, {"type": "stdin_stdout", "input": "397", "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\nproblem\n\nA city in Canada wher...
[{"type": "stdin_stdout", "input": "10 4\n13 70\n0 0", "output": "26\n55422\n"}, {"type": "stdin_stdout", "input": "10 4\n13 80\n0 0", "output": "26\n77629\n"}, {"type": "stdin_stdout", "input": "4 5\n13 34\n0 0", "output": "11\n61707\n"}, {"type": "stdin_stdout", "input": "8 4\n15 33\n0 0", "output": "20\n41241\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\nCurrently, people's entertainmen...
[{"type": "stdin_stdout", "input": "1 2 1 1 1 0\n1 2 1 0 0 -1\n1 0 0 0 1 1\n3 -1 0 0 2 0\n3 1 0 1 3 1\n0 2 0 2 -1 0\n0 0 1 1 0 7\n2 0 0 1 0 0\n0 0 0 0 0 0", "output": "1\n0\n1\n1\n3\n0\n2\n1\n"}, {"type": "stdin_stdout", "input": "1 2 1 1 1 0\n1 2 1 0 0 -1\n1 0 0 0 1 1\n3 -1 0 0 2 0\n3 0 0 1 3 1\n0 2 0 2 -1 0\n0 0 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\nNatsuki and her friends were tak...
[{"type": "stdin_stdout", "input": "23 4\n2 3\n3 1\n6 4\n5 2", "output": "1966080\n"}, {"type": "stdin_stdout", "input": "23 4\n2 3\n3 1\n6 6\n5 2", "output": "2621440\n"}, {"type": "stdin_stdout", "input": "24 4\n2 3\n3 2\n4 4\n5 2", "output": "6291456\n"}, {"type": "stdin_stdout", "input": "19 4\n2 2\n3 4\n4 3\n9 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\nProblem Statement\n\nNathan O. D...
[{"type": "stdin_stdout", "input": "5\n1 x 0 4 x\n2\nx x\n2\n1 2\n2\n3 0\n2\n1000000000 x\n4\nx 4 1 x\n0", "output": "ambiguous\nnone\nambiguous\nnone\nambiguous\nambiguous\n"}, {"type": "stdin_stdout", "input": "5\n1 x 0 4 x\n2\nx x\n2\n1 2\n2\n3 0\n2\n0000000000 x\n4\nx 4 1 x\n0", "output": "ambiguous\nnone\nambiguou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n3\n\n\nOutpu...
[{"type": "stdin_stdout", "input": "20093", "output": "276\n"}, {"type": "stdin_stdout", "input": "5663", "output": "100\n"}, {"type": "stdin_stdout", "input": "1761", "output": "292\n"}, {"type": "stdin_stdout", "input": "2283", "output": "36\n"}, {"type": "stdin_stdout", "input": "1253", "output": "88\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\nIn the building of Jewelry Art G...
[{"type": "stdin_stdout", "input": "8 10 18\n2 12 16 14 18 4 17 10", "output": "430\n"}, {"type": "stdin_stdout", "input": "8 10 18\n2 12 16 14 18 6 17 10", "output": "410\n"}, {"type": "stdin_stdout", "input": "8 10 18\n2 12 16 14 18 4 17 11", "output": "420\n"}, {"type": "stdin_stdout", "input": "8 10 18\n2 12 18 14 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 given weighted graph $G = ...
[{"type": "stdin_stdout", "input": "5\n0 3 2 4 3 1 1 2\n1 2 3 3 3 4\n2 3 0 3 3 2 4 1\n3 4 0 1 0 -1 1 0 3 3\n4 2 0 1 3 3", "output": "0 0\n1 1\n2 4\n3 1\n4 5\n"}, {"type": "stdin_stdout", "input": "5\n0 3 2 4 3 1 1 2\n1 2 1 4 3 4\n2 3 0 10 3 0 4 1\n3 4 0 1 0 1 1 1 1 3\n4 2 2 1 3 3", "output": "0 0\n1 2\n2 4\n3 1\n4 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\nWrite a program which calculates...
[{"type": "stdin_stdout", "input": "-10 2", "output": "-20 -16\n"}, {"type": "stdin_stdout", "input": "-16 -2", "output": "32 -36\n"}, {"type": "stdin_stdout", "input": "-16 -1", "output": "16 -34\n"}, {"type": "stdin_stdout", "input": "-16 1", "output": "-16 -30\n"}, {"type": "stdin_stdout", "input": "4 122", "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\nEverybody loves magic, especiall...
[{"type": "stdin_stdout", "input": "2\n2\n0 -5\n16 0\n2\n-1 -45\n-3 -2", "output": "16.0000000\nBad Judges\n"}, {"type": "stdin_stdout", "input": "2\n2\n0 -5\n15 0\n2\n-3 -22\n-4 -4", "output": "15.0000000\nBad Judges\n"}, {"type": "stdin_stdout", "input": "2\n2\n0 -5\n17 0\n2\n-3 -22\n-4 -4", "output": "17.0000000\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Fair Nut is going to travel ...
[{"type": "stdin_stdout", "input": "10\n4 85 87 24 19 100 27 11 117 120\n5 4 118\n8 9 18\n2 9 98\n8 1 61\n7 2 17\n3 9 25\n10 8 57\n1 4 80\n6 1 0\n", "output": "235\n"}, {"type": "stdin_stdout", "input": "10\n4 85 87 24 19 100 27 11 117 79\n5 4 118\n8 9 18\n2 9 168\n8 1 61\n7 2 17\n3 9 74\n10 8 57\n1 4 80\n6 1 0\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\nAsya loves animals very much. Re...
[{"type": "stdin_stdout", "input": "64\n2 20\n37 55\n42 29\n36 54\n35 50\n60 41\n25 61\n31 51\n9 43\n26 28\n48 56\n13 64\n17 19\n8 12\n52 16\n24 44\n1 18\n58 15\n5 30\n3 7\n62 22\n53 14\n11 38\n10 49\n47 59\n40 45\n33 4\n23 39\n63 57\n32 46\n34 6\n27 21\n20 55\n29 54\n35 60\n61 51\n9 26\n48 13\n19 12\n52 44\n1 58\n5 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\nCat Furrier Transform is a popul...
[{"type": "stdin_stdout", "input": "699050\n", "output": "35\n19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1\n"}, {"type": "stdin_stdout", "input": "349525\n", "output": "34\n18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2\n"}, {"type": "stdin_stdout", "input": "174762\n", "output": "31\n17 16 15 14 13 12 11 10 9 8 7 6 5 4 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\nTokitsukaze and CSL are playing ...
[{"type": "stdin_stdout", "input": "14\n9 9 1000 2000 39999 48888 16 32 123456 959658 111 987584 125632 125468\n", "output": "sjfnb\n"}, {"type": "stdin_stdout", "input": "14\n9 9 1000 2000 39999 48888 16 32 123456 959658 111 987584 125632 125477\n", "output": "cslnb\n"}, {"type": "stdin_stdout", "input": "14\n9 9 1000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAnia has a large integer S. Its ...
[{"type": "stdin_stdout", "input": "400 224\n34034718296316650556302576767095880542740697596682657060609028712014739414658241556774411582749368771597248873201583574900424227251655547840887764275893533353440635216728376201808545879398359535670372855472971530695051695650262058940466340529417646357776899296790403916961389...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "3\n3\n0 9\n1 10\n1 9\n7\n1 0\n1 1\n1 6\n6 2\n1 1\n4 0\n3 1\n6\n2 10\n2 4\n2 8\n2 14\n1 5\n5 5\n", "output": "0\n0\n4\n"}, {"type": "stdin_stdout", "input": "3\n3\n0 5\n1 10\n1 10\n7\n0 1\n1 1\n1 3\n6 2\n1 1\n4 0\n3 1\n6\n2 10\n2 4\n2 8\n2 7\n4 5\n5 5\n", "output": "0\n0\n9\n"}, {"typ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou play a strategic video game ...
[{"type": "stdin_stdout", "input": "10 10 2\n2 1 1615\n2 1 1326\n0 0 3880\n2 0 1596\n1 2 4118\n0 0 4795\n0 1 927\n0 0 4555\n0 1 3284\n2 2 1910\n10 6\n2 1\n8 3\n8 7\n6 3\n4 1\n7 4\n6 4\n7 2\n10 9\n", "output": "27079\n"}, {"type": "stdin_stdout", "input": "10 10 0\n0 2 1413\n0 0 4466\n0 0 1302\n0 0 2959\n0 2 1182\n0 0 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\nYou are given a rectangular matr...
[{"type": "stdin_stdout", "input": "7 8\n110137 66175 74657 124739 63011 153464 30956 8\n9 62369 169892 183765 84737 20941 35760 132079\n20802 67434 149925 53269 150062 35286 50218 112696\n153864 26 7405 121648 170439 115181 195278 127323\n136381 197880 57522 109132 104537 38 39 47930\n51739 77547 43 169711 18955 13495...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIchihime is the current priestes...
[{"type": "stdin_stdout", "input": "14\n2374453 2374454 8591131 23094546\n5813291 5813292 9709163 35032815\n4280399 23049698 23049701 34728360\n15184184 18688462 22400847 22400849\n24397371 31462070 33936330 33936331\n21376685 28241116 38909200 38909202\n29491847 31628480 31628482 45225214\n15144763 15414479 36902879 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\nWe define x mod y as the remaind...
[{"type": "stdin_stdout", "input": "500000 250000\n", "output": "803991687\n"}, {"type": "stdin_stdout", "input": "500000 471528\n", "output": "588862109\n"}, {"type": "stdin_stdout", "input": "500000 121854\n", "output": "377057930\n"}, {"type": "stdin_stdout", "input": "123456 78901\n", "output": "963821949\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\nBertown is a city with n buildin...
[{"type": "stdin_stdout", "input": "2\n1 1\n01000010\n10 1\n01101110\n", "output": "2\n11\n"}, {"type": "stdin_stdout", "input": "2\n2 1\n11000110\n10 1\n01101111\n", "output": "4\n11\n"}, {"type": "stdin_stdout", "input": "2\n1 1\n01010010\n10 1\n01101100\n", "output": "3\n11\n"}, {"type": "stdin_stdout", "input": "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 two integers l and...
[{"type": "stdin_stdout", "input": "168\n011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\n1001000000110110000010101110101001001101001011011101111001010000101100011111111111001000111011001001100101101...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 is known for his love ...
[{"type": "stdin_stdout", "input": "15\n2\n660632533 660632533\n2\n774306959 774306959\n2\n971739496 784083784\n2\n775353256 672614891\n2\n403290217 403290217\n2\n651261320 651261320\n2\n894672621 894672621\n2\n46281693 620415865\n2\n92929999 409128591\n2\n26890011 630323358\n2\n443724284 443724284\n2\n308822599 308822...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 defeating a Blacklist Riva...
[{"type": "stdin_stdout", "input": "10\n0.1000 0.1000 0.8000 0.5460931614544986\n0.1111 0.1111 0.7778 0.1111\n0.0001 0.0001 0.9998 1.174827513717328\n0.8000 0.1000 0.1000 0.1000\n0.1000 0.8000 0.1000 0.992075111118174\n0.9000 0.0999 0.0001 0.9000\n0.0999 0.9000 0.0001 0.9000\n0.3333 0.6666 0.0001 0.873181103672425\n0.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\n\"This problem is rubbish! There...
[{"type": "stdin_stdout", "input": "5\n", "output": "1"}, {"type": "stdin_stdout", "input": "4\n", "output": "2"}, {"type": "stdin_stdout", "input": "2\n", "output": "3"}, {"type": "stdin_stdout", "input": "3\n", "output": "1"}, {"type": "stdin_stdout", "input": "1\n", "output": "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\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\nThe World Programming Olympics M...
[{"type": "stdin_stdout", "input": "10 24 2621 2533 3148 3544 4273 4921 2950 3780 4483\n10 1687 4906 4246 2814 1874 3020 3039 3971 102 492\n10 3458 2699 2463 4395 3607 550 1608 958 3970 3077\n4 891\n", "output": "4919.7621246685\n"}, {"type": "stdin_stdout", "input": "10 24 2621 2533 3148 3544 4273 4921 2950 3780 4461\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 programming language ...
[{"type": "stdin_stdout", "input": "2 100\n44\n1 2\n2 2\n2 2\n1 2\n1 1\n2 2\n2 2\n1 2\n1 1\n1 1\n1 2\n1 1\n1 2\n1 1\n2 2\n1 1\n1 2\n2 2\n1 2\n1 2\n2 2\n2 2\n1 2\n1 1\n1 1\n1 2\n1 1\n2 2\n1 2\n1 2\n2 2\n1 2\n1 2\n2 2\n1 2\n2 2\n1 1\n1 1\n1 2\n1 2\n2 2\n1 2\n1 1\n1 2\n1 2\n2 2\n1 1\n2 2\n1 2\n1 1\n2 2\n1 1\n1 2\n2 2\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\nAs you know, Vova has recently b...
[{"type": "stdin_stdout", "input": "62\n2 3 1 1 2 2 2 2 1 2 3 3 3 3 2 1 3 2 3 3 2 2 2 2 2 2 3 3 2 3 3 1 1 1 1 1 3 3 1 2 1 1 1 1 2 1 1 3 2 2 1 1 3 1 1 1 1 1 1 1 1 2\n8 8 14 28 9 61 44 53 46\n", "output": "YES\n2 3 1 1 2 -2 2 -2 -1 2 3 -3 3 -3 -2 -1 -3 -2 3 -3 2 -2 2 -2 2 -2 3 -3 2 3 -3 1 -1 1 -1 1 3 -3 1 2 1 -1 1 -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\nIn a far away land, there are tw...
[{"type": "stdin_stdout", "input": "100 44\n41 1\n13 1\n52 1\n83 1\n64 2\n86 2\n12 1\n77 1\n100 2\n97 2\n58 1\n33 2\n8 1\n72 2\n2 1\n88 1\n50 2\n4 1\n18 1\n36 2\n46 2\n57 1\n29 2\n22 1\n75 2\n44 2\n80 2\n84 1\n62 1\n42 1\n94 1\n96 2\n31 2\n45 2\n10 2\n17 1\n5 1\n53 1\n98 2\n21 1\n82 1\n15 1\n68 2\n91 1\n", "output": "W...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 birthday soon! It's a...
[{"type": "stdin_stdout", "input": "55\n73792\n39309\n73808\n47389\n34803\n87947\n32460\n14649\n70151\n35816\n8272\n78886\n71345\n61907\n16977\n85362\n0\n43792\n8118\n83254\n89459\n32230\n87068\n82617\n94847\n83528\n37629\n31438\n97413\n62260\n13651\n47564\n43543\n61292\n51025\n64106\n0\n19282\n35422\n19657\n95170\n102...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 nuts and lots of boxe...
[{"type": "stdin_stdout", "input": "1201 495 438 1293\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "241 1202 830 417\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1201 492 438 690\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "241 1247 830 417\n", "output": "1\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\nWe saw the little game Marmot ma...
[{"type": "stdin_stdout", "input": "3 1\n1 3\n2 3\n4 10\n", "output": "14\n12\n2032\n"}, {"type": "stdin_stdout", "input": "3 1\n1 3\n2 3\n4 6\n", "output": "14\n12\n112\n"}, {"type": "stdin_stdout", "input": "3 1\n2 6\n1 3\n4 4\n", "output": "124\n14\n16\n"}, {"type": "stdin_stdout", "input": "3 1\n1 3\n2 5\n1 6\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 have written on a piece of p...
[{"type": "stdin_stdout", "input": "20 19\n512 524288 268435456 2048 16384 8192 524288 16777216 128 536870912 256 1 32768 2097152 131072 268435456 262144 134217728 8388608 16\n3 20\n5 12\n19 20\n10 15\n3 18\n3 4\n6 19\n3 14\n3 16\n5 10\n3 12\n5 20\n12 17\n8 9\n13 18\n2 11\n7 12\n6 11\n2 15\n", "output": "106\n"}, {"typ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya plays one very well-known ...
[{"type": "stdin_stdout", "input": "10 10 10\n8 8 8 8 8 8 8 8 8 8\n2 5 8\n2 4 8\n2 1 8\n2 7 8\n2 10 8\n2 9 8\n2 6 8\n2 3 8\n2 2 8\n2 8 8\n", "output": "10\n3 9 8 2 1 7 4 10 6 5 "}, {"type": "stdin_stdout", "input": "10 10 10\n8 8 8 8 8 8 8 8 8 8\n3 1 8\n3 2 8\n3 3 8\n3 6 8\n3 9 8\n3 8 8\n3 4 8\n3 7 8\n3 5 8\n3 10 8\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 developers of Looksery have ...
[{"type": "stdin_stdout", "input": "9 46\nuuexbaacesjclggslacermcbkxlcxhdgqtacdwfryxzuxc\naclrsaefakndbnzlkefenuphgcgoedhkaxefjtnkgfeaca\nefuqunpmfxdyyffyhvracozzrxlpekhtsrfhlilfmyhefg\numyacfzffvicqtdpiulefnwcojuwtfbvlxkfsiapdnzpqo\nactefvuxqptremlqjhdbdwacjxdxitxjktecvefacamjcz\neflarseklqrkayhosverpfefzirqigzlxezabh...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 number of k-divisible n...
[{"type": "stdin_stdout", "input": "1 -1000000000000000000 1000000000000000000\n", "output": "2000000000000000001\n"}, {"type": "stdin_stdout", "input": "2 -1000000000000000000 1000000000000000000\n", "output": "1000000000000000001\n"}, {"type": "stdin_stdout", "input": "100000000000000321 -1000000000000000000 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\nWay to go! Heidi now knows how m...
[{"type": "stdin_stdout", "input": "1000000000\n", "output": "231564544\n"}, {"type": "stdin_stdout", "input": "1000000100\n", "output": "231564594\n"}, {"type": "stdin_stdout", "input": "1000010100\n", "output": "231569594\n"}, {"type": "stdin_stdout", "input": "1038818275\n", "output": "519409137\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\nPolycarp is crazy about round nu...
[{"type": "stdin_stdout", "input": "1000000001 10\n", "output": "9\n"}, {"type": "stdin_stdout", "input": "1234567890 14\n", "output": "9\n"}, {"type": "stdin_stdout", "input": "1000002333 6\n", "output": "9\n"}, {"type": "stdin_stdout", "input": "1010101010 2\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "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\nHeidi's friend Jenny is asking H...
[{"type": "stdin_stdout", "input": "11\n1 0 6646\n2 0 8816\n3 2 9375\n4 2 5950\n5 1 8702\n6 2 2657\n7 2 885\n8 7 2660\n9 2 5369\n10 6 3798\n", "output": "18191\n"}, {"type": "stdin_stdout", "input": "11\n1 0 6646\n2 0 8816\n3 2 9375\n4 2 5950\n5 1 8702\n6 2 2657\n7 2 885\n8 7 2660\n9 2 2694\n10 6 3798\n", "output": "18...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIvan wants to write a letter to ...
[{"type": "stdin_stdout", "input": "aaaaaaabaaaabbbbaaaaaaabbaaaaaaaaaabbabaaaaaabaaaaabaaaaaaaabaaaaaaaaaaaaaaaabaaaaaabaaaaaaaaabbaaabaaaaabbaaabaaaaabaaabaaaaaabaaaaaaaaaaabaabaaabaaaaabbbbaaaaaaaaaaaaaaabaaaaaaaaababaaabaaaaaaaaaabaaaaaaaabaaaabbbbaaaaaaabbaaaaaaaaaabbabaaaaaabaaaaabaaaaaaaabaaaaaaaaaaaaaaaabaaaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 never-ending, fast-changing an...
[{"type": "stdin_stdout", "input": "50 33\n", "output": "805999139\n"}, {"type": "stdin_stdout", "input": "48 20\n", "output": "804531912\n"}, {"type": "stdin_stdout", "input": "33 22\n", "output": "804201731\n"}, {"type": "stdin_stdout", "input": "45 19\n", "output": "486112971\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 an array a1, a2, ....
[{"type": "stdin_stdout", "input": "39 1\n676941771 -923780377 -163050076 -230110947 -208029500 329620771 13954060 158950156 -252501602 926390671 -678745080 -921892226 -100127643 610420285 602175224 -839193819 471391946 910035173 777969600 -736144413 -489685522 60986249 830784148 278642552 -375298304 197973611 -3544823...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAre you going to Scarborough Fai...
[{"type": "stdin_stdout", "input": "67 39\nacbcbccccbabaabcabcaaaaaaccbcbbcbaaaacbbcccbcbabbcacccbbabbabbabaac\n4 36 a b\n25 38 a a\n3 44 b c\n35 57 b a\n4 8 a c\n20 67 c a\n30 66 b b\n27 40 a a\n2 56 a b\n10 47 c a\n22 65 c b\n29 42 a b\n1 46 c b\n57 64 b c\n20 29 b a\n14 51 c a\n12 55 b b\n20 20 a c\n2 57 c a\n22 60 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 the guys fried the radio stat...
[{"type": "stdin_stdout", "input": "10 10\nittmcs 112.147.123.173\njkt 228.40.73.178\nfwckqtz 88.28.31.198\nkal 224.226.34.213\nnacuyokm 49.57.13.44\nfouynv 243.18.250.17\ns 45.248.83.247\ne 75.69.23.169\nauwoqlch 100.44.219.187\nlkldjq 46.123.169.140\ngjcylatwzi 46.123.169.140;\ndxfi 88.28.31.198;\ngv 46.123.169.140;\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRight now she actually isn't. Bu...
[{"type": "stdin_stdout", "input": "1999999999\n1000000000\n1385852\n184569875\n", "output": "1385852183184023\n"}, {"type": "stdin_stdout", "input": "1000999777\n1934999345\n2356346\n34534565\n", "output": "2358701818178496\n"}, {"type": "stdin_stdout", "input": "1000000000\n1999999999\n789987\n184569875\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\nNikita likes tasks on order stat...
[{"type": "stdin_stdout", "input": "10 29\n88 57 -3 -9 16 48 -84 80 -73 -46\n", "output": "5 13 11 11 8 4 3 0 0 0 0 "}, {"type": "stdin_stdout", "input": "10 29\n88 57 0 -9 16 48 -84 80 -73 -46\n", "output": "5 13 11 11 8 4 3 0 0 0 0\n"}, {"type": "stdin_stdout", "input": "10 29\n88 57 0 -9 16 95 -84 80 -73 -46\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\nIts NU-Tech'15 and participants ...
[{"type": "stdin_stdout", "input": "300\n597113957311329435059958607533989736968628782267274168518699460337218773748101061458441626465444212519430749480506686309043987608687487248528856082640815820249994912217851402293932229282858441360639287639165414669686844134145129476519392505401548164433358465142649416718580658059...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Vaishnavi is bored during...
[{"type": "stdin_stdout", "input": "2\n1 -1\n1 -1\n\nSMAPLE", "output": "-8\n-8\n"}, {"type": "stdin_stdout", "input": "2\n1 -1\n2 -1\n\nSMALPE", "output": "-8\n-1\n"}, {"type": "stdin_stdout", "input": "2\n1 2\n1 -2\n\nSMAPLE", "output": "16\n-16\n"}, {"type": "stdin_stdout", "input": "2\n2 -1\n1 -1\n\nSMAPLE", "outpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlfie was a prisoner in mythland...
[{"type": "stdin_stdout", "input": "3\n4\n0 1 1 0 \n0 1 1 -1 \n1 0 -1 1 \n0 1 1 0 \n4\n-1 0 1 1 \n0 0 0 0 \n2 1 1 0 \n1 0 0 0 \n2\n0 1 1 -1 \n0 0 1 2 \n0 0 0 0 \n0 1 0 1 \n \nSAMPME", "output": "0\n2\n1\n"}, {"type": "stdin_stdout", "input": "3\n4\n0 1 0 0 \n0 1 1 -1 \n1 0 0 0 \n0 1 1 0 \n4\n0 0 1 1 \n0 0 0 0 \n1 1 1 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\nThere are N Snuke Cats numbered ...
[{"type": "stdin_stdout", "input": "4\n141 1 -1 2", "output": "-4 -144 142 -141\n"}, {"type": "stdin_stdout", "input": "4\n102 2 -1 2", "output": "-1 -101 102 -101\n"}, {"type": "stdin_stdout", "input": "4\n102 2 -1 1", "output": "-4 -104 101 -101\n"}, {"type": "stdin_stdout", "input": "4\n13 -17 0 0", "output": "-17 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\nGiven is an integer N.\n\nTakaha...
[{"type": "stdin_stdout", "input": "-1297", "output": "0.499614494988\n"}, {"type": "stdin_stdout", "input": "-1739", "output": "0.499712478436\n"}, {"type": "stdin_stdout", "input": "-2609", "output": "0.499808355692\n"}, {"type": "stdin_stdout", "input": "-4637", "output": "0.499892171663\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 the State of Takahashi in AtC...
[{"type": "stdin_stdout", "input": "10 39\n7 2\n7 1\n5 6\n5 8\n9 10\n2 8\n8 7\n3 10\n10 1\n8 10\n2 3\n7 4\n3 9\n4 10\n3 4\n6 1\n6 7\n9 5\n9 7\n6 9\n9 4\n4 6\n7 5\n8 3\n2 5\n9 2\n10 7\n8 6\n8 9\n7 3\n5 3\n4 5\n6 3\n2 10\n5 10\n4 2\n6 2\n8 4\n10 6", "output": "21"}, {"type": "stdin_stdout", "input": "13 5\n1 2\n1 3\n3 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 railroad running from west to ...
[{"type": "stdin_stdout", "input": "4\n1 13 1\n44 17 22\n101 4096 64", "output": "4197\n4197\n4197\n0\n"}, {"type": "stdin_stdout", "input": "4\n1 13 1\n44 17 22\n120 4096 64", "output": "4216\n4216\n4216\n0\n"}, {"type": "stdin_stdout", "input": "4\n1 18 1\n44 17 22\n111 4096 64", "output": "4207\n4207\n4207\n0\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 grid with H rows and W...
[{"type": "stdin_stdout", "input": "3 5\n5\n1 2 5 4 3", "output": "1 2 2 3 3\n4 4 3 3 3\n4 4 5 5 5\n"}, {"type": "stdin_stdout", "input": "3 5\n5\n1 2 6 4 2", "output": "1 2 2 3 3\n4 3 3 3 3\n4 4 4 5 5\n"}, {"type": "stdin_stdout", "input": "3 5\n5\n1 1 3 5 5", "output": "1 2 3 3 3\n4 4 4 4 4\n5 5 5 5 5\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\nSnuke loves working out. He is n...
[{"type": "stdin_stdout", "input": "100001", "output": "755072381\n"}, {"type": "stdin_stdout", "input": "110001", "output": "817497558\n"}, {"type": "stdin_stdout", "input": "110011", "output": "422312314\n"}, {"type": "stdin_stdout", "input": "101001", "output": "249638241\n"}, {"type": "stdin_stdout", "input": "1100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 is seeing a qu...
[{"type": "stdin_stdout", "input": "5\n3 10\n48 28\n31 199\n300 23\n3 4", "output": "12600\n"}, {"type": "stdin_stdout", "input": "5\n3 11\n87 28\n31 199\n300 23\n3 2", "output": "13000\n"}, {"type": "stdin_stdout", "input": "5\n3 11\n33 28\n31 269\n300 23\n3 2", "output": "12000\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\nI have a sequence defined as fol...
[{"type": "stdin_stdout", "input": "12.245545640480573\n11.553343685171598\n20.008357034777177", "output": "95.6966714867\n90.2872413915\n156.361604975\n"}, {"type": "stdin_stdout", "input": "12.245545640480573\n13.018962096503808\n20.008357034777177", "output": "95.6966714867\n101.740777865\n156.361604975\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\nIn April 2008, Aizuwakamatsu Cit...
[{"type": "stdin_stdout", "input": "17 5128 240 126 32\n20 4907 303 151 7\n60 73980 2086 337 15\n3 3216 562 010 6\n40 8478 221 53 307\n23 27966 5 92 13\n50 107893 4497 65 20\n199 88677 2825 226 8\n0", "output": "21 0\n7 18\n15 126\n5 40\n37 5\n13 303\n20 276\n8 292\n"}, {"type": "stdin_stdout", "input": "49 5128 240 25...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 educational program (AHK Edu...
[{"type": "stdin_stdout", "input": "0 1 1 4 11 16 3 2 0 0 5 13", "output": "no\n"}, {"type": "stdin_stdout", "input": "0 1 1 4 11 16 6 2 0 0 5 13", "output": "no\n"}, {"type": "stdin_stdout", "input": "0 1 1 4 11 16 6 2 1 0 5 13", "output": "no\n"}, {"type": "stdin_stdout", "input": "0 1 1 4 2 20 6 2 2 0 13 13", "outpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRailroad Trip\n\nThere are N cit...
[{"type": "stdin_stdout", "input": "4 4\n1 3 2 4\n147 131 100\n100 50 80\n250 70 130", "output": "577\n"}, {"type": "stdin_stdout", "input": "4 4\n1 3 3 4\n147 131 100\n100 50 80\n250 70 130", "output": "447\n"}, {"type": "stdin_stdout", "input": "4 4\n1 3 2 4\n120 90 100\n110 50 96\n250 138 130", "output": "616\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 mysterious planet cal...
[{"type": "stdin_stdout", "input": "5\n1.562976116968605\n3\n1\n2\n2\n1.7218698683022837\n3\n1\n4\n1\n2.1448962816069557\n3\n1\n2\n3\n3.0434166674596996\n4\n2\n2\n1\n3\n2.5055384306161197\n2\n1\n2\n6\n2", "output": "1.500000000\n1.500000000\n1.750000000\n2.266666667\n1.000000000\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\nMaking Lunch Boxes\n\nTaro has b...
[{"type": "stdin_stdout", "input": "4 3\n110\n101\n011\n110\n1 1\n1\n1\n1\n1\n1\n1\n1\n4 5\n10000\n01000\n00100\n00010\n6 6\n111111\n011000\n100000\n000010\n100001\n100100\n0 0", "output": "3\n0\n0\n0\n0\n6\n"}, {"type": "stdin_stdout", "input": "4 3\n110\n101\n011\n110\n7 1\n0\n1\n1\n1\n1\n1\n1\n4 5\n10000\n01000\n001...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA permutation of N numbers from ...
[{"type": "stdin_stdout", "input": "10\n3 -1 5 1 7 4 14 6 17 13", "output": "9\n"}, {"type": "stdin_stdout", "input": "10\n3 -1 5 1 7 4 14 6 17 8", "output": "9\n"}, {"type": "stdin_stdout", "input": "10\n2 -1 5 1 7 4 14 6 17 8", "output": "9\n"}, {"type": "stdin_stdout", "input": "10\n2 -1 5 1 7 4 12 6 17 8", "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\nAfter many years of research, Ik...
[{"type": "stdin_stdout", "input": "3 3 10\n18 1 13\n15 3 3\n5 10 0", "output": "100\n"}, {"type": "stdin_stdout", "input": "3 3 10\n10 14 13\n14 2 6\n5 4 1", "output": "28\n"}, {"type": "stdin_stdout", "input": "3 3 10\n18 4 13\n15 3 3\n5 11 1", "output": "34\n"}, {"type": "stdin_stdout", "input": "3 3 10\n18 4 13\n15...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nD: Shiritori Compression\n\nprob...
[{"type": "stdin_stdout", "input": "7\nbanana\nta\ntomb\nbus\nsound\ndoes\nsome", "output": "2\n"}, {"type": "stdin_stdout", "input": "7\nananab\nta\nsomb\nbus\nsound\ndoes\nsemo", "output": "3\n"}, {"type": "stdin_stdout", "input": "7\nbanaoa\nta\ntomb\nbus\nsound\ndoes\nsome", "output": "2\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\nProblem\n\nThere are $ 2 $ teams...
[{"type": "stdin_stdout", "input": "1000000000000000000 1000000000010000000", "output": "4\n"}, {"type": "stdin_stdout", "input": "1000000001000000000 1000000000010000000", "output": "2\n"}, {"type": "stdin_stdout", "input": "1000001001000000000 1000000000010000000", "output": "2\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 state with $n$ flags of ON or ...
[{"type": "stdin_stdout", "input": "3\n3 0 1 4\n1 3\n3 0 1 2\n13\n1 1\n2 1\n3 1\n4 2\n5 1\n6 2\n7 2\n8 2", "output": "0\n1\n1\n0\n0\n0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "3\n3 0 1 2\n1 3\n3 0 1 2\n13\n1 1\n2 1\n3 1\n4 2\n5 2\n6 2\n7 2\n8 2", "output": "0\n0\n1\n0\n0\n0\n0\n0\n0\n0\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\nDevuLand is a very strange place...
[{"type": "stdin_stdout", "input": "3\n2\n5 -5\n2\n-5 5\n3\n-1 3 -2", "output": "5\n5\n3\n"}, {"type": "stdin_stdout", "input": "3\n2\n5 -5\n2\n-5 5\n3\n1 2 -3", "output": "5\n5\n4\n"}, {"type": "stdin_stdout", "input": "3\n1\n5 -5\n2\n-5 5\n3\n1 2 -3", "output": "5\n5\n4\n"}, {"type": "stdin_stdout", "input": "3\n2\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\nAt the end of a busy day, The Ch...
[{"type": "stdin_stdout", "input": "1\n9 3 3\n-1 23\n1 1\n-1 -1", "output": "19\n"}, {"type": "stdin_stdout", "input": "1\n0 2 3\n5 37\n6 -1\n-1 49", "output": "46\n"}, {"type": "stdin_stdout", "input": "1\n9 3 3\n0 16\n1 1\n-1 -1", "output": "13\n"}, {"type": "stdin_stdout", "input": "1\n4 4 3\n2 0\n0 14\n-1 10", "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\nNatasha is going to fly on a roc...
[{"type": "stdin_stdout", "input": "90\n35\n1 68 16 30 24 1 1 1 35 1 1 67 1 1 1 1 33 16 37 77 83 1 77 26 1 1 68 67 70 62 1 47 1 1 1 84 1 65 1 32 83 1 1 1 28 1 71 76 84 1 1 5 1 74 10 1 1 1 38 87 13 1 7 66 81 49 1 9 1 11 1 25 1 1 1 1 7 1 1 36 61 47 51 1 1 69 40 1 37 1\n40 1 21 1 19 51 37 52 64 1 86 1 5 24 1 1 1 19 36 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\nVasya has two arrays A and B of ...
[{"type": "stdin_stdout", "input": "49\n18 1 7 2 1 1 50 22 8 2 2 1 30 2 46 10 1 4 5 18 25 21 38 11 2 15 29 8 7 2 45 12 14 16 16 23 11 1 1 4 48 18 3 1 1 23 4 10 7\n50\n5 25 34 22 19 4 4 2 40 52 1 4 1 3 47 9 4 1 8 47 4 5 1 1 9 22 9 2 2 1 1 48 7 2 8 16 4 2 41 12 3 30 21 10 2 2 5 1 31 13\n", "output": "14\n"}, {"type": "st...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 call the following process...
[{"type": "stdin_stdout", "input": "40471\n", "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 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\nThis problem differs from one wh...
[{"type": "stdin_stdout", "input": "83\n95 164 123 111 177 71 38 225 103 59 210 209 117 139 115 140 66 21 39 84 14 227 0 43 90 233 96 98 232 237 108 139 55 220 14 225 134 39 68 167 193 125 86 216 87 14 94 75 255 24 165 98 177 191 239 123 98 90 29 52 155 231 187 90 180 1 31 237 167 145 242 115 61 190 47 41 61 206 191 24...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 likes taking part in Codef...
[{"type": "stdin_stdout", "input": "100 10\n3 114 77 78 105 87 6 122 141 100 75 118 64 18 88 37 109 72 31 101 36 10 62 18 52 17 149 115 22 150 138 48 46 42 104 8 63 21 117 58 87 80 7 131 125 118 67 13 144 43 59 67 74 13 124 77 86 148 107 11 51 9 87 52 147 22 7 22 143 12 121 123 17 35 33 87 91 140 92 38 106 10 66 26 40 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 stones arranged on a...
[{"type": "stdin_stdout", "input": "20\n53 86 76 100 16 12 13 97 79 23 28 64 42 10 23 56 59 76 48 12\n48 49 49 49 48 49 48 49 49 49 48 48 48 49 49 49 49 49 49 48\n", "output": "YES\n19\n14 1 4\n14 16 7\n14 17 10\n14 12 15\n14 3 2\n6 3 25\n6 18 11\n20 18 16\n20 9 20\n7 9 10\n7 2 25\n5 2 12\n5 8 20\n10 8 25\n15 8 3\n15 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\nOnce upon a time there were seve...
[{"type": "stdin_stdout", "input": "10 10\n..P..WWP.W\nPP.WPPPPPP\nWWPP.PPWPP\nPPPPW..PPW\nPP.PW.P.PW\nWW..PPWWP.\n..PW...PP.\n.PPPP.PPPW\nPP.PWP..P.\nPWPPP..WWP\n", "output": "20\n"}, {"type": "stdin_stdout", "input": "10 10\nWPPPPWPPWP\nPPPWPPPPPP\nPWPPPPWPPP\nPPPPWPPPWP\nWPPPPPPPPP\nPPPWPPWPPP\nPWPPPPPPWP\nPPPPWPPPP...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two matrices A and...
[{"type": "stdin_stdout", "input": "5 50\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\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\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 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 will fancy any number as l...
[{"type": "stdin_stdout", "input": "1000000000 -1000\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "1000000010 -1000\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "1010000000 -1000\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "1000000000 1000\n", "output": "16\n"}, {"type": "stdin_stdo...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 planning to buy an apart...
[{"type": "stdin_stdout", "input": "10 2\n7 6 15 6 16 18 2 17 17\n12 11 3 10 9 1 10 1 5\n", "output": "0 7 13 18 24 35 36 38 41 46\n"}, {"type": "stdin_stdout", "input": "10 2\n7 6 18 6 16 18 1 17 17\n6 9 3 10 9 1 10 1 5\n", "output": "0 7 13 18 24 35 36 37 40 45 \n"}, {"type": "stdin_stdout", "input": "10 2\n7 6 18 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\nThere are n lamps on a line, num...
[{"type": "stdin_stdout", "input": "19 5\n1001001001100000110\n2\n2 3\n2\n5 6\n2\n8 9\n5\n12 13 14 15 16\n1\n19\n", "output": "0\n1\n1\n1\n2\n2\n2\n3\n3\n3\n3\n4\n4\n4\n4\n4\n4\n4\n5\n"}, {"type": "stdin_stdout", "input": "8 6\n00110011\n3\n1 3 8\n5\n1 2 5 6 7\n2\n6 8\n2\n3 5\n2\n4 7\n1\n2\n", "output": "1\n1\n1\n1\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\nOnce again, Boris needs the help...
[{"type": "stdin_stdout", "input": "5\n3\n1 -1 0\n1 1 -2\n3\n0 1 1\n0 2 2\n2\n1 -1\n1 44\n2\n-1 0\n-1 -38\n5\n1 1 -1 1 -1\n1 1 -1 1 -1\n", "output": "YES\nNO\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "5\n3\n0 -1 -1\n1 1 -2\n3\n0 1 1\n0 1 2\n2\n1 0\n1 41\n2\n-1 0\n-1 -41\n5\n0 1 -1 1 -1\n0 1 -1 1 -1\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\nYou are given a garland consisti...
[{"type": "stdin_stdout", "input": "6\n9 2\n010001010\n9 3\n111100000\n7 4\n1111111\n10 3\n1001110101\n1 1\n1\n1 1\n0\n", "output": "1\n2\n5\n4\n0\n0\n"}, {"type": "stdin_stdout", "input": "6\n9 2\n010001010\n9 3\n111100000\n7 4\n1111111\n10 3\n1001110101\n1 1\n0\n1 1\n0\n", "output": "1\n2\n5\n4\n0\n0\n"}, {"type": "s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an array a consist...
[{"type": "stdin_stdout", "input": "4\n8\n1 3 3 4 11 6 2 9\n5\n1 2 1 2 1\n10\n5 13 6 5 14 0 4 9 13 5\n4\n0 1 2 1\n", "output": "24\n5\n50\n3\n"}, {"type": "stdin_stdout", "input": "4\n8\n0 4 3 6 11 6 2 9\n5\n1 2 1 2 1\n10\n5 13 6 5 14 0 4 9 13 5\n4\n0 1 2 1\n", "output": "25\n5\n50\n3\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\nZiota found a video game called ...
[{"type": "stdin_stdout", "input": "100 4 8 9 2\n1 8 0 8 7 8 1 8 7 4 0 9 4 2 1 7 3 7 3 7 1 8 7 14 4 10 11 7 3 5 9 7 4 9 6 10 4 5 5 2 5 2 8 4 5 3 1 6 8 8 10 6 7 2 1 6 2 8 3 9 7 4 18 6 7 8 5 2 5 16 3 8 4 11 0 3 5 10 6 1 4 8 14 17 2 2 9 3 7 3 3 3 10 19 3 5 3 1 3 3\n", "output": "1584\n"}, {"type": "stdin_stdout", "input":...
code_stdio