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 have n students under your c... | [{"type": "stdin_stdout", "input": "4\n7\n4 2 4 1 4 3 4\n5\n2 1 5 4 3\n1\n1\n4\n1 1 1 3\n", "output": "3\n1\n0\n2\n"}, {"type": "stdin_stdout", "input": "4\n7\n4 2 4 1 4 3 4\n5\n2 1 5 1 3\n1\n1\n4\n1 1 1 3\n", "output": "3\n2\n0\n2\n"}, {"type": "stdin_stdout", "input": "4\n7\n4 2 4 1 4 3 4\n5\n2 1 2 1 3\n1\n1\n4\n1 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\nSometimes it is not easy to come... | [{"type": "stdin_stdout", "input": "95055178000205260180556042828469886821972993271643754429823604722162451915059073850774876808409097598794600994399688807965137141272981858091943527288664634386153778015566442088186037610366674832297348883687217598717131508310470819945168011745597038777198061493923608045375725309288583... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 median of an array of integers... | [{"type": "stdin_stdout", "input": "6\n2 4\n0 24 37 58 62 64 69 78\n2 2\n27 61 81 91\n4 3\n0 4 16 18 21 27 36 53 82 91 92 95\n3 4\n1 11 12 22 33 35 38 67 69 71 94 99\n2 1\n11 41\n3 3\n1 2 1 1 1 1 1 1 -1\n", "output": "168\n108\n145\n234\n11\n3\n"}, {"type": "stdin_stdout", "input": "6\n2 4\n0 24 25 58 62 64 69 78\n2 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 three bags. Each b... | [{"type": "stdin_stdout", "input": "3 3 3\n1000 1000 1000\n1000 1000 1000\n1 1 -1\n", "output": "5999\n"}, {"type": "stdin_stdout", "input": "3 3 3\n1010 1000 1000\n1000 1000 1000\n1 1 -1\n", "output": "6009\n"}, {"type": "stdin_stdout", "input": "3 3 3\n1010 1000 1000\n1000 1100 1000\n1 1 -1\n", "output": "6109\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\nFarmer John has a farm that cons... | [{"type": "stdin_stdout", "input": "3\n3\n0 4 10\n2\n0 0001000000\n1\n0\n", "output": "-10\n0\n0\n"}, {"type": "stdin_stdout", "input": "3\n3\n0 4 19\n2\n0 0001000000\n1\n0\n", "output": "-19\n0\n0\n"}, {"type": "stdin_stdout", "input": "3\n3\n0 2 12\n2\n0 1000010011\n1\n0\n", "output": "-12\n0\n0\n"}, {"type": "stdin_... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nΠ‘ity N. has a huge problem with ... | [{"type": "stdin_stdout", "input": "20\n3 4\n17 11\n8 15\n7 20\n1 11\n9 4\n6 10\n19 6\n12 5\n7 19\n14 12\n14 16\n19 2\n18 7\n16 13\n17 13\n12 18\n9 11\n6 15\n", "output": "18\n1 18\n2 17\n3 16\n4 15\n5 14\n6 13\n7 12\n8 11\n9 10\n10 9\n11 8\n12 7\n13 6\n14 5\n15 4\n16 3\n17 2\n18 1\n"}, {"type": "stdin_stdout", "input"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPermutation p is an ordered set ... | [{"type": "stdin_stdout", "input": "100\n-77 57 -95 -23 53 -29 82 -83 38 -73 85 28 25 6 -16 4 -10 -30 -9 -92 14 34 -93 61 36 -100 90 -68 28 16 100 -4 49 23 36 -87 62 -62 53 74 -50 -2 102 8 22 -30 -19 83 7 84 43 90 -65 -75 -15 97 90 15 66 2 13 -91 91 -44 62 51 51 -58 95 77 20 45 76 79 91 60 76 2 82 42 -130 94 -70 122 65... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 warm and sunny day king Copa... | [{"type": "stdin_stdout", "input": "10\n-4 7 24 1.8252658176990018\n3 -1 50 0.111185\n-2 -8 27 0.976475\n-9 -2 6 0.6362966234482478\n6 -4 21 0.526054\n-7 2 19 0.488637\n-6 -5 50 0.819011\n-7 3 39 0.987596\n-3 -8 9 0.8139131170857096\n4 10 1 0.9052567295555951\n", "output": "4.5371295472545965\n"}, {"type": "stdin_stdou... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGerald has been selling state se... | [{"type": "stdin_stdout", "input": "108\n", "output": " 2"}, {"type": "stdin_stdout", "input": "243\n", "output": " 1"}, {"type": "stdin_stdout", "input": "81\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\nHooray! Berl II, the king of Ber... | [{"type": "stdin_stdout", "input": "11 8\n3 5 5\n8 9 9\n4 6 6\n8 10 10\n5 7 7\n2 7 2\n10 11 11\n1 11 1\n", "output": "0 1 5 5 6 7 2 9 10 11 1 \n"}, {"type": "stdin_stdout", "input": "11 8\n3 5 5\n8 9 9\n4 6 6\n8 10 10\n4 7 7\n2 7 2\n10 11 11\n1 11 1\n", "output": "0 1 5 5 6 7 2 9 10 11 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\nCertainly, everyone is familiar ... | [{"type": "stdin_stdout", "input": "0X0\nX0X\n0X.\n", "output": "the second player won\n"}, {"type": "stdin_stdout", "input": "X.0\n0X0\nXX0\n", "output": "the second player won\n"}, {"type": "stdin_stdout", "input": "XX0\n000\nXX.\n", "output": "the second player won\n"}, {"type": "stdin_stdout", "input": "00X\nX0.\nX... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlas, finding one's true love is... | [{"type": "stdin_stdout", "input": "17601120900014764776764048700928872725171605903217\n", "output": "10428170619\n"}, {"type": "stdin_stdout", "input": "78767765544454334445445555455676565433343455432332\n", "output": "11031574582\n"}, {"type": "stdin_stdout", "input": "676765666545656543321110112122111112234332221100... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolar bears Menshykov and Uslada... | [{"type": "stdin_stdout", "input": "53 3\n1 3 4 4 5 7 10 14 19 25 32 40 23 59 70 82 148 109 124 140 157 175 194 214 235 257 280 304 329 355 382 410 439 469 500 532 565 599 634 670 388 745 784 824 865 907 950 994 1039 1085 1132 1180 1229\n1 2 40\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "53 3\n1 3 4 4 5 7 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe New Vasjuki village is stret... | [{"type": "stdin_stdout", "input": "10\n47 21 20 91 22 28 92 100 47 69\n", "output": "11.000000\n31.000000 58.000000 102.000000 "}, {"type": "stdin_stdout", "input": "10\n26 21 20 91 22 28 92 62 47 69\n", "output": "11.000000\n31.000000 58.000000 102.000000 "}, {"type": "stdin_stdout", "input": "10\n47 21 20 91 22 28 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\nLimak is an old brown bear. He o... | [{"type": "stdin_stdout", "input": "50\n840868705 387420489 387420489 795385082 634350497 206851546 536870912 536870912 414927754 387420489 387420489 536870912 387420489 149011306 373106005 536870912 700746206 387420489 1418799299 847215247 176645254 576664386 387420489 230876513 536870912 536870912 536870912 387420489... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJack decides to invite Emma out ... | [{"type": "stdin_stdout", "input": "10 10\n256 72 455 45 912 506 235 68 951 92\n246 305 45 212 788 621 449 876 459 899\n732 107 230 357 370 610 997 669 61 192\n131 93 481 527 983 920 825 540 435 54\n777 682 984 20 337 480 264 137 249 502\n51 467 479 228 923 752 714 436 199 973\n3 91 612 571 631 212 751 84 886 948\n252 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTwo positive integers a and b ha... | [{"type": "stdin_stdout", "input": "549755813887 549755813887\n", "output": "549755813886\n"}, {"type": "stdin_stdout", "input": "549755813888 549755813886\n", "output": "274877906944\n"}, {"type": "stdin_stdout", "input": "547616456703 547599679487\n", "output": "68719476736\n"}, {"type": "stdin_stdout", "input": "552... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 rebus of form ? ... | [{"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\nPari wants to buy an expensive c... | [{"type": "stdin_stdout", "input": "15 388\n33 232 106 369 266 135 22 169 367 37 14 181 232 25 257\n", "output": "89\n0 14 22 25 33 36 37 39 47 51 55 58 59 61 62 69 70 72 73 76 80 84 92 94 95 98 106 109 117 131 135 149 157 160 168 169 172 174 181 182 183 186 191 193 194 195 197 202 205 206 207 214 216 219 220 228 231 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 arithmetic pro... | [{"type": "stdin_stdout", "input": "1789433851 -633540112 1286318222 -1728151682 1438333624 1538194890\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1955378240 -837482305 1743607821 -1623988108 -653286850 178227154\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "219427 -1712095577 1502893658 5552436... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have n devices that you want... | [{"type": "stdin_stdout", "input": "20 16807\n75250 50074\n43659 8931\n11273 27545\n50879 77924\n37710 64441\n38166 84493\n43043 7988\n22504 82328\n31730 78841\n42613 44304\n33170 17710\n97158 31491\n70934 93100\n80279 51817\n95336 99098\n7827 13513\n29268 23811\n77634 80980\n79150 36580\n58822 11968\n", "output": "0.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\nA game field is a strip of 1 Γ n... | [{"type": "stdin_stdout", "input": "100\n************************************************************P***************************************\n", "output": "138\n"}, {"type": "stdin_stdout", "input": "100\n.....................P............P....P....*.............*.......**.P.................P........*...\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\nAs you could know there are no m... | [{"type": "stdin_stdout", "input": "100\n25 6 46 37 87 99 70 31 46 12 94 40 87 56 28 14 94 39 13 12 67 13 71 39 83 48 40 14 62 41 16 71 20 41 83 41 68 98 23 82 62 83 62 35 49 22 31 21 66 98 54 39 34 52 11 28 47 89 25 44 68 36 91 46 82 86 88 48 27 93 7 9 53 36 16 100 84 84 44 25 58 66 16 46 72 21 91 78 4 17 44 17 47 67 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBishwock is a chess figure that ... | [{"type": "stdin_stdout", "input": "0000000000000000000000000000000000000000000000000000000000X0000000000000000000000000000000000000X000\n0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n", "output": "66\n"}, {"type": "stdin_stdout", "input": "0000X00X000000X0000X00X... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Syed loves brute force. H... | [{"type": "stdin_stdout", "input": "2\n101\n17713\n\nRAMPME", "output": "-1\n13832\n"}, {"type": "stdin_stdout", "input": "2\n100\n4150\n\nSAMPLE", "output": "-1\n4104\n"}, {"type": "stdin_stdout", "input": "2\n101\n4150\n\nSAMPLE", "output": "-1\n4104\n"}, {"type": "stdin_stdout", "input": "2\n000\n3041\n\nRAMPLE", "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\nPranav just learned about Modulu... | [{"type": "stdin_stdout", "input": "2\n16168 15\n26 123\n\nSAMPLE", "output": "13\n26\n"}, {"type": "stdin_stdout", "input": "2\n16168 15\n18 123\n\nSAMPLE", "output": "13\n18\n"}, {"type": "stdin_stdout", "input": "2\n12344 12\n12 123\n\nSAMPLE", "output": "8\n12\n"}, {"type": "stdin_stdout", "input": "2\n12344 11\n12... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 students are back in host... | [{"type": "stdin_stdout", "input": "-1 5\nMurliaalw 2\nMithaiwal` 4\nMjthaiwala 6\nalbwhahtiM 1\nahawilbriN 18\n\nLSMPAE", "output": "ahawilbriN\n"}, {"type": "stdin_stdout", "input": "0 5\nMurljaalw 7\nMiugaiwala 4\nalawiahsjM 5\nMithajvala -6\nwirchiLala 12\n\nSAMPLE", "output": "wirchiLala\n"}, {"type": "stdin_stdou... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe window of Takahashi's room h... | [{"type": "stdin_stdout", "input": "2 -777", "output": "1556\n"}, {"type": "stdin_stdout", "input": "2 -839", "output": "1680\n"}, {"type": "stdin_stdout", "input": "1 -839", "output": "1679\n"}, {"type": "stdin_stdout", "input": "181 21", "output": "139\n"}, {"type": "stdin_stdout", "input": "194 13", "output": "168\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\nSnuke is playing with red and bl... | [{"type": "stdin_stdout", "input": "10\n582463373 690528069 8\n621230322 318051944 4\n356524296 974059503 6\n372751381 111542460 9\n392867214 581476334 2\n606955458 513028121 5\n1258194549 791660614 9\n250465517 110090143 3\n618624774 406956634 6\n426294747 736401096 0\n974896051 888765942 2\n424730474 653092928 0\n868... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string S consist... | [{"type": "stdin_stdout", "input": "dnuoodnuuuhs\n1", "output": "dnuoodnuuuhs\n"}, {"type": "stdin_stdout", "input": "shuuundoound\n1", "output": "shuuundoound\n"}, {"type": "stdin_stdout", "input": "dnuondouuuhs\n1", "output": "dnuondouuuhs\n"}, {"type": "stdin_stdout", "input": "siuuuodnound\n1", "output": "siuuuodno... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 kangaroo at coordinat... | [{"type": "stdin_stdout", "input": "12814", "output": "160\n"}, {"type": "stdin_stdout", "input": "19710", "output": "199\n"}, {"type": "stdin_stdout", "input": "36877", "output": "272\n"}, {"type": "stdin_stdout", "input": "49568", "output": "315\n"}, {"type": "stdin_stdout", "input": "44971", "output": "300\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\nSnuke is interested in strings t... | [{"type": "stdin_stdout", "input": "4\nexpr\nexpq", "output": "8\n"}, {"type": "stdin_stdout", "input": "4\nexpr\nrxep", "output": "7\n"}, {"type": "stdin_stdout", "input": "4\nexpr\nepxq", "output": "8\n"}, {"type": "stdin_stdout", "input": "4\nexpr\npexq", "output": "8\n"}, {"type": "stdin_stdout", "input": "4\nexpr\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nUsing the given four integers fr... | [{"type": "stdin_stdout", "input": "8 7 13 9\n1 0 1 1\n4 9 14 2\n0 0 0 0", "output": "((8 - 13) * (7 - 9))\n0\n((4 - 2) * (14 - 9))\n"}, {"type": "stdin_stdout", "input": "8 8 13 10\n1 4 4 4\n5 5 7 5\n0 0 0 0", "output": "(((8 - 8) * 13) + 10)\n0\n((5 * 7) - (5 * 5))\n"}, {"type": "stdin_stdout", "input": "8 7 9 9\n4 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\nAizu Gakuen High School holds a ... | [{"type": "stdin_stdout", "input": "1a 132 243\n1c 324 183\n1f 93 199\n2b 372 163\n2c 229 346\n2e 391 206\n3a 118 168\n3b 263 293\n3d 281 102", "output": "1a 375 99300\n1c 507 119700\n1f 292 78300\n2b 535 123300\n2c 575 149600\n2e 597 140000\n3a 286 74000\n3b 556 140500\n3d 383 86800\n"}, {"type": "stdin_stdout", "inpu... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nproblem\n\nDuring this time of w... | [{"type": "stdin_stdout", "input": "3 4\n31\n27\n35\n20 25 30\n23 29 90\n21 35 60\n28 48 40", "output": "100\n"}, {"type": "stdin_stdout", "input": "3 4\n31\n27\n35\n20 25 30\n23 29 90\n21 35 60\n28 48 25", "output": "130\n"}, {"type": "stdin_stdout", "input": "3 4\n34\n40\n44\n38 25 30\n24 29 11\n21 69 99\n28 43 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\nYou have full control over a rob... | [{"type": "stdin_stdout", "input": "11 5\nFORWARD 3\nRIGHT\nFORWARD 10\nLEFT\nBACKWARD 3\nSTOP\n3 1\nFORWARD 2\nSTOP\n0 0", "output": "11 1\n1 1\n"}, {"type": "stdin_stdout", "input": "14 5\nFORWARD 3\nRIGHT\nFORWARD 8\nLEFT\nBACKWARD 2\nSTOP\n3 1\nFORVARD 5\nSTOP\n0 0", "output": "9 2\n1 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\nYour companyβs next product will... | [{"type": "stdin_stdout", "input": "3 3 3\n1 1\n1 1\n1 1\n3 3 7\n3 2\n1 3\n1 1\n2 3\n2 1\n3 3\n3 1\n4 3 15\n1 1\n2 2\n1 1\n3 3\n3 3\n1 1\n3 3\n3 3\n4 4\n1 1\n4 4\n4 4\n4 4\n4 1\n2 2\n0 0 0", "output": "Draw\nWhite 6\nBlack 15\n"}, {"type": "stdin_stdout", "input": "3 3 3\n1 1\n1 1\n1 1\n3 3 7\n3 3\n1 3\n1 1\n2 3\n2 1\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem C Medical Checkup\n\nStu... | [{"type": "stdin_stdout", "input": "3 102\n1\n3\n0", "output": "103\n34\n34\n"}, {"type": "stdin_stdout", "input": "3 35\n1\n3\n3", "output": "36\n12\n11\n"}, {"type": "stdin_stdout", "input": "3 55\n1\n3\n4", "output": "56\n19\n13\n"}, {"type": "stdin_stdout", "input": "3 55\n1\n3\n0", "output": "56\n19\n19\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\nAdvanced Computer Music (ACM) so... | [{"type": "stdin_stdout", "input": "5\n2\n01000000\n00020202\n2\n0102\n00000810\n1\n0200020008000200\n5\n0001\n000001\n0000000000\n00000000000001\n0000000000000000000001\n1\n000000", "output": "01020202\n01000A10\n02020802\n000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are playing a popular video ... | [{"type": "stdin_stdout", "input": "...\n...\n.*.\n...\n...\n.*.\n...\n...\n...\n...\n...\n.*.\n...\n...\n.*.\n...\n...\n...\n\n...\n.*.\n...\n*..\n...\n..*\n*.*\n*/*\n*.*\n*.*\n.*.\n*.*\n*..\n.*.\n..*\n*.*\n...\n*.*\n\n...\n.*.\n.*.\n...\n.**\n*..\n...\n...\n.*.\n.*.\n...\n*..\n..*\n...\n.**\n...\n*..\n...\n\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\nF --Land inheritance\n\nProblem ... | [{"type": "stdin_stdout", "input": "0 2 1\n-1 2 1\n1 -1 -2\n1 -1 0", "output": "0\n"}, {"type": "stdin_stdout", "input": "0 2 1\n-1 2 1\n1 -1 -2\n2 -1 0", "output": "0\n"}, {"type": "stdin_stdout", "input": "0 2 2\n-1 2 1\n1 -1 -2\n2 -1 0", "output": "0\n"}, {"type": "stdin_stdout", "input": "0 2 2\n-1 2 1\n1 -1 -1\n2 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem\n\nThere are $ N $ balls... | [{"type": "stdin_stdout", "input": "22 7 26\n11 14 15 3 11 7 16 17 1 4 2 17 4 14 16 16 3 13 17 12 7 11 2 20 12 22\n6 10\n1 3\n13 1\n16 5\n4 1\n20 7\n18 4\n26 7\n9 1\n12 2\n21 1\n21 7\n18 1\n14 5\n24 5\n6 1\n1 1\n2 5\n21 2\n7 6\n10 14\n15 7", "output": "58\n"}, {"type": "stdin_stdout", "input": "22 7 26\n11 14 15 3 11 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\nWrite a program which reads a $n... | [{"type": "stdin_stdout", "input": "4 0 13\n1 1\n2 4\n4 15\n-1 0 2\n1 5 2", "output": "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\n0 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\n"}, {"type": "stdin_stdout", "input": "4 0 12\n1 1\n-1 2\n4 1\n1 0 -1\n1 12 5", "output": "0 0 0 0 0 0 0 0 0 0 0 0\n0 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\nIt was exam time in pesce, mandy... | [{"type": "stdin_stdout", "input": "2\n9\n5 4 2 8 3 1 3 13\n5\n1 5 2 4", "output": "6\n3\n"}, {"type": "stdin_stdout", "input": "2\n9\n5 4 2 8 3 1 3 13\n5\n1 3 2 4", "output": "6\n5\n"}, {"type": "stdin_stdout", "input": "2\n9\n5 4 2 8 3 1 7 9\n5\n1 5 2 3", "output": "6\n4\n"}, {"type": "stdin_stdout", "input": "2\n9\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\nPetya has an array a consisting ... | [{"type": "stdin_stdout", "input": "10 -196228170\n-181402541 328251238 624722764 682518931 783857631 969228879 547715844 -149364638 823684584 563974794\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "10 -196228170\n-181402541 328251238 624722764 682518931 783857631 969228879 547715844 -149364638 823684584 833... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 toy building consisti... | [{"type": "stdin_stdout", "input": "10 10\n1 1 1 1 1 1 1 1 1 1\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "10 10\n3 3 3 3 3 3 3 3 3 3\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "10 10\n1 1 1 1 2 1 1 1 1 1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "10 10\n3 3 3 3 1 3 3 3 3 3\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 sequence s consi... | [{"type": "stdin_stdout", "input": "21\n3\n123\n3\n123\n3\n123\n3\n123\n3\n123\n3\n213\n3\n123\n3\n123\n3\n123\n3\n321\n3\n123\n3\n321\n3\n132\n3\n322\n3\n321\n3\n341\n3\n123\n3\n421\n3\n421\n3\n421\n3\n421\n", "output": "YES\n2\n1 23\nYES\n2\n1 23\nYES\n2\n1 23\nYES\n2\n1 23\nYES\n2\n1 23\nYES\n2\n2 13\nYES\n2\n1 23\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\nAfter lessons Nastya decided to ... | [{"type": "stdin_stdout", "input": "49\n1 17\n18 115\n116 211\n212 269\n270 345\n346 404\n405 441\n442 467\n468 526\n527 583\n584 664\n665 757\n758 794\n795 802\n803 882\n883 920\n921 960\n961 962\n963 1006\n1007 1081\n1082 1112\n1113 1149\n1150 1217\n1218 1282\n1283 1287\n1288 1365\n1366 1374\n1375 1379\n1380 1478\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\nThere are n students standing in... | [{"type": "stdin_stdout", "input": "100 10\n19 55 91 50 31 23 60 84 38 1 22 51 27 76 28 98 11 44 61 63 15 93 52 3 66 16 53 36 18 62 35 85 78 37 73 64 87 74 46 26 82 69 49 33 83 89 56 67 71 25 39 94 96 17 21 6 47 68 34 42 57 81 13 10 54 2 48 80 20 77 4 5 59 30 90 95 45 75 8 88 24 41 40 14 97 32 7 9 65 70 100 99 72 58 92... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "100\n4 42 23 23 16 42 16 23 42 16 42 8 4 23 4 4 23 42 16 42 23 23 23 42 4 42 8 8 16 23 15 23 16 4 42 15 15 23 16 15 16 4 4 15 23 42 42 15 8 23 8 23 4 15 16 15 42 8 23 16 15 42 23 8 4 16 15 16 23 16 16 4 23 16 8 23 16 15 23 4 4 8 15 4 4 15 8 23 23 4 4 8 8 4 42 15 4 4 42 16\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\nEach evening after the dinner th... | [{"type": "stdin_stdout", "input": "1000000000 846040702\n", "output": "999939239\n"}, {"type": "stdin_stdout", "input": "1000000000 315152540\n", "output": "999948715\n"}, {"type": "stdin_stdout", "input": "999999998 434363581\n", "output": "999946439\n"}, {"type": "stdin_stdout", "input": "999999994 108004280\n", "ou... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string s consist... | [{"type": "stdin_stdout", "input": "dfcbbcfeeedbaea\n15\n1 1 e\n1 4 b\n2 10 15\n1 7 b\n1 12 c\n2 6 8\n2 1 6\n1 7 c\n1 2 f\n1 10 a\n2 7 11\n1 10 a\n1 14 b\n1 1 f\n2 1 11\n", "output": "4\n3\n4\n4\n6\n"}, {"type": "stdin_stdout", "input": "decbbcfeeedbafa\n15\n1 1 e\n1 4 b\n2 10 15\n1 7 b\n1 12 c\n2 6 8\n2 1 6\n1 7 c\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\nTsumugi brought n delicious swee... | [{"type": "stdin_stdout", "input": "37 13\n164823 8992 21818 77521 130870 83201 174985 168799 9565 84443 105083 54131 130813 42829 98759 60103 198520 125068 59611 45609 124003 106143 54167 179002 103755 152802 146640 74767 91309 11941 131534 32533 67324 27272 49166 129157 41630\n", "output": "8992 18557 30498 52316 795... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRoma is playing a new expansion ... | [{"type": "stdin_stdout", "input": "10 10 10\n51 87\n68 743\n82 1284\n73 936\n55 242\n89 1554\n58 357\n66 666\n62 512\n51 87\n92 1670\n56 280\n56 280\n91 1631\n77 1091\n89 1554\n61 473\n98 1901\n77 1091\n77 1091\n86 15 386\n43 58 386\n68 33 386\n39 62 386\n95 6 386\n74 27 386\n94 7 386\n17 84 386\n97 4 386\n45 56 386\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\nHQ9+ is a joke programming langu... | [{"type": "stdin_stdout", "input": "mzbmweyydiadtlcouegmdbyfwurpwbpuvhifnuapwyndmhtqvkgkbhtytszotwflegsjzzszfwtzfpnscguemwrczqxycivdqnkH\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "Qzbmweyydiadtlcouegmdbyfwurpwbpuvhifnuapwyndmhtqvkgkbhtytszotwflegsjzzszfwtzfpnscguemwrczqxycivdqnky\n", "output": "YES\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\nJohnny has just found the new, g... | [{"type": "stdin_stdout", "input": "1\n71 2\n100 99 98 97 96 95 94 93 92 91 90 87 86 82 79 78 76 71 70 69 68 66 64 63 62 56 55 53 52 51 50 46 43 42 39 38 37 35 33 31 30 29 22 20 19 18 11 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "output": "999999985\n"}, {"type": "stdin_stdout", "input": "1\n71 2\n100 99 98 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\nIn the game of Mastermind, there... | [{"type": "stdin_stdout", "input": "7\n5 0 4\n3 1 1 2 5\n5 3 0\n1 1 2 1 2\n4 -1 4\n5 5 3 3\n4 1 4\n2 3 2 3\n6 0 2\n3 2 1 1 1 1\n6 2 4\n3 3 2 1 1 1\n6 2 6\n1 1 3 2 0 1\n", "output": "YES\n1 4 3 5 1\nYES\n3 1 3 1 2\nYES\n3 3 5 5\nNO\nYES\n1 1 4 4 4 4\nYES\n4 4 3 3 1 1\nYES\n3 1 1 0 2 1\n"}, {"type": "stdin_stdout", "inpu... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a tree that consis... | [{"type": "stdin_stdout", "input": "4\n3\n3 1\n2 1\n4\n22861 20707 59627 9293\n3\n3 1\n1 2\n6\n15767 40973 20807 24419 46439 62816\n3\n3 2\n1 2\n6\n31575 54493 10799 37529 59743 30529\n3\n3 1\n2 1\n1\n51618\n", "output": "783349080\n372565328\n603348715\n103238\n"}, {"type": "stdin_stdout", "input": "4\n3\n3 1\n2 1\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\nLet us call two integers x and y... | [{"type": "stdin_stdout", "input": "1\n40\n1 1 5 6 2 10 12 10 4 2 17 18 6 3 1 4 1 1 7 2 9 10 3 2 4 1 9 1 1 4 2 7 8 1 7 9 2 17 7 2\n40\n1\n10\n1\n9\n0\n12\n9\n2\n1\n5\n13\n7\n3\n10\n4\n5\n0\n9\n0\n8\n5\n5\n3\n0\n6\n9\n1\n10\n13\n8\n3\n1\n2\n2\n7\n2\n2\n8\n4\n1\n", "output": "24\n24\n24\n24\n16\n24\n24\n24\n24\n24\n24\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\nEudokimus, a system administrato... | [{"type": "stdin_stdout", "input": "b.baba.ebpbac.iabaeabac.abab.adabacaba.ahcggibij.adaacab.ebaba.aa.abacaba.dacabada.daqjcpc.jadab.dab\n", "output": "YES\nb.bab\na.ebp\nbac.iab\naeabac.aba\nb.ada\nbacaba.ahc\nggibij.ada\nacab.eba\nba.a\na.aba\ncaba.dac\nabada.daq\njcpc.jad\nab.dab\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\nBajtek is learning to skate on i... | [{"type": "stdin_stdout", "input": "40\n685 711\n433 403\n703 710\n491 485\n616 619\n288 282\n884 871\n367 352\n500 511\n977 982\n51 31\n576 564\n508 519\n755 762\n22 20\n368 353\n232 225\n953 955\n452 436\n311 330\n967 988\n369 364\n791 803\n150 149\n651 661\n118 93\n398 387\n748 766\n852 852\n230 228\n555 545\n515 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\nYou've got two numbers. As long ... | [{"type": "stdin_stdout", "input": "20\n1000000000 999999999\n1000000000 999999999\n1000000000 999999999\n1000000000 999999999\n1000000000 999999999\n1000000000 999999999\n1000000000 999999999\n1000000000 999999999\n1000000000 999999999\n1000000000 999999999\n1000000000 999999999\n1000000000 999999999\n1000000000 99999... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSpecial Agent Smart Beaver works... | [{"type": "stdin_stdout", "input": "1023456789??????????????????????????????????????ABCDIFGHIJ\n", "output": "362880000000000000000000000000000000000000000\n"}, {"type": "stdin_stdout", "input": "??JG?\n", "output": "81000\n"}, {"type": "stdin_stdout", "input": "B??C?\n", "output": "81000\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 Chris knows there's no fu... | [{"type": "stdin_stdout", "input": "400\nRLR.LRL..RLRLRLRL.R..L...R...LR.L...RLR...L.RLRLR..L..RL.RLRLR.L.R..LR..L.R.L...R.LRLRLR.LRLR..LRLRLRL.......RLR..LR..LRLR.....LRL.RL.R.L..R.L.RLRL..RLR.LRLR..L.RLRLR.LR.LR..L..RL.R....LRLRLR.LR.L.R.L.R.LRLRL..R.LRL..R.LRLRLRLR..LR...LRLR.LRL..R...LRL.R..LRLRL.R..LR...LR.LR.LRLR... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 an array a[1], a[2], ..... | [{"type": "stdin_stdout", "input": "100\n100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 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\nTwilight Sparkle learnt that the... | [{"type": "stdin_stdout", "input": "10 10\n2 1\n3 1\n4 1\n3 5\n6 2\n5 7\n1 8\n5 9\n10 5\n7 2\n1 0 0 0 1 1 1 0 0 1\n", "output": "31\n1 2 6 2 7 5 3 5 3 5 9 5 9 5 10 5 7 5 7 2 1 2 1 4 1 4 1 8 1 8 1\n"}, {"type": "stdin_stdout", "input": "10 10\n1 2\n3 1\n4 3\n1 5\n6 5\n7 4\n8 7\n9 5\n10 4\n6 10\n1 0 0 1 1 0 0 1 0 1\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\nPeter decided to wish happy birt... | [{"type": "stdin_stdout", "input": "30 900 15\n1396 562\n1265 475\n3329 2605\n1016 340\n2369 1595\n2085 1245\n2677 1934\n1953 1154\n3002 2199\n1688 855\n1147 407\n2762 2064\n2202 1359\n700 30\n3265 2488\n1884 1034\n2571 1836\n3067 2269\n882 212\n3505 2793\n1602 785\n2292 1460\n2442 1712\n2889 2127\n3187 2361\n1770 932\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 evening, after the contes... | [{"type": "stdin_stdout", "input": "100\n4116 4116 4117 4117 4117 4117 4118 4119 4119 4119 4119 4120 4120 4120 4120 4121 4122 4123 4123 4123 4123 4124 4124 4124 4124 4125 4126 4126 4126 4126 4127 4127 4127 4127 4128 4128 4128 4128 4129 4129 4130 4130 4131 4132 4133 4133 4134 4134 4135 4135 4136 4137 4137 4137 4138 4139... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 recently finished writ... | [{"type": "stdin_stdout", "input": "26\nabcdefghijklmnopqrstuvwxyzfgvnsltvvohywvqhuhtydghtthgdythuhqvwyhovvtlsnvgfzyxwvutsrqponmlkjihgfedcba\n", "output": "abcdefghijklmnopqrstuvwxyzfgvnsltvvohywvqhuhtydghtthgdythuhqvwyhovvtlsnvgfzyxwvutsrqponmlkjihgfedcba\n"}, {"type": "stdin_stdout", "input": "26\nab?defg??j??mnopqrs... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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, Wet Shark is given n inte... | [{"type": "stdin_stdout", "input": "5\n999999999 503514429 850382710 999999999 1620498919\n", "output": "4974396056\n"}, {"type": "stdin_stdout", "input": "5\n999999999 503514429 850382710 999999999 1246839866\n", "output": "4097222574\n"}, {"type": "stdin_stdout", "input": "5\n999999999 999999999 850382710 999999999 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\nAccording to rules of the Berlan... | [{"type": "stdin_stdout", "input": "231\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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\nZS the Coder is coding on a craz... | [{"type": "stdin_stdout", "input": "2 1000000000\n1 1000000000\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "6 5\n1 3 8 14 19 20\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "6 5\n1 5 8 14 19 20\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "5 10\n-1 1 22 32 34\n", "output": "3\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\nEighth-grader Vova is on duty to... | [{"type": "stdin_stdout", "input": "101000010\n", "output": "2\n100999959\n 101000004\n"}, {"type": "stdin_stdout", "input": "101110010\n", "output": "2\n101109976\n 101110003\n"}, {"type": "stdin_stdout", "input": "100010010\n", "output": "2\n100009977\n 100010004\n"}, {"type": "stdin_stdout", "input": "110010011\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\nPetya has a string of length n c... | [{"type": "stdin_stdout", "input": "40 24\nYYUcKDEUVLUCU8EKiUVxnD8TZSSidW8TUDS8Sccb\n3 38 L\n24 33 d\n6 36 d\n5 10 d\n13 14 E\n12 23 S\n3 30 U\n4 11 C\n12 15 Y\n5 27 x\n25 28 W\n25 26 E\n17 26 C\n17 22 d\n6 25 n\n19 22 K\n2 26 T\n1 22 W\n7 19 d\n12 18 K\n4 12 L\n9 18 6\n4 8 i\n6 8 M\n", "output": "YYcKDEV8KiVD8ZSSi8DS8... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecently n students from city S ... | [{"type": "stdin_stdout", "input": "19\n1\n1 1\n1\n1 2\n1\n1 1000\n1\n1 2000\n1\n2 2\n1\n2 3\n1\n2 1000\n1\n2 2000\n1\n1999 1999\n1\n1999 2000\n1\n2000 2000\n2\n1 1\n1 1\n2\n1 1\n1 2\n2\n1 2\n1 1\n2\n1 2000\n1 1\n2\n1 1\n1 2000\n2\n1 2000\n2 2\n2\n2 2000\n2 2\n2\n2 2\n2 2000\n", "output": "1\n1\n1\n1\n2\n2\n2\n2\n1999\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecently Max has got himself int... | [{"type": "stdin_stdout", "input": "10 9 0\n620118469 704168608\n528098892 341451371\n15150469 449838744\n960504540 722185004\n271837337 344050133\n940943201 419522619\n85569623 788965215\n161962866 563795701\n943389281 445744350\n610994199 473866838\n", "output": "5253588583\n"}, {"type": "stdin_stdout", "input": "10 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAllen dreams of one day owning a... | [{"type": "stdin_stdout", "input": "40 77\n60 31 50 41 4 12 27 6 65 11 0 34 44 13 42 18 64 15 76 59 36 69 70 71 66 57 37 25 26 2 23 24 45 55 67 29 75 49 33 40\n11 14 65 44 74 51 55 16 19 29 75 41 27 35 69 10 70 2 73 58 45 61 0 7 30 6 23 25 66 63 28 62 24 77 20 43 0 18 50 52\n54 64 60 57 31 8 72 26 76 0 71 48 32 17 12 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\nAn extraterrestrial visit!\nReme... | [{"type": "stdin_stdout", "input": "659\n8 972726106237281\n29 516908306\n9 294\n27 84664275\n30 888188693\n6 40\n6 29\n8 877878903230015\n29 66695922\n2 38\n31 1799217893\n3 3\n12 311\n31 631884547720169\n15 26933\n9 497416784631326\n26 47553572\n35 27143570505\n33 4229111886\n17 86199\n20 789098\n20 8186139\n13 4681\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProtection of the Indian border ... | [{"type": "stdin_stdout", "input": "5 1875 14243\n3322 21\n788 589\n1479 200\n7295 2325\n4033 1259\n\nEATPLM", "output": "5522\n"}, {"type": "stdin_stdout", "input": "5 2234 14243\n3322 21\n788 589\n1479 200\n7295 2325\n4033 1259\n\nEASPLM", "output": "5163\n"}, {"type": "stdin_stdout", "input": "5 1875 14243\n3322 21\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNavi is a famous mathematician. ... | [{"type": "stdin_stdout", "input": "2\n2\n-1 2\n2\n3 4\n\nSAMELP", "output": "Case #1: 1000000005\nCase #2: 714285721\n"}, {"type": "stdin_stdout", "input": "2\n2\n1 1\n2\n12 5\n\nTAMOEL", "output": "Case #1: 500000004\nCase #2: 176470593\n"}, {"type": "stdin_stdout", "input": "2\n2\n1 1\n2\n12 2\n\nTAMOEL", "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\nAditya is a professor in Engilsh... | [{"type": "stdin_stdout", "input": "100\nyqypgenznlzztptieaqkgldlzzvfptbgkaxbfygoqyaagbvulzulemtnybvszhmpbrqmyodsudywprbyfbdlwdusnrgxytlrcaybobwugeosucuqreyfzgktbatrcponfibpsbfwbsrrkobtpmodiywsccddvpkbtnsclwoofmfkdxqhkzrvlnypxkiwodvhsefkayhy\nkgrmgjuxgpnrnozmjtflxdnpskyolhwcytjsurjavhdkcbehynyeuizynsrcxsxeehkwlzjkrcnhj... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 a string S. Replace eve... | [{"type": "stdin_stdout", "input": "sardnie", "output": "xxxxxxx\n"}, {"type": "stdin_stdout", "input": "sardnif", "output": "xxxxxxx\n"}, {"type": "stdin_stdout", "input": "findras", "output": "xxxxxxx\n"}, {"type": "stdin_stdout", "input": "findrbs", "output": "xxxxxxx\n"}, {"type": "stdin_stdout", "input": "frndibs"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 a string S of length N.... | [{"type": "stdin_stdout", "input": "13\nstrangeoranfe", "output": "3\n"}, {"type": "stdin_stdout", "input": "13\nefnaroegnarts", "output": "3\n"}, {"type": "stdin_stdout", "input": "13\nefnarotgnares", "output": "3\n"}, {"type": "stdin_stdout", "input": "13\nserangtoranfe", "output": "3\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\nSnuke has N strings. The i-th st... | [{"type": "stdin_stdout", "input": "9\nBEWPVCRWH\nZQNZYIJX\nBAVREA\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA", "output": "4\n"}, {"type": "stdin_stdout", "input": "9\nBEWPVCRWH\nZQNZYIJX\nAERVAB\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA", "output": "4\n"}, {"type": "stdin_stdout", "input": "9\nBEWPVCRWH\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 two integers A and... | [{"type": "stdin_stdout", "input": "-17 -10", "output": "170\n"}, {"type": "stdin_stdout", "input": "-10 -10", "output": "100\n"}, {"type": "stdin_stdout", "input": "-156 -1", "output": "156\n"}, {"type": "stdin_stdout", "input": "-156 -2", "output": "312\n"}, {"type": "stdin_stdout", "input": "-156 -3", "output": "468... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 has a rooted tree with N+1... | [{"type": "stdin_stdout", "input": "31\n0 1 0 2 4 0 4 1 6 4 3 9 7 3 7 3 15 6 12 10 12 16 5 3 20 1 25 20 23 24 23", "output": "831058846\n"}, {"type": "stdin_stdout", "input": "31\n0 1 0 2 4 0 4 0 6 4 3 9 7 3 7 3 15 6 12 10 12 16 5 3 20 1 25 20 23 24 23", "output": "227079070\n"}, {"type": "stdin_stdout", "input": "31\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\nSnuke has N sticks. The length o... | [{"type": "stdin_stdout", "input": "15 14\n49 26 27 21 41 12 42 35 7 5 5 36 39 1 45", "output": "390\n"}, {"type": "stdin_stdout", "input": "15 14\n49 26 27 21 33 14 42 35 7 5 5 31 39 1 45", "output": "379\n"}, {"type": "stdin_stdout", "input": "15 14\n42 26 27 21 12 14 42 35 7 5 5 31 39 1 45", "output": "351\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\nSnuke has decided to construct a... | [{"type": "stdin_stdout", "input": "HASFJGHOGAK[ZFEGA", "output": "12\n"}, {"type": "stdin_stdout", "input": "IBAG[IHNGFKKZSFGB", "output": "11\n"}, {"type": "stdin_stdout", "input": "AIEFZGKAFOFGJZSAH", "output": "14\n"}, {"type": "stdin_stdout", "input": "ICAF[IHNGFKZKSFGB", "output": "10\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\nThere is a plane like Figure 1 w... | [{"type": "stdin_stdout", "input": "2\n\n00010010\n00000100\n10001001\n00100010\n01000000\n00001000\n10100010\n01010010\n2\n5\n\n00010010\n00000100\n10001001\n00100010\n01000000\n00001000\n10100000\n01010010\n2\n5", "output": "Data 1:\n00000000\n00000100\n10001001\n00100000\n00000000\n00001000\n10100000\n00000000\nData... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYukiya, the owner of Aizuyama Sk... | [{"type": "stdin_stdout", "input": "5 5\n0 0 0 0 1\n2 1 0 2 0\n1 0 0 1 1\n0 2 1 2 0\n0 1 -1 0 0\n5 5\n0 0 1 0 0\n2 1 0 2 0\n1 0 0 0 1\n0 2 1 2 0\n0 1 0 0 0\n15 15\n0 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\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 1 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBob is playing a popular game ca... | [{"type": "stdin_stdout", "input": "6 6 12\n0 2\n5 2\n1 4\n3 4\n1 5", "output": "5\n"}, {"type": "stdin_stdout", "input": "6 6 12\n0 2\n5 2\n1 4\n3 4\n1 4", "output": "4\n"}, {"type": "stdin_stdout", "input": "6 6 5\n2 1\n5 2\n3 3\n2 4\n1 5", "output": "5\n"}, {"type": "stdin_stdout", "input": "6 6 5\n2 1\n5 2\n1 3\n2 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJOI has a stove in your room. JO... | [{"type": "stdin_stdout", "input": "2 1\n-10\n31\n0", "output": "42\n"}, {"type": "stdin_stdout", "input": "3 1\n-1\n4\n11", "output": "13\n"}, {"type": "stdin_stdout", "input": "3 1\n-1\n0\n23", "output": "25\n"}, {"type": "stdin_stdout", "input": "3 2\n-2\n6\n21", "output": "10\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\nMultiple polygonal lines are giv... | [{"type": "stdin_stdout", "input": "5\n5\n0 0\n2 0\n2 1\n4 1\n4 0\n5\n0 0\n0 2\n-1 2\n-1 4\n0 4\n5\n0 0\n0 1\n-2 1\n-2 2\n0 2\n5\n0 0\n0 -1\n2 -1\n2 0\n4 0\n5\n0 0\n2 0\n2 -1\n4 -1\n4 0\n5\n0 0\n2 0\n2 1\n4 1\n4 0\n4\n4\n-60 -75\n-60 -78\n-42 -78\n-42 -6\n4\n10 3\n10 7\n-4 7\n-4 40\n4\n-74 66\n-74 63\n-92 63\n-92 135\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\n<!--\n\nProblem D\n\n-->\n\nTall... | [{"type": "stdin_stdout", "input": "4 5\n-1 3 1 5\n2 5 5 2\n3 100\n1 10 110\n0 10 100\n5 10000\n4971 7482 1238 8523 1823\n3287 9013 9928 297 1809\n0 0", "output": "5\n100\n14615\n"}, {"type": "stdin_stdout", "input": "4 5\n3 3 1 4\n2 5 5 2\n3 100\n1 10 101\n2 10 100\n5 11000\n4971 13457 1238 8523 1823\n3287 9013 9928 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\nSaving electricity is very impor... | [{"type": "stdin_stdout", "input": "5 5 10\n.###\n....\n.#\n..#.#\n....\n0 12 0 0 0\n0 4 3 2 10\n0 0 0 99 0\n11 13 0 2 0\n0 1 1 2 1\n0 4 0 0 0\n0 13 8 2 4\n0 0 0 16 0\n1 1 0 1 0\n0 2 3 1 99\n0 2 0 0 0\n0 12 2 12 2\n0 0 0 3 0\n4 14 0 16 0\n0 2 14 2 90\n0 1\n3 0\n4 4\n1 4\n1 1\n4 4\n1 1\n4 3\n3 0\n1 4", "output": "882\n"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor given two segments s1 and s2... | [{"type": "stdin_stdout", "input": "3\n-1 -2 2 -1 2 0 2 -1\n0 0 2 0 -1 1 1 -1\n0 0 0 2 4 -1 0 2", "output": "2.000000000 -1.000000000\n0.000000000 0.000000000\n0.000000000 2.000000000\n"}, {"type": "stdin_stdout", "input": "3\n-1 -2 2 -1 2 0 2 -1\n0 0 2 0 0 1 1 -1\n0 -1 1 2 2 0 0 2", "output": "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\nCompare given two sequence $A = ... | [{"type": "stdin_stdout", "input": "4\n0 4 12 1\n5\n1 2 5 4 1", "output": "1\n"}, {"type": "stdin_stdout", "input": "4\n1 4 1 1\n2\n-1 4 5 4 2", "output": "0\n"}, {"type": "stdin_stdout", "input": "4\n1 4 1 1\n2\n-1 4 9 4 2", "output": "0\n"}, {"type": "stdin_stdout", "input": "4\n1 4 1 1\n2\n-2 4 9 4 2", "output": "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\nIvan has n songs on his phone. T... | [{"type": "stdin_stdout", "input": "1 1364355877\n1000000000 1343571090\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1 1000000000\n1000000000 999999999\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1 1992779579\n1000000000 999999999\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1 19927... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are two bus stops denoted ... | [{"type": "stdin_stdout", "input": "2 1000000000\n999999999 1000000000\n1 2\n", "output": "Yes\n1999999999 2000000000\n"}, {"type": "stdin_stdout", "input": "2 1000000000\n1 1000000000\n2 2\n", "output": "Yes\n2000000000 2000000001\n"}, {"type": "stdin_stdout", "input": "2 1000010000\n1 1000000000\n2 2\n", "output": "Y... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an integer array a... | [{"type": "stdin_stdout", "input": "50\n170081 797965 40736 224325 102476 20832 954026 923972 391400 247099 95141 927386 79799 749285 104039 200818 623552 872203 355273 838168 352783 850365 389351 930945 847154 608047 727586 549184 520573 608953 338849 536466 345479 589848 882827 771475 874283 787115 992590 128903 9780... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.