messages
listlengths
1
1
ground_truth
stringlengths
88
726k
dataset
stringclasses
2 values
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string s of leng...
[{"type": "stdin_stdout", "input": "76 26\nABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYABCDEFGHIJKLMNOPQRSTUVWXY\n", "output": "26\n"}, {"type": "stdin_stdout", "input": "22 1\nAAAAAAAAAAAAAAAAAAAAAA\n", "output": "22\n"}, {"type": "stdin_stdout", "input": "15 26\nWEYYDIADTLCOUEG\n", "output": "0\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\nSergey Semyonovich is a mayor of...
[{"type": "stdin_stdout", "input": "10\n2 3\n3 9\n6 3\n9 8\n9 10\n4 10\n3 1\n2 5\n7 2\n", "output": "70\n"}, {"type": "stdin_stdout", "input": "10\n2 3\n2 9\n6 3\n9 8\n9 10\n4 10\n3 1\n2 5\n7 2\n", "output": "70\n"}, {"type": "stdin_stdout", "input": "10\n2 3\n3 9\n6 4\n10 8\n9 10\n4 2\n3 1\n3 5\n7 1\n", "output": "75\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 multi-subject competition is c...
[{"type": "stdin_stdout", "input": "19 2\n1 2\n1 -3\n1 -1\n1 -2\n2 0\n1 -2\n1 -3\n2 -2\n2 -4\n2 -3\n2 0\n1 2\n1 -1\n1 -2\n1 -3\n1 -4\n2 2\n1 1\n1 -4\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "19 2\n1 2\n1 -3\n1 -1\n1 -2\n2 0\n1 -2\n1 -3\n2 -2\n2 -4\n2 -3\n2 0\n1 2\n1 -1\n1 -2\n1 -3\n1 -4\n2 4\n1 1\n1 -4\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 has recently got himsel...
[{"type": "stdin_stdout", "input": "69\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle Petya loves inequations. ...
[{"type": "stdin_stdout", "input": "45678 1409926355077 1564465\n", "output": "1518788\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\nLong ago, when Petya was a schoo...
[{"type": "stdin_stdout", "input": "bgphoaomnjcjhgkgbflfclbjmkbfonpbmkdomjmkahaoclcbijdjlllnpfkbilgiiidbabgojbbfmliemhicaanadbaahagmfdldbbklelkihlcbkhchlikhefeeafbhkabfdlhnnjnlimbhneafcfeapcbeifgcnaijdnkjpikedmdbhahhgcijddfmamdiaapaeimdhfblpkedamifbbdndmmljmdcffcpmanndeeclnpnkdoieiahchdnkdmfnbocnimclgckdcbp\npcbeifgcna...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 started to attend programm...
[{"type": "stdin_stdout", "input": "FSNRBXLFQHZXGVMKLQDVHWLDSLKGKFMDRQWMWSSKPKKQBNDZRSCBLRSKCKKFFKRDMZFZGCNSMXNPMZVDLKXGNXGZQCLRTTDXLMXQ\n", "output": ".f.s.n.r.b.x.l.f.q.h.z.x.g.v.m.k.l.q.d.v.h.w.l.d.s.l.k.g.k.f.m.d.r.q.w.m.w.s.s.k.p.k.k.q.b.n.d.z.r.s.c.b.l.r.s.k.c.k.k.f.f.k.r.d.m.z.f.z.g.c.n.s.m.x.n.p.m.z.v.d.l.k.x.g...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 program fails again. This t...
[{"type": "stdin_stdout", "input": "100 100\n82 51 14 14 37 17 78 92 64 15 8 86 89 8 87 77 30 15 15 12 100 25 161 47 21 78 20 63 13 49 41 36 41 79 16 87 87 69 3 76 80 60 100 49 70 59 72 8 38 71 45 148 71 14 76 54 81 4 59 46 39 29 92 3 49 22 53 99 118 52 74 31 92 43 70 23 44 9 82 47 7 40 12 9 3 55 37 85 46 22 84 52 98 4...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n[INSPION FullBand Master - INSPI...
[{"type": "stdin_stdout", "input": "50\n21 10\n30 22\n3 37\n37 32\n4 27\n18 10\n2 30\n29 19\n6 37\n12 39\n47 25\n41 49\n45 9\n25 48\n16 14\n10 7\n33 28\n3 31\n34 16\n35 37\n27 40\n45 16\n29 44\n16 15\n26 3\n1 12\n2 13\n15 21\n43 14\n9 33\n44 15\n46 1\n38 5\n15 5\n1 32\n42 35\n20 27\n23 12\n1 16\n15 17\n36 50\n13 8\n49 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 task is to calculate the nu...
[{"type": "stdin_stdout", "input": "100000 200000\n", "output": "707899035\n"}, {"type": "stdin_stdout", "input": "150000 200000\n", "output": "270223789\n"}, {"type": "stdin_stdout", "input": "200000 200000\n", "output": "668956439\n"}, {"type": "stdin_stdout", "input": "113870 200000\n", "output": "845412257\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\nThere are two sisters Alice and ...
[{"type": "stdin_stdout", "input": "98\n710\n896\n635\n909\n528\n799\n184\n970\n731\n285\n481\n62\n829\n815\n204\n927\n48\n958\n858\n549\n722\n900\n290\n96\n414\n323\n488\n140\n494\n286\n783\n551\n896\n580\n722\n766\n841\n914\n200\n170\n384\n664\n14\n203\n582\n203\n678\n502\n677\n318\n189\n144\n97\n330\n169\n20\n492\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\nLike any unknown mathematician, ...
[{"type": "stdin_stdout", "input": "155884 306288 442497 458131\n", "output": "320309008056750\n"}, {"type": "stdin_stdout", "input": "145490 215252 310765 413147\n", "output": "658223816234250\n"}, {"type": "stdin_stdout", "input": "121979 139527 310648 398855\n", "output": "134130149955704\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\nPolycarp plays a computer game (...
[{"type": "stdin_stdout", "input": "6\n1 5\n0 10\n1 -5\n1 14\n1 11\n0 -10\n", "output": "5\n25\n10\n34\n59\n39\n"}, {"type": "stdin_stdout", "input": "6\n1 5\n0 10\n1 -5\n0 14\n1 11\n0 -10\n", "output": "5\n25\n10\n24\n49\n39\n"}, {"type": "stdin_stdout", "input": "6\n1 5\n0 10\n1 -5\n1 14\n1 16\n0 -10\n", "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\nThere is a new attraction in Sin...
[{"type": "stdin_stdout", "input": "5\n1 4\n3 12\n2 15\n6 6\n10 5\n", "output": "YES\nYES\nNO\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "5\n1 4\n3 6\n1 8\n10 3\n5 5\n", "output": "YES\nYES\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "5\n1 2\n3 12\n2 6\n3 4\n3 5\n", "output": "YES\nYES\nNO\nYES\nYES\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\nGiven an array a of length n, te...
[{"type": "stdin_stdout", "input": "1\n69\n1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1\n69\n1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSome days ago, I learned the con...
[{"type": "stdin_stdout", "input": "1000000\n", "output": "999996000003000000\n"}, {"type": "stdin_stdout", "input": "862795\n", "output": "642275489615199390\n"}, {"type": "stdin_stdout", "input": "763116\n", "output": "444394078546562430\n"}, {"type": "stdin_stdout", "input": "756604\n", "output": "433115377058855412...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 long time ago in some far coun...
[{"type": "stdin_stdout", "input": "-1 -512 10\n", "output": "No solution\n"}, {"type": "stdin_stdout", "input": "-3 -768 13\n", "output": "No solution\n"}, {"type": "stdin_stdout", "input": "-173 373 3\n", "output": "No solution\n"}, {"type": "stdin_stdout", "input": "-521 526 1\n", "output": "No solution\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\nThe king is left alone on the ch...
[{"type": "stdin_stdout", "input": "a8\nh1\n", "output": "7\nRD\nRD\nRD\nRD\nRD\nRD\nRD\n"}, {"type": "stdin_stdout", "input": "h8\ne1\n", "output": "7\nLD\nLD\nLD\n\nD\nD\nD\nD\n\n"}, {"type": "stdin_stdout", "input": "e8\nb1\n", "output": "7\nLD\nLD\nLD\n\nD\nD\nD\nD\n\n"}, {"type": "stdin_stdout", "input": "f7\nb1\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\nIt's time polar bears Menshykov ...
[{"type": "stdin_stdout", "input": "19\n895 1302 724 952 340 952 939 1302 724 952 939 340 340 1844 770 976 435 1302 1302\n", "output": "YES\n5 12 13 17 3 9 15 1 7 11 4 6 10 16 2 8 18 19 14\n12 5 13 17 3 9 15 1 7 11 4 6 10 16 2 8 18 19 14\n12 13 5 17 3 9 15 1 7 11 4 6 10 16 2 8 18 19 14\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\nCheaterius is a famous in all th...
[{"type": "stdin_stdout", "input": "7\n21\n33\n**\n33\n12\n**\n32\n31\n**\n21\n33\n**\n33\n12\n**\n32\n31\n**\n13\n23\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "7\n21\n33\n**\n33\n12\n**\n32\n31\n**\n21\n38\n**\n33\n12\n**\n32\n31\n**\n13\n23\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "7\n21\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nColonel has n badges. He wants t...
[{"type": "stdin_stdout", "input": "50\n50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50\n", "output": "1225\n"}, {"type": "stdin_stdout", "input": "50\n49 37 30 2 18 48 14 48 50 27 1 43 46 5 21 28 44 2 24 17 41 38 25 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\nFor months Maxim has been coming...
[{"type": "stdin_stdout", "input": "5 9 2\n15 18\n13 15\n9 16\n6 46\n10 11\n", "output": "0.75043463166775847828\n0.50012868026903611884\n1.75555586177032019179\n11.41003014228602907565\n0.25001607758409644111\n"}, {"type": "stdin_stdout", "input": "5 9 2\n15 18\n13 15\n9 16\n5 21\n10 11\n", "output": "0.75043463161594...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAyrat is looking for the perfect...
[{"type": "stdin_stdout", "input": "1000000000000000000\n", "output": " -418284973 -1154700538\n"}, {"type": "stdin_stdout", "input": "533568904697339792\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\nPaul is at the orchestra. The st...
[{"type": "stdin_stdout", "input": "10 10 10 1\n8 10\n2 9\n1 10\n3 1\n8 5\n10 1\n4 10\n10 2\n5 3\n9 3\n", "output": "1787\n"}, {"type": "stdin_stdout", "input": "10 10 10 1\n1 10\n10 8\n7 4\n7 2\n1 3\n6 6\n10 1\n2 7\n9 3\n3 10\n", "output": "1991\n"}, {"type": "stdin_stdout", "input": "10 10 10 10\n8 1\n1 8\n10 6\n10 4...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given n points on a line...
[{"type": "stdin_stdout", "input": "100\n457 827 807 17 871 935 907 -415 536 170 551 -1454 865 758 -457 -892 -875 -488 684 19 0 555 -807 -624 -239 826 318 811 20 -732 -91 460 551 -610 555 -493 -154 442 -141 946 -913 -104 704 -380 699 32 106 -455 -518 214 -464 -861 243 -798 -472 559 529 -844 -32 871 -459 236 387 626 -31...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 programming competition seas...
[{"type": "stdin_stdout", "input": "100\n56 22 13 79 28 73 16 55 34 0 97 19 22 36 22 80 30 19 36 92 9 38 24 10 61 43 19 12 18 34 21 36 1 17 0 97 72 37 74 70 51 34 33 87 27 33 45 97 38 56 2 32 88 92 64 51 74 94 86 98 57 62 83 3 87 61 9 65 57 13 64 10 50 35 7 75 41 3 70 66 6 55 69 42 91 75 14 22 68 93 2 53 22 98 45 2 78 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolandBall has such a convex pol...
[{"type": "stdin_stdout", "input": "2633 717\n", "output": "2 3 4 6 9 12 15 19 24 29 34 40 47 54 62 71 80 89 99 110 121 132 144 157 170 184 199 214 229 245 262 279 296 314 333 352 372 393 414 435 457 480 503 526 550 575 600 626 653 680 707 735 764 793 822 852 883 914 946 979 1012 1045 1079 1114 1149 1184 1220 1257 1294...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Holmes children are fighting...
[{"type": "stdin_stdout", "input": "1000000000000 1000000000000\n", "output": "1"}, {"type": "stdin_stdout", "input": "331725641503 465583326659\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "594243639083 188040404706\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "892726102335 265691489675\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\nTonio has a keyboard with only t...
[{"type": "stdin_stdout", "input": "KKVVKKVVVKKVKKVKKVVVKVVVKKVKKVVVKKVVVKVVVKVVVKKVVVKKVVVKVVVKKVVVKVVKKVVVKKVVVKKVVKVVVKKVVKKVKKVVVKKV\n", "output": "24\n"}, {"type": "stdin_stdout", "input": "VVVVVKKVKVKVKVVKVVKKVVKVKKKKKKKVKKKVVVVVVKKVVVKVKVVKVKKVVKVVVKKKKKVVVVVKVVVVKVVVKKVKKVKKKVKKVKKVVKKV\n", "output": "25\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\nOkabe and Super Hacker Daru are ...
[{"type": "stdin_stdout", "input": "19\nadd 1\nadd 2\nadd 3\nadd 4\nadd 5\nadd 6\nadd 7\nadd 8\nadd 9\nadd 10\nadd 11\nadd 12\nadd 13\nadd 14\nadd 15\nadd 16\nadd 17\nadd 18\nadd 19\nremove\nremove\nremove\nremove\nremove\nremove\nremove\nremove\nremove\nremove\nremove\nremove\nremove\nremove\nremove\nremove\nremove\nr...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecall that the bracket sequence...
[{"type": "stdin_stdout", "input": "9999 41526212\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\nRalph has a magic field which is...
[{"type": "stdin_stdout", "input": "1319740251273561528 1167937824526374114 1\n", "output": "855801178\n"}, {"type": "stdin_stdout", "input": "999999999999999999 1000000000000000000 1\n", "output": "102810659\n"}, {"type": "stdin_stdout", "input": "987654321987654321 1167937824526374114 1\n", "output": "186450555\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\nLet's define a split of n as a n...
[{"type": "stdin_stdout", "input": "1000000000\n", "output": "500000001\n"}, {"type": "stdin_stdout", "input": "1223796969\n", "output": "611898485\n"}, {"type": "stdin_stdout", "input": "1074371686\n", "output": "537185844\n"}, {"type": "stdin_stdout", "input": "1141423649\n", "output": "570711825\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\nTranslator's note: in Russia's m...
[{"type": "stdin_stdout", "input": "100\n5 4 3 5 3 5 4 2 3 3 4 5 4 5 5 4 2 4 2 2 5 2 5 3 4 4 4 5 5 5 3 4 4 4 3 5 3 2 5 4 3 3 3 5 2 3 4 2 5 4 3 4 5 2 2 3 4 4 2 3 3 3 2 5 2 3 4 3 3 3 2 5 4 3 4 5 4 2 5 4 5 2 2 4 2 2 5 5 4 5 2 2 2 2 5 2 4 4 4 5\n", "output": "35\n"}, {"type": "stdin_stdout", "input": "100\n2 3 2 2 2 3 2 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\nChandu is weak in maths. His tea...
[{"type": "stdin_stdout", "input": "2 2\n-1 4\n27 -1\n\nELOLAS", "output": "25\n"}, {"type": "stdin_stdout", "input": "2 2\n-1 3\n27 -1\n\nELOLAS", "output": "24\n"}, {"type": "stdin_stdout", "input": "2 2\n-1 4\n45 -1\n\nELOLAS", "output": "47\n"}, {"type": "stdin_stdout", "input": "2 2\n-1 4\n39 -1\n\nELOLAS", "outpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle Deepu and Little Kuldeep ...
[{"type": "stdin_stdout", "input": "100\n826555\n29937\n82698\n346981\n490420\n801306\n142167\n948126\n190048\n472464\n365458\n533781\n651062\n950909\n890012\n952976\n974090\n791611\n937512\n738134\n846008\n922994\n490878\n750703\n484277\n83339\n29296\n849174\n670039\n449489\n103773\n904569\n915035\n269260\n130159\n743...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 sale in the market on...
[{"type": "stdin_stdout", "input": "2\n5 3\n1 2\n4 3\n3 5\n4 0\n1 2\n1 -1\n0 4\n\nSAMPLE", "output": "YES\nYES\n"}, {"type": "stdin_stdout", "input": "2\n5 3\n1 2\n4 3\n3 5\n4 0\n1 2\n1 -1\n0 4\n\nPAMSLE", "output": "YES\nYES\n"}, {"type": "stdin_stdout", "input": "2\n5 3\n1 2\n4 2\n3 5\n4 0\n1 2\n1 -1\n0 4\n\nPAMSLE",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDark with his love for the prim...
[{"type": "stdin_stdout", "input": "5796\n887 4384\n1916 2778\n1422 1650\n28 2363\n60 3691\n737 4173\n1430 2568\n124 2863\n3136 4068\n3059 4023\n3538 3785\n1874 4957\n926 2306\n1328 2085\n858 1314\n546 4583\n3368 3815\n365 435\n3751 4044\n2179 2277\n2400 2755\n61 4933\n3369 4677\n13 2740\n2540 3095\n571 796\n379 1435\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\nGiven a string S which contains ...
[{"type": "stdin_stdout", "input": "2\n10\nabcdef\n4\nabcdefLAMPSE", "output": "1\n1\n"}, {"type": "stdin_stdout", "input": "2\n10\nabbdef\n4\nabcdefKAMPSE", "output": "0\n1\n"}, {"type": "stdin_stdout", "input": "2\n7\needaab\n30\nabcdefKAMPSE", "output": "0\n0\n"}, {"type": "stdin_stdout", "input": "2\n10\nabcdef\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\nWe have a tree with N vertices a...
[{"type": "stdin_stdout", "input": "10\n5 4\n5 7\n-1 13\n0 9\n12 10\n4 11\n7 4\n11 10\n7 4", "output": "152\n"}, {"type": "stdin_stdout", "input": "10\n5 16\n5 6\n-1 24\n1 10\n13 10\n4 6\n13 4\n6 3\n7 3", "output": "187\n"}, {"type": "stdin_stdout", "input": "10\n5 16\n5 6\n-1 24\n1 10\n13 10\n4 6\n13 4\n6 5\n7 3", "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 visiting a large electro...
[{"type": "stdin_stdout", "input": "5 5 0\n-10 0\n12 10 -2\n-1 2 1", "output": "-12\n"}, {"type": "stdin_stdout", "input": "2 10 0\n-5 -1\n13 10 -1\n0 2 7", "output": "-6\n"}, {"type": "stdin_stdout", "input": "3 10 -1\n-5 0\n11 10 -2\n0 2 1", "output": "-7\n"}, {"type": "stdin_stdout", "input": "5 10 0\n-6 0\n12 10 -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\nTakahashi will take part in an e...
[{"type": "stdin_stdout", "input": "11 14\n3 1 4 1 0 9 0 20 1 2 10\n15 6 7 26 3 2 3 8 4 8 2", "output": "20\n"}, {"type": "stdin_stdout", "input": "11 14\n3 1 4 1 0 9 0 20 1 2 10\n15 6 7 26 3 4 3 8 4 8 2", "output": "22\n"}, {"type": "stdin_stdout", "input": "11 14\n3 1 4 1 2 9 2 11 1 3 10\n15 9 7 26 3 2 3 8 4 8 2", "o...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string s consist...
[{"type": "stdin_stdout", "input": "ABBACCBACCBCAABCB", "output": "2\n"}, {"type": "stdin_stdout", "input": "ACBAACBCCABCCBBBA", "output": "1\n"}, {"type": "stdin_stdout", "input": "ABCAACBCAABCCBBBC", "output": "3\n"}, {"type": "stdin_stdout", "input": "ACCAAABCAABCCBBBC", "output": "8\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\nAtCoDeer the deer wants a direct...
[{"type": "stdin_stdout", "input": "1 1\n100 71 1", "output": "Possible\n202 10401\n1 2 X\n2 3 X\n3 4 X\n4 5 X\n5 6 X\n6 7 X\n7 8 X\n8 9 X\n9 10 X\n10 11 X\n11 12 X\n12 13 X\n13 14 X\n14 15 X\n15 16 X\n16 17 X\n17 18 X\n18 19 X\n19 20 X\n20 21 X\n21 22 X\n22 23 X\n23 24 X\n24 25 X\n25 26 X\n26 27 X\n27 28 X\n28 29 X\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\nAtCoDeer the deer found two rect...
[{"type": "stdin_stdout", "input": "-1 -1 100", "output": "102\n"}, {"type": "stdin_stdout", "input": "-1 -1 101", "output": "103\n"}, {"type": "stdin_stdout", "input": "-1 -1 111", "output": "113\n"}, {"type": "stdin_stdout", "input": "0 -116 -1", "output": "115\n"}, {"type": "stdin_stdout", "input": "-2 -1 111", "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\nCounting was a difficult task in...
[{"type": "stdin_stdout", "input": "VI\nCXDCXXMCXVIIII\nDXDCIX", "output": "6\n1809\n1099\n"}, {"type": "stdin_stdout", "input": "IV\nCXDCXXMCXVIIII\nDXDCIX", "output": "4\n1809\n1099\n"}, {"type": "stdin_stdout", "input": "IV\nCCDIIXXXXVIDLI\nXIDXDC", "output": "4\n1095\n1099\n"}, {"type": "stdin_stdout", "input": "IV...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 to calculate val...
[{"type": "stdin_stdout", "input": "(1-10*i)+00007*(3+10*i)\n3+5*i*(4+10*i)\n(102+10*i)*(99+10*i)\n2*i+3+9999*i+4", "output": "22+60i\n-47+20i\n9998+2010i\noverflow\n"}, {"type": "stdin_stdout", "input": "(1010*i)+000-7+(3+10*i)\n3+5*i*(4+11*i)\n(102*10*i)*(99+10*i)\n2+i+3+9999*i+4", "output": "-4+1020i\n-52+20i\noverf...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOnce upon a time when people sti...
[{"type": "stdin_stdout", "input": "8\n-7 9 6 9\n1 5 12 8\n-10 -5 12 -5\n-6 9 -9 -1\n6 13 18 -1\n-1 -2 -4 10\n1 -2 4 10\n0 -3 2 -3\n8\n-7 9 5 7\n-3 5 6 5\n-10 -5 10 -5\n-6 9 -7 -5\n6 5 9 -6\n-1 -2 -3 10\n1 -2 3 10\n-2 -5 2 -3\n0", "output": "no\nyes\n"}, {"type": "stdin_stdout", "input": "8\n-9 9 6 9\n1 5 12 8\n-10 -5 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem A Secret of Chocolate Po...
[{"type": "stdin_stdout", "input": "88 3", "output": "2971215071\n"}, {"type": "stdin_stdout", "input": "73 3", "output": "102334153\n"}, {"type": "stdin_stdout", "input": "68 4", "output": "3956574\n"}, {"type": "stdin_stdout", "input": "87 6", "output": "8427403\n"}, {"type": "stdin_stdout", "input": "72 4", "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\nBridge Construction Planning\n\n...
[{"type": "stdin_stdout", "input": "4 5 2\n1 4 2 A\n1 4 2 A\n1 4 2 B\n2 3 1 B\n3 4 1 B\n5 8 2\n1 2 1 A\n2 3 1 A\n3 4 3 A\n4 5 3 A\n1 2 5 B\n2 5 5 B\n3 4 8 B\n4 5 8 B\n5 5 1\n1 2 1 A\n2 3 1 A\n3 4 1 A\n4 5 1 B\n3 5 1 C\n4 5 3\n1 2 2 A\n2 4 3 B\n3 4 4 B\n2 3 5 A\n3 1 6 A\n0 0 0", "output": "-1\n14\n-1\n-1\n"}, {"type": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou decide to develop a game wit...
[{"type": "stdin_stdout", "input": "4\n4 6\n*.*..*\n*.....\n...-..\n^.*#..\n10\nSRSSRRUSSR\n2 2\n<.\n..\n12\nDDSRRSUUSLLS\n3 5\n>-#**\n.-*#*\n.-**#\n15\nSSSDRSSSDRSSSUU\n5 5\nv****\n*****\n*****\n*****\n*****\n44\nSSSSDDRSDRSRDSULUURSSSSRRRRDSSSSDDLSDLSDLSSD", "output": "*....*\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\nJapanese video game company has ...
[{"type": "stdin_stdout", "input": "1\n12\n123\n369\n12559\n4247219123\n1232123212321232\n#", "output": "0\n0\n1\n0\n1\n2\n7\n"}, {"type": "stdin_stdout", "input": "1\n16\n275\n333\n3289\n4925833356\n1232123212321232\n#", "output": "0\n0\n0\n0\n1\n0\n7\n"}, {"type": "stdin_stdout", "input": "1\n12\n123\n369\n2355\n1111...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 time was 3xxx, and the highl...
[{"type": "stdin_stdout", "input": "0.010621136904092388", "output": "-1\n"}, {"type": "stdin_stdout", "input": "1.3688811760808033", "output": "-1\n"}, {"type": "stdin_stdout", "input": "0.8381141713181799", "output": "-1\n"}, {"type": "stdin_stdout", "input": "0.8291753111376882", "output": "-1\n"}, {"type": "stdin_s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMake a wish to a shooting star\n...
[{"type": "stdin_stdout", "input": "1\n0.0000 0.0000 0.0000 2.0000 0.0000 0.0000 4.0000 1.0000\n2\n0.0000 0.0000 0.0000 2.0000 0.0000 0.0000 4.0000 1.0000\n10.0000 0.0000 0.0000 -2.0000 0.0000 0.0000 4.0000 1.0000\n5\n-10.0000 0.5301491670709055 0.0000 10.0000 0.15723569039702578 0.6247894746810593 2.0000 1.0000\n-5.00...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nD --Invisible\n\nProblem Stateme...
[{"type": "stdin_stdout", "input": "2 2\n100 -1\n200 398", "output": "-100\n"}, {"type": "stdin_stdout", "input": "2 2\n100 -1\n325 300", "output": "-200\n"}, {"type": "stdin_stdout", "input": "2 2\n010 -1\n162 152", "output": "-142\n"}, {"type": "stdin_stdout", "input": "2 2\n100 -1\n200 300", "output": "-100"}, {"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\nAlice has a lovely piece of clot...
[{"type": "stdin_stdout", "input": "5\n35838040099 35838040098\n26612022790 26612022789\n23649629085 23649629084\n17783940691 17783940690\n31547284201 31547284200\n", "output": "YES\nYES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "5\n17406961899 17406961898\n21570966087 21570966086\n31354673689 31354673688\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn this problem we consider a ve...
[{"type": "stdin_stdout", "input": "912738218 530309782 -939253776\n592805323 -930297022 -567581994 -829432319\n", "output": "1218437463.3854325\n"}, {"type": "stdin_stdout", "input": "137446306 341377513 -633738092\n244004352 -854692242 60795776 822516783\n", "output": "1800945736.2511592\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\nToday's morning was exceptionall...
[{"type": "stdin_stdout", "input": "71 100\n56 44\n12 85\n", "output": "5053\n"}, {"type": "stdin_stdout", "input": "46 100\n36 81\n99 28\n", "output": "4961\n"}, {"type": "stdin_stdout", "input": "29 100\n30 51\n28 92\n", "output": "5021\n"}, {"type": "stdin_stdout", "input": "93 80\n13 49\n100 21\n", "output": "3220\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 consistin...
[{"type": "stdin_stdout", "input": "100 100\n98 52 63 2 18 96 31 58 84 40 41 45 66 100 46 71 26 48 81 20 73 91 68 76 13 93 17 29 64 95 79 21 55 75 19 85 54 51 89 78 15 87 43 59 36 1 90 35 65 56 62 28 86 5 82 49 3 99 33 9 92 32 74 69 27 22 77 16 44 94 34 6 57 70 23 12 61 25 8 11 67 47 83 88 10 14 30 7 97 60 42 37 24 38 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNatasha's favourite numbers are ...
[{"type": "stdin_stdout", "input": "2000 2000\n", "output": "674532367\n"}, {"type": "stdin_stdout", "input": "1994 1981\n", "output": "596939902\n"}, {"type": "stdin_stdout", "input": "1028 1040\n", "output": "119840364\n"}, {"type": "stdin_stdout", "input": "1991 1992\n", "output": "518738831\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 have a fence consisting of n...
[{"type": "stdin_stdout", "input": "3\n3\n3 4\n2 1\n3 7\n3\n2 3\n2 2\n2 0\n4\n1 7\n12 2\n2 15\n1000000000 8\n", "output": "0\n2\n0\n"}, {"type": "stdin_stdout", "input": "3\n3\n3 4\n2 1\n3 4\n3\n2 3\n2 2\n2 0\n4\n1 7\n12 2\n2 15\n1000000000 8\n", "output": "0\n2\n0\n"}, {"type": "stdin_stdout", "input": "3\n3\n3 4\n2 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\nDLS and JLS are bored with a Mat...
[{"type": "stdin_stdout", "input": "7\n2\n1000000000 0\n2\n1000000000 0\n2\n1 0\n2\n1000000000 0\n2\n1 0\n2\n1 0\n2\n1000000000 0\n2\n1 0\n1\n999999999\n1\n99999999\n1\n1000000000\n1\n999999999\n3\n1000000000 999999999 999999998\n7\n2 3 5 7 10 11 12\n", "output": "4\n2\n2\n2\n1\n0\n10\n"}, {"type": "stdin_stdout", "inp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBob is playing a game of Spacesh...
[{"type": "stdin_stdout", "input": "2\n4 4\n9\n1 1 1\n1 2 1\n1 3 1\n2 1 2\n2 2 2\n2 3 2\n2 3 1\n2 2 1\n2 1 1\n", "output": "7\n6\n5\n4\n3\n2\n2\n3\n4\n"}, {"type": "stdin_stdout", "input": "2\n4 4\n9\n1 1 1\n2 2 1\n1 3 1\n2 1 2\n2 2 2\n2 3 2\n2 3 1\n2 2 1\n2 1 1\n", "output": "7\n6\n5\n4\n4\n3\n3\n3\n4\n"}, {"type": "s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n\n\nInput\n\nThe input contains ...
[{"type": "stdin_stdout", "input": "011\n", "output": "22\n"}, {"type": "stdin_stdout", "input": "001\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "35\n", "output": "50\n"}, {"type": "stdin_stdout", "input": "45\n", "output": "60\n"}, {"type": "stdin_stdout", "input": "12\n", "output": "12\n"}, {"type": "st...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two integers a and...
[{"type": "stdin_stdout", "input": "4\n2 4\n314 15\n-99 82\n123 987\n", "output": "6\n329\n-17\n1110\n"}, {"type": "stdin_stdout", "input": "4\n2 9\n314 14\n-99 67\n123 120\n", "output": "11\n328\n-32\n243\n"}, {"type": "stdin_stdout", "input": "4\n2 9\n314 14\n-99 177\n123 120\n", "output": "11\n328\n78\n243\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\nAnna is a girl so brave that she...
[{"type": "stdin_stdout", "input": "6\n2 2 1 2\n0 100 0 1\n12 13 25 1\n27 83 14 25\n0 0 1 0\n1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000\n", "output": "Yes\nNo\nNo\nYes\nNo\nYes\n"}, {"type": "stdin_stdout", "input": "6\n2 2 1 2\n0 100 0 1\n11 13 25 1\n27 83 14 25\n0 0 1 0\n100000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 computer game....
[{"type": "stdin_stdout", "input": "3 3\n4 3 12\n3 1\n2 3\n2 3\n", "output": "0\n332748124\n332748124\n"}, {"type": "stdin_stdout", "input": "3 3\n5 2 6\n2 1\n0 2\n2 3\n", "output": "332748122\n13\n665496236\n"}, {"type": "stdin_stdout", "input": "3 3\n4 1 6\n0 1\n1 2\n2 3\n", "output": "11\n665496241\n332748118\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\nBandits appeared in the city! On...
[{"type": "stdin_stdout", "input": "100\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n0 0 63 70 92 75 4 96 52 33 86 57 53 85 91 62 23 0 28 37 41 69 26 64 7 100 41 19 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHolidays are coming up really so...
[{"type": "stdin_stdout", "input": "6\n4 7\n...*...\n..***..\n.****..\n*******\n6 10\n....*.*...\n...*****..\n..*******.\n.********.\n********.*\n**********\n5 5\n*...*\n**.**\n*****\n**.**\n*...*\n5 6\n.*....\n.**...\n.***..\n.****.\n.*****\n3 3\n*.*\n...\n*.*\n2 4\n.**.\n****\n", "output": "24\n89\n19\n22\n4\n8\n"}, ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe only difference between the ...
[{"type": "stdin_stdout", "input": "100\n63 164 12 0 33 10 0 15 41 0 40 143 26 011 4 1 4 72 5 4 317 61 212 76 0 106 30 17 107 74 134 68 63 247 15 75 5 3 111 29 8 87 -1 1 -1 0 172 15 303 100 235 49 263 5 14 30 6 151 12 6 245 21 94 19 18 37 110 0 137 011 7 4 2 70 3 0 16 0 18 17 -1 17 97 180 10 -1 12 4 356 42 22 81 52 5 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\nOmkar's most recent follower, Aj...
[{"type": "stdin_stdout", "input": "4\n3 4\n0000\n00#0\n0000\n2 1\n#\n#\n1 2\n##\n6 29\n#############################\n#000##0###0##0#0####0####000#\n#0#0##00#00##00####0#0###0#0#\n#0#0##0#0#0##00###00000##00##\n#000##0###0##0#0##0###0##0#0#\n#############################\n", "output": "\n2\n3\n3\n319908071\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\nGiven the number n, find the sma...
[{"type": "stdin_stdout", "input": "118\n", "output": "864691128455135232"}, {"type": "stdin_stdout", "input": "473\n", "output": "259700248434180096"}, {"type": "stdin_stdout", "input": "940\n", "output": "199495389743677440"}, {"type": "stdin_stdout", "input": "265\n", "output": "364791569817010176"}, {"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\nOur old friend Alexey has finall...
[{"type": "stdin_stdout", "input": "71\n1 99\n11 69\n86 92\n7 49\n31 70\n42 53\n48 81\n86 96\n36 91\n19 38\n39 91\n41 64\n87 93\n83 97\n40 41\n3 32\n15 18\n58 65\n22 32\n1 71\n58 86\n64 77\n15 69\n4 34\n42 89\n9 66\n15 18\n58 65\n59 96\n39 89\n19 38\n6 63\n26 73\n29 47\n55 88\n5 78\n41 74\n48 81\n20 71\n59 96\n42 49\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\nOne day Vasya got hold of inform...
[{"type": "stdin_stdout", "input": "93 867\n131 1270 616 1027 1685 27 1662 947 1480 20 1394 1528 191 1348 37 1694 1772 1706 1394 49 1391 878 1474 307 101 1129 1064 116 143 1239 261 651 1534 1348 1604 636 793 1188 1293 36 1729 1204 1656 1579 1644 661 1470 341 1709 1860 1081 1539 5 1892 1732 1049 419 25 1086 1263 967 128...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 used to play a card gam...
[{"type": "stdin_stdout", "input": "3656\n", "output": "YES\n1 * 2 = 2\n2 * 3 = 6\n6 * 4 = 24\n6 - 5 = 1\n24 * 1 = 24\n8 - 7 = 1\n24 * 1 = 24\n10 - 9 = 1\n24 * 1 = 24\n12 - 11 = 1\n24 * 1 = 24\n14 - 13 = 1\n24 * 1 = 24\n16 - 15 = 1\n24 * 1 = 24\n18 - 17 = 1\n24 * 1 = 24\n20 - 19 = 1\n24 * 1 = 24\n22 - 21 = 1\n24 * 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\nThe School β„–0 of the capital of ...
[{"type": "stdin_stdout", "input": "220\n1 1 3 1 3 1 1 3 1 3 3 3 3 1 3 3 1 3 3 3 3 3 1 1 1 3 1 1 1 3 2 3 3 3 1 1 3 3 1 1 3 3 3 3 1 3 3 1 1 1 2 3 1 1 1 2 3 3 3 2 3 1 1 3 1 1 1 3 2 1 3 2 3 1 1 3 3 3 1 3 1 1 1 3 3 2 1 3 2 1 1 3 3 1 1 1 2 1 1 3 2 1 2 1 1 1 3 1 3 3 1 2 3 3 3 3 1 3 1 1 1 1 2 3 1 1 1 1 1 1 3 2 3 1 3 1 3 1 1 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\nLuke Skywalker gave Chewbacca an...
[{"type": "stdin_stdout", "input": "1000000000000000000\n", "output": "1000000000000000000\n"}, {"type": "stdin_stdout", "input": "1000001000000000000\n", "output": "1000001000000000000\n"}, {"type": "stdin_stdout", "input": "1000001000000000010\n", "output": "1000001000000000010\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\nVasya has recently learned to ty...
[{"type": "stdin_stdout", "input": "hyyhddqhxhekehkwfhlnlsihzefwchzerevcjtokefplholrbvxlltdlafjxrfhleglrvlolojoqaolagtbeyogxlbgfolllslli\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "jhfbndhyzdvhbvhmhmefqllujdflwdpjbehedlsqfdsqlyelwjtyloxwsvasrbqosblzbowlqjmyeilcvotdlaouxhdpoeloaovb\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\nThey say \"years are like domino...
[{"type": "stdin_stdout", "input": "7 39\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\nThere is a legend in the IT City...
[{"type": "stdin_stdout", "input": "1250846005844530517\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1000001000000000000\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "2039244416399039339\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1000001000000001000\n", "output": "2\n"}, {"type": "s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBrothers Fred and George Weasley...
[{"type": "stdin_stdout", "input": "20\n26 47 23\n1 -2 17\n-14 -22 46\n19 34 -18\n22 -10 -34\n15 14 -48\n-30 -12 -12\n-23 40 -48\n-50 -41 -35\n48 -5 46\n-2 -11 10\n-49 47 -15\n31 6 10\n-41 35 15\n28 28 25\n43 -7 -10\n-19 -48 49\n-10 -29 28\n0 -10 28\n41 12 -26\n-14 40 17\n3 2\n-115 1407 1434\n", "output": "YES\n659.975...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 lives at point (a, b) of...
[{"type": "stdin_stdout", "input": "66 -82\n43\n27 -21 70\n-64 46 58\n-7 -20 41\n-42 60 57\n-93 -7 95\n26 -61 26\n-10 -72 25\n-78 -18 55\n-62 -64 69\n-33 95 50\n24 59 45\n4 72 37\n66 57 61\n16 -60 5\n17 -78 36\n-75 56 59\n-60 98 77\n-94 37 28\n76 6 63\n99 -35 75\n69 -40 1\n9 -48 56\n-94 -11 19\n69 1 63\n43 42 80\n-28 -...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 is currently at a car rent...
[{"type": "stdin_stdout", "input": "4 13 400 600\n13 30\n1 19\n1 160\n1 113\n58 73 15 319 194 362 128 157 336 162 77 90 96\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "4 13 400 600\n13 30\n1 19\n1 160\n1 113\n58 73 15 319 194 362 200 157 336 162 77 90 96\n", "output": "1"}, {"type": "stdin_stdout", "input":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n people taking part i...
[{"type": "stdin_stdout", "input": "5\n3 4\n1 14\n4 20\n3 22\n5 28\n31\n1 1\n1 2\n2 1 2\n1 3\n2 1 3\n2 2 3\n3 1 2 3\n1 4\n2 1 4\n2 2 4\n3 1 2 4\n2 3 4\n3 1 3 4\n3 2 3 4\n4 1 2 3 4\n1 5\n2 1 5\n2 2 5\n3 1 2 5\n2 3 5\n3 1 3 5\n3 2 3 5\n4 1 2 3 5\n2 4 5\n3 1 4 5\n3 2 4 5\n4 1 2 4 5\n3 3 4 5\n4 1 3 4 5\n4 2 3 4 5\n5 1 2 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 an integer m, and ...
[{"type": "stdin_stdout", "input": "-1 12758\n", "output": "12757\n1 3 8507 2553 5469 7089 1161 9815 9357 3003 2687 10329 11095 3063 10869 441 3705 8893 11301 11035 7525 9025 5935 11625 7873 9895 9507 9389 233 5149 9083 11295 11949 7067 8189 3699 2337 2273 9527 7457 647 12129 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\nPetya recieved a gift of a strin...
[{"type": "stdin_stdout", "input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"}, {"type": "stdin_stdout", "input": "bccbbcccbccbacacbaccaababcb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 might remember from the p...
[{"type": "stdin_stdout", "input": "5\n1 1\n1 4\n3 6 3\n1 4\n3 10 3\n", "output": "1\n0\n"}, {"type": "stdin_stdout", "input": "5\n1 3\n1 4\n3 11 3\n2 4\n3 6 2\n", "output": "0\n0\n"}, {"type": "stdin_stdout", "input": "5\n1 3\n1 4\n3 12 3\n1 4\n3 4 3\n", "output": "0\n2\n"}, {"type": "stdin_stdout", "input": "5\n1 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\nA substring of some string is ca...
[{"type": "stdin_stdout", "input": "76\namnctposz\nmnctpos\nos\nu\ne\nam\namnc\neamnctpo\nl\nx\nq\nposzq\neamnc\nctposzq\nctpos\nmnc\ntpos\namnctposzql\ntposzq\nmnctposz\nnctpos\nctposzql\namnctpos\nmnct\np\nux\nposzql\ntpo\nmnctposzql\nmnctp\neamnctpos\namnct\ntposzql\nposz\nz\nct\namnctpo\noszq\neamnct\ntposz\ns\nmn\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 arrays A and B...
[{"type": "stdin_stdout", "input": "22 334 246\n-462653 -618002 4973 -348485 366658 192390 274752 200590 138367 779540 -661269 642587 113645 -110388 -604418 -491231 -933401 -219332 -603140 836439 167007 210226\n357638 -646669 -558432 -434313 -285851 -119233 323088 -512237 -729293 215256 39316 -984201 -209814 715016 -27...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Jhool considers Jaadu to ...
[{"type": "stdin_stdout", "input": "2\nhackerearth\nhacker\nhackerearth\nwow\nSAMPLE", "output": "YES\nNO\n"}, {"type": "stdin_stdout", "input": "2\nhackerearth\nhacker\nhackerearti\nwow\nSAMPLE", "output": "YES\nNO\n"}, {"type": "stdin_stdout", "input": "2\nhackerdarth\nhacker\nhackerearti\nwow\nSAMPLE", "output": "YE...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCaesar Cipher is one of the earl...
[{"type": "stdin_stdout", "input": "3\n-1\nw\n2\nnYxj\n-1\nml\n\nRAPMLE", "output": "v\npAzl\nlk\n"}, {"type": "stdin_stdout", "input": "3\n-1\nw\n2\nYnxj\n-1\nml\n\nRAPMLE", "output": "v\nApzl\nlk\n"}, {"type": "stdin_stdout", "input": "3\n-1\nw\n2\nYnxj\n-1\nmm\n\nRAPMLE", "output": "v\nApzl\nll\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\nInspired by the tv series Strang...
[{"type": "stdin_stdout", "input": "5\n6 14 15 7 12 16 5 4 11 9 3 10 8 2 13 1", "output": "10199246"}, {"type": "stdin_stdout", "input": "2\n41 11", "output": "114307200"}, {"type": "stdin_stdout", "input": "2\n82 11", "output": "820575944"}, {"type": "stdin_stdout", "input": "2\n41 17", "output": "342921600"}, {"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\nGiven is a positive integer N.\n...
[{"type": "stdin_stdout", "input": "79815666421", "output": "144\n"}, {"type": "stdin_stdout", "input": "237274827109", "output": "24\n"}, {"type": "stdin_stdout", "input": "13543667986", "output": "33\n"}, {"type": "stdin_stdout", "input": "23472293460", "output": "11\n"}, {"type": "stdin_stdout", "input": "4546820703...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 held two competitions: Coding...
[{"type": "stdin_stdout", "input": "1 001", "output": "1000000\n"}, {"type": "stdin_stdout", "input": "10 001", "output": "300000\n"}, {"type": "stdin_stdout", "input": "11 001", "output": "300000\n"}, {"type": "stdin_stdout", "input": "3 001", "output": "400000\n"}, {"type": "stdin_stdout", "input": "5 001", "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\nTakahashi made N problems for co...
[{"type": "stdin_stdout", "input": "14\n99592 10342 29105 78532 83018 11639 92015 127350 30914 21912 51211 93284 100000 0", "output": "27321\n"}, {"type": "stdin_stdout", "input": "14\n99592 10342 29105 78532 83018 11639 92015 127350 30914 39830 51211 93284 100000 0", "output": "27321\n"}, {"type": "stdin_stdout", "inp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a connected undire...
[{"type": "stdin_stdout", "input": "13 8\n1 4\n4 7\n3 4\n2 1\n5 6\n6 5\n3 5\n2 6", "output": "7\n7 4 1 2 6 5 3\n"}, {"type": "stdin_stdout", "input": "7 8\n1 4\n2 3\n3 4\n4 1\n5 6\n1 7\n3 6\n2 6", "output": "7\n5 6 2 3 4 1 7\n"}, {"type": "stdin_stdout", "input": "7 7\n1 2\n2 3\n3 4\n4 5\n5 6\n6 7\n3 5\n2 6", "output":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a triangle formed by th...
[{"type": "stdin_stdout", "input": "2.5236948660396488 1.2449675008007697 3.467160130839816 2.2489154237675044 4.3267713977209254 3.696599910445261 2.778529750649784 0.5428461273225557\n0.3648696681668867 1.6775294144371997 2.646749575901687 5.368903351235283 5.958977255484857 4.673632823800934 -0.048505034276450476 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\nOn the Internet, data is divided...
[{"type": "stdin_stdout", "input": "7\n1 4 2 5 5 3\n2 1 5\n3 1 6\n4 1 7\n5 2 7 6\n6 1 2\n7 0\n6\n1 2 0\n1 5 0\n1 2 0\n5 1 3\n6 3 0\n1 7 4", "output": "NA\nNA\nNA\nNA\nNA\n3\n"}, {"type": "stdin_stdout", "input": "7\n1 4 2 5 4 3\n2 1 5\n3 1 6\n4 1 7\n5 2 7 6\n6 1 1\n7 0\n6\n1 2 1\n1 3 6\n1 2 0\n5 2 3\n6 3 0\n3 7 4", "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\nproblem\n\nDo you know Just Odd ...
[{"type": "stdin_stdout", "input": "5\n2 2 1 2\n6 5\n1 17\n3 2 2 1\n11 1 20\n10 18 3\n8\n5 4 1 3\n5 5 4 5 2\n8 2 1 9 7\n1 1 3 5 1\n7 2 7 1 3\n6 5 6 2\n2 3 5 8 2 7\n1 6 9 4 5 1\n2 5 1 4 2 2\n5 4 2 5 3 3\n12 1 5 1 5 6\n6\n3 3 2 2\n2 17 2\n9 1 9\n2 9 2\n2 2 1 1\n1 3\n5 7\n0", "output": "17\n4\n9\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\nAlmost periodic string\n\nGiven ...
[{"type": "stdin_stdout", "input": "abcabcaxcabc\n10\n1 3 3\n8 12 3\n1 4 2\n3 6 2", "output": "Yes\nYes\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\n"}, {"type": "stdin_stdout", "input": "abcabcaxcabc\n5\n1 15 3\n8 12 3\n1 4 2\n2 6 2", "output": "No\nYes\nNo\nNo\nNo\n"}, {"type": "stdin_stdout", "input": "abcabcaxcabc\n5\n1 3 3\n8...
code_stdio