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\nFrom the childhood we are taught... | [{"type": "stdin_stdout", "input": "10\nihpcfylbjskmxqogaetnwzdvur\nlvjiwjvzlybrlmclbyxpopnuxlzbqxrvhnizyipzqrvsztylptnwbsvcxegtfwawvradfryklqlezbbowsuqtsyoxrkwcbmmgngaefavwoikahtllsbvowqogdripwevhayxyyjuwcdyuatiwikdoxhkutlvtdkkfjnxatmaxqkokmxpwueiatziwkocrciyvegwshapgpvrispsbsppnxjtursjfymnosbsxkntoawyjezwobphtyimtkhg... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nShinchan and Kazama both are pla... | [{"type": "stdin_stdout", "input": "10\n41\n467 334 500 169 999 478 358 962 464 705 145 249 827 961 491 995 942 827 206 391 604 902 153 292 508 421 716 718 895 447 726 771 538 869 1338 667 299 35 894 703 811 \n23\n333\n673 664 141 711 253 868 547 644 662 1295 37 859 723 741 529 355 316 35 190 842 288 106 40 942 264 648... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTanmay is a legendary spammer - ... | [{"type": "stdin_stdout", "input": "500\n18\n8 5 5 -9 -8 0 0 -3 -7 2 0 4 2 -6 1 -9 2 -6 \n18\n9 9 -7 -6 -2 -3 -4 4 -6 5 -4 7 -4 -6 2 -10 -5 2 \n18\n-1 3 7 2 -8 -3 -7 2 -1 2 4 10 6 0 8 10 4 -6 \n18\n-6 10 8 -2 2 -8 -8 6 -4 4 6 -1 -7 -8 -9 -10 5 -6 \n18\n-5 6 6 2 -2 -3 -1 -7 7 -3 -8 0 1 -6 -3 -4 2 7 \n18\n-2 3 2 2 -6 -4 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven are a sequence of N positi... | [{"type": "stdin_stdout", "input": "10 10\n3 1 7 1 10 13 2 6 5 11", "output": "1536\n"}, {"type": "stdin_stdout", "input": "10 10\n3 1 7 1 10 13 2 6 5 3", "output": "2272\n"}, {"type": "stdin_stdout", "input": "10 10\n3 1 7 1 13 13 2 6 5 3", "output": "1760\n"}, {"type": "stdin_stdout", "input": "10 10\n3 1 6 1 13 13 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\nGiven is a permutation P_1, \\ld... | [{"type": "stdin_stdout", "input": "8\n5 14 4 2 6 8 1 3", "output": "4\n"}, {"type": "stdin_stdout", "input": "8\n5 28 4 2 6 8 1 3", "output": "4\n"}, {"type": "stdin_stdout", "input": "8\n5 14 4 2 6 4 1 3", "output": "4\n"}, {"type": "stdin_stdout", "input": "8\n5 28 4 2 8 8 1 3", "output": "4\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\nThere are N integers, A_1, A_2, ... | [{"type": "stdin_stdout", "input": "11\n-1000000000 1000000000 -1000000000 1000000000 -1000000000 0 1000000000 -1000000000 1000000000 -1000000000 1000000000", "output": "10000000000"}, {"type": "stdin_stdout", "input": "11\n-1000000000 1000000000 -364513171 1000000000 -1000000000 0 1000000000 -1000000000 1000000000 -10... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn some other world, today is De... | [{"type": "stdin_stdout", "input": "-1279", "output": "Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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. Among ... | [{"type": "stdin_stdout", "input": "atcoderamdatcodeer\n5", "output": "amdat\n"}, {"type": "stdin_stdout", "input": "roddadtadmaoefectr\n5", "output": "admao\n"}, {"type": "stdin_stdout", "input": "atcoderamdascodeer\n5", "output": "amdas\n"}, {"type": "stdin_stdout", "input": "atcoderandatcodeer\n5", "output": "andat"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 sequenc... | [{"type": "stdin_stdout", "input": "6\n-1 22 1 75 15 0", "output": "0 75 22 -1 1 15\n"}, {"type": "stdin_stdout", "input": "6\n2 20 0 59 10 1", "output": "1 59 20 2 0 10\n"}, {"type": "stdin_stdout", "input": "6\n2 20 0 59 10 0", "output": "0 59 20 2 0 10\n"}, {"type": "stdin_stdout", "input": "6\n2 20 0 59 12 0", "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\nInternet search engines, such as... | [{"type": "stdin_stdout", "input": "niW todax's premiminary contest `nd eb eqjgilaue ot vhsit Uniwersity of Aizu-", "output": "niW `nd vhsit Aizu-\n"}, {"type": "stdin_stdout", "input": "pUi sod'xsa yqnlibiocro tsfsloc `cn bg fualhgdpj pv hjssv Umjweqsity dn vyjA-", "output": "pUi `cn hjssv vyjA-\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\nMr. Matsudaira is always careful... | [{"type": "stdin_stdout", "input": "29\n104\n0\n-1", "output": "620\n-11360\n3130\n"}, {"type": "stdin_stdout", "input": "29\n112\n0\n-1", "output": "620\n-12640\n3130\n"}, {"type": "stdin_stdout", "input": "29\n130\n1\n-1", "output": "620\n-15520\n3130\n"}, {"type": "stdin_stdout", "input": "29\n97\n0\n-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\nIt’s still hot every day, but Se... | [{"type": "stdin_stdout", "input": "-7 1028", "output": "1035\n"}, {"type": "stdin_stdout", "input": "-2 1028", "output": "1030\n"}, {"type": "stdin_stdout", "input": "-2 1094", "output": "1096\n"}, {"type": "stdin_stdout", "input": "-2 1349", "output": "1351\n"}, {"type": "stdin_stdout", "input": "-3 1349", "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\nOn a clear night, a boy, Campane... | [{"type": "stdin_stdout", "input": "8\n1 0 3 3 0 1 14 5\n7\n1 2 -1 8 12 1 5\n0", "output": "NO COLOR\nNO COLOR\n"}, {"type": "stdin_stdout", "input": "8\n1 0 3 3 0 1 14 5\n7\n1 2 -1 8 22 1 5\n0", "output": "NO COLOR\nNO COLOR\n"}, {"type": "stdin_stdout", "input": "8\n1 0 3 3 0 1 14 5\n7\n1 2 -1 8 13 1 5\n0", "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\nToday is the birthday of Mr. Bon... | [{"type": "stdin_stdout", "input": "3 8 6\n1 48\n1 31\n1 3\n3 7 2\n1 1\n2 0\n1 2\n0 2 10\n0 0 0", "output": "2 10 18 18\n0 1 1 12\n20\n"}, {"type": "stdin_stdout", "input": "3 10 6\n1 35\n2 16\n1 2\n3 4 1\n1 1\n2 0\n3 1\n0 2 5\n0 0 0", "output": "6 12 18 24\n0 1 1 2\n10\n"}, {"type": "stdin_stdout", "input": "3 10 6\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\nThe amount of information on the... | [{"type": "stdin_stdout", "input": "3 1\naa\nb\nccc\naabccczbaacccbaazaabbcccaa\n3 1\na\nb\nc\ncbbcbcbabaacabccaccbaacbccbcaaaccccbcbcbbcacbaacccaccbbcaacbbabbabaccc\n3 4\naaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaaaa... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPeace, which was supposed to las... | [{"type": "stdin_stdout", "input": "2 -1 0 13 10\n2 1\n4 0\n2 0 -1 15 18\n1 1\n6 6\n4 0 0 10 10\n1 1\n10 5\n0 0 0 0 0", "output": "YES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "2 -1 0 13 10\n2 1\n4 0\n2 0 -1 15 18\n1 1\n6 6\n4 0 0 10 10\n1 1\n5 5\n0 0 0 0 0", "output": "YES\nYES\nNO\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\nA robot in a two-dimensional maz... | [{"type": "stdin_stdout", "input": "2 5 1\nL\nG.\n#S\n2 2 3\nRS\n.G\nS.\n3 6 10\nLLLLLL\nG$.\n...\n.#S\n0 0 0", "output": "Yes\nYes\nYes\n"}, {"type": "stdin_stdout", "input": "2 2 1\nL\nG.\n#S\n2 2 2\nRR\nG.\nS.\n3 3 10\nLLLLKL\nG#.\n...\n.#S\n0 0 0", "output": "Yes\nYes\nYes\n"}, {"type": "stdin_stdout", "input": "2 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nK: Relief (Angel Relief)\n\nTenm... | [{"type": "stdin_stdout", "input": "2 2\n0 0\n-2 27", "output": "100\n"}, {"type": "stdin_stdout", "input": "1 4\n1 2\n-5 41", "output": "150\n"}, {"type": "stdin_stdout", "input": "1 4\n1 2\n-7 41", "output": "138\n"}, {"type": "stdin_stdout", "input": "1 4\n1 0\n-7 41", "output": "126\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\nFor given a circle $c$ and a lin... | [{"type": "stdin_stdout", "input": "2 0 3\n2\n-1 -1 11 0\n1 -1 12 3", "output": "-0.83330025 -0.98610835 4.95743818 -0.50354682\n-0.55841103 -1.56669492 4.96717016 0.44260733\n"}, {"type": "stdin_stdout", "input": "2 -1 3\n2\n0 -1 14 0\n1 0 10 11", "output": "-0.99915098 -1.07136793 4.97884641 -0.64436811\n-0.76686667 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 travels around Mars in t... | [{"type": "stdin_stdout", "input": "60\nAND 20 4\nNOT 42\nAND 48 59\nOR 17 7\nIN 0\nAND 36 37\nIN 1\nIN 0\nIN 1\nNOT 47\nAND 52 49\nOR 44 35\nIN 0\nIN 1\nAND 33 56\nIN 0\nIN 0\nIN 0\nAND 31 41\nOR 15 3\nOR 43 46\nIN 1\nXOR 22 28\nIN 1\nIN 1\nIN 1\nAND 34 21\nIN 1\nIN 1\nIN 0\nXOR 51 23\nXOR 10 54\nOR 57 40\nIN 0\nNOT 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 Disgaea as in most role-playi... | [{"type": "stdin_stdout", "input": "20 1 0.78\nxc 6799\nztrfjsq 3023\nkhbcbsaztwigxeidh 2974\nkksvbmtjiiqlguwv 188\nwvqzzjrpmxsdbfvua 4547\niqkqqwtqifdpxfhslpv 6264\nwarmknju 9472\nfheisuiufwmtagl 292\nwge 4338\nzaklermeji 6733\nfcn 6282\nbjyjzgzkgzy 1778\ngufpvhdnsesyfuegef 4998\nxnhuhwzzxqbaphktqbc 8485\ncokabaqahfw ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nArkady coordinates rounds on som... | [{"type": "stdin_stdout", "input": "11000 10\n10000 9999 9998 1967 4502 9995 9994 10823 9992 9991\n", "output": "0000000000\n"}, {"type": "stdin_stdout", "input": "11000 10\n10000 9999 9998 1967 4502 9995 3707 10823 9992 9991\n", "output": "0000000000\n"}, {"type": "stdin_stdout", "input": "11010 10\n10000 9999 9998 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\nYou are given an array a consist... | [{"type": "stdin_stdout", "input": "5\n1 3 4\n2 3 0\n2 4 3\n1 500000 1\n2 800 0\n", "output": "4\n4\n1\n"}, {"type": "stdin_stdout", "input": "5\n1 3 4\n2 3 0\n2 4 3\n1 4 -4\n2 1 0\n", "output": "4\n4\n0\n"}, {"type": "stdin_stdout", "input": "5\n1 3 4\n1 3 0\n2 4 3\n1 4 -4\n2 1 0\n", "output": "4\n0\n"}, {"type": "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 n k-digit integers... | [{"type": "stdin_stdout", "input": "8 8\n83239439\n62184887\n58968944\n39808261\n68740623\n38480328\n81965504\n52600488\n", "output": "44481119\n"}, {"type": "stdin_stdout", "input": "8 8\n96805230\n73119021\n06552907\n86283347\n88650846\n19155689\n37032451\n19310120\n", "output": "53604668\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\nYou are given two positive integ... | [{"type": "stdin_stdout", "input": "5\n2 3\n10 10\n2 4\n7 4\n9 3\n", "output": "1\n0\n2\n2\n1\n"}, {"type": "stdin_stdout", "input": "5\n2 3\n10 10\n2 4\n4 4\n9 3\n", "output": "1\n0\n2\n0\n1\n"}, {"type": "stdin_stdout", "input": "5\n2 3\n10 10\n2 7\n4 4\n9 3\n", "output": "1\n0\n1\n0\n1\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\nYou are given a string s such th... | [{"type": "stdin_stdout", "input": "12\n11111122222222222223\n122222222222222222333\n33333333331111111122\n11111111133333333333333332\n111111111123333333333\n1\n2\n3\n12\n23\n123\n1111111111111111211111111111111111111111111111111113\n", "output": "15\n19\n10\n18\n3\n0\n0\n0\n0\n0\n3\n36\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\nYou are given a chessboard consi... | [{"type": "stdin_stdout", "input": "5 3 5\n4 4\n3 5\n2 4\n3 4\n3 5\n", "output": "0\n1\n2\n2\n1\n"}, {"type": "stdin_stdout", "input": "5 5 5\n4 4\n3 5\n2 4\n3 4\n3 5\n", "output": "0\n2\n3\n3\n2\n"}, {"type": "stdin_stdout", "input": "5 5 5\n4 4\n3 5\n2 3\n3 3\n3 5\n", "output": "0\n2\n2\n3\n2\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 n strings s_1, s_2... | [{"type": "stdin_stdout", "input": "4\n2\ncaa\ncbb\n3\ncba\ncba\ncbb\n4\nccab\ncbac\nbca\nacbcc\n4\nacb\ncaf\nc\ncbafc\n", "output": "YES\nNO\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "1\n26\na\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk\nl\nm\nn\no\np\nq\nr\ns\nt\nu\nv\nw\nx\ny\nz\n", "output": "NO\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\nThis is the hard version of the ... | [{"type": "stdin_stdout", "input": "5\n2 2\n10\n11\n3 3\n011\n101\n110\n4 4\n1111\n0100\n0100\n1110\n5 5\n00011\n11011\n01010\n11011\n10000\n2 3\n001\n101\n", "output": "1\n1 1 2 1 2 2\n6\n1 2 2 1 2 2\n1 3 2 2 2 3\n3 1 2 2 3 2\n2 2 3 2 3 3\n2 2 2 3 3 3\n2 2 2 3 3 2\n9\n1 1 1 2 2 1\n1 3 1 4 2 3\n2 1 2 2 3 1\n2 3 3 3 3 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\nArgus was charged with guarding ... | [{"type": "stdin_stdout", "input": "8\n4\n1 2 4 5\n3\n1 3 5\n3\n2 6 8\n2\n1 2\n1\n50\n5\n3 4 5 6 8\n3\n1 25 26\n6\n1 2 4 8 16 32\n", "output": "\n4\n2\n3\n1\n0\n5\n3\n15\n"}, {"type": "stdin_stdout", "input": "8\n4\n1 2 4 5\n3\n1 3 5\n3\n2 6 8\n2\n1 2\n1\n50\n5\n3 4 5 6 8\n3\n1 4 26\n6\n1 2 4 8 16 32\n", "output": "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\nYou are given a number n (divisi... | [{"type": "stdin_stdout", "input": "4\n6\n0 2 5 5 4 1\n6\n2 0 2 0 0 0\n9\n14 1 3 4 2 10 3 1 12\n6\n1 1 2 3 4 5\n", "output": "1\n2\n1\n2\n"}, {"type": "stdin_stdout", "input": "4\n6\n0 2 1 4 4 1\n6\n0 0 2 1 0 0\n9\n7 1 3 0 2 12 2 13 5\n6\n1 0 2 10 1 8\n", "output": "3\n3\n0\n2\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\nIn some country live wizards. Th... | [{"type": "stdin_stdout", "input": "10 7 8\n2 4\n3 13\n4 7\n5 1\n6 16\n10 9\n12 18\n16 4\n17 16\n20 6\n", "output": "4.285714285714286\n4.511857892036909\n5.642857142857143\n13.071428571428573\n13.071428571428573\n13.071428571428573\n13.51185789203691\n18.28571428571429\n18.511857892036907\n21.761904761904763\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\nScientists say a lot about the p... | [{"type": "stdin_stdout", "input": "100\n-485 365 -283 769 -58 224 1000 983 13 595 -963 -267 -934 -187 -609 693 -316 431 859 -753 865 -421 861 -728 -793 621 -311 414 -101 -196 120 84 633 -362 989 94 206 19 -949 -629 489 376 -391 165 50 22 -209 735 565 61 -321 -256 890 34 343 -326 984 -268 -609 385 717 81 372 -391 271 -... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPhone number in Berland is a seq... | [{"type": "stdin_stdout", "input": "100\n4004223124942730640235383244438257614581534320356060987241659784249551110165034719443327659510644224\n", "output": "40-04-22-31-24-94-27-30-64-02-35-38-32-44-43-82-57-61-45-81-53-43-20-35-60-60-98-72-41-65-97-84-24-95-51-11-01-65-03-47-19-44-33-27-65-95-10-64-42-24\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\nFarmer John has just given the c... | [{"type": "stdin_stdout", "input": "98\n94 24 17 92 275858941 58 91 57 13 468038892 42 195790073 494005784 8 468106970 518962936 33 27 61 72 42 206673418 10 82 23 34 29 77 90 39 9 67 34 71 29 95 49 48 60 69 86 64 94 77 48 74 19 96700186 5 67 881058074 663483223 64 64 78 23 8 60 7 17 96 71 70 20 5 63 35 34 63 30 86 76 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\nTwo players are playing a game. ... | [{"type": "stdin_stdout", "input": "2 5\n", "output": "3 0 3\n"}, {"type": "stdin_stdout", "input": "2 4\n", "output": "2 1 3\n"}, {"type": "stdin_stdout", "input": "6 5\n", "output": "1 0 5\n"}, {"type": "stdin_stdout", "input": "1 4\n", "output": "2 0 4\n"}, {"type": "stdin_stdout", "input": "4 1\n", "output": "4 0 2... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJzzhu is the president of countr... | [{"type": "stdin_stdout", "input": "3 3 6\n1 2 499999999\n2 3 500000000\n1 3 999999999\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\n2 3 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\nVasya decided to learn to play c... | [{"type": "stdin_stdout", "input": "1000000000\n", "output": "white\n1 2\n"}, {"type": "stdin_stdout", "input": "1000000010\n", "output": "white\n1 2\n"}, {"type": "stdin_stdout", "input": "1823733270\n", "output": "white\n1 2\n"}, {"type": "stdin_stdout", "input": "1381061568\n", "output": "white\n1 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\nAnya has bought a new smartphone... | [{"type": "stdin_stdout", "input": "71 96 75634\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71\n27 26 27 26 27 26 27 26 27 26 27 26 27 26 27 26 27 26 27 26 27 26 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVector Willman and Array Bolt ar... | [{"type": "stdin_stdout", "input": "5000000000000000000 4999999999999999837 4999999999999999963\n", "output": "1249999999999999959/1250000000000000000\n"}, {"type": "stdin_stdout", "input": "5000000000000000000 2229502307241477700 4999999999999999963\n", "output": "2229502307241477699/5000000000000000000\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\nAfter the piece of a devilish mi... | [{"type": "stdin_stdout", "input": "7 4\n1 1 3 3 5 3\n1\n2\n3\n5\n", "output": "3\n2\n3\n6\n"}, {"type": "stdin_stdout", "input": "7 4\n1 1 3 3 4 3\n1\n2\n3\n5\n", "output": "3\n2\n3\n5\n"}, {"type": "stdin_stdout", "input": "7 4\n1 1 3 3 4 3\n1\n4\n3\n5\n", "output": "3\n6\n3\n5\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\nFox Ciel saw a large field while... | [{"type": "stdin_stdout", "input": "31 31 31 4\n15 26\n29 15\n17 31\n29 21\n21 3\n9 27\n19 20\n8 19\n5 4\n1 16\n6 17\n5 24\n1 4\n27 30\n16 24\n14 29\n24 31\n6 20\n2 20\n12 26\n26 15\n23 8\n29 10\n11 8\n3 7\n2 26\n15 10\n15 24\n6 10\n31 22\n12 2\n10 3\n6 24\n23 12\n19 1\n", "output": "Grapes\nCarrots\nCarrots\nCarrots\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\nAttention: we lost all the test ... | [{"type": "stdin_stdout", "input": "100000\n", "output": "199998 2\n1 2"}, {"type": "stdin_stdout", "input": "99971\n", "output": "199940 2\n1 2\n"}, {"type": "stdin_stdout", "input": "65535\n", "output": "131068 2\n1 2\n"}, {"type": "stdin_stdout", "input": "65537\n", "output": "131072 2\n1 2\n"}, {"type": "stdin_stdo... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an array a with n ... | [{"type": "stdin_stdout", "input": "22\n133295371 188010892 71730560 209842234 193069109 184556873 87395258 234247052 230809052 211444018 148989732 17810977 158722706 11753932 100093528 1000000000 43672080 61357581 171830832 13873487 34865589 114340079\n", "output": "148989732 193069109 87395258 211444018 209842234 188... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBash likes playing with arrays. ... | [{"type": "stdin_stdout", "input": "5\n2 4 3 4 5\n6\n1 1 4 2\n2 3 12\n1 1 4 4\n1 1 5 2\n2 5 10\n1 1 5 2\n", "output": "YES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "5\n2 2 3 4 5\n6\n1 1 4 2\n2 3 6\n1 1 4 2\n1 1 5 2\n2 5 10\n1 1 5 2\n", "output": "YES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "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\nThe weather is fine today and he... | [{"type": "stdin_stdout", "input": "1000000000 1000100000\n", "output": "1000099999\n"}, {"type": "stdin_stdout", "input": "1000000000 1000101000\n", "output": "1000100999\n"}, {"type": "stdin_stdout", "input": "1013025570 1803009236\n", "output": "1803009227\n"}, {"type": "stdin_stdout", "input": "649229491 1684787431... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 of positi... | [{"type": "stdin_stdout", "input": "34\n967614464 967614464 1000000000 1000000000 1000000000 1000000000 1000000000 1010000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 wants to buy some citie... | [{"type": "stdin_stdout", "input": "1\n3\n1 2\n2 3\n1 3\n\nSAMPLE", "output": "3\n"}, {"type": "stdin_stdout", "input": "1\n3\n2 2\n2 3\n1 3\n\nSAMPLE", "output": "3\n"}, {"type": "stdin_stdout", "input": "1\n3\n2 3\n2 3\n1 3\n\nSAMPLE", "output": "3\n"}, {"type": "stdin_stdout", "input": "1\n3\n2 3\n2 3\n1 2\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\nRoy frequently needs to use his ... | [{"type": "stdin_stdout", "input": "10\no3fmci,o2p\nc8tllmhzg7\n747kdw9lo3\nsj8cz3cvmo\ns3szaonxca\npir_be2g1p\n23?behplex\nd4hiyu65r6\n6rtnnrjj0!\n7u7mlvsfd0", "output": "36\n35\n42\n39\n36\n33\n35\n38\n31\n38\n"}, {"type": "stdin_stdout", "input": "10\no3fmci,o2p\nc8tllmhzg7\n747kdw9lo3\nsj8cz3cvmo\ns3szaonxca\npir_b... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 f(n) be the number of triple... | [{"type": "stdin_stdout", "input": "743", "output": "0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n0\n0\n0\n1\n6\n0\n3\n0\n0\n0\n0\n0\n3\n3\n6\n0\n0\n3\n0\n0\n0\n0\n3\n3\n6\n0\n6\n0\n0\n0\n3\n0\n0\n1\n6\n0\n6\n6\n0\n0\n6\n0\n0\n0\n0\n3\n3\n3\n6\n0\n6\n3\n6\n0\n0\n0\n6\n0\n0\n0\n3\n3\n9\n0\n6\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\nGiven are a positive integer N a... | [{"type": "stdin_stdout", "input": "2\n1110", "output": "Possible\n20\n0 0\n1 0\n1 1\n2 1\n2 0\n1 0\n0 0\n0 1\n1 1\n1 0\n0 0\n1 0\n2 0\n2 1\n1 1\n1 0\n0 0\n1 0\n1 1\n0 1\n0 0\n"}, {"type": "stdin_stdout", "input": "2\n1100", "output": "Possible\n6\n0 0\n1 0\n1 1\n2 1\n2 0\n1 0\n0 0\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 squirrel Chokudai has N acor... | [{"type": "stdin_stdout", "input": "23\n1 2 1\n20 1 10", "output": "920\n"}, {"type": "stdin_stdout", "input": "23\n1 2 4\n10 1 4", "output": "460\n"}, {"type": "stdin_stdout", "input": "23\n1 12 1\n1 1 1", "output": "276\n"}, {"type": "stdin_stdout", "input": "23\n2 11 1\n2 1 2", "output": "506\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\nYou have three tasks, all of whi... | [{"type": "stdin_stdout", "input": "100 100 000", "output": "100\n"}, {"type": "stdin_stdout", "input": "100 111 000", "output": "111\n"}, {"type": "stdin_stdout", "input": "100 111 001", "output": "110\n"}, {"type": "stdin_stdout", "input": "100 111 010", "output": "101\n"}, {"type": "stdin_stdout", "input": "110 001 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 500-yen coins, B 100-... | [{"type": "stdin_stdout", "input": "30\n40\n77\n6000", "output": "293\n"}, {"type": "stdin_stdout", "input": "30\n47\n77\n6000", "output": "319\n"}, {"type": "stdin_stdout", "input": "30\n112\n134\n6415", "output": "0\n"}, {"type": "stdin_stdout", "input": "30\n112\n134\n8208", "output": "0\n"}, {"type": "stdin_stdout"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N towns in the State o... | [{"type": "stdin_stdout", "input": "4 6 3\n2 3 4\n1 2 4\n2 3 6\n4 3 1\n1 4 1\n4 2 2\n3 1 6", "output": "3\n"}, {"type": "stdin_stdout", "input": "4 6 3\n2 3 4\n1 2 4\n2 3 6\n4 3 1\n1 4 1\n4 1 2\n3 1 6", "output": "7\n"}, {"type": "stdin_stdout", "input": "4 6 3\n2 3 4\n1 2 4\n2 3 6\n4 4 1\n1 4 1\n4 2 2\n3 1 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\nWe will call a string x good if ... | [{"type": "stdin_stdout", "input": "2014", "output": "38\n19 17 15 13 11 8 6 4 2 1 3 5 7 9 10 12 14 16 18 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19\n"}, {"type": "stdin_stdout", "input": "3302", "output": "36\n18 16 14 10 8 6 2 1 3 4 5 7 9 11 12 13 15 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18\n"}, {"type": ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a permutation p of... | [{"type": "stdin_stdout", "input": "3\n2 3 1", "output": "5 10 100\n100 10 1"}, {"type": "stdin_stdout", "input": "3\n0 -1 -2", "output": "3 5 6\n6 3 1\n"}, {"type": "stdin_stdout", "input": "3\n-2 -1 0", "output": "1 3 6\n6 5 3\n"}, {"type": "stdin_stdout", "input": "3\n0 -2 -1", "output": "2 5 6\n6 4 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\nWrite a program that extracts n ... | [{"type": "stdin_stdout", "input": "4 14\n3 1\n0 0", "output": "13\n0\n"}, {"type": "stdin_stdout", "input": "3 10\n5 -2\n0 0", "output": "8\n0\n"}, {"type": "stdin_stdout", "input": "2 -1\n13 1\n0 0", "output": "0\n0\n"}, {"type": "stdin_stdout", "input": "3 -1\n13 1\n0 0", "output": "0\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\nAn autumn sports festival is hel... | [{"type": "stdin_stdout", "input": "8\n65541 3 20 3 8 6 27 2 25\n20941 3 5 2 41 7 19 2 42\n90585 4 8 3 12 11 46 2 34\n92201 3 28 2 47 6 37 2 58\n10001 3 50 2 42 7 12 4 54\n63812 4 11 3 11 6 98 2 22\n54092 3 33 2 54 6 18 2 19\n25012 3 44 2 58 6 45 2 46\n4\n1 3 23 1 23 1 34 4 69\n2 5 12 2 12 3 41 2 29\n3 5 24 1 24 2 0 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\nproblem\n\nAt the JOI pasta shop... | [{"type": "stdin_stdout", "input": "800\n1126\n900\n198\n330", "output": "948\n"}, {"type": "stdin_stdout", "input": "800\n1126\n900\n132\n330", "output": "882\n"}, {"type": "stdin_stdout", "input": "800\n1126\n206\n132\n330", "output": "288\n"}, {"type": "stdin_stdout", "input": "800\n1126\n180\n132\n330", "output": "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAfter having drifted about in a ... | [{"type": "stdin_stdout", "input": "2 1 1\n1 1 nn\n2 1 np\n3 2 1\n1 1 yes\n2 2 yes\n3 1 yes\n2 4 1\n1 2 yes\n2 3 no\n5 4 3\n1 2 yes\n1 3 no\n4 5 yes\n5 6 yes\n6 7 no\n0 0 0", "output": "no\n1\n3\nend\n1\n2\n4\n5\nend\n3\n4\n5\n6\nend\n"}, {"type": "stdin_stdout", "input": "2 1 1\n1 1 nn\n2 1 np\n3 2 1\n1 1 yes\n2 2 yes... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n4 3\n1000 1\... | [{"type": "stdin_stdout", "input": "25 1\n1010 1\n3784 7\n3000 6", "output": "2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n"}, {"type": "stdin_stdout", "input": "25 2\n1011 2\n2889 1\n308 2", "output": "3 3 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n"}, {"type": "stdin_stdout", "input": "20 3\n0010 1\n4107 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\nC: Acrophobia\n\nYayoi Takasugi ... | [{"type": "stdin_stdout", "input": "3 4\nM.S\n...\n...\nM.G", "output": "7\n"}, {"type": "stdin_stdout", "input": "3 4\nM.S\n...\n...\nG.M", "output": "9\n"}, {"type": "stdin_stdout", "input": "3 4\nS.N\n...\n...\nM.G", "output": "5\n"}, {"type": "stdin_stdout", "input": "3 4\nM.S\n...\n...\nMG.", "output": "6\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\nC --Dowsing Machine\n\nStory\n\n... | [{"type": "stdin_stdout", "input": "6 10 3 4\n##########\n#........#\n#...D....\"\n\"....-...#\n#........#\n####\"#####\n2 4 11\n3 0 -1\n7 10 2\n15 4 3\n0 8 1", "output": "Broken\n"}, {"type": "stdin_stdout", "input": "6 10 -1 4\n##########\n#........#\n#...D....\"\n\"....-...#\n#........#\n####\"#####\n2 4 11\n3 0 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\nB: 階層的計算機 (Hierarchical Calculat... | [{"type": "stdin_stdout", "input": "4\n-1 2 -2 2", "output": "4\n1\n2\n3\n4\n"}, {"type": "stdin_stdout", "input": "4\n2 -1 -2 -1", "output": "3\n1\n2\n3\n"}, {"type": "stdin_stdout", "input": "4\n2 -1 -2 1", "output": "3\n1\n2\n3\n"}, {"type": "stdin_stdout", "input": "4\n-1 -2 0 2", "output": "3\n1\n2\n4\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\nDraw a rectangle which has a hei... | [{"type": "stdin_stdout", "input": "8 2\n5 22\n4 -2\n0 0", "output": "##\n##\n##\n##\n##\n##\n##\n##\n\n######################\n######################\n######################\n######################\n######################\n\n\n\n\n\n\n"}, {"type": "stdin_stdout", "input": "3 4\n15 6\n2 4\n0 0", "output": "####\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\nKattapa, as you all know was one... | [{"type": "stdin_stdout", "input": "5\n12 -1 -2 -2 -2", "output": "READY FOR BATTLE\n"}, {"type": "stdin_stdout", "input": "5\n2 -1 -2 -2 -2", "output": "READY FOR BATTLE\n"}, {"type": "stdin_stdout", "input": "5\n2 -1 -1 -2 -2", "output": "READY FOR BATTLE\n"}, {"type": "stdin_stdout", "input": "5\n4 -1 -1 -2 -2", "ou... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an integer sequenc... | [{"type": "stdin_stdout", "input": "15 2\n1 2 3 1 2 3 1 2 3 1 2 3 1 2 3\n", "output": "97\n"}, {"type": "stdin_stdout", "input": "15 1\n1 2 3 1 2 3 1 2 3 1 2 3 1 2 3\n", "output": "18\n"}, {"type": "stdin_stdout", "input": "15 1\n1 2 3 0 2 3 1 2 3 1 2 3 1 2 3\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "15... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an array a, consis... | [{"type": "stdin_stdout", "input": "100 3\n14717 1461 5753 7023 6804 1826 8793 9148 9920 240 8768 15059 11439 2732 794 959 9744 2253 3273 4685 4730 6873 11982 2875 1303 2535 4901 147 8587 339 4792 154 3104 6020 10358 5537 2686 6208 9494 1826 8083 1269 1841 6210 538 3105 4092 5163 9696 9013 2153 3985 2787 4471 1170 4991... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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...Once upon a time a man came t... | [{"type": "stdin_stdout", "input": "100 66\n41 14\n19 13\n70 43\n79 62\n9 62\n71 40\n53 86\n80 4\n34 33\n72 68\n40 96\n84 59\n36 77\n55 50\n40 3\n79 81\n3 83\n33 47\n22 98\n33 90\n56 49\n69 28\n73 30\n65 22\n98 20\n9 52\n69 20\n32 70\n51 80\n63 12\n21 48\n35 17\n48 87\n25 43\n65 80\n42 3\n86 17\n95 98\n43 59\n51 46\n66... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 got an array consistin... | [{"type": "stdin_stdout", "input": "10 42 7\n-1 -1 -1 -1 -1 -1 -1 -1 -1 -1\n", "output": "645711643\n"}, {"type": "stdin_stdout", "input": "10 32 7\n-1 -1 -1 -1 -1 -1 -1 -1 -1 -1\n", "output": "61884984"}, {"type": "stdin_stdout", "input": "10 32 1\n-1 -1 -1 -1 -1 -1 -1 -1 -1 -1\n", "output": "0"}, {"type": "stdin_stdo... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecently a Golden Circle of Beet... | [{"type": "stdin_stdout", "input": "100000 100000\n50000 6424\n", "output": "1250000000 1250000000\n"}, {"type": "stdin_stdout", "input": "100000 101000\n50000 6424\n", "output": "39453125 1262500000\n"}, {"type": "stdin_stdout", "input": "98752 97209\n41218 39020\n", "output": "21427641 3199861056\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\nAlice and Bob are playing a game... | [{"type": "stdin_stdout", "input": "50 75\n2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "50 75\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 products in the shop... | [{"type": "stdin_stdout", "input": "5\n8 19551489\n31131899 17585660 3913937 14521321 9846714 96097161 115568124 35051437\n1 93900441\n15578410\n7 19560555\n124492495 53703939 20259503 99698023 98868060 83313210 5487534\n6 72321938\n59271765 72426489 16625497 51598082 31475864 20946400\n7 44965081\n49955408 62397026 39... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAmugae is in a very large round ... | [{"type": "stdin_stdout", "input": "1 1 10\n1 1 1 1\n1 1 1 1\n1 1 2 1\n1 1 1 1\n2 1 2 1\n2 1 1 1\n1 1 2 1\n1 1 2 1\n2 1 1 1\n2 1 1 1\n", "output": "YES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "999999937 999999874000003969 1\n1 1940776430 2 983249032983207370\n", "output": "NO... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nUjan has a lot of useless stuff ... | [{"type": "stdin_stdout", "input": "15 10\n2 3\n5 4\n5 6\n5 7\n3 8\n3 10\n11 12\n12 13\n13 14\n14 15\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "15 10\n2 3\n5 4\n5 4\n5 7\n3 8\n3 10\n11 12\n12 13\n13 14\n14 15\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "15 10\n2 3\n5 4\n5 4\n5 7\n3 7\n3 10\n11... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 n and... | [{"type": "stdin_stdout", "input": "11\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n", "output": "YES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "11\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n4 2\n8 2\n4 2\n", "output": "YES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLeo has developed a new programm... | [{"type": "stdin_stdout", "input": "16\n1 1 1\n3 4 6\n4 5 16\n456 123 7890123\n1 1 1000000000\n45 12 782595420\n1 1000000000 1001000000\n1 999999999 1000000100\n1 99999 676497416\n5 6 1409378894\n8 9 1376775908\n500000000 500000000 1000000000\n1000000000 1000000000 1000000000\n999999999 1000000000 1000000000\n1066 1487... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's call left cyclic shift of ... | [{"type": "stdin_stdout", "input": "3\n142345\n100120013\n253858690946\n", "output": "4\n5\n8\n"}, {"type": "stdin_stdout", "input": "3\n175995\n155501496\n289014129764\n", "output": "4\n6\n8\n"}, {"type": "stdin_stdout", "input": "3\n142345\n100120013\n339309424207\n", "output": "4\n5\n8\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\nYou have a string s consisting o... | [{"type": "stdin_stdout", "input": "5\n6\n111010\n1\n0\n1\n1\n2\n11\n6\n101010\n", "output": "3\n1\n1\n1\n3\n"}, {"type": "stdin_stdout", "input": "5\n6\n111010\n1\n1\n1\n1\n2\n11\n6\n101010\n", "output": "3\n1\n1\n1\n3\n"}, {"type": "stdin_stdout", "input": "5\n6\n111000\n1\n1\n1\n1\n2\n11\n6\n101010\n", "output": "2\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a binary string a of le... | [{"type": "stdin_stdout", "input": "5\n10\n0111010000\n0100101100\n4\n0000\n0000\n3\n001\n000\n12\n010101010101\n100110011010\n6\n000111\n110100\n", "output": "\nYES\nYES\nNO\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "5\n10\n0111010000\n0100101100\n4\n0000\n0000\n3\n000\n000\n12\n010101010101\n100110011010\n6\n00... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nParsa has a humongous tree on n ... | [{"type": "stdin_stdout", "input": "3\n2\n2 10\n6 6\n1 2\n3\n1 3\n13 6\n7 15\n1 2\n2 3\n6\n10 14\n12 20\n21 19\n2 12\n10 17\n3 17\n3 2\n6 5\n1 5\n2 6\n4 6\n", "output": "4\n18\n48\n"}, {"type": "stdin_stdout", "input": "3\n2\n0 6\n3 13\n1 2\n3\n1 3\n10 6\n12 9\n1 2\n2 3\n6\n3 14\n9 20\n12 19\n1 12\n11 17\n3 17\n3 3\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\nThere are n piles of stones of s... | [{"type": "stdin_stdout", "input": "2\n2 9\n5\n4 10 7 3 4\n", "output": " 2 2 2 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLenny is playing a game on a 3 ×... | [{"type": "stdin_stdout", "input": "62 74 119\n116 74 189\n2 47 95\n", "output": "101\n110\n010\n"}, {"type": "stdin_stdout", "input": "68 79 52\n51 39 100\n29 14 26\n", "output": "110\n000\n111\n"}, {"type": "stdin_stdout", "input": "68 79 52\n67 39 100\n29 14 26\n", "output": "110\n000\n111\n"}, {"type": "stdin_stdou... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe city Valera lives in is goin... | [{"type": "stdin_stdout", "input": "10\n1 10 2\n10 7 2\n10 8 2\n9 7 2\n8 6 2\n7 5 2\n6 4 2\n5 3 2\n4 2 2\n", "output": "3\n2 3 9\n"}, {"type": "stdin_stdout", "input": "10\n3 9 1\n2 10 2\n1 7 1\n3 4 1\n7 8 2\n1 2 1\n5 3 1\n5 6 2\n2 3 2\n", "output": "3\n6 8 10\n"}, {"type": "stdin_stdout", "input": "10\n1 9 1\n3 2 2\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\n'Jeopardy!' is an intellectual g... | [{"type": "stdin_stdout", "input": "50 30\n6015200 8643865 4116771 6555197 304415 8580071 8414182 3089212 5684567 7595481 1272699 7127763 3309618 1410297 4349070 2027355 136702 6863504 1800751 5585842 5924142 5188269 4805201 9313209 8941399 5137060 4983630 8467668 1646260 7804684 8646497 7067118 6896291 9109696 6197162... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 kilometer long auto race... | [{"type": "stdin_stdout", "input": "9 81812\n8 31 410 547 18 22 77 449 5 491 8 10 382 746 21 61 523\n1 452 181\n1 724 113\n1 113 724\n1 226 362\n46 5 257 2 126 373 6 6 491 9 7 137 23 93 73 163 13 17 106 3 100 5 415 270 2 7 723 597 4 176 3 274 18 1 852 334 14 7 25 163 1 3 199 29 140 32 32 191 2 583 3 23 11 22 23 250 1 7... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAppleman has n cards. Each card ... | [{"type": "stdin_stdout", "input": "100 100\nMQSBDAJABILIBCUEOWGWCEXMUTEYQKAIWGINXVQEOFDUBSVULROQHQRZZAALVQFEFRAAAYUIMGCAFQGIAEFBETRECGSFQJNXHHDN\n", "output": "514\n"}, {"type": "stdin_stdout", "input": "100 90\nFAFAOOAOOAFAOTFAFAFFATAAAOFAAOAFBAAAFBOAOFFFOAOAFAPFOFAOFAAFOAAAAFAAFOFAAOFPPAAOOAAOOFFOFFFOFAOTOFAF\n", "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\nFor a positive integer n let's d... | [{"type": "stdin_stdout", "input": "1000000000000000\n", "output": "500000000000000\n"}, {"type": "stdin_stdout", "input": "999999999999999\n", "output": "-500000000000000\n"}, {"type": "stdin_stdout", "input": "1000000000000100\n", "output": "500000000000050\n"}, {"type": "stdin_stdout", "input": "1100000000000100\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 on-board computer on Polycar... | [{"type": "stdin_stdout", "input": "100 100\n100 10\n", "output": "34500\n"}, {"type": "stdin_stdout", "input": "100 100\n100 0\n", "output": "10000\n"}, {"type": "stdin_stdout", "input": "100 100\n100 1\n", "output": "12450\n"}, {"type": "stdin_stdout", "input": "100 101\n100 1\n", "output": "12500\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\nToday on a lecture about strings... | [{"type": "stdin_stdout", "input": "yhwepqwyhwepqwyhwepqweahnqtueahnqtueahnqtuyhwepqwyhwepqwyhwepqwyhwepqweahnqtueahnqtuyhwepqweahnqtueahnqtueahnqtueahnqtueahnqtueahnqtu\neahnqtueahnqtueahnqtuyhwepqweahnqtuyhwepqwyhwepqweahnqtuyhwepqweahnqtuyhwepqweahnqtueahnqtuyhwepqweahnqtueahnqtuyhwepqwyhwepqwyhwepqw\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\nMikhail the Freelancer dreams of... | [{"type": "stdin_stdout", "input": "10 468662 93838\n589910 727627\n279516 867207\n470524 533177\n467834 784167\n295605 512137\n104422 629804\n925609 728473\n922365 500342\n998983 958315\n425628 935048\n", "output": "0.46913911413370062986\n"}, {"type": "stdin_stdout", "input": "10 468662 93838\n589910 727627\n279516 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\nConsider a linear function f(x) ... | [{"type": "stdin_stdout", "input": "1377612828 606974665 846646545585165081 745145208\n", "output": "891861122\n"}, {"type": "stdin_stdout", "input": "978837295 606974665 846646545585165081 745145208\n", "output": "154788991\n"}, {"type": "stdin_stdout", "input": "1 1000000000 1000000000000000000 1000000000\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\n\"Night gathers, and now my watc... | [{"type": "stdin_stdout", "input": "205\n5 5 3 3 6 2 9 3 8 9 6 6 10 8 1 5 3 3 1 2 9 9 9 3 9 10 3 9 8 3 5 6 6 4 6 9 2 9 10 9 5 6 6 7 4 2 6 3 4 1 10 1 7 2 7 7 3 2 6 5 5 2 9 3 8 8 7 6 6 4 2 2 6 2 3 5 7 2 2 10 1 4 6 9 2 3 7 2 2 7 4 4 9 10 7 5 8 6 5 3 6 10 2 7 5 6 6 8 3 3 9 4 3 5 7 9 3 2 1 1 3 2 1 9 3 1 4 4 10 2 5 5 8 1 4 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\nSome people leave the lights at ... | [{"type": "stdin_stdout", "input": "6 77\n0111111110101011111111111111111111111111111111111111100111111111101111111111110\n0111111111111111111101111101111111111011111111011111111001011111111111101111110\n0111101111111111111111111111111111111110110011111111111011111111101111111111110\n01111101111111111111111111111111111... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMayor of city S just hates trees... | [{"type": "stdin_stdout", "input": "10\n21005 10850\n27020 13372\n28183 3724\n22874 13564\n27446 11493\n22522 10012\n24819 11529\n24166 11084\n24539 9211\n24152 9235\n", "output": "71869\n31855 31856 31857 31858 31859 31860 31861 31862 31863 31864 \n"}, {"type": "stdin_stdout", "input": "10\n21005 10850\n27020 13372\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\nConsider a [billiard table](http... | [{"type": "stdin_stdout", "input": "1000000000 999999999 999999998 999999999 -1 -1\n", "output": "1000000000 999999999\n"}, {"type": "stdin_stdout", "input": "1000000000 999999999 999999998 999999999 -1 1\n", "output": "1000000000 999999999\n"}, {"type": "stdin_stdout", "input": "1000000000 999999999 999999998 30402322... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAshima's mid term exams are just... | [{"type": "stdin_stdout", "input": "1272\n4 65 44\n5 47 2\n0 59 20\n2 41 14\n2 30 17\n2 26 22\n3 44 6\n4 65 10\n5 27 1\n6 0 31\n3 47 1\n6 16 26\n3 30 2\n7 49 12\n1 6 34\n7 48 9\n4 23 4\n7 7 7\n6 38 22\n3 34 32\n6 66 28\n3 61 2\n1 33 6\n3 11 33\n2 62 17\n7 52 29\n5 48 30\n2 30 18\n3 60 15\n7 38 5\n2 26 24\n7 51 29\n4 25... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRufus wants to go to the Lily's ... | [{"type": "stdin_stdout", "input": "2\n3 10\n1 16\n\nSAMPLE", "output": "INVALID\nINVALID\n"}, {"type": "stdin_stdout", "input": "2\n1 16\n2 14\n\nSAMPLE", "output": "INVALID\nINVALID\n"}, {"type": "stdin_stdout", "input": "2\n7 11\n1 20\n\nELPMAS", "output": "INVALID\nINVALID\n"}, {"type": "stdin_stdout", "input": "2\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a grid of N rows a... | [{"type": "stdin_stdout", "input": "3 1\n10 10 1\n10 10 1\n1 1 10", "output": "30\nX..\n.X.\n..X\n"}, {"type": "stdin_stdout", "input": "3 2\n10 10 1\n10 10 1\n2 1 10", "output": "50\nXX.\nXX.\n..X\n"}, {"type": "stdin_stdout", "input": "3 2\n10 10 1\n10 10 1\n1 1 17", "output": "57\nXX.\nXX.\n..X\n"}, {"type": "stdin_... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.