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\nInternational Coding Procedures ...
[{"type": "stdin_stdout", "input": "8\n< > << >> in out fun in>>out\n6\n# let's rock\nin>>out in >> out inout>>outin bin>>out # yay!\nfun>>in>>out funin>>out out>>in <in> > <out>\nin> >> >>> >>>> >>>>>out\n# what's going on here?\n<> <> <> <> <fun> <funfun> <not so fun>\n", "output": "in>>outin>> out a>>b c>>out fun>>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\nn! = n Γ— (n βˆ’ 1) Γ— (n βˆ’ 2) Γ— ......
[{"type": "stdin_stdout", "input": "2\n51\n11000\n0", "output": "0\n12\n2748\n"}, {"type": "stdin_stdout", "input": "2\n58\n10011\n0", "output": "0\n13\n2501\n"}, {"type": "stdin_stdout", "input": "2\n59\n10111\n0", "output": "0\n13\n2525\n"}, {"type": "stdin_stdout", "input": "2\n62\n10110\n0", "output": "0\n14\n2525\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Tower of Hanoi is a well-kno...
[{"type": "stdin_stdout", "input": "0 10000 10000\n10000 0 10000\n10000 10000 0\n40\n", "output": "10995116277750000\n"}, {"type": "stdin_stdout", "input": "0 10000 10000\n10000 0 10000\n10000 10000 0\n40\n", "output": "10995116277750000\n"}, {"type": "stdin_stdout", "input": "0 00000 10000\n10000 0 10000\n10000 10000 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDo you have in mind the good old...
[{"input": "[\"1\", \"2\", \"3\", \"4\", \"5\", \"1\", \"2\", \"3\", \"4\", \"5\", \"1\", \"2\", \"3\", \"4\", \"5\", \"1\", \"2\", \"3\", \"4\", \"5\", \"1\", \"2\", \"3\", \"4\", \"5\", \"1\", \"2\", \"3\", \"4\", \"5\", \"1\", \"2\", \"3\", \"4\", \"5\", \"1\"]\n6", "output": "[\" 1 | 2 | 3 | 4 | 5 | 1 \\n----------...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nN people run a marathon. There a...
[{"type": "stdin_stdout", "input": "3 2 100\n-1 2 2\n50 -1 1\n83 2 2", "output": "0.9767033300\n0.0000000000\n-0.0005526700\n"}, {"type": "stdin_stdout", "input": "3 5 010\n-1 2 2\n55 0 1\n22 2 2", "output": "0.7318185458\n-0.0000007555\n-0.0143144522\n"}, {"type": "stdin_stdout", "input": "3 3 111\n-1 1 2\n1 0 2\n126 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nArpa is researching the Mexican ...
[{"type": "stdin_stdout", "input": "1000000000 1000000000 1000000000\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000 1000000000\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000 1400000000\n", "output": "600000000\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\nPak Chanek has $n$ blank heart-s...
[{"type": "stdin_stdout", "input": "15\n1 1 2 2 3 4 4 5 6 7 7 8 9 10\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "8\n1 1 3 3 5 5 7\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "7\n1 1 3 3 5 5\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "6\n1 2 1 4 2\n", "output": "4\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\nA robot is standing at the origi...
[{"type": "stdin_stdout", "input": "1000\n", "output": "251001\n"}, {"type": "stdin_stdout", "input": "1000\n", "output": "251001\n"}, {"type": "stdin_stdout", "input": "777\n", "output": "303420\n"}, {"type": "stdin_stdout", "input": "998\n", "output": "250000\n"}, {"type": "stdin_stdout", "input": "999\n", "output": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs a tradition, every year befor...
[{"type": "stdin_stdout", "input": "0110011110111000001101001010101000011011101001001101000000111101010101111101010011101001111010111001\n", "output": "416862683\n"}, {"type": "stdin_stdout", "input": "0111001111110010000001111100110100111110001100100001111111110000010010111010010010010111000110001111\n", "output": "77...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDemiurges Shambambukli and Mazuk...
[{"type": "stdin_stdout", "input": "50\n1 2\n2 3\n3 4\n4 5\n5 6\n6 7\n7 8\n8 9\n9 10\n10 11\n11 12\n12 13\n13 14\n14 15\n15 16\n16 17\n17 18\n18 19\n19 20\n20 21\n21 22\n22 23\n23 24\n24 25\n25 26\n26 27\n27 28\n28 29\n29 30\n30 31\n31 32\n32 33\n33 34\n34 35\n35 36\n36 37\n37 38\n38 39\n39 40\n40 41\n41 42\n42 43\n43 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCreate a function which checks a...
[{"input": "179424693", "output": "[[false, false, false]]", "fn_name": "number_property"}, {"input": "179424691", "output": "[[true, false, false]]", "fn_name": "number_property"}, {"input": "25", "output": "[[false, false, false]]", "fn_name": "number_property"}, {"input": "131", "output": "[[true, false, false]]", "...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 set $S$ of integers, perfo...
[{"type": "stdin_stdout", "input": "7\n0 -1\n0 2\n0 6\n1 2\n0 -1\n0 -1\n1 20", "output": "1\n2\n3\n1\n3\n3\n0\n"}, {"type": "stdin_stdout", "input": "7\n0 -1\n0 2\n0 5\n1 2\n0 -1\n1 0\n1 20", "output": "1\n2\n3\n1\n3\n0\n0\n"}, {"type": "stdin_stdout", "input": "7\n0 -1\n0 2\n0 6\n1 2\n0 -1\n0 0\n1 20", "output": "1\n2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMaria participates in a bicycle ...
[{"type": "stdin_stdout", "input": "24\n-10000 -10000\n-10000 9998\n9998 9998\n9998 -10000\n-6364 -10000\n-6364 6362\n6362 6362\n6362 -6364\n-2728 -6364\n-2728 2726\n2726 2726\n2726 -910\n908 -910\n908 908\n-910 908\n-910 -4546\n4544 -4546\n4544 4544\n-4546 4544\n-4546 -8182\n8180 -8182\n8180 8180\n-8182 8180\n-8182 -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\nYou've got a robot, its task is ...
[{"type": "stdin_stdout", "input": "24\n-2 -2\n-1 1\n0 1\n1 1\n0 2\n1 -1\n2 -2\n1 -4\n-1 1\n0 -2\n0 -2\n-2 0\n-2 -1\n2 -1\n2 2\n-1 -2\n-2 1\n2 0\n-1 2\n1 2\n-1 -1\n1 0\n2 1\n-2 2\n", "output": "130\n1 1 U\n2\n1 1 D\n3\n1 1 R\n2\n1 1 L\n3\n1 1 L\n1 1 U\n2\n1 1 R\n1 1 D\n3\n1 1 R\n1 1 U\n2\n1 1 L\n1 1 D\n3\n1 2 U\n2\n1 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet $f(x)$ be the sum of digits ...
[{"type": "stdin_stdout", "input": "7\n1 0\n2 1\n42 7\n1 9\n64 0\n99 0\n99 2\n", "output": "1\n-1\n4\n-1\n19999999\n99999999999\n7997\n"}, {"type": "stdin_stdout", "input": "7\n1 0\n1 1\n42 7\n1 9\n64 0\n99 0\n99 2\n", "output": "1\n0\n4\n-1\n19999999\n99999999999\n7997\n"}, {"type": "stdin_stdout", "input": "7\n1 0\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\nAlmost every text editor has a b...
[{"type": "stdin_stdout", "input": "8\n\n\n\ny\nW\n\n\n\n3B\n\nw\nV\n\n\n\nL\nSr\n\n\nV\n\n5\n\nAq\n\n\n\nJ\nR\n\n04\nJ\nv\nUh\n\n\n\nY\nG\n4\n\nG\nb\n\n\n9\n\n6\nd\n\n2\n\n\nE\n7\n\nr\n\n\n\n\nKC\ns\nE\n\nab\n4\nx\n\n\n\n\n\nEe\n4\n\nl\n\np\n\nG\nM\n\n\nn\n\n\nm0\n\nw\n\n\nP\n\n\n\n0\n\n\n", "output": "****\n*8 *\n* ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJohnny is a farmer and he annual...
[{"input": "0", "output": "[1]", "fn_name": "get_participants"}, {"input": "1", "output": "[2]", "fn_name": "get_participants"}, {"input": "3", "output": "[3]", "fn_name": "get_participants"}, {"input": "6", "output": "[4]", "fn_name": "get_participants"}, {"input": "7", "output": "[5]", "fn_name": "get_participants"}]
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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< PREVIOUS KATA\nNEXT KATA >\n\n...
[{"input": "10\n-2999", "output": "[\"1 1\\n 2 2 \\n 3 3 \\n 4 4 \\n 5 5 \\n 6 6 \\n 7 7 \\n 8 8 \\n 9 9 \\n 0 \\n 9 9 \\n 8 8 \\n 7 7 ...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 the top spy of AtCoder K...
[{"type": "stdin_stdout", "input": "32\n3 1 8 1 5 9 4 2 3 3 9 8 11 7 16 4 2 4 8 2 4 4 7 7 3 3 30 4 4 7 2 8", "output": "13\n"}, {"type": "stdin_stdout", "input": "32\n3 1 8 1 5 2 7 2 3 3 9 8 11 7 16 4 2 4 8 2 4 4 7 7 3 3 30 4 4 7 2 8", "output": "12\n"}, {"type": "stdin_stdout", "input": "32\n3 1 4 1 8 11 8 6 5 3 5 8 9...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJafar has n cans of cola. Each c...
[{"type": "stdin_stdout", "input": "10\n15 26 15 14 14 39 40 4 25 39\n27 72 16 44 69 48 53 17 63 42\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "10\n15 26 15 14 14 39 40 4 25 39\n27 72 16 44 69 48 53 17 63 42\n", "output": "no\n"}, {"type": "stdin_stdout", "input": "10\n15 26 15 14 14 39 40 5 25 39\n27 72 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 long seat of width X c...
[{"type": "stdin_stdout", "input": "100010 0 -1", "output": "-100011\n"}, {"type": "stdin_stdout", "input": "64146 123 456\n", "output": "110\n"}, {"type": "stdin_stdout", "input": "64145 123 456\n", "output": "109\n"}, {"type": "stdin_stdout", "input": "100000 1 1\n", "output": "49999\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\nYou have a simple undirected gra...
[{"type": "stdin_stdout", "input": "21 35\n1 4\n2 4\n1 5\n2 5\n1 6\n2 6\n1 7\n2 7\n1 8\n2 8\n1 9\n2 9\n1 10\n2 10\n1 11\n2 11\n1 12\n2 12\n1 13\n2 13\n1 14\n2 14\n1 15\n2 15\n1 16\n2 16\n1 17\n2 17\n1 18\n2 18\n1 19\n2 19\n1 20\n2 20\n3 21\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "21 35\n1 4\n2 4\n1 5\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\nOne foggy Stockholm morning, Kar...
[{"type": "stdin_stdout", "input": "15\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "15\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "8\n0 1\n1 0\n0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe time on the planet Lapitulet...
[{"type": "stdin_stdout", "input": "15\n1 1\n00:00\n1 100\n00:01\n100 100\n02:82\n10 10\n04:04\n100 100\n99:00\n100 2\n30:00\n50 3\n30:00\n51 3\n30:01\n52 16\n21:12\n100 20\n20:07\n23 100\n21:45\n11 11\n02:02\n89 89\n88:86\n100 1\n01:00\n1 100\n00:01\n", "output": "00:00\n00:00\n02:82\n00:00\n00:00\n00:00\n00:00\n50: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\nPetya loves lucky numbers. We al...
[{"type": "stdin_stdout", "input": "99994\n", "output": "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabc...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 trampoline park with ...
[{"type": "stdin_stdout", "input": "3\n7\n1 2 10 2 2 2 2\n2\n2 1\n5\n1 1 1 2 1\n", "output": "10\n1\n1\n"}, {"type": "stdin_stdout", "input": "3\n7\n2 4 3 2 2 13 2\n2\n3 3\n5\n1 1 1 1 2\n", "output": "13\n4\n1\n"}, {"type": "stdin_stdout", "input": "3\n7\n3 4 3 2 2 24 2\n2\n3 3\n5\n1 1 1 1 2\n", "output": "24\n4\n1\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 get an array of numbers, ret...
[{"input": "[-1, -2, -3, -4, -5]", "output": "[0]", "fn_name": "positive_sum"}, {"input": "[1, -2, 3, 4, 5]", "output": "[13]", "fn_name": "positive_sum"}, {"input": "[-1, 2, 3, 4, -5]", "output": "[9]", "fn_name": "positive_sum"}, {"input": "[1, 2, 3, 4, 5]", "output": "[15]", "fn_name": "positive_sum"}, {"input": "[]...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 is going to publish a p...
[{"type": "stdin_stdout", "input": "10\npetr\negor\nendagorion\nfeferivan\nilovetanyaromanova\nkostka\ndmitriyh\nmaratsnowbear\nbredorjaguarturnik\ncgyforever\n", "output": "aghjlnopefikdmbcqrstuvwxyz\n"}, {"type": "stdin_stdout", "input": "10\npetr\nroge\nendagorion\nfeferivan\nilovetanyaromanova\nkostka\ndmitriyh\nma...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMike is trying rock climbing but...
[{"type": "stdin_stdout", "input": "100\n2 43 47 49 50 57 59 67 74 98 901 903 904 906 907 908 909 910 911 912 913 914 915 916 917 1525 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 938 939 940 942 943 944 945 946 947 948 949 950 952 953 954 956 957 1027 959 960 961 962 963 965 966 967 968 969 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 is a great fan of telev...
[{"type": "stdin_stdout", "input": "5\n15 18\n23 24\n23 28\n26 24\n15 19\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "5\n15 18\n23 24\n23 11\n26 24\n15 19\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "5\n15 18\n23 24\n23 28\n22 24\n15 19\n", "output": "NO\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 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\n# A History Lesson\n\nSoundex is...
[{"input": "\"Sayra Cunnarr\"", "output": "[\"S600 C560\"]", "fn_name": "soundex"}, {"input": "\"Sarah Connor\"", "output": "[\"S600 C560\"]", "fn_name": "soundex"}, {"input": "\"Serah Coner\"", "output": "[\"S600 C560\"]", "fn_name": "soundex"}, {"input": "\"Sarh Connor\"", "output": "[\"S600 C560\"]", "fn_name": "sou...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 an electric circuit, when two...
[{"type": "stdin_stdout", "input": "001 230", "output": "0.995670995671\n"}, {"type": "stdin_stdout", "input": "001 379", "output": "0.997368421053\n"}, {"type": "stdin_stdout", "input": "001 119", "output": "0.991666666667\n"}, {"type": "stdin_stdout", "input": "100 113", "output": "53.0516431925\n"}, {"type": "stdin_...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n# Task\n Call two arms equally s...
[{"input": "10\n15\n15\n10", "output": "[true]", "fn_name": "are_equally_strong"}, {"input": "15\n10\n15\n10", "output": "[true]", "fn_name": "are_equally_strong"}, {"input": "10\n10\n10\n10", "output": "[true]", "fn_name": "are_equally_strong"}, {"input": "15\n10\n15\n9", "output": "[false]", "fn_name": "are_equally_s...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 going to celeb...
[{"type": "stdin_stdout", "input": "4 3\n1 2\n1 3\n3 4\n1000000000 999999999 0 1\n", "output": "0 1 0 1 "}, {"type": "stdin_stdout", "input": "4 3\n1 2\n1 3\n3 4\n1000000000 999999999 0 2\n", "output": "0 1 0 1\n"}, {"type": "stdin_stdout", "input": "4 3\n1 2\n1 3\n1 4\n1000000000 999999999 0 2\n", "output": "0 0 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\nAlice and Bonnie are sisters, bu...
[{"type": "stdin_stdout", "input": "7\n479456257 682467462 202838061 802929167\n133179116 541657110 703996842 253385760\n829210948 865639323 321812660 580155067\n723036605 467995973 911771109 838534160\n732332969 59715289 216696388 60573917\n515702466 655741352 105418444 651954316\n884987644 907866122 399463262 9527779...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne day in the IT lesson Anna an...
[{"type": "stdin_stdout", "input": "kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA conglomerate consists of $n$ c...
[{"type": "stdin_stdout", "input": "20\n1 1228\n7 957 657 854 608 621 874 617\n6 159 43 19 122 116 194\n7 813 984 847 953 808 801 900\n2 693 844\n12 903 910 764 949 990 959 987 884 876 743 838 1017\n1 636\n8 107 201 935 203 159 67 550 948\n1 919\n14 934 742 1000 707 801 958 889 980 799 841 927 676 918 841\n7 590 569 48...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDetermine if an N-sided polygon ...
[{"type": "stdin_stdout", "input": "10\n100 100 100 100 100 100 100 100 100 100\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "10\n72 91 66 75 90 52 94 1 87 59\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "10\n11 11 11 11 99 11 11 11 11 11\n", "output": "No\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\n###BACKGROUND:\nJacob recently d...
[{"input": "\"F\"\n-461.9\n0.0", "output": "[\"Invalid weight\"]", "fn_name": "lose_weight"}, {"input": "\"F\"\n160\n-10", "output": "[\"Invalid duration\"]", "fn_name": "lose_weight"}, {"input": "\"llama\"\n1\n-10", "output": "[\"Invalid gender\"]", "fn_name": "lose_weight"}, {"input": "\"??\"\n-10\n-10", "output": "[...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 need to find if a number can...
[{"type": "stdin_stdout", "input": "20\n27955\n637815\n90575\n561777\n622205\n466162\n379336\n195938\n91560\n894581\n799253\n948756\n448870\n26762\n507653\n176200\n175215\n499651\n82441\n354697", "output": "No\nNo\nNo\nNo\nNo\nYes\nYes\nYes\nYes\nYes\nNo\nNo\nNo\nYes\nYes\nYes\nNo\nNo\nNo\nYes"}, {"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\nIroha loves Haiku. Haiku is a sh...
[{"type": "stdin_stdout", "input": "5 5 7\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "13 4 -2", "output": "NO\n"}, {"type": "stdin_stdout", "input": "13 4 -1", "output": "NO\n"}, {"type": "stdin_stdout", "input": "20 4 -1", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-1 -1 3", "output": "NO\n"}...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n## Problem\n\nDetermine whether ...
[{"input": "2357893", "output": "[false]", "fn_name": "colorful"}, {"input": "235789", "output": "[true]", "fn_name": "colorful"}, {"input": "236", "output": "[false]", "fn_name": "colorful"}, {"input": "263", "output": "[true]", "fn_name": "colorful"}, {"input": "50", "output": "[false]", "fn_name": "colorful"}, {"inp...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWhen a warrior wants to talk wit...
[{"input": "\"80671991111\"", "output": "[\"Kyivstar\"]", "fn_name": "detect_operator"}, {"input": "\"80111551111\"", "output": "[\"no info\"]", "fn_name": "detect_operator"}, {"input": "\"80631551111\"", "output": "[\"Life:)\"]", "fn_name": "detect_operator"}, {"input": "\"80931551111\"", "output": "[\"Life:)\"]", "fn...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "8 3\nACACTABG\n6 3\n4 6\n2 1", "output": "-1\n0\n-1\n"}, {"type": "stdin_stdout", "input": "8 3\nACACTACG\n3 7\n2 3\n1 8\n", "output": "2\n0\n3\n"}, {"type": "stdin_stdout", "input": "8 3\nACACTACG\n3 7\n4 3\n1 2", "output": "2\n-1\n1\n"}, {"type": "stdin_stdout", "input": "8 3\nACAC...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 $n$ be an integer. Consider ...
[{"type": "stdin_stdout", "input": "1000000\n", "output": " 549766631"}, {"type": "stdin_stdout", "input": "771623\n", "output": " 501916356"}, {"type": "stdin_stdout", "input": "623847\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\nA chess board is normally played...
[{"input": "[\"a3\", \"h6\", \"a4\", \"h5\", \"a5\", \"h4\", \"a6\", \"h3\", \"axb7\", \"hxg2\"]", "output": "[[[\".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\"], [\"p\", \"P\", \"p\", \"p\", \"p\", \"p\", \"p\", \".\"], [\".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\"], [\".\", \".\", \".\", \".\", \".\"...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAstronaut Natasha arrived on Mar...
[{"type": "stdin_stdout", "input": "2 420\n412 363\n", "output": "420\n0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 8...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are wandering in the explore...
[{"type": "stdin_stdout", "input": "3 3 10\n1 1\n1 1\n1 1\n1 1 1\n1 1 1\n", "output": "\n10 10 10\n10 10 10\n10 10 10\n"}, {"type": "stdin_stdout", "input": "3 3 10\n1 1\n2 1\n1 1\n1 1 1\n1 1 1\n", "output": "10 10 10\n10 10 10\n10 10 10\n"}, {"type": "stdin_stdout", "input": "3 3 10\n1 1\n2 2\n1 1\n1 2 1\n2 2 1\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\nHint\n\nIn solving this problem,...
[{"type": "stdin_stdout", "input": "6 101\n111 101 101 101 001 101 101 001 101 101", "output": "444444\n"}, {"type": "stdin_stdout", "input": "5 100\n101 101 101 101 001 101 101 101 101 101", "output": "44444\n"}, {"type": "stdin_stdout", "input": "5 100\n101 101 101 101 101 101 001 101 101 101", "output": "66666\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\nChouti was tired of the tedious ...
[{"type": "stdin_stdout", "input": "4 4 2\n3 1\n1 2 1000000000\n2 3 1000000000\n3 1 1000000000\n3 4 1\n", "output": "1000000000 1000000000\n"}, {"type": "stdin_stdout", "input": "4 4 2\n3 1\n1 2 1000000000\n2 3 1000000001\n3 1 1000000000\n3 4 1\n", "output": "1000000000 1000000000\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\nA famous gang of pirates, Sea Do...
[{"type": "stdin_stdout", "input": "1000010000 3\n44431 10822\n45250 1096927361\n264372930 1\n", "output": "-1"}, {"type": "stdin_stdout", "input": "1000010001 3\n44431 10822\n45250 1096927361\n264372930 1\n", "output": "-1"}, {"type": "stdin_stdout", "input": "1000000000 3\n30490 19232\n45250 999980767\n264372930 1\n"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMr. Suzuki has opened a new mobi...
[{"type": "stdin_stdout", "input": "5\n-2\n45\n162\n2\n15\n0", "output": "73\n"}, {"type": "stdin_stdout", "input": "5\n-2\n32\n30\n2\n12\n0", "output": "52\n"}, {"type": "stdin_stdout", "input": "5\n-1\n-1\n4\n106\n0\n0", "output": "-3\n"}, {"type": "stdin_stdout", "input": "5\n4\n31\n14\n11\n14\n0", "output": "91\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 N numbers, f...
[{"type": "stdin_stdout", "input": "10\n807\n935399 145100 -386862 856283 628359 256963 -461034 935399 776945 -759500 -759500 935399 -967263 649644 -24686 -452785 -352467 688773 908612 -386862 -479957 -146506 439811 -506538 -146506 145100 -461034 935399 -352307 -181185 740341 740341 439811 742466 -854789 700140 -740255...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJoy is a short and lazy guy, he ...
[{"type": "stdin_stdout", "input": "100\n41\n18467\n6334\n26500\n19169\n15724\n11478\n29358\n26962\n24464\n5705\n28145\n23281\n16827\n9961\n491\n2995\n11942\n4827\n5436\n32391\n14604\n3902\n153\n292\n12382\n17421\n18716\n19718\n19895\n5447\n21726\n14771\n11538\n1869\n19912\n25667\n26299\n17035\n9894\n28703\n23811\n3132...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlan decided to get in shape for...
[{"type": "stdin_stdout", "input": "5 10000\n10010 1629 30000 40724 20000\n20000\n12 1 5 3 10\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "5 10000\n10010 1552 30000 40724 20000\n20000\n20 1 5 3 10\n", "output": "21\n"}, {"type": "stdin_stdout", "input": "5 10000\n10010 1552 30000 40724 20000\n20000\n20 0 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\nWhen Masha came to math classes ...
[{"type": "stdin_stdout", "input": "100\n2 2 2 2 3 3 3 3 3 3 1 3 3 2 3 3 0 3 3 3 2 3 3 3 3 1 3 3 3 3 3 3 3 1 1 2 2 2 2 2 1 3 3 2 2 1 3 3 3 2 3 3 3 1 1 2 3 1 0 0 1 3 3 3 1 3 2 2 2 2 3 3 2 2 2 3 3 2 2 3 1 1 1 1 3 3 3 3 3 3 3 3 3 3 3 2 3 3 3\n0 0 0 2 2 1 0 0 0 0 0 0 2 2 2 0 0 0 3 2 2 2 2 2 1 1 1 3 3 1 0 2 1 1 0 0 2 2 2 0 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n# Definition\n\nA **_Tidy number...
[{"input": "9672", "output": "[false]", "fn_name": "tidyNumber"}, {"input": "102", "output": "[false]", "fn_name": "tidyNumber"}, {"input": "2789", "output": "[true]", "fn_name": "tidyNumber"}, {"input": "2335", "output": "[true]", "fn_name": "tidyNumber"}, {"input": "12", "output": "[true]", "fn_name": "tidyNumber"}]
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSnuke can change a string t of l...
[{"type": "stdin_stdout", "input": "whcrjpbyhtxywkrlxnbrbaojmr", "output": "10\n"}, {"type": "stdin_stdout", "input": "smjoabjdoxmrjwypugydyqrchv", "output": "11\n"}, {"type": "stdin_stdout", "input": "xwwwnajdrxmrqwzpugnhlojced", "output": "12\n"}, {"type": "stdin_stdout", "input": "xpwzglbjquntrci{axpdikofyw", "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\nOnce upon a time Mike and Mike d...
[{"type": "stdin_stdout", "input": "5 6\n1 2 3 4 5\n2 10\n1 1 5\n2 10\n1 1 6\n2 10\n1 1 7\n", "output": "50\n45\n50\n46\n50\n47\n"}, {"type": "stdin_stdout", "input": "5 5\n5 6 2 10 10\n1 2 7\n2 4\n1 1 10\n2 8\n1 3 4\n", "output": "34\n20\n26\n40\n36\n"}, {"type": "stdin_stdout", "input": "5 5\n1 2 3 4 5\n1 1 5\n2 10\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\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\nOh, no!\n\nThe coronavirus has c...
[{"type": "stdin_stdout", "input": "3\n8707 7998 1614\n999941093851 131953876 8707\n", "output": "SMALL\n15155\nPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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.X, who the handle name is T, ...
[{"type": "stdin_stdout", "input": "2\ntourist\neptr\ne", "output": "1\n"}, {"type": "stdin_stdout", "input": "2\nssvuhnr\nerrs\nf", "output": "2\n"}, {"type": "stdin_stdout", "input": "2\nhupouvt\netor\ni", "output": "3\n"}, {"type": "stdin_stdout", "input": "2\nsourist\neptr\ne", "output": "1\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\nMishka is decorating the Christm...
[{"type": "stdin_stdout", "input": "1499 1498 1500\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1500 1500 1500\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1493 1489 1487\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1500 1500 1500\n", "output": "NO"}, {"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\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\nBaby Badawy's first words were \...
[{"type": "stdin_stdout", "input": "10\n99281 18\n100000 16\n100000 15\n100000 14\n100000 6\n8823 3\n283 17\n299 18\n182 19\n1928 20\n", "output": "207307884\n95964640\n764800965\n570057652\n999657007\n829332965\n995193330\n759808819\n657208696\n258367760\n"}, {"type": "stdin_stdout", "input": "10\n99281 18\n100000 16\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 time ago Mister B detected ...
[{"type": "stdin_stdout", "input": "108\n1 102 33 99 6 83 4 20 61 100 76 71 44 9 24 87 57 2 81 82 90 85 12 30 66 53 47 36 43 29 31 64 96 84 77 23 93 78 58 68 42 55 13 70 62 19 92 14 10 65 63 75 91 48 11 105 37 50 32 94 18 26 52 89 104 106 86 97 80 95 17 72 40 22 79 103 25 101 35 51 15 98 67 5 34 69 54 27 45 88 56 16 46...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 develop a tiny l...
[{"type": "stdin_stdout", "input": "4\n52 26 16 20\n143 22 35 45\n45 78 54 36\n10 86 74 55\n4\n52 151 15 28\n86 22 24 45\n45 78 54 36\n16 86 74 55\n0", "output": " 52 26 16 20 114\n 143 22 35 45 245\n 45 78 54 36 213\n 10 86 74 55 225\n 250 212 179 156 797\n 52 151 15 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\nFor given integers m and n, comp...
[{"type": "stdin_stdout", "input": "-1 1", "output": "1000000006\n"}, {"type": "stdin_stdout", "input": "-2 1", "output": "1000000005\n"}, {"type": "stdin_stdout", "input": "-4 1", "output": "1000000003\n"}, {"type": "stdin_stdout", "input": "-3 1", "output": "1000000004\n"}, {"type": "stdin_stdout", "input": "-5 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\n\"You must lift the dam. With a ...
[{"type": "stdin_stdout", "input": "5\n5\n1 5 3 12 10\n3\n1 1 2\n4\n6 2 5 3\n2\n2 4\n1\n1\n", "output": "1\n1\n2\n0\n0\n"}, {"type": "stdin_stdout", "input": "5\n5\n1 5 3 12 10\n3\n1 1 1\n4\n6 2 5 3\n2\n2 4\n1\n1\n", "output": "1\n3\n2\n0\n0\n"}, {"type": "stdin_stdout", "input": "5\n5\n1 5 3 12 10\n3\n2 1 2\n4\n6 2 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 season for Snuke Festival ha...
[{"type": "stdin_stdout", "input": "6\n5 30 290 0 -1 25\n106 2 21 1619 34 5\n1103 1563 -1 0 26 885", "output": "58\n"}, {"type": "stdin_stdout", "input": "6\n5 26 290 0 -1 25\n106 4 8 1619 60 5\n1103 1563 0 0 26 1803", "output": "64\n"}, {"type": "stdin_stdout", "input": "6\n4 43 290 -1 6 27\n106 13 11 837 28 8\n1103 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\nRead problems statements in Mand...
[{"type": "stdin_stdout", "input": "2\n4\n1111\n5\n11011", "output": "10\n10\n"}, {"type": "stdin_stdout", "input": "2\n4\n1111\n5\n10000", "output": "10\n1\n"}, {"type": "stdin_stdout", "input": "2\n4\n1111\n5\n10100", "output": "10\n3\n"}, {"type": "stdin_stdout", "input": "2\n4\n1111\n5\n10011", "output": "10\n6\n"}...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n$k$ people want to split $n$ can...
[{"type": "stdin_stdout", "input": "1815995848677761959 576460752303423488 202657637814241276 1000\n", "output": "202657637814241276\n"}, {"type": "stdin_stdout", "input": "576460752303423488 576460752303423488 351082447248993993 1000\n", "output": "351082447248993993\n"}, {"type": "stdin_stdout", "input": "57646075230...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 cleaner is placed on the...
[{"type": "stdin_stdout", "input": "5\n18 20 11 1 2 11\n10 10 5 9 2 1\n17 17 3 10 2 2\n6 9 2 2 5 8\n3 2 1 2 2 2\n", "output": "10\n10\n22\n3\n0\n"}, {"type": "stdin_stdout", "input": "5\n18 20 11 1 2 11\n10 10 5 9 2 1\n17 17 3 10 2 1\n6 9 2 2 5 8\n3 2 1 2 2 2\n", "output": "10\n10\n23\n3\n0\n"}, {"type": "stdin_stdout"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given $n$ points on the ...
[{"type": "stdin_stdout", "input": "20\n-2967010 48581504\n-2967318 48581765\n-2967443 48581988\n-2967541 48582265\n-2967443 48582542\n-2967318 48582765\n-2967010 48583026\n-2966691 48583154\n-2966252 48583234\n-2965813 48583154\n-2965494 48583026\n-2965186 48582765\n-2965061 48582542\n-2964963 48582265\n-2965061 48581...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 watches TV every day. He alw...
[{"type": "stdin_stdout", "input": "3\n-1 -1\n13 93\n3 2\n", "output": "0\n16\n1\n"}, {"type": "stdin_stdout", "input": "3\n-1 -1\n15 93\n3 2\n", "output": "0\n17\n1\n"}, {"type": "stdin_stdout", "input": "3\n-1 -1\n19 93\n3 2\n", "output": "0\n16\n1\n"}, {"type": "stdin_stdout", "input": "3\n-1 -1\n9 93\n3 6\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\nThe height of the student was me...
[{"type": "stdin_stdout", "input": "21\n182.52038838661136\n173.59035199874677\n159.1654152748587\n178.37721834424076\n171.14400777912027\n182.81130283538022\n174.6786970584368\n172.29285424816956\n164.63708333553282\n170.35024430895632\n176.98250427300766\n170.33088547272038\n163.32499378168183\n173.12553016807985\n17...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGerman mathematician Christian G...
[{"input": "1500", "output": "[[\"7+1493\", \"11+1489\", \"13+1487\", \"17+1483\", \"19+1481\", \"29+1471\", \"41+1459\", \"47+1453\", \"53+1447\", \"61+1439\", \"67+1433\", \"71+1429\", \"73+1427\", \"101+1399\", \"127+1373\", \"139+1361\", \"173+1327\", \"179+1321\", \"181+1319\", \"193+1307\", \"197+1303\", \"199+13...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCirno_9baka has a paper tape wit...
[{"type": "stdin_stdout", "input": "10\n2 1 1\n2\n2 1 1\n2\n1 1 1\n1\n1 1 1\n1\n1 1 1\n1\n2 1 1\n2\n1 1 1\n1\n1 1 1\n1\n2 1 1\n2\n2 1 1\n2\n", "output": "YES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "10\n1 1 1\n1\n1 1 1\n1\n2 1 1\n2\n2 1 1\n2\n2 1 1\n2\n2 1 1\n2\n2 1 1\n2\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\nPaprika loves permutations. She ...
[{"type": "stdin_stdout", "input": "4\n2\n2 7\n3\n2 5 2\n4\n12345678 87654321 18276684 23571113\n9\n2 3 1 4 18 23 5 12 7\n", "output": "1\n-1\n4\n-1\n"}, {"type": "stdin_stdout", "input": "4\n2\n2 7\n3\n2 5 2\n4\n12345678 87654321 18276684 23571113\n9\n2 3 1 4 18 34 5 12 7\n", "output": "1\n-1\n4\n-1\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\nLet's denote as <image> the numb...
[{"type": "stdin_stdout", "input": "18\n0 18\n1 101\n1 1001\n0 10000\n2 100000\n1 1001010\n1 10000000\n1 100000001\n1 1000000000\n1 10000010000\n1 100000000000\n0 1100000000000\n2 10000100000000\n0 100000000000000\n1 1000100000000000\n1 10000000000000000\n1 100000000000000001\n2 1000000000000000100\n", "output": "15\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\nTaro is an elementary school stu...
[{"type": "stdin_stdout", "input": "4\n1 2 3 4\n1 2 3 4\n1 2 3 4\n2 2 3 4\n1 2 3 4\n1 2 3 4\n1 2 3 4\n1 2 3 4\noooo\noooo\noooo\noooo", "output": "30\n12\n1 1 erase\n1 2 erase\n1 3 erase\n2 1 erase\n2 2 erase\n2 4 erase\n3 1 erase\n3 3 erase\n3 4 erase\n4 2 erase\n4 3 erase\n4 4 erase\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\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": "978837295 606974665 846646545585165081 745145208\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\nHave you heard about the myth th...
[{"input": "384000000", "output": "[42]", "fn_name": "fold_to"}, {"input": "5e-05", "output": "[0]", "fn_name": "fold_to"}, {"input": "1e-07", "output": "[0]", "fn_name": "fold_to"}, {"input": "-1", "output": "[null]", "fn_name": "fold_to"}, {"input": "0", "output": "[0]", "fn_name": "fold_to"}]
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNikolay lives in a two-storied h...
[{"type": "stdin_stdout", "input": "1\n100\n0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "1\n100\n0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n", "ou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOrigami, or the art of folding p...
[{"type": "stdin_stdout", "input": "2 1 1 1\n1 1\n0 0\n1 3 2 1\n2 1\n2 1\n0 0\n15 10 3 2\n2 2\n1 1\n1 1\n0 0\n3 4\n4 3 3 2\n1 2\n1 2\n1 1\n0 1\n0 0\n0 0 0 0", "output": "2\n3\n6\n1\n4\n4\n"}, {"type": "stdin_stdout", "input": "2 1 1 1\n2 1\n0 0\n1 3 2 1\n2 0\n2 1\n0 1\n10 13 3 2\n2 2\n1 3\n1 1\n0 1\n3 4\n3 5 3 2\n1 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\nThe finalists of the \"Russian C...
[{"type": "stdin_stdout", "input": "100 100\n100 100\n100\n", "output": "9900\n"}, {"type": "stdin_stdout", "input": "100 100\n100 100\n100\n", "output": "9900\n"}, {"type": "stdin_stdout", "input": "10 100\n100 100\n99\n", "output": "1000\n"}, {"type": "stdin_stdout", "input": "10 100\n100 100\n99\n", "output": "1000\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 an automatic door at th...
[{"type": "stdin_stdout", "input": "97 60 1 1\n5 6 6 7 9 10 10 11 11 11 12 13 13 13 13 14 14 15 16 18 20 23 23 24 25 26 29 31 32 35 38 41 43 43 46 47 48 48 49 52 53 54 55 56 58 59 68 70 72 74 78 81 81 82 91 92 96 96 97 98\n", "output": "49\n"}, {"type": "stdin_stdout", "input": "97 60 1 1\n5 6 6 7 9 10 10 11 11 11 12 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGerald is setting the New Year t...
[{"type": "stdin_stdout", "input": "10 1000 236\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1 1484 1100\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1 1484 0100\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "100 821 25\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven an array of integers.\n\nR...
[{"input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -11, -12, -13, -14, -15]", "output": "[[10, -65]]", "fn_name": "count_positives_sum_negatives"}, {"input": "[0, 2, 3, 0, 5, 6, 7, 8, 9, 10, -11, -12, -13, -14]", "output": "[[8, -50]]", "fn_name": "count_positives_sum_negatives"}, {"input": "[0, 0, 0, 0, 0, 0, 0, 0, 0]", "out...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWilliam has two numbers $a$ and ...
[{"type": "stdin_stdout", "input": "6\n7 0\n0 15\n7 12\n2 5\n0 0\n-1 6\n", "output": "-1\n-1\n-1\n-1\n0\n-1\n"}, {"type": "stdin_stdout", "input": "6\n7 0\n0 15\n10 12\n2 5\n0 0\n-1 6\n", "output": "-1\n-1\n2\n-1\n0\n-1\n"}, {"type": "stdin_stdout", "input": "6\n2 -1\n3 0\n0 3\n6 3\n4 1\n0 1\n", "output": "-1\n-1\n-1\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle penguin Polo adores strin...
[{"type": "stdin_stdout", "input": "70054 25\n", "output": "abababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 binary string $s...
[{"type": "stdin_stdout", "input": "4\n0110\n0101\n00001000\n0001000\n", "output": "4\n3\n4\n3\n"}, {"type": "stdin_stdout", "input": "4\n0110\n1101\n00001000\n0001000\n", "output": "4\n4\n4\n3\n"}, {"type": "stdin_stdout", "input": "4\n0110\n1101\n00001000\n0101000\n", "output": "4\n4\n4\n5\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\nGiant chess is quite common in G...
[{"type": "stdin_stdout", "input": "100 10 30\n40 4\n15 3\n75 3\n88 10\n32 1\n16 5\n81 8\n45 2\n72 8\n11 6\n86 4\n50 2\n9 4\n11 1\n20 3\n47 3\n2 4\n68 3\n90 5\n85 2\n88 1\n88 5\n86 3\n70 9\n49 3\n34 4\n5 7\n77 5\n50 1\n87 5\n", "output": "402737011\n"}, {"type": "stdin_stdout", "input": "100 10 30\n40 4\n15 3\n75 3\n88...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 2028 and after a continuous g...
[{"type": "stdin_stdout", "input": "802565984633806\n802252530129536\n544410837252078\n872045491508709\n274353138702170\n562308817245826\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "956131704220258\n897098524760050\n55734601880356\n155602009554546\n559895124828099\n830172607676349\n", "output": "22\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\nStory:\nIn the realm of numbers,...
[{"input": "[687, 829, 998]", "output": "[45664]", "fn_name": "survivor"}, {"input": "[1, 7, 15]", "output": "[0]", "fn_name": "survivor"}, {"input": "[7, 11]", "output": "[59]", "fn_name": "survivor"}, {"input": "[2, 10]", "output": "[-1]", "fn_name": "survivor"}, {"input": "[]", "output": "[-1]", "fn_name": "survivor...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 an integer N.\nDetermin...
[{"type": "stdin_stdout", "input": "748307129767950488\n", "output": "37 25\n"}, {"type": "stdin_stdout", "input": "450283905890997368\n", "output": "37 1\n"}, {"type": "stdin_stdout", "input": "298023223876953128\n", "output": "1 25\n"}, {"type": "stdin_stdout", "input": "150094635296999246\n", "output": "36 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\nAlice gave Bob two integers $a$ ...
[{"type": "stdin_stdout", "input": "5\n1 1\n2 1\n2 0\n1 10000\n2 10000\n", "output": "3\n2\n3\n2\n3\n"}, {"type": "stdin_stdout", "input": "5\n1 1\n2 1\n2 0\n1 10000\n2 10000\n", "output": "3\n2\n3\n2\n3\n"}, {"type": "stdin_stdout", "input": "1\n187994 180766\n", "output": "187995\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\nHaving learned the multiplicatio...
[{"type": "stdin_stdout", "input": "00010", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "00001", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "11111", "output": "No\n"}, {"type": "stdin_stdout", "input": "10111", "output": "No\n"}, {"type": "stdin_stdout", "input": "10011", "output": "No\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\nExample\n\nInput\n\n2 3 1 3 1 0\...
[{"type": "stdin_stdout", "input": "15 18 0 12 0 4", "output": "138\n"}, {"type": "stdin_stdout", "input": "15 18 0 22 0 4", "output": "124\n"}, {"type": "stdin_stdout", "input": "15 18 1 22 0 4", "output": "120\n"}, {"type": "stdin_stdout", "input": "11 51 4 0 1 -1", "output": "255\n"}, {"type": "stdin_stdout", "input...
code_stdio