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\nIahub is very proud of his recen...
[{"type": "stdin_stdout", "input": "30\n2 1\n3 2\n4 3\n5 3\n6 5\n7 3\n8 3\n9 2\n10 3\n11 2\n12 11\n13 6\n14 4\n15 5\n16 11\n17 9\n18 14\n19 6\n20 2\n21 19\n22 9\n23 15\n24 20\n25 14\n26 22\n27 1\n28 6\n29 13\n30 27\n0 0 1 1 1 1 0 1 0 0 1 0 0 0 1 0 0 1 0 1 0 0 1 0 0 1 1 1 1 0\n0 1 0 1 1 1 0 0 1 1 0 1 1 1 0 1 1 1 1 0 1 0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJzzhu is the president of countr...
[{"type": "stdin_stdout", "input": "3 3 6\n1 2 499999999\n2 3 500000000\n1 3 948187054\n2 499999999\n2 500000000\n2 499999999\n3 999999999\n3 1000000000\n3 1000000000\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "3 3 6\n1 2 499999999\n2 3 500000000\n1 2 999999999\n2 499999999\n2 500000000\n2 499999999\n3 999...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 way to create task is to lea...
[{"type": "stdin_stdout", "input": "25 3\n1 2 3\n4 5 6\n7 8 9\n10 11 12\n13 14 15\n16 17 18\n19 20 21\n22 23 24\n25 26 27\n28 29 30\n31 32 33\n34 35 36\n37 38 39\n40 41 42\n43 44 45\n46 47 48\n49 50 51\n52 53 54\n55 56 57\n58 59 60\n61 62 63\n64 65 66\n67 68 69\n70 71 72\n73 74 75\n75 74 73\n72 71 70\n69 68 67\n66 65 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\nVasya became interested in bioin...
[{"type": "stdin_stdout", "input": "318\nTATCAATCGGTACGTGCGCATCATTGTCAATCGGGCTTCATGGCTTGCGGGCGCTACCCGAGGGGAAGCTGCGGACAGGTAGGTAAGATACACACGAACCAAACGGAGTTATGTTGGATAAATTGGCTGGAAGGGCGTAGGTATATCGAGTCGCGGACCTGGCATAGACTATCAGGGGCAGCGGTACAAGGCAACCGTGAGCGGGGTCTGCCCACCATTAGACCGATGCGCCGGCTCGTATATGTGATTCTGGTGAAAAGTATCATGCCGGGACGCGTA...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 you know a story about the th...
[{"type": "stdin_stdout", "input": "987 50\n221 959\n221 553\n959 695\n553 959\n819 437\n371 295\n695 553\n959 347\n595 699\n652 628\n553 347\n868 589\n695 221\n282 714\n351 703\n104 665\n755 436\n556 511\n695 347\n221 347\n243 874\n695 847\n863 501\n583 145\n786 221\n38 286\n72 397\n808 658\n724 437\n911 548\n405 759\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nEdo has got a collection of n re...
[{"type": "stdin_stdout", "input": "20 5\n1 12 21 22\n9 10 15 20\n10 12 12 20\n1 1 25 29\n5 10 21 22\n4 9 20 25\n12 10 14 24\n3 3 19 27\n3 4 23 28\n9 1 11 31\n9 14 17 18\n8 12 14 20\n8 11 18 19\n12 3 14 29\n7 8 13 22\n6 4 16 30\n11 3 13 27\n9 16 15 18\n6 13 14 21\n9 12 15 22\n", "output": "4\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\nDuring a New Year special offer ...
[{"type": "stdin_stdout", "input": "58\n145410\n686144\n766870\n859775\n922809\n470967\n034349\n318920\n019664\n667953\n295078\n908733\n691385\n774622\n325695\n443254\n817406\n984471\n512092\n635832\n303546\n189826\n128551\n720334\n569318\n377719\n281502\n956352\n758447\n207280\n583935\n246631\n160045\n452683\n594100\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\nzscoder loves simple strings! A ...
[{"type": "stdin_stdout", "input": "rxxxrrxrxxxxxrrrrrxxxxrrrrxrxxrxxrxrxrrrxrrxrrxrxxxrxrrxrrxrxrxxxxxrxxxxrrrxrxxrxxrxxxrrrrrxrrxrrxrr\n", "output": "rxaxraxrxaxaxrararxaxararaxrxarxarxrxrarxraxraxrxaxrxraxraxrxrxaxaxrxaxararxrxarxarxaxrararxraxraxra\n"}, {"type": "stdin_stdout", "input": "xxxxrrxrxxxxxrrrrrxxxxrrrrx...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 and Chris the Baboo...
[{"type": "stdin_stdout", "input": "84\n2 50 67 79 71 45 43 40 57 20 25 8 60 47 52 10 37 23 1 28 22 26 3 42 11 63 61 68 49 32 55 18 5 24 31 70 66 27 38 41 54 12 65 51 15 34 30 35 77 74 21 62 33 16 81 14 19 48 80 73 69 78 39 6 76 46 75 72 84 29 58 59 13 17 82 9 83 4 36 56 53 7 64 44\n", "output": "428380105\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\nVasiliy has an exam period which...
[{"type": "stdin_stdout", "input": "100 10\n1 1 6 6 6 2 5 7 6 5 3 7 10 10 8 9 7 6 9 2 6 7 8 6 7 5 2 5 10 1 10 1 8 10 2 9 7 1 6 8 3 10 9 4 4 8 8 6 6 1 5 5 6 5 6 6 6 9 4 7 5 4 6 6 1 1 2 1 8 10 6 2 1 7 2 1 8 10 9 2 7 3 1 5 10 2 8 10 10 10 8 9 5 4 6 10 8 9 6 6\n2 4 10 11 5 2 6 7 2 15\n", "output": "74\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\nLittle Nastya has a hobby, she l...
[{"type": "stdin_stdout", "input": "aaaaaaaadbaaabbbbbddaaabdadbbbbbdbbabbbabaabdbbdababbbddddbdaabbddbbbbabbbbbabadaadabaaaadbbabbbaddb\naaaaaaaaaaaaaa\n61 52 5 43 53 81 7 96 6 9 34 78 79 12 8 63 22 76 18 46 41 56 3 20 57 21 75 73 100 94 35 69 32 4 70 95 88 44 68 10 71 98 23 89 36 62 28 51 24 30 74 55 27 80 38 48 93 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\nIn the evening Polycarp decided ...
[{"type": "stdin_stdout", "input": "27 8 1 0 1\nBcd A\nA b\nb BcDc\ndc dbaC\ndbaC dcCB\nB d\nd BbAc\nCBC b\nDBDca d\ncAbb AA\nAA Ba\ncAccb DBDca\ncb DdaB\nAAcBc Ba\nBa dc\ndc DDCd\nbcBDA da\nbDE ADD\nAA b\nb cb\ncb CCBbd\nCCBbd bcDdb\nbcDdb ddc\nddc C\nC Adc\nAdc BbAc\nBbAc DD\n", "output": "111\n"}, {"type": "stdin_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\nAs Will is stuck in the Upside D...
[{"type": "stdin_stdout", "input": ")?(??((???????()?(?????????)??(????????((?)?????)????)??????(?????)?)?????)??????(??()??????)????????)?)()??????????????())????????(???)??)????????????????????(?????)??)???)??(???????????????)???)??)?\n", "output": "8314\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\nThroughout Igor K.'s life he has...
[{"type": "stdin_stdout", "input": "446237720 920085248 296916273 439113596\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "491259590 529594367 305425951 326414536\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "733405771 1387069059 19971607 389270995\n", "output": "1\n"}, {"type": "stdin_stdout", "in...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA lot of frogs want to cross a r...
[{"type": "stdin_stdout", "input": "100 34\n16 0 10 11 12 13 0 5 4 14 6 15 4 9 1 20 19 14 1 7 14 11 10 20 6 9 12 8 3 19 20 4 17 17 8 11 14 18 5 20 17 0 3 18 14 12 11 12 5 5 11 7 9 17 4 8 4 10 0 0 12 9 15 3 15 14 19 12 6 8 17 19 4 18 19 3 8 3 9 1 6 15 4 16 1 18 13 16 3 5 20 11 10 9 9 17 20 15 12\n", "output": "312\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\nNastya received one more array o...
[{"type": "stdin_stdout", "input": "94 58\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 29 58 1 1 1 29 58 58 1 1 29 1 1 1 1 2 1 58 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 29 1 1 1 1 1 58 1 29 1 1 1 1 1 1 1 1 1 1 1 1 58 1 1 1 1 1 2 1 1 1\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "90 45\n15 1 1 1 1 3 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\nSeveral drivers had lined up for...
[{"type": "stdin_stdout", "input": "12\nlzcosnwtjk xcjunvtpwu\ncvjkwwlkyj jyjzvkopkt\nhqxxxvxvsm oaettnnxsn\nyltleijpii taddtwjkhq\nowyayplryk gamjhfquwe\nsfwqtseczr clpbsurgox\nnngbinrstc beuwpgazlm\ndmdbzrvooe sodttxayqp\ntkjafxrpth yugxdvihim\nsfavfdbiec fimvhmtjte\nktpgrbmmqb pqstnzulvo\ntacldiqwmo qywspwioip\niulf...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nEveryone who is involved with Ha...
[{"type": "stdin_stdout", "input": "3\n09:00-09:50\n13:00-17:00\n09:50-10:30", "output": "Who needs a moderator?\n"}, {"type": "stdin_stdout", "input": "3\n09:00-09:50\n13:00-17:00\n09:50-10:30", "output": "Who needs a moderator?\n"}, {"type": "stdin_stdout", "input": "3\n09:00-09:50\n13:10-17:00\n09:50-10:30", "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\nBetty had invited her friends ov...
[{"type": "stdin_stdout", "input": "1000\n422793 206235\n357333 104220\n332537 5\n245560 9\n225105 2\n780480 0\n159417 8\n1266910 507138\n218238 566718\n491224 1\n182141 639551\n401529 9\n117359 590197\n389053 8\n795228 5\n406415 9\n104353 465450\n203260 4\n152821 918970\n250128 493407\n188162 4\n202515 5\n64241 7\n637...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFatal Eagle has decided to do so...
[{"type": "stdin_stdout", "input": "10\n113 6\n169 1\n177 4\n163 1\n143 2\n121 3\n199 5\n156 29\n54 15\n133 1", "output": "624845\n250438925115\n1679833535\n142798995930\n1950689437\n40203969\n2767148467\n1152\n26\n7346629512\n"}, {"type": "stdin_stdout", "input": "10\n113 6\n169 1\n177 4\n163 1\n143 2\n121 5\n199 5\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\nTakahashi has a string S consist...
[{"type": "stdin_stdout", "input": "a\n6\n2 2 a\n2 1 b\n1\n2 2 d\n1\n1", "output": "aabd\n"}, {"type": "stdin_stdout", "input": "a\n6\n2 2 b\n2 1 b\n1\n2 2 d\n1\n1", "output": "babd\n"}, {"type": "stdin_stdout", "input": "a\n6\n2 2 a\n2 1 b\n1\n2 1 c\n1\n1", "output": "caab\n"}, {"type": "stdin_stdout", "input": "a\n6\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a tree with N vert...
[{"type": "stdin_stdout", "input": "5\n1 2\n1 3\n1 4\n1 5\n3141 59 39 53 59", "output": "210\n3141 59 59 53 39\n"}, {"type": "stdin_stdout", "input": "5\n1 2\n1 3\n1 4\n1 5\n3141 44 39 53 59", "output": "195\n3141 59 53 44 39\n"}, {"type": "stdin_stdout", "input": "5\n1 2\n1 3\n1 4\n1 5\n3141 59 26 53 59", "output": "1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a grid with H horizonta...
[{"type": "stdin_stdout", "input": "20 20\n....................\n....................\n....................\n....................\n....................\n....................\n....................\n....................\n....................\n....................\n....................\n....................\n................
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSnuke has an integer sequence A ...
[{"type": "stdin_stdout", "input": "10\n10 102 113 60 6 47 23 25 52 118", "output": "58\n"}, {"type": "stdin_stdout", "input": "10\n10 102 113 60 6 90 16 25 52 118", "output": "61\n"}, {"type": "stdin_stdout", "input": "10\n10 102 113 72 6 90 16 25 52 118", "output": "73\n"}, {"type": "stdin_stdout", "input": "10\n10 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\nOn some day in January 2018, Tak...
[{"type": "stdin_stdout", "input": "2017/01/06", "output": "2018/01/06\n"}, {"type": "stdin_stdout", "input": "2017/01/32", "output": "2018/01/32\n"}, {"type": "stdin_stdout", "input": "2017/01//7", "output": "2018/01//7\n"}, {"type": "stdin_stdout", "input": "2010/01/77", "output": "2018/01/77\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a three-digit posi...
[{"type": "stdin_stdout", "input": "676", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1293", "output": "No\n"}, {"type": "stdin_stdout", "input": "1865", "output": "No\n"}, {"type": "stdin_stdout", "input": "3151", "output": "No\n"}, {"type": "stdin_stdout", "input": "808", "output": "Yes\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\nWe will call a non-negative inte...
[{"type": "stdin_stdout", "input": "3704579452095997258280591217784156184311155893966777597430447796450532", "output": "32\n"}, {"type": "stdin_stdout", "input": "4271374355872521214646189206931447259915557225329718337053006899386612", "output": "33\n"}, {"type": "stdin_stdout", "input": "463636595558318557723662913943...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 contest is `CODEFESTIVAL`, ...
[{"type": "stdin_stdout", "input": "CODDFESTIVAL", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "EDOCLAVFTSEI", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "ECOFLAVDTSEI", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "DOECSDKSIVAF", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "DOEC...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCreate a program that reads the ...
[{"type": "stdin_stdout", "input": "1,B\n2,A\n3,B\n4,AB\n5,B\n5,O\n7,A\n8,O\n9,AB\n10,A\n11,A\n12,B\n13,AB\n14,A", "output": "5\n4\n3\n2\n"}, {"type": "stdin_stdout", "input": "1,B\n2,B\n3,B\n4,AB\n5,B\n6,O\n7,A\n8,O\n9,AB\n10,A\n11,A\n12,B\n13,AB\n14,A", "output": "4\n5\n3\n2\n"}, {"type": "stdin_stdout", "input": "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\nDr. A of the Aizu Institute of B...
[{"type": "stdin_stdout", "input": "rbgrg\nbbbrbgr\nrbg\nrgbbrgrb\nrrgbgrggb\nggrgbrbggr\nrrrrr\nbgbr\n0", "output": "5\n7\n1\n6\nNA\n11\n0\n4\n"}, {"type": "stdin_stdout", "input": "grgbr\nrbbgbbr\nbgr\nbgbrrgbr\nbggrgbgrr\ngggbrggrbr\nrrrrr\nbgbr\n0", "output": "5\n7\n1\n9\nNA\n11\n0\n4\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\nAt the pancake shop you work for...
[{"type": "stdin_stdout", "input": "3\n5 4423 -1", "output": "8846\n"}, {"type": "stdin_stdout", "input": "3\n4 1618 1", "output": "3236\n"}, {"type": "stdin_stdout", "input": "3\n4 2801 1", "output": "5602\n"}, {"type": "stdin_stdout", "input": "3\n5 4573 2", "output": "9146\n"}, {"type": "stdin_stdout", "input": "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\nIllumination\n\nIlluminations ar...
[{"type": "stdin_stdout", "input": "10\n0 4 2 -1 18 -6 -1 -1 4 5", "output": "10\n"}, {"type": "stdin_stdout", "input": "10\n0 4 2 -2 18 -6 -1 -1 4 5", "output": "10\n"}, {"type": "stdin_stdout", "input": "10\n0 4 2 -2 18 -2 -1 -1 4 5", "output": "10\n"}, {"type": "stdin_stdout", "input": "10\n0 4 2 -2 18 -2 -1 -1 5 5"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn the good old days, the Intern...
[{"type": "stdin_stdout", "input": "2 5\npermit 192168?? ?12??34?\ndeny 19216899 012243?5\n19216711 11233340 HiIamACracker\n19216891 01234345 Hello\n19216899 01234345 HiIamAlsoACracker\n19216809 11200340 World\n00000000 99999999 TheEndOfTheWorld\n1 2\npermit 12345678 23456789\n19216891 01234345 Hello\n12345678 23456789...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 year 2xxx, an expedition ...
[{"type": "stdin_stdout", "input": "3\n95 20 180 18\n125 20 185 18\n40 26 195 10\n1\n6 5 5 4\n2\n5 5 5 4\n5 10 5 2\n2\n5 5 11 6\n0 7 5 3\n16\n2338 3465 29034 1351\n1571 14389 25019 842\n1706 8015 21355 1155\n1899 4359 33815 888\n2160 10364 20511 2353\n333 8835 6587 63\n2598 3176 23679 618\n1613 14217 8003 1505\n3140 47...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem J String Puzzle\n\nAmazi...
[{"type": "stdin_stdout", "input": "9 4 1 4\n6 C\n3 I\n13 C\n9 P\n2 1\n4 1\n6 2\n11 -1\n8 4\n8\n1\n3\n0", "output": "PPPP\n"}, {"type": "stdin_stdout", "input": "9 4 1 4\n6 C\n3 I\n13 C\n9 P\n2 1\n4 1\n6 2\n11 -1\n9 4\n8\n1\n3\n0", "output": "PPPP\n"}, {"type": "stdin_stdout", "input": "9 4 1 4\n6 D\n3 I\n13 C\n9 P\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\nInternational Christmas Present ...
[{"type": "stdin_stdout", "input": "3 2 3\n0 1 10\n1 2 15\n0 -1\n1 8\n2 -1\n3 2 4\n0 1 10\n1 2 10\n0 0\n1 19\n2 20\n0 25\n13 10 10\n0 1 39\n2 3 48\n3 5 20\n4 8 25\n3 9 10\n8 9 40\n3 4 5\n5 0 17\n0 7 93\n1 3 13\n0 0\n1 100000000\n2 100\n3 543\n4 500\n5 400\n6 300\n6 200\n8 100\n9 100\n0 0 0", "output": "3\n3\n4\n"}, {"t...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNow I have a card with n numbers...
[{"type": "stdin_stdout", "input": "4\n2\n8\n6\n10", "output": "1177916\n"}, {"type": "stdin_stdout", "input": "4\n4\n8\n6\n10", "output": "1315948\n"}, {"type": "stdin_stdout", "input": "4\n1\n5\n7\n17", "output": "1022430\n"}, {"type": "stdin_stdout", "input": "4\n4\n8\n3\n10", "output": "1108900\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\nProblem Statement\n\nJAG Kingdom...
[{"type": "stdin_stdout", "input": "4 4 1 4\n1 2\n3 1\n4 2\n3 4\n12 8 1 7\n1 2\n1 3\n2 4\n5 4\n1 5\n4 6\n5 7\n7 6\n6 4 5 2\n1 2\n1 3\n4 5\n5 6\n10 21 9 10\n9 1\n9 2\n9 2\n9 4\n10 1\n10 2\n10 3\n10 4\n1 2\n2 5\n2 6\n3 6\n3 10\n4 4\n4 8\n1 8\n5 10\n6 10\n7 10\n10 8\n10 5\n2 15 1 2\n2 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\n1 2\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWrite a program which reads an i...
[{"type": "stdin_stdout", "input": "5", "output": "0 0\n0.411522633745 0.0\n0.617283950617 0.356389055055\n0.82304526749 0.0\n1.23456790123 0.0\n1.44032921811 0.356389055055\n1.23456790123 0.712778110111\n1.64609053498 0.712778110111\n1.85185185185 1.06916716517\n2.05761316872 0.712778110111\n2.46913580247 0.7127781101...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Conway's Game of Life, cells ...
[{"type": "stdin_stdout", "input": "4\n00000101\n000\n010101\n11100", "output": "11011000\nMultiple solutions\nMultiple solutions\n01000\n"}, {"type": "stdin_stdout", "input": "4\n00000101\n000\n011011\n10010", "output": "11011000\nMultiple solutions\nMultiple solutions\n01100\n"}, {"type": "stdin_stdout", "input": "4\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAstronaut Natasha arrived on Mar...
[{"type": "stdin_stdout", "input": "2 420\n412 363\n", "output": "420\n0 1 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 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\nPetya loves lucky numbers. We al...
[{"type": "stdin_stdout", "input": "10\n4 7 480392999\n3 4 32525297\n9 7 417904789\n6 2 836294777\n5 3 616099185\n1 7 1310915575\n8 10 838073755\n5 10 547050646\n2 1 12607780\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "10\n4 7 480392999\n3 4 32525297\n9 7 417904789\n6 2 836294777\n5 3 616099185\n1 7 131091...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 circle line of the Roflanpol...
[{"type": "stdin_stdout", "input": "100 26 63 60 20\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "100 26 77 60 20\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "100 45 77 77 20\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "100 45 90 77 20\n", "output": "YES\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya has an array a_1, a_2, ......
[{"type": "stdin_stdout", "input": "1001 2\n1 999 1000\n0 230 581\n", "output": "YES\n1001 1000 999 998 997 996 995 994 993 992 991 990 989 988 987 986 985 984 983 982 981 980 979 978 977 976 975 974 973 972 971 970 969 968 967 966 965 964 963 962 961 960 959 958 957 956 955 954 953 952 951 950 949 948 947 946 945 944 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 numbers a_1, a_2...
[{"type": "stdin_stdout", "input": "22\n99039804 -580368436 -694542422 231508622 -490965348 958087037 -570157955 560902976 -840005981 -1381720926 -708462966 639575552 119982241 -631099451 -154223559 102960509 -225552439 507250810 -712228569 989896753 1574991855 1\n", "output": "12773524192\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 only difference between easy...
[{"type": "stdin_stdout", "input": "20\n10\n3 8 1 4 9 6 10 2 7 5\n10\n10 4 8 6 5 3 1 2 9 7\n1\n1\n2\n2 1\n10\n2 5 3 6 9 7 4 10 8 1\n10\n1 7 4 6 9 10 8 2 3 5\n8\n3 8 1 7 6 4 2 5\n8\n7 4 5 2 8 1 6 3\n5\n1 2 4 3 5\n6\n4 2 5 6 3 1\n5\n5 3 2 4 1\n5\n4 3 5 1 2\n7\n6 5 1 7 4 2 3\n6\n6 2 4 1 5 3\n3\n3 1 2\n4\n1 3 4 2\n3\n3 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 in the IT lesson Anna an...
[{"type": "stdin_stdout", "input": "kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWord s of length n is called k-c...
[{"type": "stdin_stdout", "input": "4\n6 2\nabaaba\n6 3\nabaaba\n36 9\nhippopotomonstrosesquippedaliophobia\n21 7\nwudixiaoxingxingheclp\n", "output": "2\n0\n23\n16\n"}, {"type": "stdin_stdout", "input": "4\n6 2\nabaaba\n6 3\nabaaba\n36 9\nhippopotononstrosesquippedaliophobia\n21 7\nwudixiaoxingxingheclp\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\nFor some binary string s (i.e. e...
[{"type": "stdin_stdout", "input": "7\n2 6 0\n1 1 1\n3 17 2\n0 1 0\n3 1 1\n0 0 3\n3 1 1\n", "output": "000101010\n0011\n00001110101010101010101\n01\n000011\n1111\n000011\n"}, {"type": "stdin_stdout", "input": "7\n1 3 5\n1 1 1\n3 15 3\n0 1 0\n3 1 1\n0 0 3\n2 1 1\n", "output": "0011111101\n0011\n0000111101010101010101\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\nDanny, the local Math Maniac, is...
[{"type": "stdin_stdout", "input": "41\n67695023 47580738 52676259 26530025 83455112 2392302 23011073 86422683 148437329 42852564 97383338 95729385 6219705 42027049 79082264 1205076 1191075 18025596 75651485 93690196 63851880 23817841 79285846 9296266 60979868 62770176 40911517 96687661 35967137 55930828 78662969 51939...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nn fishermen have just returned f...
[{"type": "stdin_stdout", "input": "10\n319645572 758298525 812547177 459359946 355467212 304450522 807957797 916787906 239781206 242840396\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "10\n319645572 758298525 812547177 513929825 355467212 304450522 807957797 916787906 239781206 242840396\n", "output": "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\nPolycarp was given an array of a...
[{"type": "stdin_stdout", "input": "50\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIvan wants to have a good dinner...
[{"type": "stdin_stdout", "input": "5 5 5 5\n836 776 809 618 397\n121 629 373 169 333\n589 439 410 388 446\n936 472 433 647 791\n25\n1 2\n4 5\n5 4\n4 1\n3 5\n5 2\n2 4\n3 4\n3 3\n3 2\n4 4\n4 3\n1 1\n1 4\n5 1\n2 3\n1 5\n5 5\n2 5\n3 1\n2 1\n2 2\n1 3\n5 3\n4 2\n25\n1 1\n5 4\n4 1\n1 2\n1 4\n2 3\n3 3\n4 3\n2 2\n5 3\n2 1\n1 3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given three integers a, ...
[{"type": "stdin_stdout", "input": "9\n1 1 1\n4 4 4\n7 7 3\n4 4 4\n5 7 5\n6 6 6\n7 10 7\n8 8 5\n9 9 1\n", "output": "1 2\n1000 2000\n1000000 1000100\n1000 2000\n10000 1010000\n100000 200000\n1000000 1001000000\n10000000 10010000\n100000000 100000001\n"}, {"type": "stdin_stdout", "input": "9\n1 1 1\n4 4 2\n7 7 3\n4 4 4\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp has x of red and y of b...
[{"type": "stdin_stdout", "input": "9\n10 12 1 5\n1 2 2 2\n52 109 13 53\n1000000000 1000000000 1 1\n1000100000 1 1 1000000000\n1 1000000000 1000000001 2\n1 2 1 1\n14 11 2 2\n4 1 2 5\n", "output": "3\n0\n2\n1000000000\n1\n0\n1\n5\n0\n"}, {"type": "stdin_stdout", "input": "9\n10 12 1 16\n1 2 2 3\n52 474 13 53\n1000000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 rectangles on ...
[{"type": "stdin_stdout", "input": "314304 429528 163\n", "output": "119035307824.125411987304688\n"}, {"type": "stdin_stdout", "input": "938133 287232 156\n", "output": "182978083107.739746093750000\n"}, {"type": "stdin_stdout", "input": "646084 979010 45\n", "output": "491534756284.375061035156250\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\nCalendars in widespread use toda...
[{"type": "stdin_stdout", "input": "1900:01:01\n2038:12:31\n", "output": "50768\n"}, {"type": "stdin_stdout", "input": "1986:08:24\n1926:04:13\n", "output": "22048\n"}, {"type": "stdin_stdout", "input": "1910:01:11\n1987:02:08\n", "output": "28152\n"}, {"type": "stdin_stdout", "input": "2015:10:17\n1966:07:12\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\nYou are an adventurer currently ...
[{"type": "stdin_stdout", "input": "17\n.EEEEE...EEEE..EE\nEEE..E...EEEEE..E\n.E..E..EEE.EE...E\n.EEE.EE..EE...E..\nE..EEEEEE.EE.....\nE.EE...EEEEEEE.E.\nEEEE....EE..E.EEE\n...EEEEE.E..EE...\nEEE.E..EEEE.EEE..\n..E.E....EEE.....\nEE..E..E.E..EEEEE\nEEE..E.EEEEE.E...\n..EEEEE.E..EE.EE.\nEE.E...E..E..E.EE\n..E.EEE.EE..EE...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJeff's got n cards, each card co...
[{"type": "stdin_stdout", "input": "214\n5 0 5 0 5 0 0 0 5 5 0 5 0 5 5 0 5 0 0 0 0 5 5 0 0 5 5 0 0 0 0 5 5 5 5 0 5 0 0 0 0 0 0 5 0 0 0 5 0 0 5 0 0 5 5 0 0 5 5 0 0 0 0 0 5 0 5 0 5 5 0 5 0 0 5 5 5 0 5 0 5 0 5 5 0 5 0 0 0 5 5 0 5 0 5 5 5 5 5 0 0 0 0 0 0 5 0 5 5 0 5 0 5 0 5 5 0 0 0 0 5 0 5 0 5 0 0 5 0 0 5 5 5 5 5 0 0 5 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\nImagine that there is a group of...
[{"type": "stdin_stdout", "input": "100 48\n1 56 6\n2 42 3\n3 52 1\n9 26 8\n10 96 8\n11 39 2\n12 51 6\n12 68 7\n13 40 5\n14 18 10\n14 70 6\n15 37 8\n15 38 8\n15 82 6\n15 85 5\n16 48 3\n16 50 9\n16 71 9\n17 18 3\n17 100 10\n20 73 3\n22 32 9\n22 89 9\n23 53 3\n24 53 1\n27 78 10\n30 50 5\n33 94 8\n34 87 9\n35 73 3\n36 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\nLittle X has n distinct integers...
[{"type": "stdin_stdout", "input": "70 416035 416023\n70034 70322 345689 345965 345701 70046 345737 345713 70166 345821 70010 345749 345677 345725 69962 345869 70178 70310 345785 69998 70070 69974 70058 346001 70106 345953 70226 70154 345929 69950 70298 346049 70346 345989 70286 69986 345893 70082 70238 345797 70250 34...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 and Marina love offering pu...
[{"type": "stdin_stdout", "input": "14 30\n12 10\n1 7\n12 13\n7 3\n14 10\n3 12\n11 1\n2 12\n2 5\n14 3\n14 1\n14 4\n6 7\n12 6\n9 5\n7 10\n8 5\n6 14\n13 7\n4 12\n9 10\n1 9\n14 5\n1 8\n2 13\n5 11\n8 6\n4 9\n9 13\n2 4\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "14 30\n12 10\n1 7\n12 13\n8 3\n14 10\n3 12\n11 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\nAccording to Berland laws it is ...
[{"type": "stdin_stdout", "input": "4\n1475\nKXJURNYJHVLVKULJBPRBCZSOTKNTOGKGFKIQDQEMEAFTPNXQTIQWROI\nKTR\nRHVRWGODYWWTYZFLFYKCVUFFRTQDINKNWPKFHZBFWBHWINWJW\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "4\n1475\nKXJURNYJHVLVKULJBPRBCZSOTKNTOGKGFKIQDQEMEAFTPNXQTIQWROI\nRTK\nRHVRWGODYWWTYZFLFYKCVUFFRTQDINKNWPK...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 string s consists ...
[{"type": "stdin_stdout", "input": "))>)}}>>]}]{{}{({)>{(((}>>))<[})}{}(){}}}]>><){<{<><{[[]{<(<{{])(({[<}({)[}>>([>>(>]>[{]{}<<)()]})])}([>]{}(>{(<([([<(\n", "output": "Impossible\n"}, {"type": "stdin_stdout", "input": "))>)}}>>]}]{{}{({)>{(((}>>))<[})}{}(){}}}]>><){;{<><{[[]{<(<{{])(({[<}({)[}>>([>>(>]>[{]{}<<)()]})]...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou're given a list of n strings...
[{"type": "stdin_stdout", "input": "13\nclgknjjojyuvdtv\nclgknjjojyuvdtvzxz\nclgknjjojyuvdtvzxzxradqhm\ngvzpnckalbaubfviyhijosiixvxaydxagvymq\nclgknjjojyuvdtvjgcwarwvgilcctdiytmvmvfxxkezymt\nbvwzpuut\nclgknjjojyuvdtvjgcwarwvgilcctdiytmvmvfxxkezymth\nclgknjjojyuvdtvjgcwarwvgilcctdiytmvmvfxxkezymtlkdl\nrbwvaayhhunlvmwexv...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn this problem we assume the Ea...
[{"type": "stdin_stdout", "input": "10\n20000 South\n20000 North\n20000 South\n20000 North\n20000 South\n20000 North\n20000 South\n20000 North\n20000 South\n20000 North\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "9\n1355 North\n15309 West\n17834 North\n13612 East\n17477 North\n4546 North\n18260 East\n154...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAuthor note: I think some of you...
[{"type": "stdin_stdout", "input": "10\n7776 32915 1878 71664 7542 72359 65387 75222 95899 40333\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "10\n7776 32915 1312 71664 7542 72359 65387 75222 95899 40333\n", "output": "9\n"}, {"type": "stdin_stdout", "input": "10\n7776 32915 1030 71664 7542 72359 65387 75222...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 a1, a2,...
[{"type": "stdin_stdout", "input": "100\n39 77 67 25 81 26 50 11 73 95 86 16 90 33 14 79 12 100 68 64 60 27 41 15 34 24 3 61 83 47 57 65 99 43 40 21 94 72 82 85 23 71 76 32 10 17 30 18 44 59 35 89 6 63 7 69 62 70 4 29 92 87 31 48 36 28 45 97 93 98 56 38 58 80 8 1 74 91 53 55 54 51 96 5 42 52 9 22 78 88 75 13 66 2 37 20...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA New Year party is not a New Ye...
[{"type": "stdin_stdout", "input": "30 1000000000\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 10000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYour friend Mishka and you atten...
[{"type": "stdin_stdout", "input": "10 5\n1 1 1 1 1 1 1 1 10000 1\n1 1 1 1 1 1 1 1 0 1\n", "output": "10009\n"}, {"type": "stdin_stdout", "input": "10 5\n1 1 1 1 1 1 1 1 10000 1\n1 1 1 0 1 1 1 1 0 1\n", "output": "10008\n"}, {"type": "stdin_stdout", "input": "10 5\n1 2 1 1 1 1 1 1 10000 1\n1 1 1 0 1 1 1 1 0 0\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\nWhen the curtains are opened, a ...
[{"type": "stdin_stdout", "input": "BBB.C.CBBAACB.BCBCCAAAABAB.BCB..CCCACBB.A.CACCAABABAAB.ACBBCCA...CC...AAB..CCAABBA..CAAC..C.AAB.CACA\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": ".CBCC..AB.CCBC.CAABAA.BCCBC.CACAACA..BBCCBB.CC.A.B.CC.C.CC.AC.CBC..CB.B..BCCBCCBAB..CA.BBC.ABBCCAAC.\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\nHackerMan loves playing Age of E...
[{"type": "stdin_stdout", "input": "2\n35 30\n2 10 9 5 3 6 9 5 5 3 7 10 12 3 10 9 0 2 6 2 6 10 10 8 10 12 6 2 1 7\n5 7 3 4 2 3 6 8 4 10 10 9 7 2 5 1 3 8 5 4 7 2 5 10 9 5 8 7 6 5\n10 1 10 6 2 2 3 9 10 6 4 9 1 10 2 2 5 10 3 7 2 6 9 2 8 10 4 4 1 17\n8 2 3 8 9 8 5 1 10 7 1 4 9 2 5 6 8 10 10 8 4 3 6 5 7 8 6 10 9 5\n1 5 9 8 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Monk is trying to explain to...
[{"type": "stdin_stdout", "input": "3\n3 2 1\n1 3 2\n\nSAMPLE", "output": "5\n"}, {"type": "stdin_stdout", "input": "3\n3 2 1\n1 3 2\n\nSAMELP", "output": "5\n"}, {"type": "stdin_stdout", "input": "3\n3 2 1\n1 3 2\n\nRAMELP", "output": "5\n"}, {"type": "stdin_stdout", "input": "3\n3 2 1\n1 3 2\n\nTAMELP", "output": "5\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIts Diwali time and there are LE...
[{"type": "stdin_stdout", "input": "1000000 13032 14948 7562323", "output": "254148 252216 0 241068 0 0 0 252568\n"}, {"type": "stdin_stdout", "input": "1000000 10461 14948 7562323", "output": "251165 246577 0 246707 0 0 0 255551\n"}, {"type": "stdin_stdout", "input": "1000001 13032 16049 7562323", "output": "244591 24...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProf. M went to unknown world wh...
[{"type": "stdin_stdout", "input": "100\nioyqjzesuuaxinlclckfsvcwumqoarylhwdqvilrelqnadrmfdtzaywwkokniiapgdgdntwsgmhgsauzfobfmzbynnnvwnnervkgogywvhcnhzoopptdqwbekrbieomxjwezfevamypvzdkovfrlcupoltwqhkptjtsoaoqmofjnivdfburfoitcbpulbjekfyafoqrevctgywlbscgjlblosfztofgtegauztzuwscwrqxjsfsfidwakvvbdbwjkxdjqefmxikoyjzsosayxwy...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSiddharth is a math geek. His on...
[{"type": "stdin_stdout", "input": "3\n2\n10\n0010\n\nSAMPLE", "output": "2\n3\n3\n"}, {"type": "stdin_stdout", "input": "3\n2\n10\n0000\n\nSAMPLE", "output": "2\n3\n0\n"}, {"type": "stdin_stdout", "input": "3\n1\n10\n0110\n\nSAMPLE", "output": "1\n3\n3\n"}, {"type": "stdin_stdout", "input": "3\n2\n10\n0011\n\nSAMPLE",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have N colored balls arranged...
[{"type": "stdin_stdout", "input": "10 10\n6 5 -1 5 2 0 7 13 14 2\n5 6\n2 4\n6 7\n2 2\n7 8\n7 9\n2 8\n6 9\n8 10\n6 8", "output": "2\n2\n2\n1\n2\n3\n6\n4\n3\n3\n"}, {"type": "stdin_stdout", "input": "10 10\n6 5 -1 5 2 0 7 13 14 2\n5 6\n2 4\n6 7\n2 2\n7 8\n7 9\n2 8\n6 5\n8 10\n6 8", "output": "2\n2\n2\n1\n2\n3\n6\n0\n3\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\nA string S of an odd length is s...
[{"type": "stdin_stdout", "input": "akasaka", "output": "Yes"}, {"type": "stdin_stdout", "input": "akas`ka", "output": "No\n"}, {"type": "stdin_stdout", "input": "redocta", "output": "No\n"}, {"type": "stdin_stdout", "input": "akas`ja", "output": "No\n"}, {"type": "stdin_stdout", "input": "rfdocta", "output": "No\n"}, ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi is at an all-you-can-e...
[{"type": "stdin_stdout", "input": "10 100\n15 23\n20 18\n13 17\n47 12\n18 29\n19 27\n23 21\n18 20\n27 15\n22 25", "output": "145\n"}, {"type": "stdin_stdout", "input": "10 100\n15 23\n20 18\n13 17\n47 12\n18 29\n19 20\n23 21\n18 20\n27 15\n22 25", "output": "138\n"}, {"type": "stdin_stdout", "input": "10 100\n15 23\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\nThere are N dots in a two-dimens...
[{"type": "stdin_stdout", "input": "9\n1 1\n2 1\n11 1\n4 1\n7 1\n1 2\n2 3\n1 4\n1 5", "output": "16\n"}, {"type": "stdin_stdout", "input": "9\n1 1\n2 1\n11 1\n4 1\n7 1\n1 2\n2 3\n1 8\n1 5", "output": "16\n"}, {"type": "stdin_stdout", "input": "9\n1 1\n2 2\n11 1\n4 1\n7 1\n1 2\n2 3\n1 8\n1 5", "output": "16\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\nWe conducted a survey on newspap...
[{"type": "stdin_stdout", "input": "101 110 100", "output": "100 109\n"}, {"type": "stdin_stdout", "input": "100 110 100", "output": "100 110\n"}, {"type": "stdin_stdout", "input": "000 110 100", "output": "100 210\n"}, {"type": "stdin_stdout", "input": "000 100 100", "output": "100 200\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\nIn Takahashi Kingdom, there is a...
[{"type": "stdin_stdout", "input": "10 10 10\n1 6\n2 9\n4 5\n4 7\n4 7\n5 8\n6 6\n6 7\n7 9\n10 10\n1 8\n1 9\n1 10\n2 8\n2 10\n3 10\n3 8\n3 9\n3 10\n1 10", "output": "7\n9\n10\n6\n9\n8\n6\n7\n8\n10\n"}, {"type": "stdin_stdout", "input": "10 10 10\n1 6\n2 9\n4 5\n4 7\n4 7\n5 8\n6 6\n6 7\n7 9\n10 10\n1 8\n1 9\n1 10\n2 8\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\nWe have an N \\times N square gr...
[{"type": "stdin_stdout", "input": "10\n202", "output": "-102\n"}, {"type": "stdin_stdout", "input": "19\n110", "output": "251\n"}, {"type": "stdin_stdout", "input": "10\n-13", "output": "113\n"}, {"type": "stdin_stdout", "input": "10\n-16", "output": "116\n"}, {"type": "stdin_stdout", "input": "10\n145", "output": "-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\nThere are four points: $A(x_1, y...
[{"type": "stdin_stdout", "input": "2\n2.926287414400688 0.6174638399148507 2.2117258079089996 2.51039017960215 2.2432914589132955 0.3458310450303873 3.950438914943076 1.6292131026754104\n5.957858300757107 3.314602021400227 10.473008708157936 7.081122407685485 15.460510197185764 6.858362845609268 7.533578119892425 12.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\nI decided to do bowling as a rec...
[{"type": "stdin_stdout", "input": "3\n1010 6 3 10 10 1 0 7 9 1 10 6 2 4 3 9 1 9 0\n1200 5 3 9 1 12 1 0 0 12 1 10 10 4 3 9 1 8 2 9\n1101 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3\n4\n3321 8 2 10 9 1 7 0 10 10 10 0 8 10 10 10 10\n3332 5 0 10 13 1 4 1 9 0 10 10 7 1 5 2 8 1\n3335 10 10 10 10 10 10 10 10 10 10 10 10\n3340 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\nThere is the word heuristics. It...
[{"type": "stdin_stdout", "input": "4 1 3 4\nyskwcnt 16\nakzakr 7\ntsnukk 12\nfnmyi 13\nakzakr\n4 1 3 8\nakzakr 7\ntsnukk 4\nfnmyi 13\nyskwcnt 16\nakzakr\n4 2 2 1\nakzakr 4\ntsnukk 6\nyskwcnt 12\nfnmyi 12\nakzakr\nfnmyi\n5 2 3 28\nknmmdk 6\nskrkyk 14\ntmemm 14\nakmhmr 15\nmksyk 25\nknmmdk\nskrkyk\n5 2 3 11\ntmemm 12\ns...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\nGaccho owns a field s...
[{"type": "stdin_stdout", "input": "8 6 3\n7\n0 1 1\n5 1 -1\n4 0 2\n3 2 0\n3 0 1\n3 0 1\n5 1 1\n1 0 1 1 0 0 1 0\n0 0 1 1 0 1 0 1\n0 1 0 0 1 1 0 1", "output": "4\n"}, {"type": "stdin_stdout", "input": "8 3 3\n7\n0 1 1\n5 1 -1\n4 0 2\n3 2 0\n3 1 1\n3 0 1\n5 1 1\n1 0 1 1 0 0 1 1\n0 0 1 1 0 1 0 1\n0 1 0 0 0 1 0 1", "output...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem Statement\n\n\"Everlasti...
[{"type": "stdin_stdout", "input": "12 2\n2 2\n4 12\n6 0\n100000 0\n0 0", "output": "2049\n64\n607723520\n"}, {"type": "stdin_stdout", "input": "12 2\n1 2\n4 3\n6 0\n100000 0\n0 0", "output": "1025\n64\n607723520\n"}, {"type": "stdin_stdout", "input": "12 2\n2 2\n4 3\n6 0\n100000 0\n0 0", "output": "2049\n64\n607723520...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n2 2 2 1\n0 0...
[{"type": "stdin_stdout", "input": "26 2 22 0\n-1 2 0", "output": "1336\n"}, {"type": "stdin_stdout", "input": "36 2 22 0\n-1 2 0", "output": "1816\n"}, {"type": "stdin_stdout", "input": "36 2 43 0\n-1 2 0", "output": "3412\n"}, {"type": "stdin_stdout", "input": "3 8 88 0\n-2 8 -1", "output": "1984\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\nWrite a program which reads thre...
[{"type": "stdin_stdout", "input": "-1 -1 -1", "output": "No\n"}, {"type": "stdin_stdout", "input": "-1 -1 -2", "output": "No\n"}, {"type": "stdin_stdout", "input": "18 10 10", "output": "No\n"}, {"type": "stdin_stdout", "input": "-1 0 2", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-1 -1 2", "output": "No\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a bracket sequence...
[{"type": "stdin_stdout", "input": "100\n((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "100\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\nJATC and his friend Giraffe are ...
[{"type": "stdin_stdout", "input": "100\n901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\n103\n130\n138\n126\n157\n164\n185\n120\n109\n137\n123\n147\n124\n178\n183\n155\n146\n169\n156\n153\n196\n152\n145\n110\n184\n168\n170\n177\n190\n128\n108\n182\n102\n101\n159\n150\n117\n106\n187\n194\n167\n151\n171\n195\n127\n115\n192\n114\n125\n165\n118\n113\n189\n199\n180\n139\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 still have partial informati...
[{"type": "stdin_stdout", "input": "11\n1 100000000\n200000000 100000000\n200000000 300000000\n400000000 300000000\n400000000 500000000\n600000000 639960479\n618182416 700000000\n800000000 700000000\n800000000 900000000\n1000000000 900000000\n1000000000 1000000000\n", "output": "100000011\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\nDuring a break in the buffet of ...
[{"type": "stdin_stdout", "input": "30\n61 23\n30 93\n4 18\n34 97\n63 77\n45 95\n51 13\n41 8\n86 19\n38 24\n2 67\n20 61\n95 48\n95 1\n28 26\n92 110\n6 78\n64 28\n1 82\n61 37\n77 35\n152 21\n10 24\n52 12\n80 63\n64 61\n16 87\n118 19\n21 34\n54 49\n", "output": "29529\n"}, {"type": "stdin_stdout", "input": "30\n61 23\n30...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 palindrome is a string t which...
[{"type": "stdin_stdout", "input": "11\n4\n0\n1\n1\n0\n2\n0001000\n0000000000000\n2\n1\n0\n1\n1\n1\n0\n2\n11\n00\n2\n111\n000\n2\n111\n00\n2\n00\n111\n2\n11111\n00\n2\n00000100000\n000\n", "output": "4\n2\n2\n1\n1\n2\n2\n2\n2\n2\n2\n"}, {"type": "stdin_stdout", "input": "11\n4\n0\n1\n1\n0\n2\n0001000\n0000000000000\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\nPolycarp has three sisters: Alic...
[{"type": "stdin_stdout", "input": "5\n5 3 2 8\n100 101 102 105\n3 2 1 100000000\n10 20 15 14\n101 101 101 3\n", "output": "Yes\nYes\nNo\nNo\nYes\n"}, {"type": "stdin_stdout", "input": "5\n5 3 2 8\n100 101 102 105\n3 2 1 100000000\n23 20 15 14\n011 101 101 3\n", "output": "YES\nYES\nNO\nYES\nNO\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nScreen resolution of Polycarp's ...
[{"type": "stdin_stdout", "input": "6\n8 8 0 0\n1 11 0 3\n17 10 10 4\n2 4 0 0\n4 10 3 9\n15 18 3 12\n", "output": "56\n7\n100\n6\n36\n198\n"}, {"type": "stdin_stdout", "input": "6\n8 8 0 0\n1 11 0 3\n17 10 10 4\n2 4 0 0\n4 10 3 6\n15 18 3 12\n", "output": "56\n7\n100\n6\n30\n198\n"}, {"type": "stdin_stdout", "input": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe game of Berland poker is pla...
[{"type": "stdin_stdout", "input": "4\n8 3 2\n4 2 4\n12 6 3\n42 0 7\n", "output": "3\n0\n3\n0\n"}, {"type": "stdin_stdout", "input": "4\n12 3 2\n4 2 4\n9 6 3\n42 0 7\n", "output": "3\n0\n1\n0\n"}, {"type": "stdin_stdout", "input": "4\n8 1 2\n4 2 4\n12 6 3\n66 0 7\n", "output": "1\n0\n3\n0\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\nVladimir would like to prepare a...
[{"type": "stdin_stdout", "input": "1\n7 7\n873108721 195635452\n42649954 997221147\n873108721 1003477544\n1087176458 873108721\n1130734166 858693746\n1309378041 372607189\n1000000000 427003887\n", "output": "7410830018\n"}, {"type": "stdin_stdout", "input": "1\n7 7\n873108721 195635452\n66631086 997221147\n1700956320 ...
code_stdio