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\nLinear Kingdom has exactly one t...
[{"input": "10\n[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]", "output": "[25]", "fn_name": "tram"}, {"input": "5\n[0, 2, 4, 14, 2]\n[3, 5, 14, 0, 0]", "output": "[16]", "fn_name": "tram"}, {"input": "4\n[0, 2, 4, 4]\n[3, 5, 2, 0]", "output": "[6]", "fn_name": "tram"}, {"input": "2\n[0, 2, 4, 4]\n[3, ...
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 simple (without self-inter...
[{"type": "stdin_stdout", "input": "3 8\n-100000 -100000\n100000 100000\n1 0\n-100000 -100000 100000 -80000\n-100000 -100000 100000 -99000\n-100000 -100000 100000 -99990\n-100000 -100000 100000 -99999\n-100000 -100000 100000 -99999.99\n-100000 -100000 100000 100000\n-100000 -100000 100000 99999.99\n-100000 100000 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\nAfter lessons Nastya decided to ...
[{"type": "stdin_stdout", "input": "49\n1 17\n18 115\n116 211\n212 269\n270 345\n346 404\n405 441\n442 467\n468 526\n527 583\n584 664\n665 757\n758 794\n795 802\n803 882\n883 920\n921 960\n961 962\n963 1006\n1007 1081\n1082 1112\n1113 1149\n1150 1217\n1218 1282\n1283 1287\n1288 1365\n1366 1374\n1375 1379\n1380 1478\n14...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs you have noticed, there are l...
[{"type": "stdin_stdout", "input": "100\n84 94 72 32 61 90 61 2 76 42 35 82 90 29 51 27 65 99 38 41 44 73 100 58 56 64 54 31 14 58 57 64 90 49 73 80 74 19 31 86 73 44 39 43 28 95 23 5 85 5 74 81 34 44 86 30 50 57 94 56 53 42 53 87 92 78 53 49 78 60 37 63 41 19 15 68 25 77 87 48 23 100 54 27 68 84 43 92 76 55 2 94 100 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\nConvexity of a set of points on ...
[{"type": "stdin_stdout", "input": "278 100\n", "output": "0 100000\n1 100001\n2 100004\n3 100009\n4 100016\n5 100025\n6 100036\n7 100049\n8 100064\n9 100081\n10 100100\n11 100121\n12 100144\n13 100169\n14 100196\n15 100225\n16 100256\n17 100289\n18 100324\n19 100361\n20 100400\n21 100441\n22 100484\n23 100529\n24 1005...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAt the school where the twins Am...
[{"type": "stdin_stdout", "input": "4\n1 2\n3 1\n4 1\n2 1\n3\n10 4\n1 2\n1 2\n1\n1000 1000\n10\n5 62\n10 68\n15 132\n20 73\n25 75\n30 77\n35 79\n40 82\n45 100\n815 283\n6\n106 21\n53 55\n118 77\n19 13\n83 42\n2 1\n0", "output": "15\n24\n3000\n2072\n590\n"}, {"type": "stdin_stdout", "input": "4\n1 2\n3 1\n4 1\n2 2\n3\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\nSasha and Dima want to buy two $...
[{"type": "stdin_stdout", "input": "10\n8 8 3 9 7 1 9 6 10 6 4 2 7 3 4 10 5 5 1 2\n", "output": "123\n"}, {"type": "stdin_stdout", "input": "10\n8 8 3 9 7 1 9 6 10 6 4 2 7 3 4 10 5 5 1 2\n", "output": "123\n"}, {"type": "stdin_stdout", "input": "9\n1 3 6 1 4 9 2 8 3 4 8 7 5 7 2 5 9 6\n", "output": "89\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\nExample\n\nInput\n\n2 2 2 0 0 0 ...
[{"type": "stdin_stdout", "input": "2 2 4 1 0 1 35", "output": "1 4 6 4 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"}, {"type": "stdin_stdout", "input": "1 1 4 0 0 0 24", "output": "1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"}, {"type": "stdin_stdout", "input": "1 1 4 0 0 1 24", "output": "1 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFafa owns a company that works o...
[{"type": "stdin_stdout", "input": "100000\n", "output": "35\n"}, {"type": "stdin_stdout", "input": "83160\n", "output": "127\n"}, {"type": "stdin_stdout", "input": "127925\n", "output": "23\n"}, {"type": "stdin_stdout", "input": "99999\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "65536\n", "output": "16\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\nCreate a function that accepts d...
[{"input": "4\n4", "output": "[[[1, 2, 3, 4], [2, 4, 6, 8], [3, 6, 9, 12], [4, 8, 12, 16]]]", "fn_name": "multiplication_table"}, {"input": "3\n4", "output": "[[[1, 2, 3, 4], [2, 4, 6, 8], [3, 6, 9, 12]]]", "fn_name": "multiplication_table"}, {"input": "2\n5", "output": "[[[1, 2, 3, 4, 5], [2, 4, 6, 8, 10]]]", "fn_name...
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\nA Madhav array has the following...
[{"input": "[6, 2, 4, 2, 2, 2, 1, 5, 0, 0, -12, 13, -5, 4, 1]", "output": "[false]", "fn_name": "is_madhav_array"}, {"input": "[6, 2, 4, 2, 2, 2, 1, 5, 0, 0, -12, 13, -5, 4, 6]", "output": "[true]", "fn_name": "is_madhav_array"}, {"input": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, -2, -1]", "output": "[true]", "fn_name"...
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\nRead problems statements in Mand...
[{"type": "stdin_stdout", "input": "2\n12\n191", "output": "5\n11\n"}, {"type": "stdin_stdout", "input": "2\n14\n108", "output": "6\n10\n"}, {"type": "stdin_stdout", "input": "2\n21\n114", "output": "7\n10\n"}, {"type": "stdin_stdout", "input": "2\n25\n193", "output": "7\n11\n"}, {"type": "stdin_stdout", "input": "2\n3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 undirected conn...
[{"type": "stdin_stdout", "input": "9 9 7\n1 2 1000000000\n7 9 1000000000\n9 4 1000000000\n2 6 1000000000\n2 3 1000000000\n3 7 1000000000\n6 8 1000000000\n8 4 1000000000\n4 5 1000000000\n", "output": "7\n1 5 4 6 7 8 2 \n"}, {"type": "stdin_stdout", "input": "9 9 7\n1 2 1000000000\n7 9 1000000000\n9 4 1000000000\n2 6 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\nThe sales department of Japanese...
[{"type": "stdin_stdout", "input": "4\n0 0 x\n2 0 x\n0 1 x\n2 1 x\n4\n1 0 x\n0 1 x\n3 1 x\n1 2 x\n4\n0 0 x\n2 0 y\n0 1 y\n1 2 x\n0", "output": "Yes\nYes\nYes\n"}, {"type": "stdin_stdout", "input": "4\n0 0 x\n2 0 x\n0 1 x\n2 1 x\n4\n1 0 x\n0 1 x\n3 1 x\n1 2 x\n4\n0 0 x\n2 0 y\n0 1 y\n2 2 x\n0", "output": "Yes\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\nPeter likes to travel by train. ...
[{"type": "stdin_stdout", "input": "aababaaababaabbaabababaaababaabababbaabbabaabababaabbabbbababbababababababaabababaababaaaabababaabab\nabaabababaa\nabaabbaa\n", "output": "backward\n"}, {"type": "stdin_stdout", "input": "aababaaababaabbaabababaaababaabababbaabbabaabababaabbabbbababbababababababaabababaababaaaabababa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 permutation of size n is an ar...
[{"type": "stdin_stdout", "input": "1\n1\n10\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n", "output": "even\neven\neven\neven\neven\neven\neven\neven\neven\neven\n"}, {"type": "stdin_stdout", "input": "1\n1\n10\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n", "output": "even\neven\neven\neven\neven\neven\ne...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDima is a beginner programmer. D...
[{"type": "stdin_stdout", "input": "12 12\n10\n11\n5\n3\n11\n2\n8\n6\n4\n4\n12\n1\n", "output": "9\n6\n3\n2\n6\n7\n12\n8\n10\n10\n11\n1\n"}, {"type": "stdin_stdout", "input": "12 12\n9\n11\n5\n3\n11\n2\n8\n4\n4\n4\n12\n1\n", "output": "5\n6\n3\n2\n6\n7\n12\n10\n10\n10\n11\n1\n"}, {"type": "stdin_stdout", "input": "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\n# How much is the fish! (- Scoot...
[{"input": "\"African glass catfish\"", "output": "[0]", "fn_name": "fisHex"}, {"input": "\"Airbreathing catfish\"", "output": "[12]", "fn_name": "fisHex"}, {"input": "\"Australasian salmon\"", "output": "[10]", "fn_name": "fisHex"}, {"input": "\"Atlantic silverside\"", "output": "[1]", "fn_name": "fisHex"}, {"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\nLimak is a little polar bear. He...
[{"type": "stdin_stdout", "input": "20 2 15\n1744261 55128070 116962690 156763505 188535242 194018601 134662359 428710623 442819431 483000923 516768937 552903993 633087286 373594646 415184994 714291344 717660646 846508634 879748146 937368929\n2 20\n1 2\n2 2\n1 19\n1 12\n2 2\n2 18\n2 11\n1 16\n2 1\n2 3\n2 19\n1 17\n2 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\nFor a given sequence $A = \\\\{a...
[{"type": "stdin_stdout", "input": "5\n3 -13 7 -1 -4", "output": "6\n"}, {"type": "stdin_stdout", "input": "5\n3 -13 10 0 -4", "output": "6\n"}, {"type": "stdin_stdout", "input": "5\n3 -13 10 0 -5", "output": "6\n"}, {"type": "stdin_stdout", "input": "5\n2 -13 10 0 -5", "output": "6\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\nThere are $n$ detachments on the...
[{"type": "stdin_stdout", "input": "23\n-1000000000 -964752353\n-967012509 -1000000000\n34021744 1000000000\n-931956512 -34021744\n-1034253 967204159\n-1034253 -34021744\n-1034253 -1000000000\n-931956512 -1000000000\n-967012509 1000000000\n964944003 1225903\n1000000000 1225903\n-967012509 1225903\n-1034253 -964752353\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've got an array a, consistin...
[{"type": "stdin_stdout", "input": "42 42\n42 42 42 42 74 42 42 42 3 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 59 42 42 42 42 42\n", "output": "42 1806 39732 595980 6853802 64426782 515432400 608248315 553670947 820980301 784579711 753219887 714714707 805611691 208784644 262712997...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 just entered a programmin...
[{"input": "123\n456", "output": "[1419]", "fn_name": "code"}, {"input": "200\n100", "output": "[1698]", "fn_name": "code"}, {"input": "100\n200", "output": "[1698]", "fn_name": "code"}, {"input": "12\n8", "output": "[88]", "fn_name": "code"}, {"input": "3\n2", "output": "[13]", "fn_name": "code"}, {"input": "1\n1", "o...
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\nA balance scale tips to the left...
[{"type": "stdin_stdout", "input": "3 4 5 2\n", "output": "Balanced\n"}, {"type": "stdin_stdout", "input": "0 8 7 1", "output": "Balanced\n"}, {"type": "stdin_stdout", "input": "4 3 5 2", "output": "Balanced\n"}, {"type": "stdin_stdout", "input": "8 3 8 3", "output": "Balanced\n"}, {"type": "stdin_stdout", "input": "12...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\nJohn won the champions...
[{"input": "[4, 10, 2, 3, 1, 3, 1, 6, 9]", "output": "[6722]", "fn_name": "calc"}, {"input": "[1, 2, 5]", "output": "[50]", "fn_name": "calc"}, {"input": "[1, 2, 1]", "output": "[22]", "fn_name": "calc"}, {"input": "[1, 1]", "output": "[6]", "fn_name": "calc"}, {"input": "[1]", "output": "[2]", "fn_name": "calc"}]
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\nGematria is an Assyro-Babylonian...
[{"input": "\"Coding is fun\"", "output": "[458]", "fn_name": "gematria"}, {"input": "\"jaels\"", "output": "[716]", "fn_name": "gematria"}, {"input": "\"JAELS\"", "output": "[716]", "fn_name": "gematria"}, {"input": "\"Devil\"", "output": "[738]", "fn_name": "gematria"}, {"input": "\"love\"", "output": "[775]", "fn_na...
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 the school computer room ther...
[{"type": "stdin_stdout", "input": "10\n19999 19999 20000 20000 29860 20000 12103 20000 19999 17191\n", "output": "10536\n"}, {"type": "stdin_stdout", "input": "10\n19999 19999 20000 39539 29860 20000 12103 20000 19999 17191\n", "output": "25661\n"}, {"type": "stdin_stdout", "input": "10\n11328 19999 20000 39539 29860 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 permutation of length n is an ...
[{"type": "stdin_stdout", "input": "100\n99 5 40 32 4 31 38 57 94 47 26 16 89 72 9 80 55 86 78 90 42 41 46 74 56 97 21 48 66 27 93 85 88 59 64 95 10 45 12 22 84 60 8 98 62 51 14 65 39 30 11 71 92 19 76 43 87 54 15 53 37 6 25 18 96 35 13 91 2 3 0 23 1 7 49 75 81 33 50 52 63 44 69 36 17 61 24 20 68 34 73 29 70 83 58 79 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 have N items that you want t...
[{"type": "stdin_stdout", "input": "4 3\n4 0\n5 2\n2 1\n13 1", "output": "22\n"}, {"type": "stdin_stdout", "input": "4 6\n4 0\n5 2\n2 1\n13 1", "output": "24\n"}, {"type": "stdin_stdout", "input": "4 5\n0 2\n5 2\n2 1\n8 3", "output": "13\n"}, {"type": "stdin_stdout", "input": "4 5\n4 2\n5 2\n2 0\n8 3", "output": "15\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\nEugeny loves listening to music....
[{"type": "stdin_stdout", "input": "10 10\n3 1\n2 7\n5 1\n7 2\n9 10\n9 5\n2 5\n4 8\n9 9\n1 9\n26 34 37 141 146 201 239 245 296 299\n", "output": "4\n4\n5\n6\n6\n8\n9\n9\n10\n10\n"}, {"type": "stdin_stdout", "input": "10 10\n3 1\n2 7\n5 1\n7 2\n9 10\n9 5\n2 5\n4 10\n9 15\n1 9\n26 34 37 141 146 201 239 245 296 299\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\nI need to save some money to buy...
[{"input": "4000", "output": "[32024004000]", "fn_name": "finance"}, {"input": "5000", "output": "[62537505000]", "fn_name": "finance"}, {"input": "2000", "output": "[4006002000]", "fn_name": "finance"}, {"input": "730", "output": "[195308580]", "fn_name": "finance"}, {"input": "999", "output": "[499999500]", "fn_name"...
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 built an online judge to h...
[{"type": "stdin_stdout", "input": "ACABA", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "ACBAA", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "ACAAA", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "AAACA", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "AAAC@", "output": "Yes\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\nToday Vasya visited a widely kno...
[{"type": "stdin_stdout", "input": "September\n0\n", "output": "September\n"}, {"type": "stdin_stdout", "input": "November\n46\n", "output": "September\n"}, {"type": "stdin_stdout", "input": "December\n240\n", "output": "December\n"}, {"type": "stdin_stdout", "input": "December\n81\n", "output": "September\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\nFor a set $S$ of integers, perfo...
[{"type": "stdin_stdout", "input": "10\n0 1\n0 1\n0 2\n0 3\n2 2\n1 1\n0 2\n1 3\n0 4\n3 1 4", "output": "1\n2\n3\n4\n2\n4\n1\n5\n1\n1\n2\n3\n4\n"}, {"type": "stdin_stdout", "input": "10\n0 1\n0 1\n0 2\n0 3\n2 2\n1 1\n1 1\n1 3\n0 4\n3 1 4", "output": "1\n2\n3\n4\n2\n2\n1\n4\n1\n1\n3\n4\n"}, {"type": "stdin_stdout", "inpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs you may know, once some peopl...
[{"input": "32", "output": "[\"32? That's just 20, in base 16!\"]", "fn_name": "womens_age"}, {"input": "39", "output": "[\"39? That's just 21, in base 19!\"]", "fn_name": "womens_age"}, {"input": "22", "output": "[\"22? That's just 20, in base 11!\"]", "fn_name": "womens_age"}, {"input": "65", "output": "[\"65? That'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\nGiven is a string S of length N ...
[{"type": "stdin_stdout", "input": "90585\nfohfoxuvgjxpybcfoxmefomtzopbsprupidgsybejhphoymfoxxaobhdxbmfoxqioqjzehbmufpownifoxhwlrybqsqijgkdmbpfoxzlobcfoxfpdznrbcqqjqglhqgnuooojywfoxfsqesfoxagdfmfoxlzlhjxrfkwmrktsintfocipouajpsqucpoydkfogknyjffoxddeqsrdeupfownwreitzyflusfoxrhmoffoxqfoxsmyurkfotmlxhekuksfotxukcdfopfoxrcr...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMadoka decided to entrust the or...
[{"type": "stdin_stdout", "input": "100000 1000000000\n", "output": "607723520\n"}, {"type": "stdin_stdout", "input": "100000 53228\n", "output": "871774727\n"}, {"type": "stdin_stdout", "input": "11994 11995\n", "output": "685385528\n"}, {"type": "stdin_stdout", "input": "87532 32150\n", "output": "165162987\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\nDo you know a story about the th...
[{"type": "stdin_stdout", "input": "987 50\n221 959\n221 553\n959 695\n553 959\n819 437\n371 295\n695 553\n959 347\n595 699\n652 628\n553 347\n868 589\n695 221\n282 714\n351 703\n104 665\n755 436\n556 511\n695 347\n221 347\n243 874\n695 847\n863 501\n583 145\n786 221\n38 286\n72 397\n808 658\n724 437\n911 548\n405 759\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are $n$ models in the shop...
[{"type": "stdin_stdout", "input": "4\n23\n3198 4895 1585 3916 2650 5552 876 2731 1971 126 2152 6910 1096 4103 1074 2594 2897 3983 3830 3460 729 576 3281\n1\n0000000010\n2\n1 1\n100\n1 2 3 4 5 2 7 10 9 14 11 12 13 14 24 16 17 33 19 20 21 22 23 24 25 26 27 28 29 41 31 32 56 34 35 36 37 38 39 40 41 42 43 44 45 46 54 48 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA permutation p of size n is the...
[{"type": "stdin_stdout", "input": "17877\n", "output": "2 17877 4 17875 6 17873 8 17871 10 17869 12 17867 14 17865 16 17863 18 17861 20 17859 22 17857 24 17855 26 17853 28 17851 30 17849 32 17847 34 17845 36 17843 38 17841 40 17839 42 17837 44 17835 46 17833 48 17831 50 17829 52 17827 54 17825 56 17823 58 17821 60 178...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 the prime number `23`. ...
[{"input": "100\n1000", "output": "[28]", "fn_name": "solve"}, {"input": "100\n2000", "output": "[47]", "fn_name": "solve"}, {"input": "100\n3000", "output": "[65]", "fn_name": "solve"}, {"input": "100\n4000", "output": "[95]", "fn_name": "solve"}, {"input": "1\n25", "output": "[4]", "fn_name": "solve"}]
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\nLet's call an array $a$ of $m$ i...
[{"type": "stdin_stdout", "input": "20\n2 1 13 10 12 18 15 19 5 14 16 9 3 8 17 11 7 20 6 4\n", "output": "90\n"}, {"type": "stdin_stdout", "input": "10\n7 10 1 8 3 9 2 4 6 5\n", "output": "39\n"}, {"type": "stdin_stdout", "input": "6\n4 5 2 6 1 3\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "3\n2 3 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\nHearing that energy drinks incre...
[{"type": "stdin_stdout", "input": "1 100000\n1000000000 100000\n", "output": "100000000000000\n"}, {"type": "stdin_stdout", "input": "1 100000\n1000000100 100000", "output": "100000010000000\n"}, {"type": "stdin_stdout", "input": "1 100000\n1000000110 100010", "output": "100000011000000\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\nPetya loves lucky numbers. We al...
[{"type": "stdin_stdout", "input": "10\n4 8 480392999\n3 4 32525297\n9 7 417904789\n6 2 836294777\n5 3 616099185\n1 7 830574407\n8 10 838073755\n6 10 547050646\n2 1 12607780\n", "output": "0"}, {"type": "stdin_stdout", "input": "5\n1 2 1000000000\n2 3 747774\n3 4 4\n4 5 8447854\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\nPig is visiting a friend.\n\nPig...
[{"type": "stdin_stdout", "input": "70 100\n0 99\n1 87\n1 94\n1 4\n2 72\n3 39\n3 69\n4 78\n5 85\n7 14\n8 59\n12 69\n14 15\n14 76\n17 17\n19 53\n19 57\n19 21\n21 35\n21 83\n24 52\n24 33\n27 66\n27 97\n30 62\n30 74\n30 64\n32 63\n35 49\n37 60\n40 99\n40 71\n41 83\n42 66\n42 46\n45 83\n51 76\n53 69\n54 82\n54 96\n54 88\n5...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 graph theory, a graph is a co...
[{"input": "[[1], [0, 2, 3], [1], [1], [5], [4, 6, 7], [5], [5]]", "output": "[false]", "fn_name": "isTree"}, {"input": "[[1], [0, 2], [1, 3, 5], [2, 4], [3, 5], [4, 2]]", "output": "[false]", "fn_name": "isTree"}, {"input": "[[1, 2], [0, 3], [0, 3], [1, 2, 4], [3]]", "output": "[false]", "fn_name": "isTree"}, {"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\nIvan had string s consisting of ...
[{"type": "stdin_stdout", "input": "18\nabacab 2 329 401\nabadabacabae 1 293\nbacab 1 2\nabacabadabacabaga 1 433\nc 1 76\nbaca 1 26\ndab 1 72\nabagabaca 1 445\nabaea 1 397\ndabac 1 280\nab 2 201 309\nca 1 396\nabacabadab 1 497\nac 1 813\ncaba 1 444\nad 1 167\nbadab 1 358\naba 1 421\n", "output": "abacabaaaaaaaaaaaaaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKolya is developing an economy s...
[{"type": "stdin_stdout", "input": "1000000000\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1000000000\n", "output": "YES"}, {"type": "stdin_stdout", "input": "999129999\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "917261049\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "80321920...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 cities and M roads.\...
[{"type": "stdin_stdout", "input": "17 1\n2 8\n3 4\n1 5\n2 8\n4 7\n8 2\n4 1\n0 14", "output": "0\n1\n0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "13 7\n2 4\n3 4\n1 5\n2 8\n3 7\n5 2\n4 1\n6 8", "output": "2\n3\n2\n3\n2\n0\n1\n1\n0\n0\n0\n0\n0\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\nNaturally, the magical girl is v...
[{"type": "stdin_stdout", "input": "3\n0 0 0 1\n2\n0\n0\n0 -1 -1 0\n3\n4\n-1\n3 1 2 1\n2 1 0\n1 12\n0 15", "output": "1\n4\n12\n"}, {"type": "stdin_stdout", "input": "3\n0 0 0 1\n2\n0\n0\n0 -1 -1 0\n3\n5\n-1\n3 1 2 1\n2 1 0\n1 12\n0 15", "output": "1\n5\n12\n"}, {"type": "stdin_stdout", "input": "3\n0 0 1 0\n1\n0\n0\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\nNastya came to her informatics l...
[{"type": "stdin_stdout", "input": "4 9\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "4 9\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1\n1 1 1 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven an array of numbers (in st...
[{"input": "[\"25\", \"7\", \"8\", \"4\", \"14\", \"23\", \"8\", \"25\", \"23\", \"29\", \"16\", \"16\", \"4\"]", "output": "[\"btswmdsbd kkw\"]", "fn_name": "switcher"}, {"input": "[\"12\", \"28\", \"25\", \"21\", \"25\", \"7\", \"11\", \"22\", \"15\"]", "output": "[\"o?bfbtpel\"]", "fn_name": "switcher"}, {"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\nFor an array of non-negative int...
[{"type": "stdin_stdout", "input": "69\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n## Task\n\nComplete the function...
[{"input": "[\"MMCDXVIII\", \"\", \"MMMCCXXXIV\", \"MMMMDCLXXXI\", \"MMMCMXIL\", \"MMMMCLXI\"]", "output": "[[\"MMCDXVIII\", \"MMMCCXXXIV\", \"MMMMDCLXXXI\", \"MMMMCLXI\"]]", "fn_name": "valid_romans"}, {"input": "[\"MMMMCCCXXXII\", \"MMDCCCXXVCD\", \"MMCCCXLV\", \"DCCLXVIIICD\", \"MMMMCXII\"]", "output": "[[\"MMMMCCCX...
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 an integer a as input, pri...
[{"type": "stdin_stdout", "input": "1109", "output": "1365169019\n"}, {"type": "stdin_stdout", "input": "488", "output": "116452904\n"}, {"type": "stdin_stdout", "input": "762", "output": "443032134\n"}, {"type": "stdin_stdout", "input": "767", "output": "451806719\n"}, {"type": "stdin_stdout", "input": "853", "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\nNearly each project of the F com...
[{"type": "stdin_stdout", "input": "110 5\n- 60\n- 58\n+ 25\n- 32\n+ 86\n", "output": "105\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26 27 28 29 30 31 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 59 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMichael and Joe are playing a ga...
[{"type": "stdin_stdout", "input": "18\n1 1\n-37\n1 2\n47 0\n1 2\n-48 -7\n2 1\n37\n-8\n2 1\n-3\n27\n2 2\n46 36\n-33 -9\n2 2\n-20 24\n-6 -33\n2 2\n-50 -45\n50 10\n2 2\n-38 -12\n1 8\n3 3\n42 4 -29\n-27 28 -16\n-35 -13 26\n3 3\n-46 40 -27\n-32 28 -24\n37 13 -13\n3 3\n-38 -17 30\n22 -50 7\n-26 18 -3\n3 3\n-2 26 29\n41 11 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\nDuring a recent research Berland...
[{"type": "stdin_stdout", "input": "183\n", "output": "8372\n1 92\n1 93\n1 94\n1 95\n1 96\n1 97\n1 98\n1 99\n1 100\n1 101\n1 102\n1 103\n1 104\n1 105\n1 106\n1 107\n1 108\n1 109\n1 110\n1 111\n1 112\n1 113\n1 114\n1 115\n1 116\n1 117\n1 118\n1 119\n1 120\n1 121\n1 122\n1 123\n1 124\n1 125\n1 126\n1 127\n1 128\n1 129\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\nThor is getting used to the Eart...
[{"type": "stdin_stdout", "input": "10 85\n2 2\n1 10\n1 1\n2 6\n1 2\n1 4\n1 7\n2 1\n1 1\n3 3\n1 9\n1 6\n1 8\n1 10\n3 8\n2 8\n1 6\n1 3\n1 9\n1 6\n1 3\n1 8\n1 1\n1 6\n1 10\n2 1\n2 10\n1 10\n1 1\n1 10\n1 6\n2 2\n1 8\n1 3\n1 4\n1 9\n1 5\n1 5\n2 2\n2 4\n1 7\n1 1\n2 4\n2 9\n1 1\n1 7\n1 8\n3 14\n1 10\n2 2\n1 3\n1 10\n1 6\n3 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\nThe employees of the F company h...
[{"type": "stdin_stdout", "input": "100 50\n11 28\n11 1\n98 58\n38 27\n24 27\n67 37\n90 48\n91 14\n43 29\n3 64\n24 6\n53 19\n97 65\n13 27\n75 53\n37 82\n69 75\n94 99\n1 26\n95 60\n45 27\n100 82\n71 49\n86 99\n74 58\n88 68\n39 63\n38 23\n22 39\n29 58\n62 83\n62 1\n61 58\n2 30\n41 48\n83 90\n1 17\n73 81\n23 53\n71 16\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\n### self_converge\n`Goal`: Given...
[{"input": "992299229", "output": "[22]", "fn_name": "self_converge"}, {"input": "90900", "output": "[9]", "fn_name": "self_converge"}, {"input": "4321", "output": "[4]", "fn_name": "self_converge"}, {"input": "2111", "output": "[6]", "fn_name": "self_converge"}, {"input": "211", "output": "[7]", "fn_name": "self_conve...
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 an array consistin...
[{"type": "stdin_stdout", "input": "5\n1 1\n1 8\n7 10\n1 10\n100000 186611\n", "output": "0\n4\n1\n5\n31072\n"}, {"type": "stdin_stdout", "input": "5\n1 2\n1 13\n4 5\n4 10\n110000 200000\n", "output": "1\n6\n0\n3\n21072\n"}, {"type": "stdin_stdout", "input": "5\n1 2\n1 13\n4 5\n1 10\n110000 200000\n", "output": "1\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\nLet's denote the median of a seq...
[{"type": "stdin_stdout", "input": "4\n3 5 1\n1\n13 3 3\n1 4 7\n15 5 3\n2 5 10\n17 18 7\n2 3 5 7 5 11 12\n", "output": "NO\nYES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "4\n3 5 1\n1\n11 3 3\n1 3 7\n15 5 3\n4 5 6\n13 7 7\n2 3 5 7 9 11 12\n", "output": "NO\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "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\nAlternate Escape\n\nAlice House\...
[{"type": "stdin_stdout", "input": "3 3 2 2\n 1 1 1\n0 0 0 0\n 1 1 1\n0 0 0 0\n 1 1 1\n0 0 0 0\n 1 1 1\n3 3 2 1\n 1 0 1\n1 0 1 1\n 1 0 0\n0 0 0 0\n 0 0 1\n1 1 0 1\n 1 0 1\n1 3 1 1\n 1 1 1\n1 0 0 1\n 1 0 1\n2 2 1 1\n 1 0\n1 0 0\n 0 0\n0 0 0\n 0 0\n0 0 0 0", "output": "Yes\nYes\nYes\nNo\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\nIn the beginning, Takahashi has ...
[{"type": "stdin_stdout", "input": "231274241 358979323 84", "output": "393502366 196751183\n"}, {"type": "stdin_stdout", "input": "377378637 358979323 84", "output": "490905292 245452646\n"}, {"type": "stdin_stdout", "input": "7425724 358979323 157", "output": "122135010 244270020\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\nKaren is getting ready for a new...
[{"type": "stdin_stdout", "input": "05:51\n", "output": "250\n"}, {"type": "stdin_stdout", "input": "15:52\n", "output": "250\n"}, {"type": "stdin_stdout", "input": "06:59\n", "output": "182\n"}, {"type": "stdin_stdout", "input": "17:31\n", "output": "151\n"}, {"type": "stdin_stdout", "input": "07:59\n", "output": "122...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDuring the archaeological resear...
[{"type": "stdin_stdout", "input": "2 12\naa\n+ 1 a\n+ 2 a\n+ 3 a\n- 1\n+ 1 a\n- 2\n+ 2 a\n- 3\n+ 3 a\n+ 2 a\n- 1\n- 3\n", "output": "YES\nYES\nNO\nYES\nNO\nYES\nNO\nYES\nNO\nNO\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "2 12\naa\n+ 1 a\n+ 2 a\n+ 3 a\n- 1\n+ 1 a\n- 2\n+ 2 a\n- 3\n+ 3 a\n+ 2 a\n- 1\n- 3\n", "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\nWe have a string S of length N c...
[{"type": "stdin_stdout", "input": "50\nABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCAB\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "50\nBMZBMWEYYDIADTLCOUEGMDBYFWURPWBPUVHIFNUAPWYNDMHTQV\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "50\nKGKBHTYTSZOTWFLEGSJZZSZFWTZFPNSCGUEMWRCZQXYCIVDQNK\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\nDreamoon is a big fan of the Cod...
[{"type": "stdin_stdout", "input": "5\n6 2\n3 1 1 5 7 10\n1 100\n100\n11 1\n1 1 1 1 1 1 1 1 1 1 1\n1 1\n1\n4 57\n80 60 40 20\n", "output": "5\n101\n2\n2\n60\n"}, {"type": "stdin_stdout", "input": "5\n6 2\n3 1 1 5 7 10\n1 100\n100\n11 1\n1 1 1 1 1 1 1 1 1 1 1\n1 1\n1\n4 57\n61 60 40 20\n", "output": "5\n101\n2\n2\n61\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\nReminder: the median of the arra...
[{"type": "stdin_stdout", "input": "3\n1\n1 1\n3\n6 5 4 1 2 3\n5\n13 4 10 22 2 5 10 3 16 16\n", "output": "0\n1\n0\n"}, {"type": "stdin_stdout", "input": "3\n1\n-1 2\n3\n11 1 0 2 2 5\n5\n13 2 7 13 1 5 1 3 23 14\n", "output": "3\n0\n2\n"}, {"type": "stdin_stdout", "input": "3\n1\n1 2\n3\n6 5 4 1 2 1\n5\n13 4 7 14 2 10 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\nDark Assembly is a governing bod...
[{"type": "stdin_stdout", "input": "8 1 8109\n1944 40\n9732 40\n9214 80\n1770 40\n7837 50\n7430 100\n1753 30\n3991 60\n", "output": "0.6441514424\n"}, {"type": "stdin_stdout", "input": "8 3 6395\n8159 90\n4143 50\n6954 50\n5011 20\n9872 10\n7689 90\n8811 70\n2058 10\n", "output": "0.5175644027\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\nGiven a string, swap the case fo...
[{"input": "\"ThIs iS A l0NG sENTence witH nUMbERs in IT 123 456\"", "output": "[\"tHiS Is a L0ng SentENCE WITh NumBerS IN it 123 456\"]", "fn_name": "swap"}, {"input": "\"H_E_l-l_0 WO|||Rld\"", "output": "[\"h_e_L-L_0 wo|||rLD\"]", "fn_name": "swap"}, {"input": "\"EeEEeeEEEeee\"", "output": "[\"eEeeEEeeeEEE\"]", "fn_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\nAs a big fan of Formula One, Cha...
[{"type": "stdin_stdout", "input": "100000 100000 1\n", "output": "3.999900002193968e-05\n"}, {"type": "stdin_stdout", "input": "15566 14608 0\n", "output": "0.061604676559388505\n"}, {"type": "stdin_stdout", "input": "100000 100000 10\n", "output": "0.00120926220494\n"}, {"type": "stdin_stdout", "input": "100000 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\nThe Smart Beaver from ABBYY bega...
[{"type": "stdin_stdout", "input": "120\n242 524 420 973 816 432 247 666 134 849 145 366 1119 930 613 315 863 628 97 109 65 704 741 314 736 17 872 971 559 648 223 771 171 327 782 837 303 393 292 339 730 834 794 868 540 251 789 893 23 305 116 220 699 863 580 992 861 393 98 253 544 171 336 207 348 496 316 285 286 727 613...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 matrix of size $...
[{"type": "stdin_stdout", "input": "7 6\nypnxnnp\npnxonpm\nnxanpou\nxnnpmud\nnhtdudu\nnpmuduh\npmutsnz\n", "output": "aaaaaaadudsnz\n"}, {"type": "stdin_stdout", "input": "7 6\nypnxnnp\npnxonpm\nnxanpou\nxnnpmud\nnhtdudu\nhudumpn\npmutsnz\n", "output": "aaaaaaadudpnz\n"}, {"type": "stdin_stdout", "input": "7 6\nypnxpnn...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 now in a bookshop with y...
[{"type": "stdin_stdout", "input": "0111 12618 3831", "output": "3720\n"}, {"type": "stdin_stdout", "input": "0101 15626 3831", "output": "3730\n"}, {"type": "stdin_stdout", "input": "0110 15626 3831", "output": "3721\n"}, {"type": "stdin_stdout", "input": "0111 27455 5699", "output": "5588\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\nLet S be the sum of divisors of ...
[{"type": "stdin_stdout", "input": "1\n2\n2\n1\n1\n14\n16\n27\n66290451\n187711252\n124798312\n100001000\n0", "output": "deficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\na...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 lines in the xy-plan...
[{"type": "stdin_stdout", "input": "7\n1 7 8\n-2 4 9\n3 -8 -5\n9 2 -14\n6 7 5\n-8 -9 3\n3 8 10", "output": "-1.722222222222222 1.325000000000000"}, {"type": "stdin_stdout", "input": "7\n1 7 9\n-2 4 9\n3 -8 -5\n17 2 -14\n4 11 5\n-8 -9 3\n1 8 10", "output": "-1.027777778 1.210526316\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\nRecently Max has got himself int...
[{"type": "stdin_stdout", "input": "10 9 0\n620118469 704168608\n528098892 341451371\n15150469 449838744\n960504540 722185004\n271837337 344050133\n940943201 419522619\n85569623 788965215\n161962866 563795701\n943389281 445744350\n610994199 473866838\n", "output": "5253588583\n"}, {"type": "stdin_stdout", "input": "10 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given n segments on the ...
[{"type": "stdin_stdout", "input": "35\n-47 61\n-73 -15\n9 43\n43 -4\n13 -6\n48 -65\n49 -84\n-6 76\n40 6\n-41 11\n-63 -42\n-7 -7\n47 -98\n-17 61\n79 99\n47 -98\n61 31\n85 72\n-50 -17\n-67 45\n14 -50\n-45 61\n-6 -96\n-47 -83\n56 -58\n-24 -15\n14 20\n-95 -82\n47 93\n-4 -7\n70 9\n91 -18\n-71 31\n55 -20\n81 -8\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\nYou are given a string of words ...
[{"input": "\"what time are we climbing up the volcano\"", "output": "[\"hwta item are we milcgnib up the lovcona\"]", "fn_name": "inside_out"}, {"input": "\"massage yes massage yes massage\"", "output": "[\"samsega yes samsega yes samsega\"]", "fn_name": "inside_out"}, {"input": "\"take bintang and a dance please\"", ...
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\nTake a string and return a hash ...
[{"input": "\"hello world\"", "output": "[{\"h\": 104, \"e\": 101, \"l\": 108, \"o\": 111, \"w\": 119, \"r\": 114, \"d\": 100}]", "fn_name": "char_to_ascii"}, {"input": "\"ABaa ^\"", "output": "[{\"A\": 65, \"B\": 66, \"a\": 97}]", "fn_name": "char_to_ascii"}, {"input": "\"aaa\"", "output": "[{\"a\": 97}]", "fn_name": ...
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\nOn February, 30th n students cam...
[{"type": "stdin_stdout", "input": "185\n28 4 4 26 15 21 14 35 22 28 26 24 2 35 21 34 1 23 35 10 6 16 31 0 30 9 18 33 1 22 24 26 22 10 8 27 14 33 16 16 26 22 1 28 32 1 35 12 31 0 21 6 6 5 29 27 1 29 23 22 30 19 37 17 2 2 2 25 3 23 28 0 3 31 34 5 2 23 27 7 26 25 33 27 15 31 31 4 3 21 1 1 23 30 0 13 24 33 26 5 1 17 23 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\nAn abundant number or excessive ...
[{"input": "14771", "output": "[false]", "fn_name": "abundant_number"}, {"input": "11410", "output": "[true]", "fn_name": "abundant_number"}, {"input": "11690", "output": "[true]", "fn_name": "abundant_number"}, {"input": "118", "output": "[false]", "fn_name": "abundant_number"}, {"input": "5830", "output": "[true]", "...
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\nWe have five variables x_1, x_2,...
[{"type": "stdin_stdout", "input": "0 2 3 4 5\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1 2 0 4 5\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "1 0 3 4 5\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1 2 3 0 5\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "1 2 3 4 0\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\nOne day Vasya came across three ...
[{"type": "stdin_stdout", "input": "A>B\nC<B\nC;tg&A\n", "output": "Impossible\n"}, {"type": "stdin_stdout", "input": "A&lt:B\nB>C\nC>A\n", "output": "Impossible\n"}, {"type": "stdin_stdout", "input": "&Agt;B\nC<B\nC;tg&A\n", "output": "Impossible\n"}, {"type": "stdin_stdout", "input": "B:tl&A\nB>C\nC...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have an array a consisting o...
[{"type": "stdin_stdout", "input": "100\n15 37 41 48 50 55 62 81 82 101 129 139 141 143 146 154 163 169 170 218 220 237 240 247 249 258 266 271 281 286 288 295 308 328 330 332 338 341 349 392 394 396 408 424 436 440 443 451 452 463 465 469 472 483 484 496 506 512 524 542 550 551 570 574 586 604 610 612 618 629 635 637 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVery simple, given a number, fin...
[{"input": "-95858588225", "output": "[95858588225]", "fn_name": "opposite"}, {"input": "1425.2222", "output": "[-1425.2222]", "fn_name": "opposite"}, {"input": "-3.1458", "output": "[3.1458]", "fn_name": "opposite"}, {"input": "25.6", "output": "[-25.6]", "fn_name": "opposite"}, {"input": "1", "output": "[-1]", "fn_na...
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 Absurdistan, there are n town...
[{"type": "stdin_stdout", "input": "4 6\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "10 5\n2 5\n1 2\n1 4\n1 3\n3 2\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "4 5\n1 3\n2 1\n3 4\n4 2\n2 3\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "5 5\n2 5\n1 2\n1 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\nA continued fraction of height n...
[{"type": "stdin_stdout", "input": "633468529243155234 4\n90\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "742143496299253703 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\nNeko loves divisors. During the ...
[{"type": "stdin_stdout", "input": "1000000000 264865600\n", "output": "102701600\n"}, {"type": "stdin_stdout", "input": "1000000000 264865600\n", "output": "102701600"}, {"type": "stdin_stdout", "input": "999999973 800000007\n", "output": "199999823\n"}, {"type": "stdin_stdout", "input": "159488527 938932258\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\nMike has n strings s1, s2, ..., ...
[{"type": "stdin_stdout", "input": "33\nnkgcmrfvxe\nvxenkgcmrf\nrfvxenkgcm\nvxenkgcmrf\nxenkgcmrfv\nenkgcmrfvx\nenkgcmrfvx\nnkgcmrfvxe\nkgcmrfvxen\ncmrfvxenkg\ncmrfvxenkg\nxenkgcmrfv\nrfvxenkgcm\nrfvxenkgcm\nnkgcmrfvxe\nxenkgcmrfv\nrfvxenkgcm\nxenkgcmrfv\nxenkgcmrfv\ngcmrfvxenk\nmrfvxenkgc\nfvxenkgcmr\nvxenkgcmrf\nenkg...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 decides to observe a rive...
[{"type": "stdin_stdout", "input": "100\n0 1 2 2 3 0 1 5 6 6 0 0 8 7 1 9 9 4 10 11 12 2 12 12 12 12 9 13 14 8 15 15 15 19 15 7 17 17 18 19 9 10 21 0 22 9 2 24 24 4 24 7 25 14 5 8 28 29 30 31 31 31 0 3 15 31 8 33 6 35 35 35 36 36 37 37 38 39 28 0 2 23 75 9 9 0 6 25 41 41 12 42 43 43 36 44 51 45 43 4\n", "output": "2385\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Adilbek is taking his prob...
[{"type": "stdin_stdout", "input": "20 25\n1 1 1 1 1 1 2 2 1 1 2 1 2 2 1 2 1 1 2 2\n", "output": "846324940\n"}, {"type": "stdin_stdout", "input": "20 26\n1 2 1 1 1 2 1 1 2 2 2 1 2 1 2 1 1 2 2 1\n", "output": "509799974\n"}, {"type": "stdin_stdout", "input": "20 27\n1 2 1 2 1 2 1 2 2 1 2 2 1 2 2 2 1 1 2 1\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 lot of frogs want to cross a r...
[{"type": "stdin_stdout", "input": "100 34\n16 0 10 11 12 13 0 5 4 14 6 15 4 9 1 20 19 14 1 7 14 11 10 20 6 9 12 8 3 19 20 4 17 17 8 11 14 18 5 20 17 0 3 18 14 12 11 12 5 5 11 7 9 17 4 8 4 10 0 0 12 9 15 3 15 14 19 12 6 8 17 19 4 18 19 3 8 3 9 1 6 15 4 16 1 18 13 16 3 5 20 11 10 9 9 17 20 15 12\n", "output": "312\n"}, ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp has recently got himsel...
[{"type": "stdin_stdout", "input": "69\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n+ 1 2\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an undirected weig...
[{"type": "stdin_stdout", "input": "8 10\n1 2 1\n2 3 2\n2 4 5\n1 4 2\n6 3 3\n6 1 3\n3 5 2\n3 7 1\n4 8 1\n6 2 4\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "8 10\n1 2 1\n2 3 4\n2 4 5\n1 4 2\n6 3 3\n6 1 3\n3 5 2\n3 7 1\n4 8 1\n6 2 4\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "8 10\n1 2 1\n2 3 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\nProblem\n\nGiven $ N $ a pair of...
[{"type": "stdin_stdout", "input": "10 1 12\n15 70\n36 -1\n18 43\n26 46\n33 20\n58 10\n0 -1\n80 5\n98 32\n23 84", "output": "1\n"}, {"type": "stdin_stdout", "input": "10 1 12\n15 70\n36 -1\n18 43\n26 46\n33 20\n58 10\n0 -1\n80 5\n98 32\n23 30", "output": "1\n"}, {"type": "stdin_stdout", "input": "10 1 12\n15 70\n58 -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\nOverall there are m actors in Be...
[{"type": "stdin_stdout", "input": "50 25\n8 18 41 25 16 39 2 47 49 37 40 23 3 35 15 7 11 28 22 48 10 17 38 46 44\n4\nswyzirxhx\n28\n43 32 14 5 0 17 25 39 0 0 36 0 0 34 27 22 6 13 26 0 0 41 12 16 0 0 0 23\nzyn\n3\n36 12 47\np\n33\n38 0 35 0 6 20 43 9 15 37 17 23 2 0 0 0 0 0 34 0 28 10 33 0 5 4 7 12 36 46 0 0 45\nycaqpk...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGildong has an interesting machi...
[{"type": "stdin_stdout", "input": "7\n2\n0 1\n3\n-1 0 2\n4\n110 133 106 95\n4\n-3 -5 -2 1\n6\n1 8 3 8 4 1\n5\n5 0 0 0 5\n9\n-367741579 319422997 -415264583 -125558838 -300860379 721691728 294512916 -383235489 425814447\n", "output": "0\n1\n15\n4\n14\n5\n3449059550\n"}, {"type": "stdin_stdout", "input": "7\n2\n0 1\n3\n...
code_stdio