messages listlengths 1 1 | ground_truth stringlengths 156 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\nVera adores poems. All the poems Vera knows are divided into quatrains (groups of four lines) and in each qua... | [{"input": "7 3\nferwljzwakxedlgwl\noerwljzwakxedlgwl\nhyqombizhuhxedprb\netptjrizhuhxedprb\nurtuckar\ndkartmwramklcmi\nrurtuckar\nnurartmwramklcmi\niraziomsv\nsaziomsv\nbprapiqpayzurgij\nusyemayzurgij\nztstmeecvmkvuu\nquexlecvmkvuu\nrlhwecvmkvuu\nzecvmkvuu\niikymgbncljtub\nqiikymgbncljtub\nbcavhexqamyszgfya\nojexqamys... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe Third Doctor Who once correctly said that travel between parallel universes is \"like travelling sideways... | [{"input": "18 16 20 4\n0 0\n0 1\n1 7\n1 7\n", "output": "18 16\n17 15\n18 16\n19 17\n"}, {"input": "18 16 20 4\n0 0\n0 1\n1 7\n1 6\n", "output": "18 16\n17 15\n18 16\n19 17\n"}, {"input": "18 8 20 4\n1 1\n0 1\n1 7\n1 7\n", "output": "19 9\n18 8\n19 9\n20 10\n"}, {"input": "18 5 20 4\n1 4\n0 11\n1 7\n1 7\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\nNotes\n\nTemplate in C\n\nConstraints\n\n2 ≤ the number of operands in the expression ≤ 100\n1 ≤ the number o... | [{"input": "1 1 + 5 11 - *", "output": "-12\n"}, {"input": "0 0 + 6 21 - +", "output": "-15\n"}, {"input": "1 12 + 3 8 - *", "output": "-65\n"}, {"input": "1 0 + 6 21 - +", "output": "-14\n"}, {"input": "1 12 + 3 5 - *", "output": "-26\n"}, {"input": "2 0 + 6 21 - +", "output": "-13\n"}, {"input": "0 11 + 2 5 - *", "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\nSanta Claus decided to disassemble his keyboard to clean it. After he returned all the keys back, he suddenly... | [{"input": "dofbgdppdvmwjwtdyphhmqliydxyjfxoopxiscevowleccmhwybrxitvujkfliamvqinlrpytyaqdlbywccprukoisyaseibuqbfqjcabkieimsggsakpnqliwhehnemewhychqrfiuyaecoydnromrh\ndofbgdppdvmwjwtdyphhmqliydxyjfxoopxiscevowleccmhwybsxitvujkfliamvqinlrpytyaqdlbywccprukoisyaseibuqbfqjcabkieimsggsakpnqliwhehnemewhychqrfiuyaecoydnromrh\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\nPetya works as a PR manager for a successful Berland company BerSoft. He needs to prepare a presentation on t... | [{"input": "100\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100\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\nProblem Statement\n\nMr. Takatsuki, who is planning to participate in the Aizu training camp, is enthusiastic... | [{"input": "6\nZI?U -1\nLINFR 14\nKNGE -1\nLCL -1\n@S 2\nKFHD 15\nBSKA\nILIC\nPZRH\nEDLU\n1", "output": "0\n"}, {"input": "6\n[I?U -1\nLINFR 14\nKNGE -1\nLCL -1\n@S 2\nKFHD 15\nBSKA\nILIC\nPZRH\nEDLU\n1", "output": "0\n"}, {"input": "6\n[I?U -1\nRFNIL 14\nKNGE -1\nLCL -1\n@S 2\nKFHD 15\nBSKA\nILIC\nPZRH\nEDLU\n1", "out... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have a robot that can move along a number line. At time moment $0$ it stands at point $0$.\n\nYou give $n... | [{"input": "8\n3\n1 5\n3 0\n6 4\n3\n1 5\n2 4\n10 -5\n5\n2 -5\n3 1\n4 1\n5 1\n6 1\n4\n3 3\n5 -3\n9 2\n12 0\n8\n1 1\n2 -6\n7 2\n8 3\n12 -9\n14 2\n18 -1\n23 9\n5\n1 -4\n4 -7\n6 -1\n7 -3\n8 -7\n2\n1 2\n2 -2\n6\n3 10\n5 5\n8 0\n12 -4\n14 -7\n19 -5\n", "output": "\n1\n2\n0\n2\n1\n1\n0\n2\n"}, {"input": "8\n3\n1 5\n3 0\n6 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\nMisha was interested in water delivery from childhood. That's why his mother sent him to the annual Innovativ... | [{"input": "100 74 20\n9 15 16 18 55 41 64 44 5 1 27 31 36 25 71 28 71 35 47 40 21 53 31 11 24 1 69 67 58 16 19 52 33 17 63 1 49 28 17 52 46 60 53 21 21 60 19 63 11 61 10 27 3 22 38 31 45 69 61 18 58 22 8 71 17 1 64 70 56 10 66 47 70 1 45 8 66 8 66 25 39 45 47 7 41 24 41 72 16 42 28 7 15 10 38 29 50 4 37 11\n123\n140\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\nYou are given a sequence $a=[a_1,a_2,\\dots,a_n]$ consisting of $n$ positive integers.\n\nLet's call a group ... | [{"input": "4\n6\n55 45 30 30 40 100\n4\n10 23 7 13\n5\n10 55 35 30 65\n6\n4 1 1 1 1 4\n", "output": "3\n4\n2\n3\n"}, {"input": "5\n4\n18 6 6 6\n5\n5 5 5 5 5\n3\n12 6 6\n2\n1 1\n1\n1\n", "output": "3\n1\n2\n1\n1\n"}, {"input": "4\n3\n6 6 12\n4\n18 6 6 6\n5\n1 1 1 1 1\n3\n12 6 6\n", "output": "2\n3\n1\n2\n"}, {"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\nSnuke is giving cookies to his three goats.\nHe has two cookie tins. One contains A cookies, and the other co... | [{"input": "-4 -10", "output": "Impossible\n"}, {"input": "-1 14", "output": "Impossible\n"}, {"input": "-2 28", "output": "Impossible\n"}, {"input": "-2 40", "output": "Impossible\n"}, {"input": "-1 -1", "output": "Impossible\n"}, {"input": "-2 -2", "output": "Impossible\n"}, {"input": "11 -1", "output": "Impossible\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\nThere are five people playing a game called \"Generosity\". Each person gives some non-zero number of coins b... | [{"input": "100 100 100 100 100\n", "output": "100\n"}, {"input": "100 100 100 100 100\n", "output": "100\n"}, {"input": "180 100 100 100 100\n", "output": "116\n"}, {"input": "203 100 101 000 101\n", "output": "101\n"}, {"input": "100 000 100 100 100\n", "output": "80\n"}, {"input": "180 000 100 100 100\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\nSeveral months later Alex finally got his brother Bob's creation by post. And now, in his turn, Alex wants to... | [{"input": "-155221108 -190475340 -155221108 -819044368\n-155221108 -190475340 -155875856 -190475340\n-155875856 -190475340 -155875856 -819044368\n-155875856 -819044368 -155221108 -819044368\n", "output": "YES\n"}, {"input": "-985236057 -809433993 -985236057 -225363622\n-484344733 -225363622 -484344733 -225363622\n-985... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYour task is to construct a building which will be a pile of n cubes.\nThe cube at the bottom will have a vol... | [{"input": "10252519345963644753025", "output": "[450010]", "fn_name": "find_nb"}, {"input": "102525193459636447530260", "output": "[-1]", "fn_name": "find_nb"}, {"input": "10252519345963644753026", "output": "[-1]", "fn_name": "find_nb"}, {"input": "1025292944081385001", "output": "[45001]", "fn_name": "find_nb"}, {"i... | 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\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The... | [{"input": "1000000000000001\n", "output": "gbdpxgrzxjm\n"}, {"input": "530000050000000\n", "output": "csoypdctwnh\n"}, {"input": "95678123450002\n", "output": "qpdjiixlxb\n"}, {"input": "1000000000\n", "output": "cfdgsxl\n"}, {"input": "1000000001\n", "output": "cfdgsxm\n"}, {"input": "321272416\n", "output": "aaaaaaj... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMove every letter in the provided string forward 10 letters through the alphabet.\n\nIf it goes past 'z', sta... | [{"input": "\"returnofthespacecamel\"", "output": "[\"bodebxypdroczkmomkwov\"]", "fn_name": "move_ten"}, {"input": "\"bringonthebootcamp\"", "output": "[\"lbsxqyxdrolyydmkwz\"]", "fn_name": "move_ten"}, {"input": "\"weneedanofficedog\"", "output": "[\"goxoonkxyppsmonyq\"]", "fn_name": "move_ten"}, {"input": "\"examplet... | 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\nLittle Bolek has found a picture with n mountain peaks painted on it. The n painted peaks are represented by ... | [{"input": "100 20\n2 3 0 4 0 1 0 6 3 4 3 6 4 6 0 9 0 6 2 7 3 8 7 10 2 9 3 9 5 6 5 10 3 7 1 5 2 8 3 7 2 3 1 6 0 8 3 8 0 4 1 8 3 7 1 9 5 9 5 8 7 8 5 6 5 8 1 9 8 9 8 10 7 10 5 8 6 10 2 6 3 9 2 6 3 10 5 9 3 10 1 3 2 11 8 9 8 10 1 8 7 11 0 9 5 8 4 5 0 7 3 7 5 9 5 10 1 7 1 9 1 6 3 8 2 4 1 4 2 6 0 4 2 4 2 7 6 9 -1 1 0 4 0 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\nAs it's the first of April, Heidi is suspecting that the news she reads today are fake, and she does not want... | [{"input": "sjvmovplbrnakthytvanvvbscgdcdkdkbgginnbiyczyrkywcuvbgolznifdyiilonvqblbywxzgjnntldeuhhlecubshirsdxugezholvufotprjovwqiitypvaghlcxlrajrtufmysbpegjfvdboewogamnunalynjvwiopqfhndupfqxfatbpklpzdsdmzwvtitvdxkefremodmlferuxyisxmvjydjthekokldjkwoiffmhlquulcbogdnnzqaisoxqpgztuzvbleiitrqbzljbbjzugwthffpsolefofaqrpkce... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn your garden, there is a long and narrow flowerbed that stretches infinitely to the east. You have decided ... | [{"input": "1 1000000000\n1000000000000000000 1000000000", "output": "1999999999000000000"}, {"input": "3 17\n22 15\n10 10\n17 10", "output": "70\n"}, {"input": "3 17\n22 19\n10 10\n17 10", "output": "77\n"}, {"input": "3 27\n22 19\n10 10\n1 10", "output": "110\n"}, {"input": "3 27\n22 35\n10 10\n1 10", "output": "120\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regu... | [{"input": "10\n22290 75956\n-66905 -22602\n-88719 12654\n-191 -81032\n0 -26057\n-39609 0\n0 51194\n2648 88230\n90584 15544\n0 23060\n-29107 26878\n", "output": "NO\n"}, {"input": "10\n22290 75956\n-66905 -22602\n-88719 12654\n-191 -81032\n0 -26057\n-39609 0\n0 51194\n4903 88230\n90584 15544\n0 23060\n-29107 26878\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\nC --Misawa's rooted tree\n\nProblem Statement\n\nYou noticed that your best friend Misawa's birthday was near... | [{"input": "((()[1]())[2]())[5](((()[2]())[6](()[3]()))[8]()(\n(()[4]())[3](((()[2]())[1]())[8](()[4]')))", "output": "(()[6]())[8](((()[4]())[7]())[16]())\n"}, {"input": "((()[8]())[2]())[5](((()[3]())[6](()[3]()))[2]())\n(()[4]())[2](((()[2]())[1]())[8](()[3]())(", "output": "(()[6]())[7](((()[5]())[7]())[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\nThe fundamental idea in the JPEG compression algorithm is to sort coeffi- cient of given image by zigzag path... | [{"input": "3\n9\n0", "output": "Case 1:\n 1 2 6\n 3 5 7\n 4 8 9\nCase 2:\n 1 2 6 7 15 16 28 29 45\n 3 5 8 14 17 27 30 44 46\n 4 9 13 18 26 31 43 47 60\n 10 12 19 25 32 42 48 59 61\n 11 20 24 33 41 49 58 62 71\n 21 23 34 40 50 57 63 70 72\n 22 35 39 51 56 64 69 73 78\n 36 38 52 55 65 68 74 77 79\n 37 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe bear decided to store some raspberry for the winter. He cunningly found out the price for a barrel of hon... | [{"input": "100 9\n66 71 37 41 23 38 77 11 74 13 51 26 93 56 81 17 12 70 85 37 54 100 14 99 12 83 44 16 99 65 13 48 92 32 69 33 100 57 58 88 25 45 44 85 5 41 82 15 37 18 21 45 3 68 33 9 52 64 8 73 32 41 87 99 26 26 47 24 79 93 9 44 11 34 85 26 14 61 49 38 25 65 49 81 29 82 28 23 2 64 38 13 77 68 67 23 58 57 83 46\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\nIn this kata you will have to modify a sentence so it meets the following rules:\n\nconvert every word backwa... | [{"input": "\"As Grainier drove along in the wagon behind a wide, slow, sand-colored mare, clusters of orange butterflies exploded off the purple blackish piles of bear sign and winked and winked and fluttered magically like leaves without trees.\"", "output": "[\"AS reiniarG drove along IN the wagon behind 0 WIDE, SLO... | 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\nYou are an all-powerful being and you have created a rectangular world. In fact, your world is so bland that ... | [{"input": "4\n7 8\nAAPAAAAA\nAAAAPPPP\nPPPPAAAA\nAPAAPPPP\nAPAPPAPP\nAAAAPPAP\nAAAAPPAA\n6 5\nAAAAA\nAAAAA\nAAPAA\nAAPAP\nAAAPP\nAAAPP\n4 4\nPPPP\nPPPP\nPPPP\nPPPP\n3 4\nPPPP\nPAAP\nPPPP\n", "output": "2\n1\nMORTAL\n4\n"}, {"input": "4\n7 8\nAAPABAAA\nPPPPAAAA\nPPPPAAAA\nAQAAPPPP\nAPAPPAPP\nAAAAPPAP\nAAABPPAA\n6 5\nAA... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a system of n vessels arranged one above the other as shown in the figure below. Assume that the ves... | [{"input": "50\n57 122 98 44 22 63 5 65 36 69 49 54 61 15 58 79 50 30 43 155 18 105 46 92 72 67 67 51 34 40 50 77 91 53 79 72 72 34 91 75 83 67 71 93 11 51 85 20 6 2\n20\n2 40\n1 14 102\n2 4\n2 15\n2 43\n1 29 532\n2 27\n2 47\n1 24 107\n1 20 720\n1 21 315\n2 20\n1 2 787\n1 27 909\n2 38\n1 32 445\n1 38 17\n1 26 450\n2 40... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe number 105 is quite special - it is odd but still it has eight divisors.\nNow, your task is this: how man... | [{"input": "105\n", "output": "1\n"}, {"input": "104\n", "output": "0\n"}, {"input": "134\n", "output": "1\n"}, {"input": "135\n", "output": "2\n"}, {"input": "164\n", "output": "2\n"}, {"input": "165\n", "output": "3\n"}, {"input": "188\n", "output": "3\n"}, {"input": "189\n", "output": "4\n"}, {"input": "194\n", "out... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a positive integer N. Find the number of the pairs of integers u and v (0≦u,v≦N) such that ther... | [{"input": "1000000001000000000", "output": "999867657\n"}, {"input": "1100000001000000000", "output": "355035671\n"}, {"input": "1100000001000010000", "output": "391646023\n"}, {"input": "1100000001001010000", "output": "103347644\n"}, {"input": "1100000011001010000", "output": "194416284\n"}, {"input": "1100000001001... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array $a_1, a_2, \\dots , a_n$ consisting of integers from $0$ to $9$. A subarray $a_l, a_{l... | [{"input": "11\n1\n0\n1\n1\n1\n2\n1\n3\n1\n4\n1\n5\n1\n6\n1\n7\n1\n8\n1\n9\n26\n11140000000090000000002111\n", "output": "0\n1\n0\n0\n0\n0\n0\n0\n0\n0\n37\n"}, {"input": "11\n1\n0\n1\n1\n1\n2\n1\n3\n1\n4\n1\n5\n1\n6\n1\n7\n1\n8\n1\n9\n26\n11140000000090000000002111\n", "output": "0\n1\n0\n0\n0\n0\n0\n0\n0\n0\n37\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\nYou will be given a contest schedule for D days. For each d=1,2,\\ldots,D, calculate the satisfaction at the ... | [{"input": "5\n86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 121\n19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424\n6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 10711 4917 10770 17272 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nChef has decided to arrange the free shuttle service for his employees. City of Bhiwani has a strange layout ... | [{"input": "3\n2\n181\n2", "output": "1\n180\n1\n"}, {"input": "3\n2\n132\n1", "output": "1\n40\n1\n"}, {"input": "3\n2\n166\n1", "output": "1\n82\n1\n"}, {"input": "3\n2\n1\n106", "output": "1\n1\n52\n"}, {"input": "3\n4\n1\n106", "output": "2\n1\n52\n"}, {"input": "3\n5\n1\n106", "output": "4\n1\n52\n"}, {"input": "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\nLet's call the string beautiful if it does not contain a substring of length at least $2$, which is a palindr... | [{"input": "10 3\naaabababaa\n1 1\n2 10\n1 2\n", "output": "0\n6\n1\n"}, {"input": "10 3\naaabababaa\n1 1\n3 10\n1 2\n", "output": "0\n5\n1\n"}, {"input": "10 3\naaabababaa\n1 1\n2 10\n1 4\n", "output": "0\n6\n2\n"}, {"input": "10 3\naaabababaa\n1 1\n2 10\n1 8\n", "output": "0\n6\n5\n"}, {"input": "10 3\naaabababaa\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\nPetya studies at university. The current academic year finishes with $n$ special days. Petya needs to pass $m... | [{"input": "100 43\n76 77 1\n24 25 1\n2 3 1\n85 86 1\n49 50 1\n15 16 1\n30 31 1\n78 79 1\n54 55 1\n58 59 1\n17 18 1\n67 68 1\n21 22 1\n80 81 1\n35 36 1\n8 9 1\n83 84 1\n44 45 1\n62 63 1\n64 65 1\n72 73 1\n27 28 1\n56 57 1\n12 13 1\n40 41 1\n32 33 1\n52 53 1\n70 71 1\n97 98 1\n37 38 1\n87 88 1\n46 47 1\n89 90 1\n4 5 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\nThe only difference between the easy and hard versions are the locations you can teleport to.\n\nConsider the... | [{"input": "1\n100 123\n398 282 403 364 468 174 143 360 217 340 354 195 84 253 114 421 494 370 104 214 149 469 446 362 108 106 115 402 253 461 483 59 365 94 281 84 248 321 228 196 96 360 321 357 151 250 496 207 425 397 114 345 252 489 30 345 182 310 440 392 111 361 49 307 328 84 201 339 351 459 372 50 72 223 246 215 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\nSince I got tired to write long problem statements, I decided to make this problem statement short. For given... | [{"input": "12\n7\n24\n0", "output": "8\n2\n11\n"}, {"input": "12\n11\n2\n0", "output": "8\n2\n2\n"}, {"input": "12\n15\n2\n0", "output": "8\n5\n2\n"}, {"input": "12\n11\n4\n0", "output": "8\n2\n3\n"}, {"input": "12\n15\n1\n0", "output": "8\n5\n1\n"}, {"input": "12\n16\n4\n0", "output": "8\n5\n3\n"}, {"input": "12\n11\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMin Element\n\nGiven the sequence a_1, a_2, .., a_N.\n\nFind the minimum number in this sequence.\n\nIf the m... | [{"input": "6\n10 17 3 2 6 -1", "output": "6\n"}, {"input": "6\n3 33 0 2 10 -1", "output": "6\n"}, {"input": "6\n3 55 0 2 10 -1", "output": "6\n"}, {"input": "6\n3 55 0 4 10 -1", "output": "6\n"}, {"input": "6\n10 59 0 0 10 1", "output": "3\n"}, {"input": "6\n10 37 0 0 10 1", "output": "3\n"}, {"input": "6\n10 60 0 0 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\nSoon after the Chunga-Changa island was discovered, it started to acquire some forms of civilization and even... | [{"input": "500000000000000000 500000000000000000 1000000000000000000\n", "output": "1 500000000000000000\n"}, {"input": "500000000000000000 500000000000000000 1000000000000000000\n", "output": "1 500000000000000000\n"}, {"input": "350919308160677995 916982339945800203 1000000000000001000\n", "output": "1 8301766005420... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nImplement function which will return sum of roots of a quadratic equation rounded to 2 decimal places, if the... | [{"input": "1\n-1.6666666666666667\n-26", "output": "[1.67]", "fn_name": "roots"}, {"input": "8\n47\n41", "output": "[-5.88]", "fn_name": "roots"}, {"input": "1\n-35\n-23", "output": "[35]", "fn_name": "roots"}, {"input": "3\n11\n6", "output": "[-3.67]", "fn_name": "roots"}, {"input": "7\n-2\n-5", "output": "[0.29]", "... | 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\nVasya claims that he had a paper square. He cut it into two rectangular parts using one vertical or horizonta... | [{"input": "3\n2 3\n3 1\n3 2\n1 3\n3 3\n1 3\n", "output": "Yes\nYes\nNo\n"}, {"input": "3\n2 3\n3 1\n3 2\n1 3\n3 6\n1 3\n", "output": "Yes\nYes\nNo\n"}, {"input": "3\n2 3\n3 1\n3 2\n1 3\n3 6\n1 0\n", "output": "Yes\nYes\nNo\n"}, {"input": "3\n2 3\n3 1\n3 2\n1 3\n3 3\n1 3\n", "output": "Yes\nYes\nNo\n"}, {"input": "3\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\nYou are given a sequence of a journey in London, UK. The sequence will contain bus **numbers** and TFL tube n... | [{"input": "[\"Northern\", \"Central\", \"Circle\"]", "output": "[\"\\u00a37.20\"]", "fn_name": "london_city_hacker"}, {"input": "[12, \"Central\", \"Circle\", 21]", "output": "[\"\\u00a37.80\"]", "fn_name": "london_city_hacker"}, {"input": "[\"Piccidilly\", 56, 93, 243]", "output": "[\"\\u00a35.40\"]", "fn_name": "lon... | 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\nIn the advanced algorithm class, n2 students sit in n rows and n columns. One day, a professor who teaches th... | [{"input": "3\n1 2 5\n11 3 6\n12 5 9\n3\n1 11 3\n13 11 14\n4 8 6\n0", "output": "5\n11\n"}, {"input": "3\n2 1 3\n4 2 11\n7 0 4\n3\n1 4 12\n14 10 18\n4 8 10\n0", "output": "2\n10\n"}, {"input": "3\n1 2 10\n11 3 6\n12 9 15\n3\n1 11 3\n13 11 9\n7 8 1\n0", "output": "9\n9\n"}, {"input": "3\n2 1 3\n4 2 1\n7 -1 4\n3\n0 4 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\nYou are given $n$ positive integers $a_1, \\ldots, a_n$, and an integer $k \\geq 2$. Count the number of pair... | [{"input": "100 3\n94 94 149 27 80 73 61 38 34 139 72 96 59 36 113 15 83 78 39 22 21 57 54 20 9 32 81 64 55 90 67 41 18 57 93 76 44 62 77 66 31 70 39 73 81 57 43 31 20 104 62 26 44 26 23 23 66 53 3 14 10 170 53 19 43 81 98 12 91 15 122 90 89 86 58 30 67 73 46 69 68 47 30 7 89 35 17 93 45 6 4 23 73 36 10 34 73 25 45 27\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given a regular polygon with $n$ vertices labeled from $1$ to $n$ in counter-clockwise order. The tri... | [{"input": "500\n", "output": "41666498\n"}, {"input": "497\n", "output": "40920990\n"}, {"input": "494\n", "output": "40184428\n"}, {"input": "491\n", "output": "39456758\n"}, {"input": "488\n", "output": "38737926\n"}, {"input": "485\n", "output": "38027878\n"}, {"input": "482\n", "output": "37326560\n"}, {"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\nA binary string is a string that consists of characters $0$ and $1$. A bi-table is a table that has exactly t... | [{"input": "4\n7\n0001000\n1101100\n5\n01001\n10110\n2\n01\n01\n6\n010000\n011111\n", "output": "10\n10\n2\n10\n"}, {"input": "4\n7\n0101000\n1100100\n5\n01100\n10101\n2\n01\n01\n6\n000100\n111111\n", "output": "10\n8\n2\n10\n"}, {"input": "4\n7\n0001000\n1101100\n5\n01001\n10101\n2\n01\n01\n6\n010000\n001111\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\nYou're in ancient Greece and giving Philoctetes a hand in preparing a training exercise for Hercules! You've ... | [{"input": "5455\n54956", "output": "[\"No solutions\"]", "fn_name": "beasts"}, {"input": "25\n555", "output": "[\"No solutions\"]", "fn_name": "beasts"}, {"input": "54\n956", "output": "[\"No solutions\"]", "fn_name": "beasts"}, {"input": "12\n25", "output": "[\"No solutions\"]", "fn_name": "beasts"}, {"input": "-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\nA tutorial for this problem is now available on our blog. Click here to read it. \n\nYou are asked to calcul... | [{"input": "4\n1\n2\n4\n57", "output": "1\n2\n24\n40526919504877216755680601905432322134980384796226602145184481280000000000000\n"}, {"input": "4\n5\n3\n10\n29", "output": "120\n6\n3628800\n8841761993739701954543616000000\n"}, {"input": "4\n5\n4\n4\n29", "output": "120\n24\n24\n8841761993739701954543616000000\n"}, {"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\nThere are N people, conveniently numbered 1 through N.\nWe want to divide them into some number of groups, un... | [{"input": "1000 1 1000 1 1000\n", "output": "465231251\n"}, {"input": "1000 1 1000 2 1000", "output": "860178665\n"}, {"input": "1000 1 1000 3 1000", "output": "980205027\n"}, {"input": "1000 1 1000 1 1001", "output": "465231251\n"}, {"input": "1000 1 1001 5 1010", "output": "354813907\n"}, {"input": "1000 1 1000 3 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\nToday in the scientific lyceum of the Kingdom of Kremland, there was a biology lesson. The topic of the lesso... | [{"input": "50\nROWGGKNUITVHOBMKZXOZNBZMQGSFERNCZDFKLRBCFVVDXJEFLP\n", "output": "13\n"}, {"input": "50\nALWLSFLXYPQYMIWXMYMXFYMIVFYJDTJAIGVOAUDAIIAHKNNVTX\n", "output": "13\n"}, {"input": "50\nHKKUWHLYYKBLLEHKVNIRYAPVFTAPRIFUZELKGRDXZNCNWHSAFG\n", "output": "14\n"}, {"input": "50\nVKRGXLUWYURTRNGAODFLYCKAPHGPHGDLWIGXE... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYour task is very simple. Just write a function `isAlphabetic(s)`, which takes an input string `s` in lowerca... | [{"input": "\"codewars\"", "output": "[false]", "fn_name": "alphabetic"}, {"input": "\"asd\"", "output": "[false]", "fn_name": "alphabetic"}, {"input": "\"door\"", "output": "[true]", "fn_name": "alphabetic"}, {"input": "\"cell\"", "output": "[true]", "fn_name": "alphabetic"}, {"input": "\"z\"", "output": "[true]", "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\nYou wrote down all integers from $0$ to $10^n - 1$, padding them with leading zeroes so their lengths are exa... | [{"input": "2352\n", "output": "388795058 433322746 541969001 523323201 867893102 537695799 837561050 990678065 688882179 577079614 937069914 960273782 761665782 282484628 787581089 314410468 983373531 353249698 130693309 82500826 144964998 247781749 108001361 947489703 358119467 770902487 739563471 529518967 368034134... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYaroslav thinks that two strings s and w, consisting of digits and having length n are non-comparable if ther... | [{"input": "10\n?8?528?91?\n1???60??54\n", "output": "1000000000\n"}, {"input": "10\n?8?258?91?\n1???60??54\n", "output": "1000000000\n"}, {"input": "10\n0????19?01\n????164759\n", "output": "1000000000\n"}, {"input": "10\n219?85??8?\n45??06???1\n", "output": "1000000000\n"}, {"input": "10\n???0?19?01\n957461????\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\nYou are an immigration officer in the Kingdom of AtCoder. The document carried by an immigrant has some numbe... | [{"input": "100\n768 125 109 300 471 697 999 760 529 42 373 15 59 387 75 823 850 330 756 661 700 610 99 156 367 481 720 588 477 65 513 600 569 531 970 97 456 223 963 625 823 612 421 633 774 529 190 835 245 263 861 456 893 293 762 270 955 457 65 941 787 700 617 813 550 70 807 217 683 935 732 320 815 821 397 445 807 439 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nNearly each project of the F company has a whole team of developers working on it. They often are in differen... | [{"input": "100 5\n- 60\n- 58\n+ 25\n- 32\n+ 86\n", "output": "95\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 84 85 87 88 89 90 91 92 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\nThere is a 120 minute videotape with standard recording. When I set the VCR counter to 00:00:00 with the tape... | [{"input": "1 36 0\n-1 -1 -1", "output": "00:24:00\n01:12:00\n"}, {"input": "0 30 0\n-1 -1 -1", "output": "01:30:00\n04:30:00\n"}, {"input": "0 32 0\n-1 -1 -1", "output": "01:28:00\n04:24:00\n"}, {"input": "1 16 0\n-1 -1 -1", "output": "00:44:00\n02:12:00\n"}, {"input": "0 36 0\n-1 -1 -1", "output": "01:24:00\n04:12: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\nThe zombies are gathering in their secret lair! Heidi will strike hard to destroy them once and for all. But ... | [{"input": "10\n0000000000\n0000000000\n0000000000\n0000000000\n0000000000\n0000000000\n0012100000\n0024200000\n0012100000\n0000000000\n", "output": "Yes\n"}, {"input": "10\n0000000000\n0122210000\n0244420100\n0122210000\n0000000000\n0000000000\n0000000000\n0000000000\n0000000000\n0000000000\n", "output": "No\n"}, {"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\nThe start of the new academic year brought about the problem of accommodation students into dormitories. One ... | [{"input": "1000000000 1000000000 1000000000\n", "output": "1000000000000000000\n1000000000 1000000000\n"}, {"input": "1000000000 1000000000 1000000000\n", "output": "1000000000000000000\n1000000000 1000000000\n"}, {"input": "1000001000 1000000000 1000000000\n", "output": "1000000000000000000\n1000000000 1000000000\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\nN programmers are going to participate in the preliminary stage of DDCC 20XX. Due to the size of the venue, h... | [{"input": "3\n1 0\n0 10\n7 2", "output": "12\n"}, {"input": "3\n1 0\n0 17\n7 2", "output": "19\n"}, {"input": "3\n1 1\n0 17\n7 2", "output": "20\n"}, {"input": "3\n1 0\n0 27\n7 2", "output": "29\n"}, {"input": "3\n1 1\n0 10\n7 2", "output": "13\n"}, {"input": "3\n1 0\n1 17\n7 2", "output": "21\n"}, {"input": "3\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\nThere are n points on the plane, the i-th of which is at (x_i, y_i). Tokitsukaze wants to draw a strange rect... | [{"input": "35\n8 1\n6 8\n4 1\n1 2\n1 4\n5 10\n10 8\n9 1\n9 9\n10 2\n6 5\n8 8\n7 6\n10 6\n9 4\n4 9\n3 2\n1 8\n3 9\n7 3\n3 7\n2 7\n3 8\n3 1\n2 2\n5 5\n7 2\n4 10\n6 3\n5 1\n8 10\n4 3\n9 8\n9 7\n3 10\n", "output": "316"}, {"input": "35\n4 2\n9 6\n3 10\n2 5\n7 9\n6 9\n10 7\n6 6\n5 4\n4 10\n5 9\n8 1\n2 4\n9 9\n5 7\n6 5\n10 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are N towns in the State of Atcoder, connected by M bidirectional roads.\nThe i-th road connects Town A... | [{"input": "4 6 3\n2 3 4\n1 2 4\n2 3 3\n4 3 1\n1 4 1\n4 2 2\n3 1 6\n", "output": "3\n"}, {"input": "4 6 3\n2 3 4\n1 2 4\n2 3 6\n4 3 1\n1 4 1\n4 2 2\n3 1 6", "output": "3\n"}, {"input": "4 6 3\n2 3 4\n1 2 4\n2 3 6\n4 3 1\n1 4 1\n4 1 2\n3 1 6", "output": "7\n"}, {"input": "4 6 3\n2 3 4\n1 2 4\n2 3 6\n4 4 1\n1 4 1\n4 2 2\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a given sequence of integers a1, a2, ..., an, where every number is from 1 to 3 inclusively. You hav... | [{"input": "30\n2 1 3 2 3 2 2 2 2 3 2 2 3 2 1 1 3 1 3 2 1 2 3 1 1 3 3 1 3 1\n", "output": "19\n"}, {"input": "30\n2 1 3 2 3 2 2 2 2 3 2 2 1 2 1 1 3 1 3 2 1 2 3 1 1 3 3 1 3 1\n", "output": "19\n"}, {"input": "30\n2 1 3 2 3 2 2 2 2 3 2 2 1 2 1 1 3 1 3 2 1 2 3 1 1 3 2 1 3 1\n", "output": "18\n"}, {"input": "30\n2 1 3 2 3 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA very easy task for you!\n\nYou have to create a method, that corrects a given date string.\nThere was a pro... | [{"input": "\"03.12.2016\"", "output": "[\"03.12.2016\"]", "fn_name": "date_correct"}, {"input": "\"30.02.2016\"", "output": "[\"01.03.2016\"]", "fn_name": "date_correct"}, {"input": "\"40.06.2015\"", "output": "[\"10.07.2015\"]", "fn_name": "date_correct"}, {"input": "\"11.13.2014\"", "output": "[\"11.01.2015\"]", "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\nNowadays it is becoming increasingly difficult to park a car in cities successfully. Let's imagine a segment ... | [{"input": "50 3 1\n30\n1 9\n2 1\n1 6\n1 5\n1 8\n1 1\n2 6\n1 7\n2 3\n2 8\n1 7\n2 4\n2 5\n2 11\n1 2\n2 15\n1 6\n1 3\n2 17\n1 9\n1 3\n2 18\n1 3\n2 23\n2 21\n1 8\n1 2\n2 27\n1 8\n2 29\n", "output": "0\n0\n9\n17\n28\n28\n0\n0\n0\n9\n15\n0\n6\n0\n11\n27\n"}, {"input": "50 3 2\n30\n1 9\n2 1\n1 6\n1 5\n1 8\n1 1\n2 6\n1 7\n2 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\nYou are given two integers a and b. Moreover, you are given a sequence s_0, s_1, ..., s_{n}. All values in s ... | [{"input": "904132655 827386249 118827660 334\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\nKarl is developing a key storage service. Each user has a positive integer key.\n\nKarl knows that storing ke... | [{"input": "100\n1\n3\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n14\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n19\n42\n43\n44\n45\n46\n47\n20\n49\n50\n65\n52\n53\n54\n55\n56\n57\n58\n59\n60\n61\n62\n63\n64\n65\n66\n67\n68\n69\n70\n71\n72\n73\n123\n75\n76\n77\n78\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOnce again Tavas started eating coffee mix without water! Keione told him that it smells awful, but he didn't... | [{"input": "777777777\n", "output": "1022\n"}, {"input": "444444444\n", "output": "511\n"}, {"input": "477477447\n", "output": "728\n"}, {"input": "777744747\n", "output": "996\n"}, {"input": "777777777\n", "output": "1022"}, {"input": "477477447\n", "output": "728"}, {"input": "777744747\n", "output": "996"}, {"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\n*This kata is based on [Project Euler Problem #349](https://projecteuler.net/problem=349). You may want to st... | [{"input": "10000000", "output": "[1153412]", "fn_name": "langtons_ant"}, {"input": "1000000", "output": "[114952]", "fn_name": "langtons_ant"}, {"input": "100000", "output": "[11108]", "fn_name": "langtons_ant"}, {"input": "10000", "output": "[720]", "fn_name": "langtons_ant"}, {"input": "1000", "output": "[118]", "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\nYou are given a string $s$, consisting of $n$ letters, each letter is either 'a' or 'b'. The letters in the s... | [{"input": "4\n1\na\n6\nabbaba\n6\nabbaba\n9\nbabbabbaa\n", "output": "-1 -1\n1 2\n1 2\n1 2\n"}, {"input": "4\n1\na\n6\nabbaba\n6\nabbaba\n9\nbabbabbaa\n", "output": "-1 -1\n1 2\n1 2\n1 2\n"}, {"input": "4\n1\na\n6\nabbaba\n6\nabbaba\n7\nbabbabbaa\n", "output": "-1 -1\n1 2\n1 2\n1 2\n"}, {"input": "4\n1\na\n6\nababba\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\nThere are $n$ players sitting at the card table. Each player has a favorite number. The favorite number of th... | [{"input": "50 1\n995 1815 941 1716 725 1098 747 627 1728 1007 34 1001 679 1742 22 1495 1299 1696 507 631 1971 775 1052 1665 1035 203 1564 1329 1592 1295 983 177 734 1442 172 943 33 486 1078 946 947 592 1524 563 396 1541 1670 326 543 79\n176 214 1601 1758 1468 972 628 1524 1506 425 746 309 387 1761 1002 625 496 1638 18... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nValera runs a 24/7 fast food cafe. He magically learned that next day n people will visit his cafe. For each ... | [{"input": "50\n0 23\n1 21\n2 8\n2 45\n3 1\n4 19\n4 37\n7 7\n7 40\n8 43\n9 51\n10 13\n11 2\n11 19\n11 30\n12 37\n12 37\n12 37\n12 37\n12 37\n12 37\n12 37\n12 37\n12 54\n13 32\n13 42\n14 29\n14 34\n14 48\n15 0\n15 27\n16 22\n16 31\n17 25\n17 26\n17 33\n18 14\n18 16\n18 20\n19 0\n19 5\n19 56\n20 22\n21 26\n22 0\n22 10\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\nYou have a nuts and lots of boxes. The boxes have a wonderful feature: if you put x (x ≥ 0) divisors (the spa... | [{"input": "1201 495 438 1293\n", "output": "1\n"}, {"input": "241 1202 830 417\n", "output": "1\n"}, {"input": "1201 492 438 690\n", "output": "1\n"}, {"input": "241 1247 830 417\n", "output": "1\n"}, {"input": "1201 495 438 690\n", "output": "1\n"}, {"input": "477 492 438 690\n", "output": "1\n"}, {"input": "461 790 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWabbit is trying to move a box containing food for the rest of the zoo in the coordinate plane from the point... | [{"input": "5\n1 0 1000000000 1000000000\n1 1 1000000000 1000001100\n1 0 1001000000 1000000000\n1 1 1100010011 1001000000\n2 1 108856 18413\n", "output": "2000000001\n2000001100\n2001000001\n2101010011\n127268\n"}, {"input": "5\n1 0 1000000000 1000000000\n1 1 1001000000 1000001100\n1 0 1001000000 1000000000\n1 1 110001... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have a permutation: an array $a = [a_1, a_2, \\ldots, a_n]$ of distinct integers from $1$ to $n$. The len... | [{"input": "3\n3\n3 2 1\n7\n4 5 7 1 3 2 6\n5\n1 2 3 4 5\n", "output": "3\n5\n0\n"}, {"input": "3\n3\n3 2 1\n7\n4 5 7 1 3 2 6\n5\n1 3 2 4 5\n", "output": "3\n5\n2\n"}, {"input": "3\n3\n2 3 1\n7\n4 5 7 1 3 2 6\n5\n1 2 3 4 5\n", "output": "3\n5\n0\n"}, {"input": "3\n3\n3 2 1\n7\n4 5 6 1 3 2 7\n5\n1 2 3 4 5\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\nJAG-channel\n\nNathan O. Davis operates an electronic bulletin board called JAG-channel. He is currently work... | [{"input": "6\nhoge\n.fuga\n..foobar\n..jagjag\n...zigzag\n.piyo\n8\njagjag\n.hogehoge\n..fugafuga\n...ponyoponyo\n....evaeva\n....pokemon\n...nowawa\n.buhihi\n8\nhello\n.goodmorning\n..howareyou\n.goodafternoon\n..letshavealunch\n.goodevening\n.goodnight\n..gotobed\n3\ncaution\n.themessagelengthislessthanorequaltofift... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRudolf is on his way to the castle. Before getting into the castle, the security staff asked him a question:\... | [{"input": "30\n011110110100010000011001000100\n110111101001011001100001101101\n", "output": "146\n"}, {"input": "30\n011110110100010000011001000100\n110111101001011001100001101101\n", "output": "146\n"}, {"input": "30\n011110110100010000011001000100\n110111101000011001100001101101\n", "output": "153\n"}, {"input": "30... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOne day Dima and Alex had an argument about the price and quality of laptops. Dima thinks that the more expen... | [{"input": "4\n4 2\n6 1\n2 6\n-2 11\n", "output": "Happy Alex\n"}, {"input": "4\n4 1\n6 2\n2 5\n-1 4\n", "output": "Happy Alex\n"}, {"input": "4\n4 1\n6 2\n2 5\n-2 4\n", "output": "Happy Alex\n"}, {"input": "4\n4 1\n6 2\n2 9\n-2 4\n", "output": "Happy Alex\n"}, {"input": "4\n4 1\n6 1\n2 9\n-2 4\n", "output": "Happy Ale... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou've got string s, consisting of small English letters. Some of the English letters are good, the rest are ... | [{"input": "dcijflpluxgeqlroaktzcujfaaidnrdzgogzhobhsmbwmjpschtvjmivfapddsmxfvlhhgguymgtdjxpiezbnlmnlvdnuaohqskdbcjlyfdrzicflveffvpeyzhwqqdaenbsghuvetpxvqcutjxbelbfzuqpwlfvveebnmkoryxgodpccanzwhziiiumgtwskxhrhwdkwmyreefwmoedcvaokvetcgundyiidsqkolpqkarpszrrmagrfvpnwharotashtwcnrcnhapdwrbltgkpkkmlrpapfizonyttrikh\n110110... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe new PIN is hard to remember. I was told that I shouldn't take notes, but I don't think I can remember the... | [{"input": "Thereare100yenonthetable.Iam17yearsold.\n.mp6taemohogdluohsI", "output": "123\n"}, {"input": "Thergarn100yeeontgesable-Iam17ye`rsolc.\nIshptkogdhomemt5q`.", "output": "122\n"}, {"input": "Thereare100yenonthetable.Iam17ye`rsold.\n.mp6taemohogdluohsI", "output": "123\n"}, {"input": "Thereare100yenonthesable.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\nAn array is called beautiful if all the elements in the array are equal.\n\nYou can transform an array using ... | [{"input": "5\n0 11 12 13 14\n", "output": "\n120"}, {"input": "5\n0 12 1 13 14\n", "output": "24\n"}, {"input": "5\n1 3 0 13 48\n", "output": "120\n"}, {"input": "5\n1 18 2 13 26\n", "output": "24\n"}, {"input": "5\n0 11 14 13 14\n", "output": "0\n"}, {"input": "5\n-1 20 2 13 14\n", "output": "0\n"}, {"input": "5\n0 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\nYou are given a sequence of numbers a_1, a_2, ..., a_{n}, and a number m.\n\nCheck if it is possible to choos... | [{"input": "100 968\n966 966 967 966 967 967 967 967 966 1446 966 967 966 966 966 967 967 966 966 967 967 967 967 966 967 967 967 967 563 967 967 967 600 967 967 966 967 1750 967 966 967 966 967 966 966 966 967 966 967 966 966 967 967 193 966 966 967 966 1294 967 967 966 967 966 966 580 966 967 966 966 967 966 966 966 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nComplete the method which returns the number which is most frequent in the given input array. If there is a t... | [{"input": "[12, 10, 8, 8, 3, 3, 3, 3, 2, 4, 10, 12, 10]", "output": "[3]", "fn_name": "highest_rank"}, {"input": "[12, 10, 8, 12, 7, 6, 4, 10, 12, 10]", "output": "[12]", "fn_name": "highest_rank"}, {"input": "[12, 10, 8, 12, 7, 6, 4, 10, 12]", "output": "[12]", "fn_name": "highest_rank"}, {"input": "[12, 10, 8, 12, 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\nThere is a grass field that stretches infinitely.\nIn this field, there is a negligibly small cow. Let (x, y)... | [{"input": "1000 1000\n-994461514 -985306778 -517708279\n-994461514 -985306778 -232175991\n-991585642 -983349857 -817377920\n-991585642 -983349857 -769081289\n-983107981 -980980057 -973401374\n-997908939 -980980057 -857139401\n-978282897 -966923595 -81201061\n-997908939 -966923595 45414533\n-962515169 -962345576 -98681... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAccording to rules of the Berland fashion, a jacket should be fastened by all the buttons except only one, bu... | [{"input": "231\n0 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 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 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 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 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 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\nWe have a grid with H rows and W columns. At first, all cells were painted white.\nSnuke painted N of these c... | [{"input": "10 28 20\n0 1\n2 4\n1 9\n2 5\n0 6\n4 1\n1 7\n5 9\n6 4\n6 6\n6 5\n2 2\n10 3\n7 8\n16 1\n3 5\n11 10\n10 5\n17 4\n4 7", "output": "152\n28\n18\n10\n0\n0\n0\n0\n0\n0\n"}, {"input": "10 28 20\n0 1\n2 4\n1 9\n2 5\n0 6\n4 1\n1 7\n5 9\n6 4\n6 6\n6 5\n2 2\n10 1\n7 8\n16 1\n3 5\n11 10\n10 5\n17 4\n4 7", "output": "15... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSnuke is interested in strings that satisfy the following conditions:\n\n* The length of the string is at lea... | [{"input": "4\nexpr\nexpq", "output": "8\n"}, {"input": "4\nexpr\nrxep", "output": "7\n"}, {"input": "4\nexpr\nepxq", "output": "8\n"}, {"input": "4\nexpr\npexq", "output": "8\n"}, {"input": "4\nexpr\nqxep", "output": "8\n"}, {"input": "4\nexqr\nrxep", "output": "7\n"}, {"input": "4\nexqr\nrxeo", "output": "7\n"}, {"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\nFurik loves writing all sorts of problems, especially such that he can't solve himself. You've got one of his... | [{"input": "100\n100 100 100 100 100 100 100 100 100 100\n", "output": "0\n"}, {"input": "100\n100 100 100 100 100 100 100 100 101 100\n", "output": "0\n"}, {"input": "82\n100 100 100 100 100 100 100 100 100 100\n", "output": "0\n"}, {"input": "55\n100 100 100 100 100 100 100 100 100 100\n", "output": "0\n"}, {"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\nThere are two sisters Alice and Betty. You have $n$ candies. You want to distribute these $n$ candies between... | [{"input": "98\n710\n896\n635\n909\n528\n799\n184\n970\n731\n285\n481\n62\n829\n815\n204\n927\n48\n958\n858\n549\n722\n900\n290\n96\n414\n323\n488\n140\n494\n286\n783\n551\n896\n580\n722\n766\n841\n914\n200\n170\n384\n664\n14\n203\n582\n203\n678\n502\n677\n318\n189\n144\n97\n330\n169\n20\n492\n233\n198\n876\n697\n691\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\nYou are given two sorted arrays that contain only integers. Your task is to find a way to merge them into a s... | [{"input": "[-8, -3, -2, 4, 5, 6, 7, 15, 42, 90, 134]\n[216, 102, 74, 32, 8, 2, 0, -9, -13]", "output": "[[-13, -9, -8, -3, -2, 0, 2, 4, 5, 6, 7, 8, 15, 32, 42, 74, 90, 102, 134, 216]]", "fn_name": "merge_arrays"}, {"input": "[18, 7, 2, 0, -22, -46, -103, -293]\n[-300, -293, -46, -31, -5, 0, 18, 19, 74, 231]", "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\nAndrey's favourite number is n. Andrey's friends gave him two identical numbers n as a New Year present. He h... | [{"input": "10802611971893001160947949048137125257663360973350362557151889546818281691354280360512029669737944667993533147136817951837479019430773307929092792540144287240690218353482990299029694493198951486742073494255017372881972567810450854959208991586907060759736152497682999322253656832611644507455595270340103399952... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIahub helps his grandfather at the farm. Today he must milk the cows. There are n cows sitting in a row, numb... | [{"input": "100\n1 1 0 0 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 0 0 0 1 1 0 1 0 0 0 0 1 1 1 1 0 0 1 0 0 1 1 0 1 1 1 1 1 1 0 0 0 0 1 1 0 0 0 0 0 1 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0 1 0 1 1 0 1 1 1 1 0 0 1 1 0 0 0 0 1 1 1 0 0 1 0 0\n", "output": "1446"}, {"input": "50\n1 1 0 1 1 1 1 1 1 0 0 1 1 0 1 1 0 0 1 0 1 1 0 1 1 1 1 0 1 0 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\nMayor of city S just hates trees and lawns. They take so much space and there could be a road on the place th... | [{"input": "10\n21005 10850\n27020 13372\n28183 3724\n22874 13564\n27446 11493\n22522 10012\n24819 11529\n24166 11084\n24539 9211\n24152 9235\n", "output": "71869\n31855 31856 31857 31858 31859 31860 31861 31862 31863 31864 \n"}, {"input": "10\n21005 10850\n27020 13372\n28183 3724\n22874 13564\n27446 11493\n22522 10012... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nJeff got 2n real numbers a1, a2, ..., a2n as a birthday present. The boy hates non-integer numbers, so he dec... | [{"input": "10\n8003.867 4368.000 2243.298 3340.000 5384.489 1036.000 3506.115 4463.317 1477.000 2420.314 9391.186 1696.000 5857.833 244.314 8220.000 5879.647 5424.482 2631.000 7111.130 9157.536\n", "output": "0.472\n"}, {"input": "10\n8003.000 4368.194 2243.000 3340.287 5384.000 1036.456 3506.000 4463.000 1477.787 242... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies.\nYou... | [{"input": "43535 7\n5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 1 1 5 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\nIn his publication Liber Abaci Leonardo Bonacci, aka Fibonacci, posed a problem involving a population of ide... | [{"input": "100\n3", "output": "[465790837923166086127602033842234887]", "fn_name": "fib_rabbits"}, {"input": "40\n6", "output": "[2431532871909060205]", "fn_name": "fib_rabbits"}, {"input": "11\n33", "output": "[58212793]", "fn_name": "fib_rabbits"}, {"input": "8\n12", "output": "[8425]", "fn_name": "fib_rabbits"}, {"... | 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\nJoisino has a formula consisting of N terms: A_1 op_1 A_2 ... op_{N-1} A_N. Here, A_i is an integer, and op_i... | [{"input": "5\n2 - 159 - 13 + 21 - 5", "output": "-118\n"}, {"input": "5\n1 - 157 - 13 + 14 - 5", "output": "-124\n"}, {"input": "5\n2 - 119 - 13 + 14 - 5", "output": "-85\n"}, {"input": "5\n2 - 119 - 13 + 19 - 5", "output": "-80\n"}, {"input": "5\n1 - 119 - 13 + 19 - 5", "output": "-81\n"}, {"input": "5\n1 - 119 - 13 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSome time ago Lesha found an entertaining string $s$ consisting of lowercase English letters. Lesha immediate... | [{"input": "ggaaaawwwxxxxxxrrrrrrrrwwwwwwwwggggggggjjusszzzzqqqqqsssssssbbwwwwwwmmmmtttttttvvvvvvvvssssppppppggggsrrrrrrzzzzzzzyyyyyccccccchhhhhhhhjjrrrrhhhhhhhheeeeeeeaaaaaaaiiiiiuuuuuuuvvvvvjjjjjjjjffbbbbbbbbrrrrrllllllllggggggggooooollssvvvvvvvvvvnnnnnnnnuuuuuuuucccccyyyyyyyyyyzzzzzzzkkkkuuuuuunnnnnnnqnnnnnnggggdddd... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nUnlucky year in Berland is such a year that its number n can be represented as n = x^{a} + y^{b}, where a and... | [{"input": "433333986179614514 1000000000000000000 433333986179614515 726628630292055493\n", "output": "293294644112440978\n"}, {"input": "433333986179614514 1000001000000000000 433333986179614515 726628630292055493\n", "output": "293294644112440978\n"}, {"input": "239838434825939759 805278168279318096 2023378499191046... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA restaurant received n orders for the rental. Each rental order reserve the restaurant for a continuous peri... | [{"input": "20\n22 77\n13 50\n55 64\n16 52\n67 96\n49 51\n59 95\n2 25\n69 91\n2 24\n4 46\n50 74\n45 106\n39 55\n31 33\n9 33\n6 72\n14 67\n56 98\n69 152\n", "output": "5\n"}, {"input": "20\n22 77\n13 50\n55 64\n16 52\n62 96\n49 51\n59 95\n2 25\n69 91\n2 24\n4 46\n50 74\n45 106\n39 55\n31 33\n9 33\n6 72\n14 67\n56 98\n69... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have a set of four (4) balls labeled with different numbers: ball_1 (1), ball_2 (2), ball_3 (3) and ball(... | [{"input": "4\n5", "output": "[\"It cannot be possible!\"]", "fn_name": "combs_non_empty_boxes"}, {"input": "20\n8", "output": "[15170932662679]", "fn_name": "combs_non_empty_boxes"}, {"input": "4\n3", "output": "[6]", "fn_name": "combs_non_empty_boxes"}, {"input": "4\n2", "output": "[7]", "fn_name": "combs_non_empty_b... | 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\nThe new ITone 6 has been released recently and George got really keen to buy it. Unfortunately, he didn't hav... | [{"input": "141 12 6\n66 53 86 91 12 27 5 74 79 50 33 2 100 26 2 73 16 14 50 86 75 9 66 48 19 34 25 1 22 50 63 39 38 42 98 71 76 27 80 16 74 21 36 1 32 20 65 28 68 40 41 6 0 77 65 84 0 34 60 0 42 65 2 16 25 85 35 57 74 66 26 33 39 14 0 6 2 15 87 99 47 67 75 63 72 32 93 7 5 63 35 99 89 61 18 25 76 5 39 80 37 17 78 23 61... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n# Task\n A robot is standing at the `(0, 0)` point of the Cartesian plane and is oriented towards the vertica... | [{"input": "[11, 8, 6, 6, 4, 3, 7, 2, 1]", "output": "[true]", "fn_name": "robot_walk"}, {"input": "[10, 3, 10, 2, 5, 1, 2]", "output": "[false]", "fn_name": "robot_walk"}, {"input": "[34241, 23434, 2341]", "output": "[false]", "fn_name": "robot_walk"}, {"input": "[9348, 2188, 9348]", "output": "[false]", "fn_name": "r... | 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\nYou are given n integers a_1, a_2, …, a_n and an integer k. Find the maximum value of i ⋅ j - k ⋅ (a_i | a_j)... | [{"input": "4\n3 3\n1 1 3\n2 2\n2 2\n4 3\n0 1 2 3\n6 6\n3 2 0 0 5 6\n", "output": "-1\n-2\n3\n12\n"}, {"input": "4\n3 3\n1 1 3\n2 2\n0 2\n4 3\n0 1 2 3\n6 6\n3 2 0 0 5 6\n", "output": "-1\n-2\n3\n12\n"}, {"input": "4\n3 3\n1 1 3\n2 2\n0 2\n4 3\n0 1 2 3\n6 9\n3 2 0 0 5 6\n", "output": "-1\n-2\n3\n12\n"}, {"input": "4\n3 ... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.