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\nYou are both a shop keeper and a...
[{"type": "stdin_stdout", "input": "3\n5\n1 2 6 4 5\n3\n1 2 3\n2\n777 2131\n", "output": "4\n2\n1454\n"}, {"type": "stdin_stdout", "input": "3\n5\n1 2 3 4 5\n3\n1 2 3\n2\n777 1089\n", "output": "3\n2\n933\n"}, {"type": "stdin_stdout", "input": "3\n5\n1 2 6 4 5\n3\n1 2 3\n2\n777 1089\n", "output": "4\n2\n933\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 queen is the strongest chess p...
[{"type": "stdin_stdout", "input": "10 20\n6 10\n3 10\n10 4\n5 3\n9 4\n10 1\n10 3\n10 7\n8 5\n7 2\n4 7\n5 1\n2 9\n5 5\n6 6\n9 8\n2 10\n9 10\n1 4\n7 4\n", "output": "0 0 4 9 4 1 2 0 0\n"}, {"type": "stdin_stdout", "input": "100 10\n97 5\n53 35\n92 86\n54 95\n98 13\n36 23\n55 56\n96 94\n25 96\n49 31\n", "output": "6 4 0 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given n strings a_1, a_2...
[{"type": "stdin_stdout", "input": "5\n2 4\nabac\nzbab\n2 4\naaaa\nbbbb\n3 3\nbaa\naaa\naab\n2 2\nab\nbb\n3 1\na\nb\nc\n", "output": "zbac\n-1\naaa\nab\na\n"}, {"type": "stdin_stdout", "input": "5\n2 4\nabac\nzbab\n2 4\naaaa\nbbbb\n3 3\nbaa\naaa\naab\n2 2\nab\nbb\n3 1\na\nb\nc\n", "output": "zbac\n-1\naaa\nab\na\n"}, {...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are creating a level for a v...
[{"type": "stdin_stdout", "input": "50\n499 1400 1621 123 72 526 944 482 862 136 265 605 5 616 974 967 713 187 969 467 573 845 71 224 17 873 648 120 239 1722 438 574 404 129 899 583 632 314 525 496 443 857 241 78 575 2 430 137 387 911\n", "output": "459200194 19968654 978281891 778632355 119790684 519088159 339403985 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\nDuring one of the space missions...
[{"type": "stdin_stdout", "input": "4\n3 13\n5 8\n8 9\n8 10\n", "output": "8 3\n"}, {"type": "stdin_stdout", "input": "4\n3 13\n5 8\n6 9\n8 10\n", "output": "6 3\n"}, {"type": "stdin_stdout", "input": "4\n3 4\n4 5\n4 6\n8 10\n", "output": "4 2\n"}, {"type": "stdin_stdout", "input": "4\n3 4\n4 8\n4 6\n8 10\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\nOleg's favorite subjects are His...
[{"type": "stdin_stdout", "input": "10\n622457341638479796 338608092\n891914827865404228 279127582\n1567895284521734914 1071397817\n859803368805468629 746530097\n286803888063493394 769449696\n28943295091599321 24611833\n598448092106640578 352238501\n733629261048200000 672172589\n1286713648467123503 46\n7203441458027487...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPetya loves lucky numbers very m...
[{"type": "stdin_stdout", "input": "44447774444474477747774774477777474774744744477444447777477477744747477774744444744777777777747777477447744774744444747477744744\n77777474477477747774777777474474477444474777477747747777477747747744474474747774747747444777474444744744444477477777747744747477\n", "output": "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\nThere is a n Γ— m grid. You are s...
[{"type": "stdin_stdout", "input": "9\n1 1 0\n2 2 4\n2 2 3\n2 2 -2\n1 1 1\n100 100 11000\n2 3 7\n3 1 9\n2 6 11\n", "output": "YES\nNO\nYES\nNO\nNO\nNO\nNO\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "9\n1 1 0\n2 2 4\n2 2 3\n2 2 -1\n2 1 1\n100 100 10000\n2 4 7\n3 1 9\n2 6 8\n", "output": "YES\nNO\nYES\nNO\nYES\nNO\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\nAquaMoon had n strings of length...
[{"type": "stdin_stdout", "input": "3\n3 5\naaaaa\nbbbbb\nccccc\n2 2 4 1 0 2 4 7\n2 1 3\n3 4\naaaa\nbbbb\ncccc\n0 0 2 1 2\n2 1 3\n5 6\nabcdef\nuuuuuu\nkekeke\nekekek\nmyzklx\n1 5 1 2 -1 4\n2 5 5 2 4 1\n5 8 1 2 3\n", "output": "abcabcabcabcabc\n\nabcabcabcabc\n"}, {"type": "stdin_stdout", "input": "3\n3 5\naaaaa\nbbbbb\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDuring the break the schoolchild...
[{"type": "stdin_stdout", "input": "50 30\nBGGGGGGBGGBGBGGGGBGBBGBBBGGBBBGBGBGGGGGBGBBGBGBGGG\n", "output": "GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGBBBBBBBBBBBBBBBBBBBB\n"}, {"type": "stdin_stdout", "input": "50 13\nGGGBGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG\n", "output": "GGGGGGGGGGGGGGGGBGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSereja has got an array, consist...
[{"type": "stdin_stdout", "input": "6 6\n202714501 613423725 367325359 862808465 196327629 745008828\n2 492\n2 1943\n1 3 173984392\n1 5 17007494\n3 4\n1 5 472683539\n", "output": "862810900\n\n"}, {"type": "stdin_stdout", "input": "6 6\n202714501 613423725 367325359 862808465 196327629 745008828\n2 492\n2 1943\n1 3 173...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPaladin Manao caught the trail o...
[{"type": "stdin_stdout", "input": "50 2 5\n9 14\n46 34\n40 35\n44 30\n32 16\n1 38\n48 2\n17 14\n50 25\n6 1\n45 19\n21 15\n22 11\n15 33\n8 28\n2 32\n10 22\n37 3\n43 39\n25 16\n9 19\n16 3\n36 32\n20 45\n24 32\n4 18\n49 39\n13 45\n26 4\n11 33\n14 37\n42 19\n31 45\n38 3\n34 8\n18 29\n35 34\n29 16\n7 46\n19 28\n27 33\n30 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\nLevko loves array a1, a2, ... , ...
[{"type": "stdin_stdout", "input": "97 29\n2 78 82 356152\n2 14 29 430177\n1 59 84 3680\n1 49 89 -2247\n1 92 96 3701\n2 54 89 377271\n1 62 70 -507\n2 94 97 431563\n1 46 55 -9257\n1 51 83 1627\n1 10 20 6633\n1 17 34 -9263\n2 66 92 383251\n1 12 82 3884\n1 78 96 -5379\n2 13 35 424798\n1 68 91 2939\n2 80 84 214725\n1 61 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\nValera had an undirected connect...
[{"type": "stdin_stdout", "input": "10 6\n0 4 1 1 2 1 1 2 1 3\n", "output": "9\n1 3\n1 4\n1 6\n1 7\n1 9\n3 5\n3 8\n5 10\n10 2\n"}, {"type": "stdin_stdout", "input": "10 6\n0 2 1 1 1 1 1 2 1 2\n", "output": "9\n1 3\n1 4\n1 5\n1 6\n1 7\n1 9\n3 2\n3 8\n3 10\n"}, {"type": "stdin_stdout", "input": "10 6\n0 2 1 1 2 1 1 2 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\nOne day, after a difficult lectu...
[{"type": "stdin_stdout", "input": "101628400798615604 31\n", "output": "981546175132942729\n"}, {"type": "stdin_stdout", "input": "101628400788615604 30\n", "output": "999999999999995905\n"}, {"type": "stdin_stdout", "input": "10000000000000000 24\n", "output": "318248384812319433\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\nTwilight Sparkle once got a crys...
[{"type": "stdin_stdout", "input": "101\n", "output": "**************************************************D**************************************************\n*************************************************DDD*************************************************\n************************************************DDDDD******...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDreamoon likes to play with sets...
[{"type": "stdin_stdout", "input": "3600 8\n", "output": "172792\n8 16 24 40\n56 64 72 88\n104 112 120 136\n152 160 168 184\n200 208 216 232\n248 256 264 280\n296 304 312 328\n344 352 360 376\n392 400 408 424\n440 448 456 472\n488 496 504 520\n536 544 552 568\n584 592 600 616\n632 640 648 664\n680 688 696 712\n728 736 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 DNA sequence for every livin...
[{"type": "stdin_stdout", "input": "caaijqulvbesqytzrjqujqhsqtzqulbvhsquqsqcmzlqswbvug\nyinccmmtvchfctzlqcsqwqlpktbjidmusqmqbfjsqwuclwfugq\n50\nw->ep\nc->ya\nj->dc\nf->ot\nc->xm\nb->ce\nt->vl\ni->qu\nk->rv\ns->hs\nh->cu\nl->fn\nl->ai\ng->di\nb->bn\nc->ej\ng->kx\ns->uw\nh->hp\nv->ji\nw->sh\nn->cm\nj->ed\ny->lf\nk->lr\nf...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 consider a table consistin...
[{"type": "stdin_stdout", "input": "100000 1000000000\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "100000 479001600\n", "output": "254\n"}, {"type": "stdin_stdout", "input": "100000 551350800\n", "output": "392\n"}, {"type": "stdin_stdout", "input": "100000 183783600\n", "output": "438\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\nSpongebob is already tired tryin...
[{"type": "stdin_stdout", "input": "983282300\n", "output": "48\n 1 983282300\n 2 3277...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 pearls in a row. Let...
[{"type": "stdin_stdout", "input": "10\n460626451 460626451 460626451 460626451 460626451 460626451 460626451 460626451 460626451 460626451\n", "output": "5\n1 2\n3 4\n5 6\n7 8\n9 10\n"}, {"type": "stdin_stdout", "input": "10\n460626451 460626451 460626451 460626451 460626451 460626451 460626451 352666953 460626451 460...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Artem likes electronics. ...
[{"type": "stdin_stdout", "input": "5 12 1\n1 5\n", "output": "0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0\n"}, {"type": "stdin_stdout", "input": "5 10 2\n1 2\n3 1 7 5\n", "output": "0 0 0 0 0 0 5 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 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\nLittle Artem has invented a time...
[{"type": "stdin_stdout", "input": "10\n1 1 1000000000\n1 4 1000000000\n2 2 1000000000\n1 5 1000000000\n1 8 1000000000\n2 15 1000000000\n3 3 1000000000\n3 10 1000000000\n3 6 1000000000\n3 7 1000000000\n", "output": "0\n3\n2\n2\n"}, {"type": "stdin_stdout", "input": "10\n1 1 1000000000\n1 4 1000000000\n2 2 1000000000\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\nZS the Coder has drawn an undire...
[{"type": "stdin_stdout", "input": "7 9 999999999 0 3\n0 1 0\n1 2 0\n2 3 0\n0 4 1\n4 1 1\n1 5 499999999\n5 2 499999999\n2 6 1\n6 3 1\n", "output": "YES\n0 1 1\n1 2 999999996\n2 3 999999997\n0 4 1\n4 1 1\n1 5 499999999\n5 2 499999999\n2 6 1\n6 3 1\n"}, {"type": "stdin_stdout", "input": "7 9 999999999 0 3\n0 1 0\n1 2 0\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAhmed and Mostafa used to compet...
[{"type": "stdin_stdout", "input": "14 14\n6 -1 1 1 1 1 1\n6 1 1 1 1 1 1\n6 2 1 1 1 1 1\n6 1 1 1 1 1 1\n6 1 1 1 1 1 1\n6 1 1 1 1 1 1\n6 1 1 1 1 1 1\n6 1 1 1 1 1 1\n6 1 1 1 1 1 1\n6 1 1 1 1 1 1\n6 1 1 1 1 1 1\n6 1 1 1 1 1 1\n6 1 1 1 1 1 1\n6 1 1 1 1 1 -1\n1 2 3 4 5 6 7 8 9 10 11 12 13 14\n", "output": "83\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\nYou are given an array a consist...
[{"type": "stdin_stdout", "input": "10 10\n10 8 10 14 2 2 4 6 10 1\n10\n1 17 87 5\n2 31 94\n1 5 99 8\n1 56 90 10\n1 25 93 6\n1 11 32 5\n2 20 49\n1 46 87 8\n2 14 48\n2 40 48\n", "output": "1\n5\n5\n6\n"}, {"type": "stdin_stdout", "input": "10 10\n10 8 10 9 2 2 4 6 2 1\n10\n1 17 87 5\n2 31 94\n1 10 56 8\n1 78 90 10\n1 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\nYou are given set of n points in...
[{"type": "stdin_stdout", "input": "11\n358 -724 -232 53 -520\n486 -554 -328 53 -220\n358 -554 -232 -372 -520\n358 -554 -232 308 -520\n868 -554 448 53 -520\n478 -554 -322 53 -600\n358 296 -232 53 -520\n256 -554 -368 53 -520\n230 -554 -136 53 -820\n-182 -554 173 53 -160\n358 -554 -232 53 -520\n", "output": "1\n11\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\nEverybody in Russia uses Gregori...
[{"type": "stdin_stdout", "input": "24\n29 31 30 31 30 31 31 30 31 30 31 31 28 31 30 31 30 31 31 30 31 30 31 31\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "24\n28 31 30 31 30 31 31 30 31 30 31 31 28 31 30 31 30 31 31 30 31 30 31 31\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "24\n31 28 31 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\nA ski base is planned to be buil...
[{"type": "stdin_stdout", "input": "2 40\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n", "output": "0\n1\n3\n7\n15\n31\n63\n127\n255\n511\n1023\n2047\n4095\n8191\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\nBob is a farmer. He has a large ...
[{"type": "stdin_stdout", "input": "10 10\n....W.W.W.\n.........S\n.S.S...S..\nW.......SS\n.W..W.....\n.W...W....\nS..S...S.S\n....W...S.\n..S..S.S.S\nSS.......S\n", "output": "Yes\nDDDDWDWDWD\nDDDDDDDDDS\nDSDSDDDSDD\nWDDDDDDDSS\nDWDDWDDDDD\nDWDDDWDDDD\nSDDSDDDSDS\nDDDDWDDDSD\nDDSDDSDSDS\nSSDDDDDDDS\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\nString can be called correct if ...
[{"type": "stdin_stdout", "input": "100\n1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n", "output": "1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n"}, {"type": "stdin_stdout", "input": "100\n10000000000000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Noku recently picked up cons...
[{"type": "stdin_stdout", "input": "328 292351550 423738 553208\n212104 323236 874897 789938 217603 184758 141056 786670 468124 275297 166078 549777 797943 48188 1239581 612740 236243 719660 10818 237349 7310 533049 18681 643358 866782 174809 1123432 32784 718241 62650 438776 423884 482093 19525 611891 31928 1485735 81...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 26 letters in the Engl...
[{"type": "stdin_stdout", "input": "50\net\ngel\nkekjoiceuuziizyu\nisaemwyocoioymeuiwovorgiuljiu\neydexzizfiahklyoesbyxemedqvrxlvtikiiawufoxcsfysreq\nuwluy\neeoxnizrabguxzeoqyefeziamxumborjyeanunzuphaimuxej\niueeuaqceueoeoomsd\ngowut\nihvy\nyieixymmhfpegakiyignijewuteofajjplviiapeggxipuieju\neanodofhmmbsivegmidiaalulht...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\"She loves me\", \"She loves me...
[{"type": "stdin_stdout", "input": "64\n317306974\n24435194\n36701392\n102003399\n38591177\n150073105\n171554925\n4769107\n48186188\n92980498\n202706670\n253829104\n235038229\n5859136\n125741147\n48357310\n411432358\n169557272\n29923942\n206794813\n35005212\n247430138\n16720534\n81965044\n62300552\n38525838\n6441541\n2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWizKid went on a trip to Wonderl...
[{"type": "stdin_stdout", "input": "10\n5 5\nprtei\nfyidw\nnshrv\nvflws\noefcc\nfyidw\n703\n1\noefcc\nfyidw\n35\n3\nnshrv\noefcc\nvflws\noefcc\n117\n2\nfyidw\nprtei\nfyidw\n149\n3\nnshrv\noefcc\nvflws\nfyidw\n408\n2\noefcc\nvflws\n5 5\nnoocg\nvugwp\nzjioj\nnpedp\nwqqbm\nwqqbm\n263\n1\nnpedp\nnpedp\n782\n3\nzjioj\nwqqbm...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nToday, teacher taught Xenny the ...
[{"type": "stdin_stdout", "input": "2\n109\n1\n\nMMEOAS", "output": "110\n4\n"}, {"type": "stdin_stdout", "input": "2\n122\n0\n\nSAOMEM", "output": "123\n4\n"}, {"type": "stdin_stdout", "input": "2\n0\n100\n\nRKPELB", "output": "4\n102\n"}, {"type": "stdin_stdout", "input": "2\n30\n12\n\nEMOMAS", "output": "32\n14\n"},...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWhen you asked some guy in your ...
[{"type": "stdin_stdout", "input": "sakahashi", "output": "sak\n"}, {"type": "stdin_stdout", "input": "sbkahashi", "output": "sbk\n"}, {"type": "stdin_stdout", "input": "ihsahakbs", "output": "ihs\n"}, {"type": "stdin_stdout", "input": "hhsaiakbr", "output": "hhs\n"}, {"type": "stdin_stdout", "input": "rbkaiashh", "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\nWe have N integers A_1, A_2, ......
[{"type": "stdin_stdout", "input": "30 413\n-170202098 -268409015 537203564 983211703 11883920 -443999067 -286607651 -159124657 -358352725 526800997 -1907718835 648738515 -1273635706 -1268616353 37909651 -1 1196187672 -20098238 0 -948955241 1 -214720580 287839163 -18897162 694477644 0 -425610555 158912296 842295515 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 is a tree with N vertices....
[{"type": "stdin_stdout", "input": "7\n1 2\n6 1\n4 5\n1 7\n1 5\n2 3", "output": "1036\n"}, {"type": "stdin_stdout", "input": "7\n1 2\n6 1\n4 1\n1 7\n2 5\n1 3", "output": "1448\n"}, {"type": "stdin_stdout", "input": "7\n1 2\n1 3\n4 5\n1 7\n1 5\n2 6", "output": "1036\n"}, {"type": "stdin_stdout", "input": "7\n1 2\n6 2\n4...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 tree with N vertices,...
[{"type": "stdin_stdout", "input": "8\n2 8 13\n1 5 1\n4 5 0\n3 5 4\n3 8 5\n6 8 17\n2 7 12", "output": "171\n"}, {"type": "stdin_stdout", "input": "8\n2 4 8\n1 5 0\n4 8 2\n2 5 11\n3 8 6\n6 3 9\n2 7 12", "output": "178\n"}, {"type": "stdin_stdout", "input": "8\n2 8 8\n1 5 1\n4 8 0\n2 5 4\n3 8 5\n6 8 17\n2 7 12", "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\nThere is a plan view consisting ...
[{"type": "stdin_stdout", "input": "111100001111\n111000001111\n110000001110\n100000001111\n000100010000\n010000111010\n000001111100\n100011111110\n010101111100\n111000111000\n111100010000\n000000100000\n\n110001111100\n110010001010\n010010000001\n010000000001\n010000000110\n010000111000\n010000000000\n010000010010\n01...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 neutral city of Eyes City, i...
[{"type": "stdin_stdout", "input": "10 4\nA\nB\nB\nC\n8 4\nD\nD\nB\nB\n0 0", "output": "AC######BB\nD####BBD\n"}, {"type": "stdin_stdout", "input": "12 4\nA\nB\nB\nD\n5 4\nC\nD\nB\nB\n0 0", "output": "A####D####BB\nD#CBB\n"}, {"type": "stdin_stdout", "input": "10 4\nA\nC\nD\nB\n7 4\nC\nA\nB\nB\n0 0", "output": "AC#####...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 now in a bookshop with y...
[{"type": "stdin_stdout", "input": "0111 12618 3831", "output": "3720\n"}, {"type": "stdin_stdout", "input": "0101 15626 3831", "output": "3730\n"}, {"type": "stdin_stdout", "input": "0110 15626 3831", "output": "3721\n"}, {"type": "stdin_stdout", "input": "0111 27455 5699", "output": "5588\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\nThe JOI Railways is the only rai...
[{"type": "stdin_stdout", "input": "10 3 1\n10 6 -1\n10\n-1\n1\n10", "output": "3\n"}, {"type": "stdin_stdout", "input": "10 3 5\n3 2 6\n79\n-1\n13\n10", "output": "11\n"}, {"type": "stdin_stdout", "input": "16 3 10\n10 3 6\n16\n2\n11\n11", "output": "2\n"}, {"type": "stdin_stdout", "input": "10 3 1\n10 6 -1\n51\n-1\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\nYou are given N points in the xy...
[{"type": "stdin_stdout", "input": "3\n6.834942604239939 7.69628\n6.04723928846506 4.859878448884584\n7.439438773048666 6.914350092484497\n6\n7.260024632937995 4.220572316804344\n7.2301779956102665 2.69466\n5.977411451010016 4.7893139817742\n5.771323891387089 5.033018424848772\n7.097650770216692 5.940611762552271\n8.51...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTraining is indispensable for ac...
[{"type": "stdin_stdout", "input": "3 1 1 2 3 110\n49\n50\n51", "output": "53.6666666667\n"}, {"type": "stdin_stdout", "input": "3 0 1 2 3 100\n49\n50\n74", "output": "48.8333333333\n"}, {"type": "stdin_stdout", "input": "3 1 2 2 3 100\n49\n50\n51", "output": "47.6666666667\n"}, {"type": "stdin_stdout", "input": "3 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\nNathan O. Davis has been running...
[{"type": "stdin_stdout", "input": "1\n0\nccpi", "output": "ccpi\n"}, {"type": "stdin_stdout", "input": "1\n0\nipcc", "output": "ipcc\n"}, {"type": "stdin_stdout", "input": "1\n0\njpcc", "output": "jpcc\n"}, {"type": "stdin_stdout", "input": "1\n0\ncbpi", "output": "cbpi\n"}, {"type": "stdin_stdout", "input": "1\n0\nio...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\nIf you bring an empty...
[{"type": "stdin_stdout", "input": "560118409912468 316250877917599 1316995007040099", "output": "500636509\n"}, {"type": "stdin_stdout", "input": "316250877917604 316250877917599 672514164456590", "output": "265329493\n"}, {"type": "stdin_stdout", "input": "560118409912468 316250877917599 681260158257385", "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\nFor given three points p1, p2, p...
[{"type": "stdin_stdout", "input": "0 0 2 0\n3\n-1 1\n0 1\n1 1", "output": "-1.0000000000 -1.0000000000\n0.0000000000 -1.0000000000\n1.0000000000 -1.0000000000"}, {"type": "stdin_stdout", "input": "0 0 3 -1\n3\n0 1\n4 20\n-1 2", "output": "-0.600000000 -0.800000000\n-8.800000000 -18.400000000\n-2.000000000 -1.000000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 $n$ lists $L_i$ $(i = 0, 1, ...
[{"type": "stdin_stdout", "input": "3 24\n0 1 1\n0 1 1\n0 1 3\n0 1 4\n0 1 5\n2 2 1\n0 2 7\n1 1\n1 2\n1 2", "output": "1 1 3 4 5\n7\n7\n7\n7\n7\n7\n7\n7\n7\n7\n7\n7\n7\n7\n7\n7\n"}, {"type": "stdin_stdout", "input": "3 24\n0 1 1\n0 1 1\n0 1 5\n0 1 4\n0 1 5\n2 2 1\n0 2 7\n1 1\n1 2\n1 2", "output": "1 1 5 4 5\n7\n7\n7\n7\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDid you know that Chwee kueh, a ...
[{"type": "stdin_stdout", "input": "3\n4\n1 4 2 3\n2\n1 2\n10\n1 0 3 4 1 6 7", "output": "-1\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "3\n4\n1 4 2 3\n2\n1 2\n10\n1 0 3 1 1 6 7", "output": "-1\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "3\n4\n1 4 1 3\n2\n1 2\n7\n1 -1 3 4 6 6 7", "output": "-1\n-1\n-1\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\nLittle boy Gerald studies at sch...
[{"type": "stdin_stdout", "input": "68 74\n51 54\n3 22\n12 24\n3 27\n32 42\n36 55\n60 64\n1 4\n4 23\n11 64\n54 62\n50 56\n21 34\n27 63\n15 54\n28 61\n13 57\n39 53\n12 32\n32 40\n33 67\n55 61\n33 67\n30 37\n15 49\n27 45\n21 41\n8 42\n24 63\n40 48\n28 41\n30 67\n0 4\n7 15\n27 59\n60 62\n25 65\n30 31\n38 67\n24 43\n14 64\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a grid, consisting...
[{"type": "stdin_stdout", "input": "1000 1100\n", "output": "961685369\n"}, {"type": "stdin_stdout", "input": "1000 1110\n", "output": "720640362\n"}, {"type": "stdin_stdout", "input": "1000 1010\n", "output": "841013797\n"}, {"type": "stdin_stdout", "input": "1000 1000\n", "output": "987824894"}, {"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 are given two integers l and...
[{"type": "stdin_stdout", "input": "272324690824608523 272324690825360086 10\n", "output": "654181460\n"}, {"type": "stdin_stdout", "input": "671230848573969360 813646736032170824 12\n", "output": "406228104\n"}, {"type": "stdin_stdout", "input": "542839106765197089 928416801745511006 10\n", "output": "353013736\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 bracket sequence...
[{"type": "stdin_stdout", "input": "20\n(())(((((((()())()()\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "20\n(()())()((((()(())((\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "20\n(())((((()(((())()()\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "20\n(())(()(((())())()((\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\nKurt reaches nirvana when he fin...
[{"type": "stdin_stdout", "input": "1616324002\n", "output": "387420489\n"}, {"type": "stdin_stdout", "input": "1193916775\n", "output": "387420489\n"}, {"type": "stdin_stdout", "input": "1498619968\n", "output": "387420489\n"}, {"type": "stdin_stdout", "input": "1720967773\n", "output": "387420489\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\nThis problem is same as the prev...
[{"type": "stdin_stdout", "input": "10\n30518 30518 30518 30518 30518 30518 30518 30518 30518 30518\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "10\n30518 96518 74071 59971 50121 4862 43967 73607 19138 90754\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "10\n30518 96518 74071 59971 50121 4862 12...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 the ...
[{"type": "stdin_stdout", "input": "100 1000000000000\ndjgykfqaywhkhpocyxcpvbiiouyielmighclnuopadzuvrirbecucwnzwahahagvfstbxxaednajfauscxwttiglbbxtomnnalcl\n", "output": "8854753825335\n"}, {"type": "stdin_stdout", "input": "100 1000000000000\nlclannmotxbblgittwxcsuafjandeaxxbtsfvgahahawznwcucebrirvuzdapounlchgimleiyuo...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 of n in...
[{"type": "stdin_stdout", "input": "23 290352079\n162011045 845692742 774584765 103906675 222286673 251540072 1067675108 30856336 71306611 790640347 835976636 327687572 387722548 48938195 769656348 341889962 393959831 928029640 320443541 248114937 798473713 159552755 814528707\n", "output": "471308140\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\nThis problem is different from t...
[{"type": "stdin_stdout", "input": "4\n5\nsouse\nhouhe\n3\ncat\ndog\n2\naa\naz\n3\nabc\nbca\n", "output": "YES\n1\n4 1\nNO\nNO\nYES\n3\n3 3\n3 1\n3 2\n"}, {"type": "stdin_stdout", "input": "4\n5\nsouse\nhouhe\n3\ncat\ndog\n2\naa\naz\n3\nabc\nbca\n", "output": "YES\n1\n4 1\nNO\nNO\nYES\n3\n3 3\n3 1\n3 2\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 have three piles of candies:...
[{"type": "stdin_stdout", "input": "6\n2 1 1\n1 1 1\n4 1 2\n7 7 18\n12 1 4\n14 0 13\n", "output": "2\n1\n3\n14\n5\n13\n"}, {"type": "stdin_stdout", "input": "6\n1 1 1\n1 2 1\n4 1 1\n7 7 25\n8 1 4\n14 2 15\n", "output": "1\n2\n2\n14\n5\n15\n"}, {"type": "stdin_stdout", "input": "6\n1 1 1\n1 2 1\n4 1 1\n7 7 25\n8 1 4\n14...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFilled with optimism, Hyunuk wil...
[{"type": "stdin_stdout", "input": "4\n544431836 544432042 793496989 793497079\n544429970 544430041 793496343 793496350\n544432412 544432541 793497670 793498269\n544431029 544431033 793494552 793494859\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "4\n922033367 922033530 246113700 246113747\n922034178 92203...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAndrey's favourite number is n. ...
[{"type": "stdin_stdout", "input": "10802611971893001160947949048137125257663360973350362557151889546818281691354280360512029669737944667993533147136817951837479019430773307929092792540144287240690218353482990299029694493198951486742073494255017372881972567810450854959208991586907060759736152497682999322253656832611644...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis is an interactive problem.\...
[{"type": "stdin_stdout", "input": "100\n2 3 4 5 6 7 8 0 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 10 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 1 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n\n\nInput\n\nThe first line of t...
[{"type": "stdin_stdout", "input": "10\n2 0 0 1 1\n1 1 1 2 1\n2 1 0 1 2\n1 1 0 1 1\n2 1 0 2 1\n1 1 1 2 1\n1 2 1 3 1\n2 0 0 1 1\n1 1 0 1 1\n1 1 2 2 2\n", "output": "\ncodeforcez\n"}, {"type": "stdin_stdout", "input": "1\n1 0 0 1 0\n", "output": "codeforcez\n"}, {"type": "stdin_stdout", "input": "1\n1 0 0 1 0\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\nEshag has an array a consisting ...
[{"type": "stdin_stdout", "input": "3\n6\n1 1 1 7 3 1\n6\n17 17 8 11 9 12\n6\n10 2 2 2 1 1\n", "output": "2\n5\n4\n"}, {"type": "stdin_stdout", "input": "3\n6\n1 1 1 7 3 1\n6\n17 17 8 11 9 12\n6\n10 2 2 2 0 1\n", "output": "2\n5\n5\n"}, {"type": "stdin_stdout", "input": "3\n6\n1 1 2 7 3 1\n6\n17 17 8 11 9 12\n6\n10 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\nImagine that you have a twin bro...
[{"type": "stdin_stdout", "input": "100\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA widely known among some people...
[{"type": "stdin_stdout", "input": "10 10\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 1585 1564 3603 1095 1364 1029 3189 1331\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 1749\n0 3495 1540 641 1093 702 2249 983 1218 2108\n0 1397 1105 3119 1194 839 1286 2979 2941 1911\n0 1818 2264...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAn expedition group flew from pl...
[{"type": "stdin_stdout", "input": "602799218 494169337\n", "output": "105935725\n"}, {"type": "stdin_stdout", "input": "523061914 144515354\n", "output": "127493116\n"}, {"type": "stdin_stdout", "input": "622152471 448257864\n", "output": "210299666\n"}, {"type": "stdin_stdout", "input": "549662082 945236243\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\nLittle Petya likes points a lot....
[{"type": "stdin_stdout", "input": "100 100\n-98 -97 -96 -93 -92 -91 -90 -87 -86 -84 -81 -80 -79 -78 -76 -75 -73 -71 -69 -67 -65 -64 -63 -62 -61 -54 -51 -50 -49 -48 -46 -45 -44 -37 -36 -33 -30 -28 -27 -16 -15 -13 -12 -10 -9 -7 -6 -5 -4 2 3 5 8 9 10 11 13 14 15 16 17 19 22 24 25 26 27 28 30 31 32 36 40 43 45 46 47 50 51...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Little Girl loves problems o...
[{"type": "stdin_stdout", "input": "opfokvwzpllctflkphutcrkferbjyyrasqqkrcvoymyrxwaudgsugcqveccymdplxmtlzfoptmrapfeizpnnhbzlkuyznwacnswibxhqunazbhdvrlidghisuqunstbuevjzimvlfvopgqxrvahhngnaumgywscfrfwfpnfxwhfrelbunmedvkssykwjyartxjiplerntzkpiiaalijiwhyuhxlvhxpkgfypvrpqqsacuwocdampnnhvibsbolyduvscsjfayxpldyvqzjbqojjxdvxt...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFox Ciel has some flowers: r red...
[{"type": "stdin_stdout", "input": "1000000000 1000000000 1000000000\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "1000000000 1100000000 1000000000\n", "output": "1033333333\n"}, {"type": "stdin_stdout", "input": "1137468270 1106087921 972974334\n", "output": "1072176841\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\nLittle Petya is learning to play...
[{"type": "stdin_stdout", "input": "1 1 6 2\n", "output": "2 2 5\n"}, {"type": "stdin_stdout", "input": "8 1 1 7\n", "output": "2 0 7\n"}, {"type": "stdin_stdout", "input": "1 2 1 6\n", "output": "1 2 4\n"}, {"type": "stdin_stdout", "input": "1 5 1 7\n", "output": "1 2 2\n"}, {"type": "stdin_stdout", "input": "3 2 6 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\nThis problem consists of three s...
[{"type": "stdin_stdout", "input": "10 4\n2\n7\n1\n9\n8\n10\n5\n10\n1\n20\n", "output": "38\n"}, {"type": "stdin_stdout", "input": "10 4\n1\n7\n1\n9\n8\n10\n5\n10\n1\n20\n", "output": "39\n"}, {"type": "stdin_stdout", "input": "10 5\n2\n13\n3\n9\n8\n7\n9\n7\n1\n18\n", "output": "36\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\nValera loves his garden, where n...
[{"type": "stdin_stdout", "input": "24 1524\n16 934\n23 1940\n21 1447\n20 417\n24 1340\n22 1932\n13 775\n19 2918\n12 2355\n9 593\n11 2676\n3 1857\n16 868\n13 426\n18 1679\n22 991\n9 2728\n10 2497\n16 1221\n9 772\n23 2522\n24 982\n12 1431\n18 757\n", "output": "25893\n"}, {"type": "stdin_stdout", "input": "24 1524\n32 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\nAlexandra has a paper strip with...
[{"type": "stdin_stdout", "input": "2 1000000000 2\n-1000000000 1000000000\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2 1000000000 1\n-1000000000 1000000000\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "2 1000000000 4\n-1000000000 1000000000\n", "output": "-1"}, {"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\nFox Ciel starts to learn program...
[{"type": "stdin_stdout", "input": "49 50\n", "output": "##################################################\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\nOnce again Tavas started eating ...
[{"type": "stdin_stdout", "input": "777777777\n", "output": "1022"}, {"type": "stdin_stdout", "input": "477477447\n", "output": "728"}, {"type": "stdin_stdout", "input": "777744747\n", "output": "996"}, {"type": "stdin_stdout", "input": "444444444\n", "output": "511"}, {"type": "stdin_stdout", "input": "7474747\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\nVolodya and Vlad play the follow...
[{"type": "stdin_stdout", "input": "19 13 83\n5 2\n12 11\n5 6\n3 11\n17 8\n10 8\n3 10\n9 10\n16 3\n15 12\n14 2\n11 8\n18 6\n15 10\n11 12\n2 1\n15 3\n16 3\n1 7\n15 7\n2 9\n11 13\n18 9\n4 7\n13 4\n7 4\n3 1\n14 8\n4 5\n5 7\n8 3\n17 2\n18 2\n16 3\n10 12\n6 2\n3 6\n5 2\n10 3\n18 9\n14 3\n3 6\n6 5\n12 8\n7 12\n2 11\n6 6\n18 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSaitama accidentally destroyed a...
[{"type": "stdin_stdout", "input": "100 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\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\nTreeland is a country in which t...
[{"type": "stdin_stdout", "input": "35 15\n6 12 32 18 11 10 29 9 30 27 31 14 8 24 28 25 19 15 21 3 4 1 33 22 23 17 16 13 7 2\n1 2\n20 3\n1 4\n20 5\n20 6\n1 7\n13 8\n4 9\n1 10\n1 11\n1 12\n1 13\n18 14\n10 15\n1 16\n16 17\n1 18\n1 19\n1 20\n20 21\n1 22\n27 23\n25 24\n1 25\n20 26\n20 27\n18 28\n4 29\n13 30\n1 31\n1 32\n20...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVova plays a computer game known...
[{"type": "stdin_stdout", "input": "15 100\n1 8 8\n2 200 101\n2 10 99\n1 9 9\n2 10 99\n2 200 101\n1 14 4\n2 194 195\n2 194 194\n2 990 290\n1 2 999992\n2 6 256\n2 7 256\n2 2 999988\n2 2 252\n", "output": "NO\nNO\nYES\nNO\nNO\nYES\nNO\nNO\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "15 100\n1 8 8\n2 200 101\n2 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlice got tired of playing the t...
[{"type": "stdin_stdout", "input": "34 33\n2 1\n3 2\n4 3\n5 2\n6 3\n7 2\n8 1\n9 7\n10 12\n11 7\n12 7\n13 8\n14 2\n15 10\n16 1\n17 2\n18 14\n19 1\n20 2\n21 16\n22 21\n23 1\n24 6\n25 2\n26 20\n27 5\n28 20\n29 2\n30 10\n31 14\n32 12\n33 15\n34 8\n", "output": "12\n"}, {"type": "stdin_stdout", "input": "34 33\n2 1\n3 2\n4 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDaenerys Targaryen has an army c...
[{"type": "stdin_stdout", "input": "10000 100\n800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 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\nA new set of desks just arrived,...
[{"type": "stdin_stdout", "input": "50\n73 1\n65 73\n16 65\n57 65\n33 16\n34 57\n98 16\n84 98\n55 34\n64 84\n80 55\n75 64\n28 75\n20 75\n42 75\n88 42\n50 20\n48 28\n32 48\n58 88\n92 76\n76 53\n53 15\n15 1\n1 10\n10 71\n71 37\n37 95\n95 63\n63 92\n45 97\n97 51\n51 96\n96 12\n12 62\n62 31\n31 5\n5 29\n29 19\n19 49\n49 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\nA ski base is planned to be buil...
[{"type": "stdin_stdout", "input": "2 40\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n", "output": "0\n1\n3\n7\n15\n31\n63\n127\n255\n511\n1023\n2047\n4095\n8191\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\nVivek was roaming around in the ...
[{"type": "stdin_stdout", "input": "1000\n917\n816\n831\n979\n848\n744\n882\n615\n657\n977\n860\n951\n614\n971\n634\n838\n882\n625\n821\n918\n722\n712\n769\n761\n618\n649\n888\n629\n720\n932\n834\n895\n692\n692\n823\n711\n838\n983\n762\n962\n665\n715\n910\n863\n817\n672\n734\n958\n817\n856\n790\n932\n692\n722\n983\n618...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFoo was not amongst the most bri...
[{"type": "stdin_stdout", "input": "2\n2 9 2 -1 19\n2 1 2 10 0010\n\nSAMPLE", "output": "1\n0\n"}, {"type": "stdin_stdout", "input": "2\n1 2 4 -1 16\n1 3 3 12 1010\n\nSAMPKE", "output": "1\n8\n"}, {"type": "stdin_stdout", "input": "2\n2 -1 1 1 16\n1 1 1 7 1000\n\nQAMSKE", "output": "2\n9\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\nMilly and Pranjul are playing a ...
[{"type": "stdin_stdout", "input": "2\n2 3\n2\n2\n4\n\nSAMPLE", "output": "1\n2\n"}, {"type": "stdin_stdout", "input": "2\n2 3\n2\n3\n4\n\nSAMPLE", "output": "2\n2\n"}, {"type": "stdin_stdout", "input": "2\n2 3\n2\n2\n1\n\nSAMPLE", "output": "1\n1\n"}, {"type": "stdin_stdout", "input": "2\n3 3\n2\n2\n4\n\nSAMPLE", "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\nRahul has set upon the quest for...
[{"type": "stdin_stdout", "input": "100\n10\n10\n10\n9\n10\n8\n10\n9\n10\n10\n8\n10\n10\n10\n10\n10\n10\n9\n10\n10\n8\n10\n10\n9\n7\n10\n10\n10\n10\n10\n9\n10\n10\n10\n9\n9\n10\n10\n9\n10\n10\n10\n10\n10\n7\n10\n10\n10\n9\n10\n10\n10\n10\n10\n10\n10\n10\n10\n9\n10\n10\n10\n10\n10\n10\n9\n10\n10\n8\n10\n10\n9\n10\n9\n10...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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_0, a_1,...
[{"type": "stdin_stdout", "input": "8 12\n1 2 3 3 5\n0 1 5\n0 2 4 100 101\n1 0 3\n0 1 5 102 103\n1 2 5\n0 1 4 65 105\n1 0 2", "output": "404\n82623\n20061\n20061\n20061\n20061\n20061\n20061\n20061\n"}, {"type": "stdin_stdout", "input": "5 9\n1 2 5 4 5\n1 0 5\n0 2 4 100 101\n1 0 3\n0 1 5 102 103\n1 2 5\n0 2 5 41 105\n1 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are S sheep and W wolves.\...
[{"type": "stdin_stdout", "input": "-1 -1", "output": "unsafe\n"}, {"type": "stdin_stdout", "input": "-2 -2", "output": "unsafe\n"}, {"type": "stdin_stdout", "input": "000 0", "output": "unsafe\n"}, {"type": "stdin_stdout", "input": "000 1", "output": "unsafe\n"}, {"type": "stdin_stdout", "input": "001 1", "output": "u...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have a sequence of N integers...
[{"type": "stdin_stdout", "input": "100001 50000", "output": "546347865\n"}, {"type": "stdin_stdout", "input": "100001 27098", "output": "949668337\n"}, {"type": "stdin_stdout", "input": "101000 27098", "output": "277745716\n"}, {"type": "stdin_stdout", "input": "101000 14296", "output": "338861381\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 planned a trip using trains ...
[{"type": "stdin_stdout", "input": "549\n838\n715\n603", "output": "1152\n"}, {"type": "stdin_stdout", "input": "549\n817\n715\n603", "output": "1152"}, {"type": "stdin_stdout", "input": "555\n312\n400\n200", "output": "512\n"}, {"type": "stdin_stdout", "input": "600\n548\n220\n420", "output": "768\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\nSquare1001 has seen an electric ...
[{"type": "stdin_stdout", "input": "10\n-32", "output": "-16128\n"}, {"type": "stdin_stdout", "input": "10\n-23", "output": "-11520\n"}, {"type": "stdin_stdout", "input": "10\n-37", "output": "-18688\n"}, {"type": "stdin_stdout", "input": "10\n-42", "output": "-21248\n"}, {"type": "stdin_stdout", "input": "10\n-33", "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 are given three integers A, ...
[{"type": "stdin_stdout", "input": "-1 2 -1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-3 0 -3", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-5 0 -3", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-4 2 -3", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-1 4 -1", "output": "Yes...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSnuke received a triangle as a b...
[{"type": "stdin_stdout", "input": "-1 -1\n1 1\n2 0", "output": "0.402627528107\n"}, {"type": "stdin_stdout", "input": "3 -1\n2 5\n1 16", "output": "0.143556168892\n"}, {"type": "stdin_stdout", "input": "-3 1\n1 1\n2 -1", "output": "0.548232156368\n"}, {"type": "stdin_stdout", "input": "6 -2\n2 5\n1 18", "output": "0.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\nWe have a large square grid with...
[{"type": "stdin_stdout", "input": "100000 100000 99999 72298", "output": "471980925\n"}, {"type": "stdin_stdout", "input": "100000 100000 43938 55555", "output": "265769345\n"}, {"type": "stdin_stdout", "input": "100000 100000 99999 39553", "output": "199584029\n"}, {"type": "stdin_stdout", "input": "100000 100000 439...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDo the following for a four-digi...
[{"type": "stdin_stdout", "input": "6174\n3985\n3333\n0000", "output": "0\n3\nNA\n"}, {"type": "stdin_stdout", "input": "6174\n1779\n3333\n0000", "output": "0\n6\nNA\n"}, {"type": "stdin_stdout", "input": "6174\n1794\n3333\n0000", "output": "0\n5\nNA\n"}, {"type": "stdin_stdout", "input": "6174\n1542\n3333\n0000", "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\nBrave Ponta and his best friend,...
[{"type": "stdin_stdout", "input": "5\n1 4 3 2 20\n19\n1 3 4 10\n0", "output": "10\n2\n"}, {"type": "stdin_stdout", "input": "5\n1 4 3 2 20\n19\n2 3 4 10\n0", "output": "10\n1\n"}, {"type": "stdin_stdout", "input": "5\n2 0 3 4 20\n29\n1 3 4 10\n0", "output": "11\n2\n"}, {"type": "stdin_stdout", "input": "5\n2 0 3 4 20\...
code_stdio