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\nArseniy is already grown-up and independent. His mother decided to leave him alone for m days and left on a v... | [{"input": "10 3 3\n2 2 1 3 1 2 1 2 2 2\n10 8\n9 6\n8 10\n", "output": "0\n"}, {"input": "10 1 3\n2 2 1 3 1 2 1 2 2 2\n10 8\n9 6\n8 10\n", "output": "0\n"}, {"input": "10 1 3\n2 2 1 3 1 2 1 2 2 2\n10 8\n9 6\n3 10\n", "output": "0\n"}, {"input": "10 1 3\n2 2 1 3 1 2 1 2 3 2\n10 8\n9 6\n3 10\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\nRead problems statements in English, Mandarin Chinese and Russian as well. \n\nSherlock is stuck. There is a ... | [{"input": "2\n3\n#..\n..#\n#..\n3\n#.#\n#.#\n#.#", "output": "3\n0\n"}, {"input": "2\n3\n#..\n\"..\n#..\n3\n#.#\n#.#\n#.#", "output": "6\n0\n"}, {"input": "2\n3\n$..\n..#\n#..\n3\n\"-#\n#.#\n\"#.", "output": "3\n1\n"}, {"input": "2\n3\n$..\n.#.\n#..\n3\n\"-#\n#.#\n\".#", "output": "4\n0\n"}, {"input": "2\n3\n#..\n..#\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are $n$ students in a school class, the rating of the $i$-th student on Codehorses is $a_i$. You have t... | [{"input": "100 100\n63 100 75 32 53 24 73 98 76 15 70 48 8 81 88 58 95 78 27 92 14 16 72 43 46 39 66 38 64 42 59 9 22 51 4 6 10 94 28 99 68 80 35 50 45 20 47 7 30 26 49 91 77 19 96 57 65 1 11 13 31 12 82 87 93 34 62 3 21 79 56 41 89 18 44 23 74 86 2 33 69 36 61 67 25 83 5 84 90 37 40 29 97 60 52 55 54 71 17 85\n", "ou... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an integer n. You have to apply m operations to it.\n\nIn a single operation, you must replace ... | [{"input": "5\n178 170\n26 25\n64 84\n19 12\n20 136\n", "output": "764520\n12\n1015\n6\n32483\n"}, {"input": "5\n178 170\n26 25\n64 84\n19 12\n38 136\n", "output": "764520\n12\n1015\n6\n46148\n"}, {"input": "5\n178 170\n26 25\n64 84\n19 6\n20 136\n", "output": "764520\n12\n1015\n3\n32483\n"}, {"input": "5\n176 143\n16 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 three houses on a number line: House 1, 2 and 3, with coordinates A, B and C, respectively. Print `... | [{"input": "31 61 59", "output": "Yes\n"}, {"input": "31 61 51", "output": "Yes\n"}, {"input": "31 86 59", "output": "Yes\n"}, {"input": "39 69 59", "output": "Yes\n"}, {"input": "31 49 59", "output": "No\n"}, {"input": "39 49 59", "output": "No\n"}, {"input": "39 49 10", "output": "No\n"}, {"input": "51 49 10", "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\nA bracket sequence is a string containing only characters \"(\" and \")\".\n\nA regular bracket sequence is a... | [{"input": "10\n()()(\n)((\n)()(((()(\n(((()(\n)(()((\n))\n()()()()\n))()))((\n)\n))())(\n", "output": "2\n"}, {"input": "10\n()()(\n)((\n)()(((()(\n(((()(\n)(()((\n))\n()()()()\n))()))((\n)\n))())(\n", "output": "2\n"}, {"input": "10\n()()(\n)((\n)()((((((\n(((()(\n)(()((\n))\n()()()()\n))()))((\n)\n))())(\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\nYour company was appointed to lay new asphalt on the highway of length $n$. You know that every day you can e... | [{"input": "3\n10 1 1\n11 4 10\n1000000 1 1000100\n", "output": "10\n16\n500049499900\n"}, {"input": "3\n10 1 1\n16 4 10\n1000000 1 1000100\n", "output": "10\n18\n500049499900\n"}, {"input": "3\n10 1 1\n16 4 10\n1000001 1 1000100\n", "output": "10\n18\n500050500001\n"}, {"input": "3\n10 1 1\n16 8 10\n1000001 1 1000100\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMonocarp wants to draw four line segments on a sheet of paper. He wants the $i$-th segment to have its length... | [{"input": "4\n1 1 5 4\n4 16 10 4\n2 1 4 1\n100 21 54 111\n", "output": "4\n40\n2\n2100\n"}, {"input": "4\n0 5 2 4\n6 14 10 3\n2 0 5 1\n101 40 47 111\n", "output": "0\n30\n0\n4040\n"}, {"input": "4\n1 1 5 8\n4 16 10 4\n2 1 4 1\n100 21 54 111\n", "output": "5\n40\n2\n2100\n"}, {"input": "4\n1 1 3 4\n4 16 5 4\n2 0 4 1\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\nThere is a grid of squares with H+1 horizontal rows and W vertical columns.\n\nYou will start at one of the s... | [{"input": "4 4\n1 4\n1 1\n2 0\n3 4", "output": "-1\n-1\n-1\n-1\n"}, {"input": "4 5\n0 4\n0 1\n4 5\n3 4", "output": "1\n2\n-1\n-1\n"}, {"input": "4 34\n2 3\n1 2\n2 2\n2 14", "output": "1\n2\n3\n4\n"}, {"input": "4 34\n2 3\n2 2\n2 2\n2 14", "output": "1\n2\n3\n4\n"}, {"input": "4 12\n2 4\n-1 1\n4 3\n2 4", "output": "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\nTakahashi is meeting up with Aoki.\nThey have planned to meet at a place that is D meters away from Takahashi... | [{"input": "7202 7775 4325\n", "output": "Yes\n"}, {"input": "3982 4784 8417\n", "output": "Yes\n"}, {"input": "2156 1932 5902\n", "output": "Yes\n"}, {"input": "1 10000 10000\n", "output": "Yes\n"}, {"input": "522 4575 6426\n", "output": "Yes\n"}, {"input": "3447 629 3497\n", "output": "Yes\n"}, {"input": "9445 8772 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\n## Your Story\n\"A *piano* in the home meant something.\" - *Fried Green Tomatoes at the Whistle Stop Cafe*\n... | [{"input": "2017", "output": "[\"white\"]", "fn_name": "black_or_white_key"}, {"input": "100", "output": "[\"black\"]", "fn_name": "black_or_white_key"}, {"input": "111", "output": "[\"white\"]", "fn_name": "black_or_white_key"}, {"input": "200", "output": "[\"black\"]", "fn_name": "black_or_white_key"}, {"input": "12"... | 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\nGiven a string and an array of integers representing indices, capitalize all letters at the given indices. \n... | [{"input": "\"abracadabra\"\n[2, 6, 9, 10]", "output": "[\"abRacaDabRA\"]", "fn_name": "capitalize"}, {"input": "\"indexinglessons\"\n[0]", "output": "[\"Indexinglessons\"]", "fn_name": "capitalize"}, {"input": "\"codewars\"\n[1, 3, 5, 50]", "output": "[\"cOdEwArs\"]", "fn_name": "capitalize"}, {"input": "\"codewarrior... | 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\nIlya is a very clever lion, he lives in an unusual city ZooVille. In this city all the animals have their rig... | [{"input": "-1000000000\n", "output": "-100000000\n"}, {"input": "-1000000000\n", "output": "-100000000\n"}, {"input": "-1015555150\n", "output": "-101555510\n"}, {"input": "-1620057635\n", "output": "-162005763\n"}, {"input": "-1246147339\n", "output": "-124614733\n"}, {"input": "-1005651079\n", "output": "-100565107\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAddition is easy to calculate by hand, but if some numbers are missing, is it easy to fill in the missing num... | [{"input": "-1 -1 -1 -1 -1 -1 -1 -1 -1", "output": "168"}, {"input": "-1 -1 -1 -1 -1 -1 3 4 6", "output": "0\n"}, {"input": "-1 -1 -1 -1 -1 -1 3 2 6", "output": "0\n"}, {"input": "-1 -1 -1 -1 -1 -2 3 2 6", "output": "0\n"}, {"input": "-1 -1 -1 -1 -1 -1 8 4 6", "output": "12"}, {"input": "-1 -1 -1 0 -1 -2 3 2 6", "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\nOne popular blog site edits the uploaded photos like this. It cuts a rectangular area out of them so that the... | [{"input": "1010000000 1000000000\n", "output": "671088640 536870912\n"}, {"input": "1010000000 1000000010\n", "output": "671088640 536870912\n"}, {"input": "1010000000 1000000001\n", "output": "671088640 536870912\n"}, {"input": "1011000000 1000000010\n", "output": "671088640 536870912\n"}, {"input": "1000000010 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\nExample\n\nInput\n\n3 3 1 2 4\n1 2\n2 3\n3 1\n\n\nOutput\n\nIMPOSSIBLE### Format: Read the inputs from stdin ... | [{"input": "4 1 2 1 2\n1 2\n2 3\n11 0", "output": "IMPOSSIBLE\n"}, {"input": "8 1 2 1 2\n1 2\n2 3\n11 0", "output": "IMPOSSIBLE\n"}, {"input": "3 3 2 2 4\n1 2\n2 3\n3 1", "output": "IMPOSSIBLE\n"}, {"input": "3 3 2 1 4\n1 2\n2 3\n3 1", "output": "IMPOSSIBLE\n"}, {"input": "4 3 2 1 4\n1 2\n2 3\n3 1", "output": "IMPOSSIB... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 play Hit and Blow game. A imagines four numbers and B guesses the numbers. After B picks out four numbe... | [{"input": "9 1 8 3\n6 1 4 3\n8 6 -1 -1\n2 7 3 1", "output": "2 0\n0 0\n"}, {"input": "4 1 8 2\n6 1 2 3\n8 6 -1 -1\n2 7 3 1", "output": "1 1\n0 0\n"}, {"input": "5 0 8 2\n6 1 2 3\n7 6 -1 -1\n2 7 3 1", "output": "0 1\n0 1\n"}, {"input": "9 0 8 2\n6 1 5 9\n7 22 13 2\n2 6 7 1", "output": "0 1\n0 2\n"}, {"input": "11 1 8 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\nOleg the bank client and Igor the analyst are arguing again. This time, they want to pick a gift as a present... | [{"input": "40\n2 2 88 105 2 2 2 2 2 2 2 2 2 2 4 2 2 2 2 2 2 2 2 2 2 2 2 7 7 2 2 2 2 0 2 2 2 2 2 2\n", "output": "2 2 2 2 2 2 2 2 2 2 4 2 4 2 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 105 88 105 88 105 88 105 105\n"}, {"input": "40\n2 2 88 105 2 2 2 2 2 1 2 2 2 2 4 2 2 2 2 2 2 2 2 2 2 2 2 7 7 2 2 2 2 0 2 2 2 2 2 2\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\nThere are $n$ computers in a row, all originally off, and Phoenix wants to turn all of them on. He will manua... | [{"input": "100 999999733\n", "output": "499246611\n"}, {"input": "350 999999733\n", "output": "255248393\n"}, {"input": "397 999999733\n", "output": "239189389\n"}, {"input": "398 999999733\n", "output": "875462745\n"}, {"input": "399 999999733\n", "output": "530105147\n"}, {"input": "400 999999733\n", "output": "5640... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 tree with N vertices.\n\nHere, a tree is a kind of graph, and more specifically, a connected ... | [{"input": "30\n20 2 885820291\n9 3 833676138\n21 8 969316096\n13 10 732239064\n14 12 568976928\n4 14 362005859\n4 17 46938898\n4 21 706609800\n13 4 114271135\n18 13 475446302\n20 22 582315387\n7 23 941896909\n18 7 546231774\n30 24 698675648\n30 25 13971027\n11 26 760254873\n30 27 731457744\n1 28 242926757\n15 1 704423... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nJapan achieved the second straight victory in the national baseball competition WBC !! A baseball tournament ... | [{"input": "6\nA 1 0 0 2 -1\nB 0 0 1 2 -1\nC 2 1 1 1 1\nD 2 0 -1 0 2\nE 2 0 0 0 0\nF 1 1 1 2 2\n4\nh 1 1 1\ng 0 2 2\nx -1 0 0\n` 0 2 2\n0", "output": "E\nD\nA\nB\nF\nC\nx\ng\n`\nh\n"}, {"input": "6\nA 1 0 0 2 -1\nB 0 0 1 1 0\nC 1 1 1 1 1\nD 1 1 0 0 2\nE 2 0 -1 0 0\nF 1 2 0 2 1\n4\ng 1 1 1\nh 0 1 2\nx 0 -1 0\na 0 2 2\n0... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nJohnny drives a truck and must deliver a package from his hometown to the district center. His hometown is lo... | [{"input": "281 12 23\n178 650197\n129 288456\n34 1664910\n43 683515\n305 957083\n103 724815\n105 308008\n252 1280706\n74 87088\n229 146026\n85 241042\n35 39127\n62 47524\n217 760274\n156 562141\n10 209057\n50 714473\n201 164128\n97 624021\n120 102709\n147 388268\n317 1546753\n190 1448117\n", "output": "-1\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\nFast Forwarding\n\nMr. Anderson frequently rents video tapes of his favorite classic films. Watching the film... | [{"input": "2139", "output": "21\n"}, {"input": "1374", "output": "22\n"}, {"input": "3723", "output": "23\n"}, {"input": "138", "output": "12\n"}, {"input": "149", "output": "13\n"}, {"input": "132", "output": "14\n"}, {"input": "374", "output": "16\n"}, {"input": "315", "output": "15\n"}, {"input": "933", "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\nWhen Serezha was three years old, he was given a set of cards with letters for his birthday. They were arrang... | [{"input": "400\nzzzerrzrzzrozrezooreroeoeezerrzeerooereezeeererrezrororoorrzezoeerrorzrezzrzoerrzorrooerzrzeozrrorzzzzeoeereeroeozezeozoozooereoeorrzoroeoezooeerorreeorezeozeroerezoerooooeerozrrorzozeroereerozeozeoerroroereeeerzzrzeeozrezzozeoooeerzzzorozrzezrrorozezoorzzerzroeeeerorreeoezoeroeeezerrzeorzoeorzoeeororz... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 (P_1,P_2,...,P_N) which is a permutation of the integers from 1 through N. You would... | [{"input": "8\n6\n3\n2\n1\n7\n4\n8\n5", "output": "5\n"}, {"input": "8\n6\n3\n1\n2\n5\n4\n8\n7", "output": "6\n"}, {"input": "8\n6\n3\n2\n1\n4\n7\n8\n5", "output": "5\n"}, {"input": "8\n6\n3\n2\n1\n7\n4\n5\n8", "output": "5\n"}, {"input": "8\n6\n3\n2\n1\n7\n4\n8\n5", "output": "5\n"}, {"input": "8\n6\n3\n2\n1\n5\n4\n8\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMax wants to buy a new skateboard. He has calculated the amount of money that is needed to buy a new skateboa... | [{"input": "80124649014054971081213608137817466046254652492627741860478258558206397113198232823859870363821007188476405951611069347299689170240023979048198711745011542774268179055311013054073075176122755643483380248999657649211459997766221072399103579977409770898200358240970169892326442892826731631357561876251276209119... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nKnights' tournaments were quite popular in the Middle Ages. A lot of boys were dreaming of becoming a knight,... | [{"input": "14", "output": "0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA motorcade of n trucks, driving from city «Z» to city «З», has approached a tunnel, known as Tunnel of Horro... | [{"input": "20\n7892 2 0 24\n4201 1 2 23\n3667 1 3 22\n6388 1 4 21\n2406 1 5 20\n1148 1 6 19\n3958 1 7 18\n7363 1 8 17\n9025 2 9 15\n1909 1 11 14\n73 1 12 13\n5477 2 13 11\n1869 1 15 10\n107 1 16 9\n523 1 17 8\n6589 2 18 6\n6277 2 20 4\n3881 1 22 3\n5771 1 23 2\n622 2 24 0\n", "output": "20\n1 2 3 4 5 6 7 8 9 10 11 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\nSnuke Festival 2017 will be held in a tree with N vertices numbered 1,2, ...,N. The i-th edge connects Vertex... | [{"input": "19\n19 14 48\n11 19 23\n17 14 30\n7 11 15\n2 19 15\n2 18 21\n19 10 43\n12 11 25\n3 11 4\n5 19 50\n4 11 19\n9 12 29\n14 13 3\n14 6 12\n14 15 17\n5 1 6\n8 18 13\n7 16 14", "output": "103\n238\n71\n266\n373\n193\n232\n207\n302\n361\n298\n302\n54\n371\n250\n220\n322\n238\n373\n"}, {"input": "19\n19 14 48\n11 19... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n# Task\n Sorting is one of the most basic computational devices used in Computer Science. \n \n Given a seque... | [{"input": "[9, 9, 9, 9, 9, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7]", "output": "[6]", "fn_name": "exchange_sort"}, {"input": "[9, 9, 9, 7, 7, 8, 9, 7, 8, 9, 7, 9]", "output": "[4]", "fn_name": "exchange_sort"}, {"input": "[8, 8, 7, 9, 9, 9, 8, 9, 7]", "output": "[4]", "fn_name": "exchange_sort"}, {"input": "[7, 7, 8, 8, 9, 9]",... | 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 are K pieces of cakes. Mr. Takahashi would like to eat one cake per day, taking K days to eat them all.... | [{"input": "110 2\n110", "output": "109\n"}, {"input": "12 3\n2 2 -1", "output": "0\n"}, {"input": "13 8\n-1 1 1", "output": "0\n"}, {"input": "100 2\n100", "output": "99\n"}, {"input": "7 3\n-1 1 1", "output": "0\n"}, {"input": "7 5\n-1 1 1", "output": "0\n"}, {"input": "12 3\n2 1 2", "output": "0\n"}, {"input": "7 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\nWrite a program which reads a $ n \\times m$ matrix $A$ and a $m \\times 1$ vector $b$, and prints their prod... | [{"input": "3 4\n1 4 -2 1\n0 3 0 -1\n4 1 0 0\n0\n-2\n3\n0", "output": "-14\n-6\n-2\n"}, {"input": "3 4\n0 7 -13 0\n0 0 0 1\n4 2 2 0\n1\n1\n3\n-1", "output": "-32\n-1\n12\n"}, {"input": "3 4\n0 7 -13 0\n0 0 0 1\n4 2 2 0\n1\n2\n3\n-1", "output": "-25\n-1\n14\n"}, {"input": "3 4\n0 7 -13 0\n0 0 0 1\n4 2 4 0\n1\n2\n3\n-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\nWe have N gemstones labeled 1 through N.\nYou can perform the following operation any number of times (possib... | [{"input": "99\n122741031 -204980087 525357399 -35985856 -416421742 611495756 -929791499 -703341024 312660354 -8716403 -885125673 332761853 -601694152 -453492700 658205998 -888173729 58182557 620328675 -664005151 -864927032 645923185 675352889 -954440570 -792010737 -826546996 -44381354 332330747 -64136214 -790678352 -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\nBitwise exclusive OR (or bitwise addition modulo two) is a binary operation which is equivalent to applying l... | [{"input": "9992164445234764941\n8162963574901971597\n", "output": "914600435166396672 9077564010068368269"}, {"input": "1367480970723947\n584615739735395\n", "output": "391432615494276 976048355229671"}, {"input": "339671107814\n208405902980\n", "output": "65632602417 274038505397"}, {"input": "1870807699\n259801747\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\nLet's suppose you have an array a, a stack s (initially empty) and an array b (also initially empty).\n\nYou ... | [{"input": "40 39\n25 4 26 34 35 11 22 23 21 2 1 28 20 8 36 5 27 15 39 7 24 14 17 19 33 6 38 16 18 3 32 10 30 13 37 31 29 9 12\n", "output": "-1\n"}, {"input": "40 39\n25 4 26 34 35 11 22 23 21 2 1 28 20 8 36 5 27 15 39 7 24 14 17 19 33 6 38 16 18 3 32 10 30 13 37 31 29 9 12\n", "output": "-1"}, {"input": "40 38\n32 35... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRecall that string $a$ is a subsequence of a string $b$ if $a$ can be obtained from $b$ by deletion of severa... | [{"input": "ovvvvovovvvvovoovovovovvvvvvvoovoovvovvoooooovo\n", "output": "463\n"}, {"input": "ovvvvovovvvvovoovovovovvvvvvvoovoovvovvoooooovo\n", "output": "463\n"}, {"input": "vvovooovovvovoovoovvvvovovvvov\n", "output": "100\n"}, {"input": "vovvvovovvvvoovoovovvovooovovv\n", "output": "100\n"}, {"input": "vovvvvvovo... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nStudents of group 199 have written their lectures dismally. Now an exam on Mathematical Analysis is approachi... | [{"input": "10\n9 10 6 8 5 3 1 7 4 2\n7 6 2 9 5 10 8 4 1 3\n", "output": "8 3 10 1 5 2 4 9 7 6 "}, {"input": "10\n2 9 1 7 6 8 5 4 10 3\n6 8 5 1 9 10 2 3 4 7\n", "output": "5 6 7 3 2 9 1 10 8 4 "}, {"input": "10\n5 9 7 1 4 10 3 6 2 8\n8 3 9 10 6 5 2 1 7 4\n", "output": "10 7 2 6 8 1 9 4 3 5 "}, {"input": "5\n4 1 2 5 3\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given n points on the plane. The polygon formed from all the n points is strictly convex, that is, th... | [{"input": "20\n-2967010 48581504\n-2967318 48581765\n-2967443 48581988\n-2967541 48582265\n-2967443 48582542\n-2967318 48582765\n-2967010 48583026\n-2966691 48583154\n-2966252 48583234\n-2965813 48583154\n-2965494 48583026\n-2965186 48582765\n-2965061 48582542\n-2964963 48582265\n-2965061 48581988\n-2965186 48581765\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\n# Esolang Interpreters #2 - Custom Smallfuck Interpreter\n\n## About this Kata Series\n\n\"Esolang Interprete... | [{"input": "\"*>*>>>*>*>>>>>*>[>*]\"\n\"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\"", "output": "[\"11001... | 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 an H \\times W grid (H vertical, W horizontal), where each square contains a lowercase English lette... | [{"input": "12 12\nbimonigaloaf\nfaurwlkbleht\ndexwimqxzxbb\nlxdgyoifcxid\nydxiliocfdgx\nnfoabgilamoi\nibxbdqmzxxwe\npqirylfrcrnf\nwtehfkllbura\nyfrnpflcrirq\nwvcclwgiubrk\nlkbrwgwuiccv\n", "output": "YES\n"}, {"input": "12 12\ntcjbfnoikqgi\nqnnpryzflcef\nagdzieukjutu\nffzyepnqclrn\nkuuetzdaujig\noywsialqlusj\nkqjvjhyc... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 of length N. Among its subsequences, count the ones such that all characters are dif... | [{"input": "5\naabbc", "output": "17\n"}, {"input": "5\nabcda", "output": "23\n"}, {"input": "5\nbdacf", "output": "31\n"}, {"input": "5\nabcaa", "output": "15\n"}, {"input": "5\nabbaa", "output": "11\n"}, {"input": "5\naabba", "output": "11\n"}, {"input": "5\nabbba", "output": "11\n"}, {"input": "5\nbbbaa", "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\nThere are N mountains in a circle, called Mountain 1, Mountain 2, ..., Mountain N in clockwise order. N is an... | [{"input": "4347\n260851 113568 146755 277208 291368 365593 306158 216020 344668 347475 275144 352224 284362 117882 195739 364750 445348 416819 269652 99635 82915 80392 51627 75388 237943 322687 343290 419290 298882 162789 250158 343046 283281 278723 215017 105840 263209 271290 119076 276553 322767 277981 268358 302036... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 easy and hard versions is the maximum value of $n$.\n\nYou are given a positive i... | [{"input": "100\n2\n8\n5\n6\n5\n4\n4\n6\n12\n2\n9\n5\n10\n8\n4\n10\n9\n6\n9\n4\n5\n6\n4\n4\n7\n1\n2\n2\n5\n6\n1\n5\n10\n9\n10\n16\n3\n2\n2\n3\n2\n7\n9\n2\n9\n5\n7\n8\n1\n5\n2\n5\n1\n3\n8\n4\n7\n9\n3\n1\n7\n1\n2\n4\n7\n2\n7\n1\n1\n10\n8\n5\n7\n12\n10\n8\n1\n7\n5\n10\n7\n6\n6\n6\n7\n4\n9\n3\n4\n9\n10\n7\n1\n1\n6\n9\n3\n8... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 car number in Berland consists of exactly n digits. A number is called beautiful if it has at least k equal... | [{"input": "490 406\n69376206583505466779821214863898994183223683064168986020986087427466188663988162816834873783630551758344308091300551677259892974326315461675692547390099840313192163258859011559750513086756892636598304230038445861422033560468535920495378496152301219687339355030990474992436599674672102617346048230206... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 days ago you bought a new house and now you are planning to start a renovation. Since winters in your... | [{"input": "69\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 15\n2 6\n2 6\n2 6\n2 6\n2 6\n2 11\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 7\n2 11\n2 6\n2 6\n2 6\n2 6\n4 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\n2 6\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\nBoy Valera likes strings. And even more he likes them, when they are identical. That's why in his spare time ... | [{"input": "aaaaaaaaaa\naaaaaaaaaa\n50\na a 47\na a 40\na a 22\na a 48\na a 37\na a 26\na a 40\na a 28\na a 8\na a 46\na a 42\na a 37\na a 1\na a 0\na a 16\na a 34\na a 12\na a 50\na a 45\na a 49\na a 12\na a 8\na a 32\na a 17\na a 13\na a 1\na a 1\na a 33\na a 1\na a 15\na a 9\na a 11\na a 31\na a 5\na a 18\na a 13\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\nTaro and Hanako have numbers of cards in their hands. Each of the cards has a score on it. Taro and Hanako wi... | [{"input": "2 2\n1\n6\n3\n14\n6 5\n3\n4\n5\n2\n4\n7\n11\n2\n7\n4\n1\n4 5\n10\n-1\n3\n11\n1\n9\n6\n0\n1\n7 4\n1\n0\n4\n0\n2\n1\n4\n4\n2\n1\n-1\n2 3\n0\n1\n2\n4\n2\n0 0", "output": "-1\n2 2\n3 0\n2 -1\n-1\n"}, {"input": "2 2\n1\n6\n3\n14\n6 5\n3\n4\n5\n2\n4\n7\n11\n2\n7\n4\n1\n4 5\n10\n-1\n3\n11\n1\n9\n6\n0\n1\n7 4\n1\n0... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nInzane finally found Zane with a lot of money to spare, so they together decided to establish a country of th... | [{"input": "11 1 5\n6\n1 2\n2 3\n3 4\n4 5\n5 6\n6 11\n7 8\n8 9\n9 10\n10 11\n", "output": "0\n\n"}, {"input": "11 1 5\n6\n1 2\n2 3\n3 4\n4 5\n5 6\n6 7\n7 8\n8 9\n9 10\n10 11\n", "output": "0\n"}, {"input": "11 1 5\n6\n1 2\n2 3\n3 4\n4 5\n5 6\n6 7\n7 8\n8 9\n9 10\n10 11\n", "output": "0\n"}, {"input": "10 1 5\n5\n1 2\n1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a frog living in a big pond. He loves jumping between lotus leaves floating on the pond. Interesting... | [{"input": "10 10\n.o....o...\no.oo......\n..oo..oo..\n..o.......\n..oo..oo..\n.o.o...o..\no..U.o....\noo......oo\noo........\noo..oo....", "output": "RDLLLURUUURDDLLUURRDDLULLDDRR\n"}, {"input": "10 10\n.o....o...\no.oo......\n..oo..oo..\n..o.......\n..oo..oo..\n..o...o.o.\no..U.o....\noo......oo\noo........\noo..oo..... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven any integer x, Aoki can do the operation below.\nOperation: Replace x with the absolute difference of x... | [{"input": "999999482938498888 1000000000000000000\n", "output": "517061501112\n"}, {"input": "34439284758432890 4389039281938432\n", "output": "673029497074566\n"}, {"input": "542309233112233445 542309233112233445\n", "output": "0\n"}, {"input": "435893948572830341 43\n", "output": "12\n"}, {"input": "10 9999999999999... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 you are the best Wraith King, Nizhniy Magazin «Mir» at the centre of Vinnytsia is offering you a discou... | [{"input": "100 20\n9149 9142 7686 5769 1871 4565 5670 8587 663 637 3421 4267 6884 8142 7634 5748 936 316 9300 771 6906 9230 8994 9690 7155 9393 6274 3183 932 7460 1611 6122 4031 6922 5466 1499 5290 4907 4673 5665 9744 1602 9891 8260 6351 4640 9930 9756 5242 3752 82 3287 824 6897 5579 9095 883 6231 5738 6690 10553 1195... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nConsider a sequence of digits of length $2^k$ $[a_1, a_2, \\ldots, a_{2^k}]$. We perform the following operat... | [{"input": "20\n4 8 6 6 3 0 1 8 3 6 1 4 3 2 1 3 6 4 5 4\n15\n16 19\n3 10\n9 9\n3 18\n6 7\n15 18\n12 19\n17 18\n12 12\n6 9\n3 10\n1 2\n2 3\n4 19\n16 16\n", "output": "1\n3\n0\n5\n0\n1\n2\n1\n0\n1\n3\n1\n1\n5\n0\n"}, {"input": "20\n4 8 6 6 3 0 1 8 3 6 1 4 3 2 1 3 6 4 5 4\n15\n16 19\n3 10\n9 9\n3 18\n6 7\n15 18\n12 19\n17... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n<image>\n\n\nA directed acyclic graph (DAG) can be used to represent the ordering of tasks. Tasks are represe... | [{"input": "26 0\n1 0\n0 6\n-1 1\n18 9\n12 1\n0 2", "output": "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n"}, {"input": "21 -1\n1 2\n0 6\n-1 1\n11 4\n7 1\n0 1", "output": "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n"}, {"input": "17 0\n1 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLittle Nastya has a hobby, she likes to remove some letters from word, to obtain another word. But it turns o... | [{"input": "aaaaaaaadbaaabbbbbddaaabdadbbbbbdbbabbbabaabdbbdababbbddddbdaabbddbbbbabbbbbabadaadabaaaadbbabbbaddb\naaaaaaaaaaaaaa\n61 91 5 43 53 81 7 96 6 9 34 78 79 12 8 63 22 76 18 46 41 56 3 20 57 21 75 73 100 94 35 69 32 4 70 95 88 44 68 10 71 98 23 89 36 62 28 51 24 30 74 55 27 80 38 48 93 1 19 84 13 11 86 60 87 33... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 many blue cards and red cards on the table. For each card, an integer number greater than 1 is prin... | [{"input": "4 3\n2 6 6 15\n2 3 5\n2 3\n4 9\n8 16 32\n4 2\n4 9 11 13\n2 7\n5 5\n2 3 5 1001 1001\n7 11 13 17 34\n10 10\n2 3 5 7 12 11 13 15 17 29\n3 11 1 22 18 22 26 30 34 38\n20 20\n314 144 903 63 137 609 44 626 75 473\n876 421 909 519 755 840 374 368 570 872\n363 650 155 265 64 26 426 391 15 421\n373 984 564 54 823 477... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDuring her tantrums the princess usually smashes some collectable porcelain. Every furious shriek is accompan... | [{"input": "1 68\n100 26 58 15 8 69 66 49 97 18 74 27 39 19 76 37 25 4 88 75 17 79 41 21 44 39 7 42 63 82 92 87 41 85 25 30 43 80 165 106 98 88 16 15 97 74 81 76 33 19 64 3 14 72 17 36 33 21 34 59 38 75 48 1 57 20 81 56 74 67 14 89 51 30 1 66 20 58 64 58 16 99 33 97 31 5 54 87 6 64 70 40 93 25 50 62 53 80 75 68 13\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 integer $n$ ($n > 0$). Find any integer $s$ which satisfies these conditions, or report that ... | [{"input": "4\n7648\n1421\n37753\n53050\n", "output": "2333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 squares in a row. The leftmost square contains the integer A, and the rightmost contains the inte... | [{"input": "491995 412925347 465710940 59999126 59999339", "output": "NO\n"}, {"input": "1788 122437383 681218449 90629745 148553464", "output": "YES\n"}, {"input": "1788 122437383 541607279 90629745 148553464", "output": "YES\n"}, {"input": "1788 122437383 943846071 90629745 148553464", "output": "YES\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\nPetya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representat... | [{"input": "117335682 1000000001\n", "output": "1373020883634915584\n"}, {"input": "696386388 1000000010\n", "output": "1049164104211999364\n"}, {"input": "777777777 1000000000\n", "output": "987654325123456789\n"}, {"input": "777777778 1000000000\n", "output": "987654324345679012\n"}, {"input": "777777777 1000000010\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\nA boy Petya loves chess very much. He even came up with a chess piece of his own, a semiknight. The semiknigh... | [{"input": "6\nK.......\n........\n.##..##.\n#..##..#\n........\n...##...\n.#....#.\n..####.K\n\n.......K\n........\n.##..##.\n#..##..#\n........\n...##...\n.#....#.\nK.####..\n\nK.......\n........\n.##..##.\n#..##..#\n........\n...##...\n.#....#.\nK.####..\n\n.......K\n........\n.##..##.\n#..##..#\n........\n...##...\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOne day, Ikta, an elementary school student, received a piece of paper with mathematical formulas from his gr... | [{"input": "(198876743*1-210*4-89)", "output": "3533045339395\n"}, {"input": "(198876744*1-210*4-89)", "output": "3533045357160\n"}, {"input": "(198776744*1-210*4-89)", "output": "3531268857160\n"}, {"input": "(198777744*1-210*4-89)", "output": "3531286622160\n"}, {"input": "(198777744*1-120*4-89)", "output": "20106368... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nProfessor GukiZ doesn't accept string as they are. He likes to swap some letters in string to obtain a new on... | [{"input": "brtakoktrosttttttttttosafasfkalsfkodfdasiofhadfhasdsajfdsafoasodsafahaihfdisoadspapsapiosapdsajdipsahdhasuirhaeuifhhfkjgosooooooooodafdfioottttafdsafaddfuiasdjfjasdo\nokat\ntako\n", "output": "takotakotakotakotakoaaaaaaaaaaaaaaaaaaaaaabddddddddddddddddddeffffffffffffffffffghhhhhhhhhiiiiiiiiijjjjjloooooooooo... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nExample\n\nInput\n\n6\n2\n3\n1\n1\n4\n2\n\n\nOutput\n\nYes\nYes\nYes\nNo\nYes\nNo### Format: Read the inputs ... | [{"input": "6\n2\n3\n2\n1\n11\n2", "output": "Yes\nYes\nYes\nNo\nYes\nYes\n"}, {"input": "6\n2\n10\n0\n4\n4\n1", "output": "Yes\nYes\nNo\nYes\nYes\nYes\n"}, {"input": "6\n6\n8\n1\n2\n5\n3", "output": "Yes\nYes\nYes\nYes\nYes\nYes\n"}, {"input": "6\n2\n6\n2\n1\n11\n2", "output": "Yes\nYes\nYes\nNo\nYes\nYes\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 famous Berland's painter Kalevitch likes to shock the public. One of his last obsessions is chess. For more... | [{"input": "BBBBBBBB\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nBWBBWBWB\n", "output": "12\n"}, {"input": "BWBBBWWB\nBWBBBWWB\nBBBBBBBB\nBBBBBBBB\nBWBBBWWB\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\n", "output": "10\n"}, {"input": "BBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWBBBWBBW\nBBBBBBBB\nBBBBBBBB\nWBBBWBBW\nBBBBBBBB\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\nIt's now the season of TAKOYAKI FESTIVAL!\nThis year, N takoyaki (a ball-shaped food with a piece of octopus ... | [{"input": "50\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100\n", "output": "12250000\n"}, {"input": "41\n49 91 82 7 70 97 50 3 58 42 57 3 46 10 46 36 78 58 29 7 49 5... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which ... | [{"input": "2\n2.926287414400688 0.6174638399148507 2.2117258079089996 2.51039017960215 2.2432914589132955 0.3458310450303873 3.950438914943076 1.6292131026754104\n5.957858300757107 3.314602021400227 10.473008708157936 7.081122407685485 15.460510197185764 6.858362845609268 7.533578119892425 12.180352827357845", "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\n# Task\n Suppose there are `n` people standing in a circle and they are numbered 1 through n in order. \n \n ... | [{"input": "15", "output": "[15]", "fn_name": "circle_slash"}, {"input": "31", "output": "[31]", "fn_name": "circle_slash"}, {"input": "11", "output": "[7]", "fn_name": "circle_slash"}, {"input": "16", "output": "[1]", "fn_name": "circle_slash"}, {"input": "5", "output": "[3]", "fn_name": "circle_slash"}, {"input": "1"... | 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\nTo introduce the problem think to my neighbor who drives a tanker truck. \nThe level indicator is down and he... | [{"input": "3\n10\n7853", "output": "[1981]", "fn_name": "tankvol"}, {"input": "4\n10\n7853", "output": "[2933]", "fn_name": "tankvol"}, {"input": "2\n10\n7853", "output": "[1118]", "fn_name": "tankvol"}, {"input": "5\n7\n3848", "output": "[2940]", "fn_name": "tankvol"}, {"input": "4\n9\n6361", "output": "[2731]", "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're given a string of dominos. For each slot, there are 3 options:\n\n * \"|\" represents a standing domi... | [{"input": "\"||| ||||//| |/\"", "output": "[\"/// ||||//| |/\"]", "fn_name": "domino_reaction"}, {"input": "\"||||| |||\"", "output": "[\"///// |||\"]", "fn_name": "domino_reaction"}, {"input": "\"|||||/|||\"", "output": "[\"//////|||\"]", "fn_name": "domino_reaction"}, {"input": "\"|||||\"", "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\nThere are N people numbered 1 to N. Each of them is either an honest person whose testimonies are always corr... | [{"input": "15\n14\n2 1\n3 1\n4 1\n5 1\n6 1\n7 1\n8 1\n9 1\n10 1\n11 1\n12 1\n13 1\n14 1\n15 1\n14\n1 1\n3 1\n4 1\n5 1\n6 1\n7 1\n8 1\n9 1\n10 1\n11 1\n12 1\n13 1\n14 1\n15 1\n14\n1 1\n2 1\n4 1\n5 1\n6 1\n7 1\n8 1\n9 1\n10 1\n11 1\n12 1\n13 1\n14 1\n15 1\n14\n1 1\n2 1\n3 1\n5 1\n6 1\n7 1\n8 1\n9 1\n10 1\n11 1\n12 1\n13... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\n\nLet $ f (x) $ be the sum of each digit when the non-negative integer $ x $ is expressed in binary.... | [{"input": "10830", "output": "13\n"}, {"input": "1663", "output": "10\n"}, {"input": "2604", "output": "11\n"}, {"input": "5020", "output": "12\n"}, {"input": "170", "output": "7\n"}, {"input": "264", "output": "8\n"}, {"input": "585", "output": "9\n"}, {"input": "120", "output": "6\n"}, {"input": "119", "output": "6\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAll cities of Lineland are located on the Ox coordinate axis. Thus, each city is associated with its position... | [{"input": "50\n-50000 -49459 -48875 -48456 -48411 -48096 -47901 -47500 -47150 -46808 -46687 -46679 -46337 -45747 -45604 -45194 -44752 -44242 -44231 -44122 -43636 -43274 -42916 -42881 -42386 -42095 -41830 -41618 -41145 -40897 -40534 -40007 -39761 -39389 -39104 -38909 -38630 -38561 -38364 -38255 -38214 -38084 -37959 -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\nYou are given an array of positive integers $a = [a_0, a_1, \\dots, a_{n - 1}]$ ($n \\ge 2$).\n\nIn one step,... | [{"input": "1\n97\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "0\n"}, {"input": "1\n97\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... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 grid with H rows and W columns.\n\nThe square at the i-th row and j-th column contains a string S_... | [{"input": "15 10\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake sna... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 some other world, today is December D-th.\nWrite a program that prints Christmas if D = 25, Christmas Eve ... | [{"input": "-1279", "output": "Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYour company’s next product will be a new game, which is a three-dimensional variant of the classic game “Tic... | [{"input": "3 3 3\n1 1\n1 1\n1 1\n3 3 7\n3 2\n1 3\n1 1\n2 3\n2 1\n3 3\n3 1\n4 3 15\n1 1\n2 2\n1 1\n3 3\n3 3\n1 1\n3 3\n3 3\n4 4\n1 1\n4 4\n4 4\n4 4\n4 1\n2 2\n0 0 0", "output": "Draw\nWhite 6\nBlack 15\n"}, {"input": "3 3 3\n1 1\n1 1\n1 1\n3 3 7\n3 3\n1 3\n1 1\n2 3\n2 1\n3 3\n3 1\n4 3 15\n1 1\n2 2\n1 1\n3 3\n3 3\n1 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\nThis is the easy version of the problem. The difference between versions is the constraints on $n$ and $a_i$.... | [{"input": "123 79\n49 100 128 149 148 22 89 81 46 142 119 70 22 134 134 80 69 145 144 33 28 127 70 27 91 94 98 29 153 53 102 138 113 123 135 143 87 77 84 27 106 8 156 27 97 150 53 31 126 135 40 79 150 79 69 7 3 49 84 14 24 39 13 103 54 98 122 95 71 157 79 114 136 101 38 25 150 103 150 158 109 121 74 76 3 46 133 31 38 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRead problems statements in Mandarin Chinese and Russian. \n\nYou are given two positive integers – A and B.... | [{"input": "3\n120 75\n184 16\n16 18", "output": "Yes\nYes\nNo\n"}, {"input": "3\n120 75\n184 16\n16 36", "output": "Yes\nYes\nNo\n"}, {"input": "3\n120 75\n184 16\n0 11", "output": "Yes\nYes\nYes\n"}, {"input": "3\n120 75\n128 16\n7 11", "output": "Yes\nYes\nNo\n"}, {"input": "3\n120 137\n128 16\n7 11", "output": "No\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe brave Knight came to the King and asked permission to marry the princess. The King knew that the Knight w... | [{"input": "15\n11 22 13 24 15 26 17 28 19 30 21 2 23 4 25 6 27 8 29 10 1 12 3 14 5 16 7 18 9 20\n", "output": "10\n"}, {"input": "15\n11 22 13 24 15 26 17 28 19 30 21 2 23 4 25 6 27 8 29 10 1 12 3 14 5 16 7 18 9 20\n", "output": "10\n"}, {"input": "9\n16 5 18 7 2 9 4 11 6 13 8 15 10 17 12 1 14 3\n", "output": "7\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\n# Task\n Given an integer `product`, find the smallest positive integer the product of whose digits is equal ... | [{"input": "450", "output": "[2559]", "fn_name": "digits_product"}, {"input": "12", "output": "[26]", "fn_name": "digits_product"}, {"input": "19", "output": "[-1]", "fn_name": "digits_product"}, {"input": "13", "output": "[-1]", "fn_name": "digits_product"}, {"input": "10", "output": "[25]", "fn_name": "digits_product... | 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\nWe are still with squared integers.\n\nGiven 4 integers `a, b, c, d` we form the sum of the squares of `a` an... | [{"input": "7\n96\n-1\n81", "output": "[[[471, 7783], [663, 7769]]]", "fn_name": "prod2sum"}, {"input": "-14\n12\n-10\n8", "output": "[[[8, 236], [44, 232]]]", "fn_name": "prod2sum"}, {"input": "10\n11\n12\n13", "output": "[[[2, 263], [23, 262]]]", "fn_name": "prod2sum"}, {"input": "1\n20\n-4\n-5", "output": "[[[75, 10... | 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 new attraction in Singapore Zoo: The Infinite Zoo.\n\nThe Infinite Zoo can be represented by a gra... | [{"input": "5\n1 4\n3 12\n2 15\n6 6\n10 5\n", "output": "YES\nYES\nNO\nYES\nNO\n"}, {"input": "5\n1 4\n3 6\n1 8\n10 3\n5 5\n", "output": "YES\nYES\nYES\nNO\nYES\n"}, {"input": "5\n1 2\n3 12\n2 6\n3 4\n3 5\n", "output": "YES\nYES\nNO\nYES\nYES\n"}, {"input": "5\n1 1\n3 17\n2 18\n6 4\n3 5\n", "output": "YES\nYES\nNO\nNO\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 solution so that it strips all text that follows any of a set of comment markers passed in. Any ... | [{"input": "\"apples, pears # and bananas\\ngrapes\\navocado @apples\"\n[\"@\", \"!\"]", "output": "[\"apples, pears # and bananas\\ngrapes\\navocado\"]", "fn_name": "solution"}, {"input": "\"apples, pears # and bananas\\ngrapes\\nbananas !apples\"\n[]", "output": "[\"apples, pears # and bananas\\ngrapes\\nbananas !app... | 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\nMost C/C++ programmers know about excellent opportunities that preprocessor #define directives give; but many... | [{"input": "5\n#define iiXEqDYeyVmIYsOaO fj/x-9-6/x*x+ 1/ 7*2-x -x+9+235*23*Ww+x-2*K+2-x/70\n#define XVgLzhoTUxoBr ( x+x/x/x*6-x)* x+K/24206-2 /5/8-x-7/Ww/K-x+6 \n#define QdfRBaJk 470551685-( 54-x)-30\n#define gEJcAGnF x+x-x+(x/x+9)/x-41-1/fj/1157561+x/x -x/26/x+K*x\n#define lO 7-1*(x*58 )-K*fj /722113691/x/K+2\n2+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\nFind the length between 2 co-ordinates. The co-ordinates are made of integers between -20 and 20 and will be... | [{"input": "[[0, 0], [10, 15]]", "output": "[\"18.03\"]", "fn_name": "length_of_line"}, {"input": "[[-3, 4], [10, 5]]", "output": "[\"13.04\"]", "fn_name": "length_of_line"}, {"input": "[[0, 0], [-5, -6]]", "output": "[\"7.81\"]", "fn_name": "length_of_line"}, {"input": "[[0, 0], [-7, 4]]", "output": "[\"8.06\"]", "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\nA connected undirected graph is called a vertex cactus, if each vertex of this graph belongs to at most one s... | [{"input": "40 43\n1 2\n1 3\n1 4\n4 5\n5 6\n1 7\n5 8\n7 9\n2 10\n10 11\n11 12\n2 13\n13 14\n14 15\n15 16\n16 17\n17 18\n18 19\n19 20\n20 21\n21 22\n22 23\n23 24\n24 25\n25 2\n3 26\n26 27\n27 28\n28 29\n29 30\n30 31\n31 32\n32 3\n4 33\n33 34\n34 35\n35 36\n36 37\n37 4\n5 38\n38 39\n39 40\n40 5\n25\n6 24\n31 14\n40 34\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\nThere are n points marked on the plane. The points are situated in such a way that they form a regular polygo... | [{"input": "10\n0 1 1 0 -1 -2 1 0 0 0\n1 0 0 0 1 0 0 0 0 0\n0 0 1 2 1 0 1 1 0 0\n0 0 1 0 0 0 0 -1 0 0\n-1 0 -1 0 0 0 0 0 1 0\n0 0 -1 0 0 1 -1 0 0 1\n2 0 0 0 0 0 1 0 0 2\n0 -1 0 0 0 0 0 0 0 0\n0 0 0 0 0 -1 0 0 0 0\n0 1 0 -2 0 0 -1 -1 0 0\n", "output": "0\n"}, {"input": "10\n0 1 1 0 -1 -2 1 0 0 0\n1 0 0 0 1 0 0 0 0 0\n0 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLet's define the permutation of length n as an array p = [p1, p2, ..., pn] consisting of n distinct integers ... | [{"input": "50 20365011074\n", "output": "2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 20 19 22 21 24 23 26 25 28 27 30 29 32 31 34 33 36 35 38 37 40 39 42 41 44 43 46 45 48 47 50 49\n"}, {"input": "50 5608642004\n", "output": "1 2 4 3 5 6 8 7 9 10 11 13 12 15 14 17 16 18 20 19 22 21 23 24 25 26 28 27 30 29 31 32 33 34... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nCreate a function named `divisors`/`Divisors` that takes an integer `n > 1` and returns an array with all of ... | [{"input": "24", "output": "[[2, 3, 4, 6, 8, 12]]", "fn_name": "divisors"}, {"input": "13", "output": "[\"13 is prime\"]", "fn_name": "divisors"}, {"input": "29", "output": "[\"29 is prime\"]", "fn_name": "divisors"}, {"input": "3", "output": "[\"3 is prime\"]", "fn_name": "divisors"}, {"input": "253", "output": "[[11,... | 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\n```if-not:sql\nImplement a function that receives two IPv4 addresses, and returns the number of addresses bet... | [{"input": "\"180.0.0.0\"\n\"181.0.0.0\"", "output": "[16777216]", "fn_name": "ips_between"}, {"input": "\"10.11.12.13\"\n\"10.11.13.0\"", "output": "[243]", "fn_name": "ips_between"}, {"input": "\"170.0.0.0\"\n\"170.1.0.0\"", "output": "[65536]", "fn_name": "ips_between"}, {"input": "\"1.2.3.4\"\n\"5.6.7.8\"", "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\nThis problem is same as the previous one, but has larger constraints.\n\nIt was a Sunday morning when the thr... | [{"input": "25\n-10000 -10000\n-10000 -5000\n-10000 0\n-10000 5000\n-10000 10000\n-7452 -10000\n-5000 -5000\n-5000 0\n-5000 5000\n-5000 10000\n-1 -10000\n0 -5000\n0 0\n0 5000\n0 10000\n5000 -13650\n5000 -5000\n5000 0\n5000 5000\n5000 10000\n10000 -10000\n10000 -5000\n10000 0\n10000 5000\n10000 10000\n", "output": "1410... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 easy and hard versions is the length of the string. You can hack this problem if ... | [{"input": "0111001100111011101000\n", "output": "0011001100001011101000\n"}, {"input": "0111001100111111101000\n", "output": "0011001100000011101000\n"}, {"input": "0111011100111111101000\n", "output": "0001001100000011101000\n"}, {"input": "0111011100111101101000\n", "output": "0001001100001101101000\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\nSurrounding Area\n\nLand fence\n\nEnglish text is not available in this practice contest.\n\nTwo real estate ... | [{"input": "10 10\n.....W....\n....W.W...\n...W...W..\n....W...W.\n.....W...W\n......W.W.\nBBB....W..\n..BB.BB.BB\n....B..B..\n...B.B..W.\n5 3\n...B.\n...BB\n.....\n1 1\n.\n0 0", "output": "10 21\n12 0\n0 0\n"}, {"input": "10 10\n.....W....\n....W.W...\n...W...W..\n....W...W.\n.....W...W\n......W.W.\nBBB....W..\n..B..B... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nConsider some set of distinct characters $A$ and some string $S$, consisting of exactly $n$ characters, where... | [{"input": "1000000000 2 2\n1 500000000\n", "output": "933660593\n"}, {"input": "1000000000 2 2\n1 500000000\n", "output": "933660593\n"}, {"input": "1000000000 2 2\n2 500000000\n", "output": "811805447\n"}, {"input": "1000000000 2 3\n1 500000000\n", "output": "947751250\n"}, {"input": "1000000000 2 2\n2 182433767\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 employees in Alternative Cake Manufacturing (ACM). They are now voting on some very important que... | [{"input": "100\nRDRRDRDDDDRDRRDDRDRRDDRRDDRRRDRRRDDDRDDRDDRRDRDRRRDRDRRRDRRDDDRDDRRRDRDRRRDDRDRDDDDDDDRDRRDDDDDDRRDD\n", "output": "D\n"}, {"input": "100\nRRDRRDDDDDDDRDRRRDRDRDDDRDDDRDDRDRRDRRRDRRDRRRRRRRDRRRRRRDDDRRDDRRRDRRRDDRRDRRDDDDDRRDRDDRDDRRRDRRDD\n", "output": "R\n"}, {"input": "100\nRRDRRDDDDDDDRDRRRDRDRDDDR... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 is so happy about inventing bubble sort graphs that he's staying all day long at the office and writing... | [{"input": "20\n-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1\n", "output": "927799753\n"}, {"input": "20\n-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1\n", "output": "927799753\n"}, {"input": "10\n4 10 -1 1 6 8 9 2 -1 -1\n", "output": "4\n"}, {"input": "10\n4 10 -1 1 6 8 9 2 -1 -1\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\nVasily the Programmer loves romance, so this year he decided to illuminate his room with candles.\n\nVasily h... | [{"input": "1000 1000\n", "output": "1001\n"}, {"input": "1000 1000\n", "output": "1001\n"}, {"input": "1000 2\n", "output": "1999\n"}, {"input": "1000 3\n", "output": "1499\n"}, {"input": "1000 4\n", "output": "1333\n"}, {"input": "1000 3\n", "output": "1499\n"}, {"input": "1000 2\n", "output": "1999\n"}, {"input": "1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nEve is a beginner stand-up comedian. Her first show gathered a grand total of two spectators: Alice and Bob.\... | [{"input": "15\n1 100000000 100000000 100000000\n1 100000000 100000000 100000000\n1 100000000 100000000 100000000\n1 100000000 100000000 100000000\n1 100000000 100000000 100000000\n1 100000000 100000000 100000000\n1 100000000 100000000 100000000\n1 100000000 100000000 100000000\n1 100000000 100000000 100000000\n1 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\nAfter their adventure with the magic mirror Kay and Gerda have returned home and sometimes give free ice crea... | [{"input": "6 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n", "output": "7000000000 0\n"}, {"input": "6 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n+ 1000000000\n", "output": "7000000000 0\n"}, {"input": "6 1000000000\n+ 1000000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThis is the easy version of this problem. The only difference between easy and hard versions is the constrain... | [{"input": "10\n3\n1 1 1\n1\n1\n4\n3 4 3 3\n1\n1\n7\n7 1 1 3 3 4 5\n3\n3 2 1\n9\n4 1 7 1 1 6 1 1 7\n5\n3 5 3 3 3\n1\n1\n9\n8 9 5 7 4 1 3 5 4\n", "output": "1\n0\n4\n0\n8\n1\n11\n10\n0\n12\n"}, {"input": "10\n3\n1 1 1\n1\n1\n4\n3 4 3 3\n1\n1\n7\n7 1 1 3 3 4 5\n3\n3 2 1\n9\n4 1 7 1 1 6 1 1 7\n5\n3 5 3 3 3\n1\n1\n9\n8 9 5... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.