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\nIt's finally summer in Chefland! So our chef is looking forward to prepare some of the best \"beat-the-heat\"...
[{"input": "2\n5\n1 -1 0 1 10\n4\n2 1 -2 -1", "output": "12\n6\n"}, {"input": "2\n5\n0 0 3 10 5\n4\n4 1 0 -5", "output": "18\n10\n"}, {"input": "2\n5\n1 2 3 11 10\n4\n2 1 0 -1", "output": "25\n4\n"}, {"input": "2\n5\n1 2 3 11 10\n4\n4 1 0 -1", "output": "25\n6\n"}, {"input": "2\n5\n1 0 0 1 10\n4\n1 1 -2 -1", "output": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is an Amidakuji that consists of w vertical bars and has a height (the number of steps to which horizon...
[{"input": "10 8 10\n10 4\n4 4\n5 1\n6 2\n3 3\n1 3\n2 4\n8 2\n7 5\n7 1", "output": "1\n2\n3\n7\n8\n5\n4\n6\n"}, {"input": "10 6 10\n10 4\n4 4\n5 1\n4 2\n7 3\n1 3\n2 4\n8 2\n3 5\n7 1", "output": "1\n4\n3\n5\n6\n2\n"}, {"input": "10 6 10\n10 4\n4 4\n5 1\n6 2\n7 3\n1 3\n2 4\n8 2\n7 5\n7 1", "output": "4\n2\n3\n1\n5\n6\n"}...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given two arithmetic progressions: a_1k + b_1 and a_2l + b_2. Find the number of integers x such that...
[{"input": "1789433851 -633540112 1286318222 -1728151682 1438333624 1538194890\n", "output": "0\n"}, {"input": "1789433851 -633540112 1286318222 -1728151682 1438333624 1538194890\n", "output": "0\n"}, {"input": "1955378240 -837482305 1743607821 -1623988108 -653286850 178227154\n", "output": "0\n"}, {"input": "195537824...
code_stdio
[ { "content": "You are an expert Python programmer. 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_1, a_2, \\dots, a_n$, consisting of integers.\n\nYou can apply the following oper...
[{"input": "3\n7\n3 1 6 6 3 1 1\n8\n1 1 4 4 4 7 8 8\n7\n4 2 5 2 6 2 7\n", "output": "2\n0\n1\n"}, {"input": "3\n7\n3 1 6 6 3 1 1\n8\n1 1 4 4 4 7 8 8\n7\n4 2 5 2 6 2 5\n", "output": "2\n0\n2\n"}, {"input": "3\n7\n3 1 6 6 3 1 1\n8\n1 1 4 4 4 7 8 8\n7\n4 2 5 3 6 2 5\n", "output": "2\n0\n3\n"}, {"input": "3\n7\n3 1 6 6 3 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\nSuppose you are given a string s of length n consisting of lowercase English letters. You need to compress it...
[{"input": "255 3880 4590\nwgwzwgwuwgwzwgwxwgwzwgwuwgwzwgwewgwzwgwuwgwzwgwxwgwzwgwuwgwzwgwkwgwzwgwuwgwzwgwxwgwzwgwuwgwzwgwewgwzwgwuwgwzwgwxwgwzwgwuwgwzwgwawgwzwgwuwgwzwgwxwgwzwgwuwgwzwgwewgwzwgwuwgwzwgwxwgwzwgwuwgwzwgwkwgwzwgwuwgwzwgwxwgwzwgwuwgwzwgwewgwzwgwuwgwzwgwxwgwzwgwuwgwzwgw\n", "output": "62460"}, {"input": "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\nScreen resolution of Polycarp's monitor is $a \\times b$ pixels. Unfortunately, there is one dead pixel at hi...
[{"input": "6\n8 8 0 0\n1 11 0 3\n17 10 10 4\n2 4 0 0\n4 10 3 9\n15 18 3 12\n", "output": "56\n7\n100\n6\n36\n198\n"}, {"input": "6\n8 8 0 0\n1 11 0 3\n17 10 10 4\n2 4 0 0\n4 10 3 6\n15 18 3 12\n", "output": "56\n7\n100\n6\n30\n198\n"}, {"input": "6\n8 8 0 0\n1 11 0 3\n17 10 10 4\n2 4 0 0\n4 10 3 6\n15 18 0 12\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 have a long stick, consisting of $m$ segments enumerated from $1$ to $m$. Each segment is $1$ centimeter ...
[{"input": "2 1000000000 1\n1 1000000000\n", "output": "1000000000\n"}, {"input": "2 1000000000 1\n1 1001000000\n", "output": "1001000000\n"}, {"input": "2 1000000000 1\n1 1000001000\n", "output": "1000001000\n"}, {"input": "2 1000000000 1\n1 1000000000\n", "output": "1000000000"}, {"input": "2 1000000000 2\n1 10000000...
code_stdio
[ { "content": "You are an expert Python programmer. 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 Johnny Bubbles enjoys spending hours in front of his computer playing video games. His favorite game i...
[{"input": "504 0.47945891424701503\n", "output": "168\n"}, {"input": "1000 0.4721875056593412\n", "output": "327\n"}, {"input": "444 0.34094493029760853\n", "output": "103\n"}, {"input": "743 0.47945891424701503\n", "output": "247\n"}, {"input": "444 0.49265183917195776\n", "output": "152\n"}, {"input": "550 0.3318234...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nBrief\n=====\nSometimes we need information about the list/arrays we're dealing with. You'll have to write su...
[{"input": "[11, 22, 33.33, 44.44, \"hasan\", \"ahmad\"]", "output": "[[[6], [2], [2], [2], [null]]]", "fn_name": "array_info"}, {"input": "[1, 2, 3.33, 4, 5.01, \"bass\", \"kick\", \" \"]", "output": "[[[8], [3], [2], [2], [1]]]", "fn_name": "array_info"}, {"input": "[1, 2, 3, 4, 5, 6, 7, 8, 9]", "output": "[[[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\nYou are given a tree (an undirected connected acyclic graph) consisting of $n$ vertices and $n - 1$ edges. A ...
[{"input": "7\n2 1 1\n3 2 0\n4 2 1\n5 2 0\n6 7 1\n7 2 1\n", "output": "34\n"}, {"input": "7\n2 1 1\n3 2 0\n4 2 1\n5 4 0\n6 7 1\n7 2 1\n", "output": "32\n"}, {"input": "7\n2 1 1\n3 2 1\n4 2 1\n5 2 0\n6 7 1\n7 2 1\n", "output": "37\n"}, {"input": "7\n2 1 1\n3 2 0\n4 2 1\n5 2 0\n6 7 0\n7 2 1\n", "output": "29\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\nWe have a weighted directed graph with N vertices numbered 0 to N-1.\n\nThe graph initially has N-1 edges. Th...
[{"input": "10\n190587 2038070 142162180 88207341 215145790 38 2 5 20\n32047998 21426 4177178 52 734621629 2596 102224223 5 1864\n49 481241221 1518272 51 772 146 8805349 3243297 449\n918151 126080576 5186563 46354 6646 491776 5750138 2897 161\n3656 7551068 2919714 43035419 495 3408 26 3317 2698\n455357 3 12 1857 5459 7...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an array of unique numbers. The numbers represent points. The higher the number the higher the ...
[{"input": "[22, 33, 18, 9, 110, 4, 1, 88, 6, 50]", "output": "[[5, 4, 6, 7, 1, 9, 10, 2, 8, 3]]", "fn_name": "rankings"}, {"input": "[10, 20, 40, 50, 30]", "output": "[[5, 4, 2, 1, 3]]", "fn_name": "rankings"}, {"input": "[1, 2, 3, 4, 5]", "output": "[[5, 4, 3, 2, 1]]", "fn_name": "rankings"}, {"input": "[3, 4, 1, 2, ...
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 prime number p, n integers a_1, a_2, …, a_n, and an integer k. \n\nFind the number of pairs o...
[{"input": "7 7 3\n4 0 5 3 1 2 6\n", "output": "0"}, {"input": "6 11 2\n1 2 3 4 5 6\n", "output": "1\n"}, {"input": "6 10 2\n1 2 3 4 5 6\n", "output": "1\n"}, {"input": "6 10 2\n1 2 3 4 5 0\n", "output": "1\n"}, {"input": "6 17 2\n1 2 3 4 5 0\n", "output": "0\n"}, {"input": "6 17 2\n1 2 3 4 8 0\n", "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\nThe goal is to write a pair of functions the first of which will take a string of binary along with a specifi...
[{"input": "\"1010 1010 0010 0010 1110 1010 0010 1110\"\n32", "output": "[-1440552402]", "fn_name": "to_twos_complement"}, {"input": "\"1000 0000 1110 1111 0011 0100 1100 1010\"\n32", "output": "[-2131807030]", "fn_name": "to_twos_complement"}, {"input": "\"10110001000100000101100011111000\"\n32", "output": "[-13243287...
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 and your friend are participating in a TV show \"Run For Your Prize\".\n\nAt the start of the show n priz...
[{"input": "10\n3934 38497 42729 45023 51842 68393 77476 82414 91465 98055\n", "output": "98054\n"}, {"input": "10\n3934 38497 42729 45023 51842 68393 77476 82414 91465 98055\n", "output": "98054\n"}, {"input": "6\n2 3 500000 999997 999998 999999\n", "output": "499999\n"}, {"input": "6\n2 3 500000 999997 999998 999999\...
code_stdio
[ { "content": "You are an expert Python programmer. 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 fearless Ikta has finally hunted down the infamous Count Big Bridge! Count Bigbridge is now trapped in a ...
[{"input": "1 3 1000 1000 1 0 0 4", "output": "1047197552288\n"}, {"input": "1 2 1000 1000 1 0 0 4", "output": "1570796325024\n"}, {"input": "1 3 1000 1000 0 0 0 4", "output": "1047197542296\n"}, {"input": "1 3 1001 1000 1 0 0 4", "output": "1049292990824\n"}, {"input": "2 3 1001 1000 1 1 1 2", "output": "524646496019\...
code_stdio
[ { "content": "You are an expert Python programmer. 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# Background\n\nMy TV remote control has arrow buttons and an `OK` button.\n\nI can use these to move a \"cur...
[{"input": "\"mississippi\"", "output": "[35]", "fn_name": "tv_remote"}, {"input": "\"codewars\"", "output": "[36]", "fn_name": "tv_remote"}, {"input": "\"solution\"", "output": "[33]", "fn_name": "tv_remote"}, {"input": "\"these\"", "output": "[27]", "fn_name": "tv_remote"}, {"input": "\"words\"", "output": "[25]", "f...
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 circle line of the Roflanpolis subway has $n$ stations.\n\nThere are two parallel routes in the subway. T...
[{"input": "100 26 63 60 23\n", "output": "YES\n"}, {"input": "100 26 63 60 20\n", "output": "YES\n"}, {"input": "100 26 77 60 20\n", "output": "YES\n"}, {"input": "100 45 77 77 20\n", "output": "YES\n"}, {"input": "100 45 90 77 20\n", "output": "YES\n"}, {"input": "100 45 10 77 20\n", "output": "YES\n"}, {"input": "10...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOrac is studying number theory, and he is interested in the properties of divisors.\n\nFor two positive integ...
[{"input": "5\n497347 19283\n2568 1000000000\n499979 123987\n93 19\n13 5\n", "output": "536584\n2000002568\n1247930\n132\n34\n"}, {"input": "5\n497347 19283\n2568 1000000000\n499979 123987\n93 19\n13 5\n", "output": "536584\n2000002568\n1247930\n132\n34\n"}, {"input": "5\n497347 19283\n2568 1000000000\n499979 202537\n9...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nYou can preview the image in better quality by the link: [http://assets.codeforces.com/files/656/w...
[{"input": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\n", "output": "-1300\n"}, {"input": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzyzzzzzzzzzzzzzzzzzz\n", "output": "-1299\n"}, {"input": "zzzzzzyzzzzzzzzzzzzzzzzzzzzzzzzyzzzzzzzzzzzzzzzzzz\n", "output": "-1298\n"}, {"input": "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGrigoriy, like the hero of one famous comedy film, found a job as a night security guard at the museum. At fi...
[{"input": "dqcpcobpcobnznamznamzlykxkxlxlylzmaobnaobpbnanbpcoaobnboaoboanzlymzmykylymylzlylymanboanaocqdqesfrfs\n", "output": "1236\n"}, {"input": "uhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuh\n", "output": "1293\n"}, {"input": "uhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuhuh...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nNastya received one more array on her birthday, this array can be used to play a traditional Byteland game on...
[{"input": "94 58\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 29 58 1 1 1 29 58 58 1 1 29 1 1 1 1 2 1 58 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 29 1 1 1 1 1 58 1 29 1 1 1 1 1 1 1 1 1 1 1 1 58 1 1 1 1 1 2 1 1 1\n", "output": "5\n"}, {"input": "94 58\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 29 58 1 1 1 29 58 58...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTonight is brain dinner night and all zombies will gather together to scarf down some delicious brains. The a...
[{"input": "1000000000\n", "output": "500000000\n"}, {"input": "1000000000\n", "output": "500000000\n"}, {"input": "1001000000\n", "output": "500500000\n"}, {"input": "1393488002\n", "output": "696744001\n"}, {"input": "1001000100\n", "output": "500500050\n"}, {"input": "1001000110\n", "output": "500500055\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\nTakahashi and Aoki will take N exams numbered 1 to N. They have decided to compete in these exams. The winner...
[{"input": "10 1000\n451 4593 6263\n324 310 6991\n225 1431 7068\n133 1757 4072\n204 3676 4328\n840 6600 9080\n415 1545 15200\n709 5467 8674\n862 6504 9835\n283 4965 9980", "output": "2373\n"}, {"input": "10 1000\n451 4593 6263\n324 310 9662\n378 1431 7068\n120 1757 9218\n204 3676 4328\n840 6221 9080\n684 1545 8511\n709...
code_stdio
[ { "content": "You are an expert Python programmer. 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 has decided to give a string to his mother.\n\nThe value of a string T is the length of the longest...
[{"input": "ssgtnscdnaqreedocoa\n14", "output": "19"}, {"input": "tsetnocdnargredocta\n3", "output": "15"}, {"input": "tsetnocdnargredocta\n2", "output": "13"}, {"input": "tsetnocdnargredocta\n1", "output": "11"}, {"input": "atcodergrandcontest\n6", "output": "17"}, {"input": "atcodergrandcontest\n5", "output": "16"}, ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSince most contestants do not read this part, I have to repeat that Bitlandians are quite weird. They have th...
[{"input": "3\n184 222 102\n", "output": "BitAryo\n"}, {"input": "3\n101 186 223\n", "output": "BitAryo\n"}, {"input": "3\n101 186 223\n", "output": "BitAryo\n"}, {"input": "3\n184 222 102\n", "output": "BitAryo\n"}, {"input": "3\n103 286 100\n", "output": "BitLGM\n"}, {"input": "3\n244 241 295\n", "output": "BitLGM\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\nLеt's create function to play cards. Our rules:\n\nWe have the preloaded `deck`:\n\n```\ndeck = ['joker','2♣'...
[{"input": "\"3\\u2663\"\n\"Q\\u2663\"\n\"\\u2666\"", "output": "[\"The second card won.\"]", "fn_name": "card_game"}, {"input": "\"A\\u2660\"\n\"2\\u2666\"\n\"\\u2666\"", "output": "[\"The second card won.\"]", "fn_name": "card_game"}, {"input": "\"Q\\u2663\"\n\"3\\u2663\"\n\"\\u2666\"", "output": "[\"The first card w...
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 non-empty string is called palindrome, if it reads the same from the left to the right and from the right t...
[{"input": "21\narozauprlanalapuazoaa\n", "output": "aaaaaaaallnoopprruuzz\n"}, {"input": "21\narozbuprlanalapuazoaa\n", "output": "aaaaaaabllnoopprruuzz\n"}, {"input": "21\narozbuarlpnalapuayoaa\n", "output": "aaaaaaabllnoopprruuyz\n"}, {"input": "21\naaoyaupalanplrbubzora\n", "output": "aaaaaabbllnoopprruuyz\n"}, {"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\nThis is the performance version of [this kata](https://www.codewars.com/kata/59afff65f1c8274f270020f5).\n\n--...
[{"input": "16777216\n14348907", "output": "[23951671]", "fn_name": "spinning_rings"}, {"input": "2\n10", "output": "[13]", "fn_name": "spinning_rings"}, {"input": "10\n2", "output": "[10]", "fn_name": "spinning_rings"}, {"input": "5\n5", "output": "[3]", "fn_name": "spinning_rings"}, {"input": "7\n9", "output": "[4]",...
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\nConsider a 32-bit real type with 7 bits from the right as the decimal part, the following 24 bits as the inte...
[{"input": "8\n00101110\n66920828\n00000080\n00000040\n000000c0\n00100110\n45306216\n07f00009", "output": "8226.125\n13444112.3125\n1.0\n0.5\n1.5\n8194.125\n9068740.171875\n1040384.0703125\n"}, {"input": "8\n00100100\n45780507\n00000080\n00000040\n0c000000\n00000101\n15330257\n80000f70", "output": "8194.0\n9105418.0546...
code_stdio
[ { "content": "You are an expert Python programmer. 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. Consider an infinite N-ary tree as shown below:\n\n<image>\n\nFigure: an infinite...
[{"input": "3 3\n11 11\n1 15\n3 15", "output": "11\n1\n1\n"}, {"input": "2 3\n7 7\n8 59\n5 16", "output": "7\n1\n2\n"}, {"input": "10 2\n7 5\n23 23\n0 3", "output": "1\n23\n"}, {"input": "2 3\n7 7\n5 83\n5 16", "output": "7\n5\n2\n"}, {"input": "3 3\n7 7\n5 83\n5 16", "output": "7\n1\n5\n"}, {"input": "3 3\n7 2\n5 83\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 number $n$ (divisible by $3$) and an array $a[1 \\dots n]$. In one move, you can increase any...
[{"input": "4\n6\n0 2 5 5 4 1\n6\n2 0 2 0 0 0\n9\n14 1 3 4 2 10 3 1 12\n6\n1 1 2 3 4 5\n", "output": "1\n2\n1\n2\n"}, {"input": "4\n6\n0 2 1 4 4 1\n6\n0 0 2 1 0 0\n9\n7 1 3 0 2 12 2 13 5\n6\n1 0 2 10 1 8\n", "output": "3\n3\n0\n2\n"}, {"input": "4\n6\n0 2 1 4 4 1\n6\n0 0 2 1 0 0\n9\n7 1 3 0 2 12 2 13 9\n6\n1 0 2 10 1 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\nHave a look at the following numbers.\n\n```\n n | score\n---+-------\n 1 | 50\n 2 | 150\n 3 | 300\n 4 | ...
[{"input": "10000", "output": "[2500250000]", "fn_name": "get_score"}, {"input": "12345", "output": "[3810284250]", "fn_name": "get_score"}, {"input": "1000", "output": "[25025000]", "fn_name": "get_score"}, {"input": "1234", "output": "[38099750]", "fn_name": "get_score"}, {"input": "100", "output": "[252500]", "fn_na...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a very long bench. The bench is divided into M sections, where M is a very large integer.\n\nInitial...
[{"input": "100\n-X-X-X--X-X--X--X-X--X-X-X--X-X-X--X--X-X-X-X--X--X-X-X-X-X-X-X-X-X-X-X-X-X-X-X--X-X-X-X-X-X-X-X-X-X", "output": "0 0 435664291\n"}, {"input": "100\nX-X-X-X-X-X-X-X-X-X--X-X-X-X-X-X-X-X-X-X-X-X-X-X-X--X--X-X-X-X--X--X-X-X--X-X-X--X-X--X--X-X--X-X-X-", "output": "0 0 435664291"}, {"input": "20\nX-X-X--X...
code_stdio
[ { "content": "You are an expert Python programmer. 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[Chopsticks (singular: chopstick) are short, frequently tapered sticks used in pairs of equal length, which a...
[{"input": "5 3\n13\n-2\n3\n9\n1", "output": "1\n"}, {"input": "5 3\n13\n-3\n3\n9\n1", "output": "1\n"}, {"input": "5 3\n13\n-3\n3\n1\n1", "output": "1\n"}, {"input": "5 4\n17\n-1\n3\n9\n2", "output": "1\n"}, {"input": "5 1\n13\n-3\n3\n1\n1", "output": "1\n"}, {"input": "5 2\n10\n-1\n3\n9\n6", "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\nIt is nighttime and Joe the Elusive got into the country's main bank's safe. The safe has n cells positioned ...
[{"input": "95 97575868 5\n4612 1644 3613 5413 5649 2419 5416 3926 4610 4419 2796 5062 2112 1071 3790 4220 3955 2142 4638 2832 2702 2115 2045 4085 3599 2452 5495 4767 1368 2344 4625 4132 5755 5815 2581 6259 1330 4938 815 5430 1628 3108 4342 3692 2928 1941 3714 4498 4471 4842 1822 867 3395 2587 3372 6394 6423 3728 3720 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nThere is a tree consisting of $ N $ vertices $ N-1 $ edges, and the $ i $ th edge connec...
[{"input": "4\n1 2\n2 3\n1 4\n1 3 2 -1\n-5 2 9 -1", "output": "33\n"}, {"input": "4\n1 2\n2 3\n1 4\n0 3 0 -1\n-4 2 5 -1", "output": "23\n"}, {"input": "4\n1 2\n1 4\n3 4\n-1 3 2 0\n-8 4 8 -1", "output": "27\n"}, {"input": "4\n1 2\n2 4\n3 4\n1 5 2 1\n-4 1 10 -1", "output": "38\n"}, {"input": "4\n1 2\n2 3\n1 4\n1 5 0 -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\nYou are given an integer x of n digits a_1, a_2, …, a_n, which make up its decimal notation in order from lef...
[{"input": "20 19\n19999999999999999999\n", "output": "20\n20000000000000000002\n"}, {"input": "20 10\n21474836472147483648\n", "output": "20\n21474836482147483648\n"}, {"input": "20 10\n19999999999999999999\n", "output": "20\n20000000002000000000\n"}, {"input": "20 10\n30583716933544117071\n", "output": "20\n305837169...
code_stdio
[ { "content": "You are an expert Python programmer. 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 array a with n elements and the number m. Consider some subsequence of a and the value of least...
[{"input": "100 343\n999 284 486 785 176 742 856 415 992 601 600 122 460 214 338 92 627 913 376 835 384 914 335 179 409 957 96 784 531 43 584 206 971 799 592 801 870 978 437 517 466 952 1 327 731 689 816 681 383 969 452 298 114 687 314 436 267 154 827 197 805 207 284 550 351 700 94 567 524 329 414 561 284 666 702 226 7...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDenis, after buying flowers and sweets (you will learn about this story in the next task), went to a date wit...
[{"input": "10 10\n1101001\n0110000\n0111010\n0010000\n1010000\n0111000\n1011011\n1010010\n1101011\n1111110\n", "output": "9941743758\n"}, {"input": "10 10\n0101111\n0000000\n1111011\n1011011\n1011011\n1111011\n0010010\n1010010\n1101111\n0000000\n", "output": "8993391761\n"}, {"input": "10 10\n1101001\n0110000\n0111010...
code_stdio
[ { "content": "You are an expert Python programmer. 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 children are standing in a circle and playing a game. Children's numbers in clockwise order form a permutat...
[{"input": "100 100\n96 73 23 74 35 44 75 13 62 50 76 63 29 45 24 63 29 45 24 63 29 45 24 63 29 45 24 63 29 45 24 63 29 45 24 63 29 45 24 63 29 45 24 63 29 45 24 63 29 45 24 63 29 45 24 63 29 45 24 63 29 45 24 63 29 45 24 63 29 45 24 63 29 45 24 63 29 45 24 63 29 45 24 63 29 45 24 63 29 45 24 63 29 45 24 63 29 45 24 63...
code_stdio
[ { "content": "You are an expert Python programmer. 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 long corridor which can be divided into $n$ square cells of size $1 \\times 1$. These cells are nu...
[{"input": "3\n25 2 3 5\n2 7\n11 2 11 10\n1 1\n4 2 3 6\n4 4\n", "output": "1\n0\n1\n"}, {"input": "3\n11 2 3 20\n4 4\n7 2 3 -1\n5 1\n1 2 4 10\n0 1\n", "output": "2\n2\n2\n"}, {"input": "3\n13 2 3 1\n1 8\n7 2 1 6\n13 2\n7 2 3 12\n2 4\n", "output": "1\n1\n2\n"}, {"input": "3\n25 2 3 7\n2 7\n11 2 3 10\n1 1\n4 2 3 6\n4 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\nIt is well known that Berland has n cities, which form the Silver ring — cities i and i + 1 (1 ≤ i < n) are c...
[{"input": "100 50\n79 24\n65 69\n44 6\n49 53\n26 22\n24 76\n10 2\n19 44\n44 10\n87 82\n91 87\n23 92\n69 66\n95 30\n90 24\n95 20\n76 36\n82 24\n63 80\n70 72\n34 76\n42 40\n17 100\n66 64\n85 96\n34 30\n36 69\n45 56\n36 62\n26 38\n31 28\n79 64\n78 69\n41 62\n36 40\n64 67\n21 13\n90 88\n28 30\n59 6\n59 56\n63 1\n24 91\n12...
code_stdio
[ { "content": "You are an expert Python programmer. 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 rectangles whose bases are parallel to the x-axis. Read the lower left coordinates (xa1, ya1) a...
[{"input": "2.223070606524155 1.4960198812761343 6.988386378768428 7.000508921833194 4.205136917017809 2.2424931885142083 5.1569216527923185 5.191516114177997\n1.1891195386027824 2.2619900314452366 6.37960763673212 8.721050113941343 1.5944937676218054 1.5944269037686163 7.4405536026925985 7.593208053380714\n1.948236149...
code_stdio
[ { "content": "You are an expert Python programmer. 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 us call a pair of integer numbers m-perfect, if at least one number in the pair is greater than or equal ...
[{"input": "-1000000000000000000 -1000000000000000000 -1000000000000000000\n", "output": "0\n"}, {"input": "-1000000000000000000 -1000000000000000000 -999999999999999999\n", "output": "-1\n"}, {"input": "-1000000000000000000 -1000000000000000000 -1000000000000000000\n", "output": "0\n"}, {"input": "-1000000000000000000...
code_stdio
[ { "content": "You are an expert Python programmer. 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На тренировку по подготовке к соревнованиям по программированию пришли n команд. Тренер для каждой команды по...
[{"input": "100 1019 35\n34 50 60 47 49 49 59 60 37 51 3 86 93 33 78 31 75 87 26 74 32 30 52 57 44 10 33 52 78 16 36 77 53 49 98 82 93 85 16 86 19 57 17 24 73 93 37 46 27 87 35 76 33 91 96 55 34 65 97 66 7 30 45 68 18 51 77 43 99 76 35 47 6 1 83 49 67 85 89 17 20 7 49 33 43 59 53 71 86 71 3 47 65 59 40 34 35 44 46 64\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 playing with N cards.\n\nThe i-th card has an integer X_i on it.\n\nTakahashi is trying to creat...
[{"input": "15 10\n1 5 6 10 11 11 11 20 21 25 25 26 99 124 99", "output": "6\n"}, {"input": "15 10\n0 5 6 10 11 11 11 20 21 25 25 26 99 131 99", "output": "5\n"}, {"input": "15 10\n0 5 6 10 11 11 11 20 21 46 25 26 99 131 99", "output": "5\n"}, {"input": "15 10\n0 5 6 10 11 11 17 20 21 46 25 26 99 131 99", "output": "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 N squares arranged in a row from left to right. The height of the i-th square from the left is H_i....
[{"input": "1\n1000000000\n", "output": "Yes\n"}, {"input": "5\n1 2 1 1 3\n", "output": "Yes\n"}, {"input": "5\n1 2 3 4 5\n", "output": "Yes\n"}, {"input": "1\n1000010000", "output": "Yes\n"}, {"input": "1\n1000011000", "output": "Yes\n"}, {"input": "1\n1000011100", "output": "Yes\n"}, {"input": "1\n1000001100", "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\nGiven are an N \\times N matrix and an integer K. The entry in the i-th row and j-th column of this matrix is...
[{"input": "49 4643\n1 50 99 148 197 246 295 344 393 442 491 540 589 638 687 736 785 834 883 932 981 1030 1079 1128 1177 1226 1275 1324 1373 1422 1471 1520 1569 1618 1667 1716 1765 1814 1863 1912 1961 2010 2059 2108 2157 2185 2255 2304 2353\n2 51 742 149 198 247 296 345 394 443 1148 541 590 639 688 737 786 835 1431 933...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAlice and Bob are playing a game with n piles of stones. It is guaranteed that n is an even number. The i-th ...
[{"input": "50\n42 31 49 11 28 38 49 32 15 22 10 18 43 39 46 32 10 19 13 32 19 40 34 28 28 39 19 3 1 47 10 18 19 31 21 7 39 37 34 45 19 21 35 46 10 24 45 33 20 40\n", "output": "Alice\n"}, {"input": "50\n42 31 49 11 28 13 49 32 15 22 10 18 43 39 46 32 10 19 13 32 19 40 34 28 28 39 19 3 1 47 10 18 19 31 21 7 39 37 34 45...
code_stdio
[ { "content": "You are an expert Python programmer. 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$ block towers in a row, where tower $i$ has a height of $a_i$. You're part of a building crew, a...
[{"input": "3\n3\n10 14 10\n4\n4 1 1 2\n5\n2 1 3 1 10\n", "output": "1\n0\n1\n"}, {"input": "3\n3\n10 10 10\n4\n3 2 1 2\n5\n1 2 3 1 5\n", "output": "0\n0\n1\n"}, {"input": "3\n3\n10 10 10\n4\n3 2 0 2\n5\n1 2 3 1 5\n", "output": "0\n1\n1\n"}, {"input": "3\n3\n10 10 10\n4\n3 2 1 2\n5\n1 2 3 1 4\n", "output": "0\n0\n1\n"}...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a complete graph of m vertices. Initially, the edges of the complete graph are uncolored. Sunuke did...
[{"input": "5\n2\n3\n4\n10\n6", "output": "17\n"}, {"input": "5\n2\n3\n3\n5\n6", "output": "11\n"}, {"input": "5\n2\n3\n5\n5\n6", "output": "13\n"}, {"input": "5\n2\n3\n3\n2\n6", "output": "9\n"}, {"input": "5\n2\n3\n4\n5\n6", "output": "12"}, {"input": "2\n80\n22", "output": "101\n"}, {"input": "2\n139\n5", "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\nGiven are two strings S and T.\nLet us change some of the characters in S so that T will be a substring of S....
[{"input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. 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 trying to cross a river by jumping along stones. Every time you land on a stone, you hop forwards by ...
[{"input": "[2, 2, 3, 1, 1, 2, 1]", "output": "[7]", "fn_name": "hop_across"}, {"input": "[1, 2, 1, 2]", "output": "[5]", "fn_name": "hop_across"}, {"input": "[1, 2, 5, 1]", "output": "[5]", "fn_name": "hop_across"}, {"input": "[2, 1, 1]", "output": "[5]", "fn_name": "hop_across"}, {"input": "[1, 1]", "output": "[4]", ...
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 Nastya has a hobby, she likes to remove some letters from word, to obtain another word. But it turns o...
[{"input": "aaaaaaaadbaaabbbbbddaaabdadbbbbbdbbabbbabaabdbbdababbbddddbdaabbddbbbbabbbbbabadaadabaaaadbbabbbaddb\naaaaaaaaaaaaaa\n61 52 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\nExample\n\nInput\n\n6 3\n1 0 0 1 0 1\n1 3 2\n\n\nOutput\n\n1### Format: Read the inputs from stdin solve the ...
[{"input": "1 3\n1 -1 0 1 -1 1\n2 1 -1", "output": "0\n"}, {"input": "1 3\n1 -1 0 1 0 1\n-1 3 2", "output": "0\n"}, {"input": "1 3\n1 0 -1 1 0 1\n-1 3 2", "output": "0\n"}, {"input": "1 3\n1 -1 0 1 0 1\n-1 1 2", "output": "0\n"}, {"input": "1 3\n1 -1 0 1 -1 1\n2 1 0", "output": "0\n"}, {"input": "1 3\n1 0 0 1 0 1\n-1 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\n## Task:\n\nYou have to write a function `pattern` which returns the following Pattern(See Examples) upto n n...
[{"input": "27", "output": "[\"777777777777777777777777777\\n766666666666666666666666666\\n765555555555555555555555555\\n765444444444444444444444444\\n765433333333333333333333333\\n765432222222222222222222222\\n765432111111111111111111111\\n765432100000000000000000000\\n765432109999999999999999999\\n7654321098888888888...
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\nEmuskald is an avid horticulturist and owns the world's longest greenhouse — it is effectively infinite in le...
[{"input": "20 15\n6 8719.787178\n10 13066.663722\n15 58623.690996\n9 184321.819759\n3 227999.294560\n2 279836.330518\n9 282806.308675\n8 311056.507765\n1 312315.562927\n5 459200.373445\n14 563454.265947\n7 647364.984868\n13 679762.0281866578\n4 684192.647497\n1 733119.607626\n7 748637.778398\n12 828048.945890\n11 8936...
code_stdio
[ { "content": "You are an expert Python programmer. 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 the Codeforces round author sat exams. He had n exams and he needed to get an integer from 2 to 5 for...
[{"input": "45 104\n", "output": "31\n"}, {"input": "50 100\n", "output": "50\n"}, {"input": "47 128\n", "output": "13\n"}, {"input": "46 127\n", "output": "11\n"}, {"input": "42 104\n", "output": "22\n"}, {"input": "56 128\n", "output": "40\n"}, {"input": "50 101\n", "output": "49\n"}, {"input": "53 116\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\nThe Rebel fleet is afraid that the Empire might want to strike back again. Princess Heidi needs to know if it...
[{"input": "10 10\n8530 -3814\n-9330 -6035\n3951 -217\n-9276 8291\n636 -3118\n5024 -2403\n4601 7977\n-3620 -1428\n4954 -9632\n-9852 6553\n-3457 5430\n-8866 -7343\n1020 -5748\n5043 -3820\n-2832 1528\n-5058 -825\n2406 -3530\n9152 -7463\n-8547 7108\n2492 8953\n", "output": "Yes\n"}, {"input": "10 10\n8530 -3814\n-9330 -60...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there ...
[{"input": "3\n3 1000 1000 1000\n6 1000 1000 1000 1000 1000 1000\n5 1000 1000 1000 1000 1000\n", "output": "7000 7000\n"}, {"input": "3\n3 1000 1000 1001\n6 1000 1000 1000 1000 1000 1000\n5 1000 1000 1000 1000 1000\n", "output": "7000 7001\n"}, {"input": "3\n3 1000 1000 1001\n6 1000 1000 1000 1000 1000 1001\n5 1000 100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nInput Format\n\n\nN K\na_1 a_2 a_3 ... a_N\n\n\nOutput Format\n\nPrint the minimum cost in one line. In the e...
[{"input": "5 5\n11683 3774 3598 4173 3424", "output": "31773\n"}, {"input": "5 4\n11683 3774 3598 4173 3424", "output": "23510\n"}, {"input": "5 5\n3949 3208 13644 3469 3424", "output": "21140\n"}, {"input": "5 5\n4931 3208 13644 3469 3424", "output": "22122\n"}, {"input": "5 5\n2312 3208 13644 3469 3424", "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\nMake a function that returns the value multiplied by 50 and increased by 6. If the value entered is a string ...
[{"input": "\"RyanIsCool\"", "output": "[\"Error\"]", "fn_name": "problem"}, {"input": "\"hello\"", "output": "[\"Error\"]", "fn_name": "problem"}, {"input": "1.2", "output": "[66]", "fn_name": "problem"}, {"input": "5", "output": "[256]", "fn_name": "problem"}, {"input": "3", "output": "[156]", "fn_name": "problem"}, ...
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\nLet's play Amidakuji.\n\nIn the following example, there are five vertical lines and four horizontal lines. T...
[{"input": "5\n-1\n1,4\n4,5\n,12\n43,", "output": "1\n2\n3\n4\n5\n"}, {"input": "5\n-1\n1,4\n5,4\n,12\n43,", "output": "1\n2\n3\n4\n5\n"}, {"input": "5\n-1\n1,4\n5,4\n-12\n43,", "output": "1\n2\n3\n4\n5\n"}, {"input": "5\n4\n2,4\n3,5\n2,1\n3,4", "output": "4\n1\n2\n5\n3\n"}, {"input": "5\n4\n2,4\n4,5\n2,1\n3,4", "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\nImplement `String#parse_mana_cost`, which parses [Magic: the Gathering mana costs](http://mtgsalvation.gamepe...
[{"input": "\"1wubrg\"", "output": "[{\"*\": 1, \"w\": 1, \"u\": 1, \"b\": 1, \"r\": 1, \"g\": 1}]", "fn_name": "parse_mana_cost"}, {"input": "\"3wubrg\"", "output": "[{\"*\": 3, \"w\": 1, \"u\": 1, \"b\": 1, \"r\": 1, \"g\": 1}]", "fn_name": "parse_mana_cost"}, {"input": "\"wwuubbrrgg\"", "output": "[{\"w\": 2, \"u\":...
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\nConsider a table G of size n × m such that G(i, j) = GCD(i, j) for all 1 ≤ i ≤ n, 1 ≤ j ≤ m. GCD(a, b) is the...
[{"input": "1000000000000 1000000000000 116\n1587924000 7 2 3 4 5 6 1 56 9 10 1 12 13 2 105 16 1 18 1 620 3 14 1 24 25 26 27 4 203 30 1 32 3 2 5 252 1 2 39 40 1 6 7 4 45 2 1 48 1 350 93 52 1 54 5 8 21 58 1 60 1 2 9 224 65 6 1 4 3 10 7 72 1 2 75 4 1 546 1 80 81 62 1 12 35 2 87 8 1 90 13 28 3 2 5 96 1 2 63 100 1 6 1 104 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 three integers, A, B and C.\n\nAmong them, two are the same, but the remaining one is different...
[{"input": "-100 100 100\n", "output": "-100\n"}, {"input": "-123 100 100", "output": "-123\n"}, {"input": "-157 100 100", "output": "-157\n"}, {"input": "-100 100 100", "output": "-100"}, {"input": "-25 100 100", "output": "-25\n"}, {"input": "-19 100 100", "output": "-19\n"}, {"input": "-27 100 100", "output": "-27\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 an integer sequence of length n, a_1, ..., a_n. Let us consider performing the following n oper...
[{"input": "6\n-1 22 1 75 15 0", "output": "0 75 22 -1 1 15\n"}, {"input": "6\n2 20 0 59 10 1", "output": "1 59 20 2 0 10\n"}, {"input": "6\n2 20 0 59 10 0", "output": "0 59 20 2 0 10\n"}, {"input": "6\n2 20 0 59 12 0", "output": "0 59 20 2 0 12\n"}, {"input": "6\n0 20 0 59 12 0", "output": "0 59 20 0 0 12\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\nThis is yet another problem dealing with regular bracket sequences.\n\nWe should remind you that a bracket se...
[{"input": "())(((((())())((((()))(())))())())(((()(()()()())(())()))((()(())())()()))()(()())))))(()))((())((((\n", "output": "80 1\n"}, {"input": ")(()(((((())))))(((()))))))((()(((((((())())()))))((((((((())))((((((())))))(()((((()))))(()))))))))\n", "output": "68 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\nFind the number of integers between 1 and K (inclusive) satisfying the following condition, modulo 10^9 + 7:\...
[{"input": "98765432109876543210\n66", "output": "678072802\n"}, {"input": "98765432109876543210\n18", "output": "852803440\n"}, {"input": "98765432109876543210\n11", "output": "501683936\n"}, {"input": "98765432109876543210\n12", "output": "209841644\n"}, {"input": "98765432109876543210\n10", "output": "851852334\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 Dwango Co., Ltd., there is a content distribution system named 'Dwango Media Cluster', and it is called 'D...
[{"input": "54\nDIALUPWIDEAREADETWORKGAMINGOPERATIONCORPORATIONLIMITEN\n3\n20 30 40", "output": "0\n2\n3\n"}, {"input": "54\nDIALUPWIDEAREADETWORKGAMINGOPERATIONCORPORATIONLIMITEN\n3\n20 38 40", "output": "0\n3\n3\n"}, {"input": "54\nDIALUPWIDEAREADETWORKGAMINGOPERATIONCORPORATIONLIMITEN\n3\n20 30 32", "output": "0\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\n# Task\n Let's say that `\"g\" is happy` in the given string, if there is another \"g\" immediately to the ri...
[{"input": "\"A half of a half is a quarter.\"", "output": "[true]", "fn_name": "happy_g"}, {"input": "\"bigger is ggooder\"", "output": "[true]", "fn_name": "happy_g"}, {"input": "\"ggg ggg g ggg\"", "output": "[false]", "fn_name": "happy_g"}, {"input": "\"gg0gg3gg0gg\"", "output": "[true]", "fn_name": "happy_g"}, {"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\nRead problems statements in Mandarin Chinese here \n\n------ Problem Statement ------ \n\nMaxim likes divider...
[{"input": "10\n1\n2\n1\n10\n5\n11\n10\n8\n14\n4", "output": "0\n0\n0\n0\n0\n0\n0\n1\n2\n1\n"}, {"input": "10\n2\n2\n1\n7\n5\n13\n14\n8\n18\n5", "output": "0\n0\n0\n1\n0\n0\n2\n1\n0\n0\n"}, {"input": "10\n2\n2\n1\n10\n5\n11\n7\n8\n14\n4", "output": "0\n0\n0\n0\n0\n0\n1\n1\n2\n1\n"}, {"input": "10\n2\n2\n2\n9\n7\n13\n14...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n# Let's play Psychic \n\nA box contains green, red, and blue balls. The total number of balls is given by `n`...
[{"input": "50\n180", "output": "[[[0, 30, 20], [1, 28, 21], [2, 26, 22], [3, 24, 23], [4, 22, 24], [5, 20, 25], [6, 18, 26], [7, 16, 27], [8, 14, 28], [9, 12, 29], [10, 10, 30], [11, 8, 31], [12, 6, 32], [13, 4, 33], [14, 2, 34], [15, 0, 35]]]", "fn_name": "Guess_it"}, {"input": "50\n172", "output": "[[[0, 22, 28], [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\nShe is an extraordinary girl. She works for a library. Since she is young and cute, she is forced to do a lot...
[{"input": "2\n2\nYYZNNNNY\n4\nNNNYYNYNNNYYONYN", "output": "6\n10\n"}, {"input": "2\n2\nYYZNYNNN\n4\nNNNYYNYNNNYYNNYN", "output": "5\n10\n"}, {"input": "2\n2\nYYZNNNNY\n4\nNNNYNNYNYNYYONYN", "output": "6\n11\n"}, {"input": "2\n2\nYYZLXNNN\n3\nNYNNYNYNNNYYNNYN", "output": "4\n10\n"}, {"input": "2\n2\nNNONYZYY\n4\nNNNYY...
code_stdio
[ { "content": "You are an expert Python programmer. 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, hedgehog Filya went to school for the very first time! Teacher gave him a homework which Filya was una...
[{"input": "10\n1 1 1 1 1 2 2 2 2 2\n", "output": "YES\n"}, {"input": "10\n1 1 1 1 1 2 2 2 2 2\n", "output": "YES\n"}, {"input": "10\n1 1 1 1 1 3 2 2 2 2\n", "output": "YES\n"}, {"input": "3\n99999999 1 50000000\n", "output": "YES\n"}, {"input": "2\n100000001 100000003\n", "output": "YES\n"}, {"input": "2\n100000001 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\nNote : Issues Fixed with python 2.7.6 , Use any one you like :D , ( Thanks to \n\nTime , time , time . Your t...
[{"input": "\"-09:00\"", "output": "[\"Check your time !\"]", "fn_name": "clock_degree"}, {"input": "\"26:78\"", "output": "[\"Check your time !\"]", "fn_name": "clock_degree"}, {"input": "\"24:00\"", "output": "[\"Check your time !\"]", "fn_name": "clock_degree"}, {"input": "\"00:00\"", "output": "[\"360:360\"]", "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\nAtCoder Mart sells 1000000 of each of the six items below:\n\n* Riceballs, priced at 100 yen (the currency of...
[{"input": "386", "output": "0\n"}, {"input": "115", "output": "0\n"}, {"input": "173", "output": "0\n"}, {"input": "145", "output": "0\n"}, {"input": "192", "output": "0\n"}, {"input": "160", "output": "0\n"}, {"input": "604", "output": "1\n"}, {"input": "248", "output": "0\n"}, {"input": "368", "output": "0\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\nIt is so boring in the summer holiday, isn't it? So Alice and Bob have invented a new game to play. The rules...
[{"input": "10\n100000000 200000000 300000000 400000000 500000000 600000000 555489806 1596475927 1262387014 1000000000\n", "output": "Alice\n"}, {"input": "10\n100000000 200000000 300000000 400000000 500000000 600000000 555489806 1596475927 1262387014 1000000100\n", "output": "Alice\n"}, {"input": "10\n100000000 200000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nReal stupidity beats artificial intelligence every time.\n\n— Terry Pratchett, Hogfather, Discworld\n\nYou ar...
[{"input": "4\n3 2\naab\n3 3\naab\n7 1\nabacaba\n2 0\nab\n", "output": "2\n2\n1\n1\n"}, {"input": "1\n4 1\nabcd\n", "output": "2\n"}, {"input": "1\n4 2\nabca\n", "output": "2\n"}, {"input": "1\n3 1\naab\n", "output": "2\n"}, {"input": "1\n3 1\nabc\n", "output": "2\n"}, {"input": "1\n2 1\nab\n", "output": "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 pictures delivered for the new exhibition. The i-th painting has beauty a_{i}. We know that a vis...
[{"input": "100\n9 9 49 55 14 8 55 58 35 67 3 6 106 169 41 49 15 60 18 66 3 26 97 47 43 88 71 98 12 34 48 17 134 53 8 24 69 49 12 23 77 12 21 88 66 9 29 13 61 69 54 77 41 20 4 65 37 74 7 6 24 210 55 72 89 4 78 27 29 82 13 83 18 4 32 69 89 91 66 13 92 54 38 5 26 56 17 98 29 4 17 39 29 181 3 67 85 98 21 26\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\nIn a kindergarten, the children are being divided into groups. The teacher put the children in a line and ass...
[{"input": "2\n-1000000000 1000000000\n", "output": "2000000000\n"}, {"input": "2\n-1000000000 1000000100\n", "output": "2000000100\n"}, {"input": "2\n-1000000000 1000010100\n", "output": "2000010100\n"}, {"input": "2\n-1000000000 1010010100\n", "output": "2010010100\n"}, {"input": "2\n-1000000000 1010011100\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\nVasya had three strings $a$, $b$ and $s$, which consist of lowercase English letters. The lengths of strings ...
[{"input": "100 200\ndddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\ndddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\nddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with...
[{"input": "999999999999999999 1000000000000000000\n", "output": "1000000000000000000\n"}, {"input": "999999999999999999 1000000000000000000\n", "output": "1000000000000000000\n"}, {"input": "999999999999999991 1000000000000000000\n", "output": "111111111111111120\n"}, {"input": "999999999999999991 1000000000000000000\...
code_stdio
[ { "content": "You are an expert Python programmer. 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 has n positive integers a_1, a_2, ..., a_{n}. \n\nHis friend Vasya decided to joke and replaced all dig...
[{"input": "50\ng\nha\nhd\ndi\nac\nfdhhb\ng\nhgeag\nafafb\nb\nb\najjj\ncaiadi\nhciifa\nhb\ncaih\ncdbbi\ngjff\nbfe\neddci\ndijfie\nacjj\nef\ng\njdc\nahg\ne\nhbbh\ncdc\njifdc\ne\nffaehj\nhjhi\ng\neag\nfbbc\nchg\njhahfg\nbb\njd\njchh\nbefifj\nejac\ne\nh\njfhb\nedhe\nf\nag\nca\n", "output": "2673136\n"}, {"input": "50\ng\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\nPolycarp has $n$ coins, the value of the $i$-th coin is $a_i$. Polycarp wants to distribute all the coins bet...
[{"input": "100\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 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...
code_stdio
[ { "content": "You are an expert Python programmer. 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$.\n\nIn one move, you can choose some integer $k$ from $1$ to $10$ and ...
[{"input": "11\n5 5\n13 42\n18 4\n1337 420\n123456789 1000000000\n100500 9000\n5 5\n13 42\n18 4\n2524 420\n123456789 1000000000\n", "output": "0\n3\n2\n92\n87654322\n9150\n0\n3\n2\n211\n87654322\n"}, {"input": "11\n10 5\n4 42\n17 4\n1337 420\n123456789 1000000000\n100500 9000\n5 5\n13 42\n18 4\n2524 420\n123456789 1000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode la...
[{"input": "30 3 50 32 1 18\n46 60\n66 94\n99 141\n162 239\n309 334\n400 550\n594 630\n659 663\n664 701\n735 736\n741 755\n756 801\n823 854\n865 915\n937 964\n984 986\n990 1007\n1008 1031\n1052 1064\n1073 1080\n1190 1191\n1192 1254\n1265 1266\n1272 1273\n1274 1277\n1284 1302\n1308 1312\n1358 1383\n1388 1389\n1390 1401\...
code_stdio
[ { "content": "You are an expert Python programmer. 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 next one, but has smaller constraints.\n\nIt was a Sunday morning when the three ...
[{"input": "42\n-5391 -2932\n-5391 -2868\n-5391 1744\n-5391 2236\n-5391 4148\n-5391 5217\n-5391 6188\n-3584 -2932\n-3584 -2868\n-3584 1744\n-3584 2236\n-3584 4148\n-3584 5217\n-3584 6188\n-1657 -2932\n-1657 -2868\n-1657 1744\n-1657 2236\n-1657 4148\n-1657 5217\n-1657 6188\n3218 -2932\n3218 -2868\n3218 1744\n3218 2236\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 the rush of modern life, people often forget how beautiful the world is. The time to enjoy those around th...
[{"input": "20 20\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "output": "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n"}, {"input": "20 20\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1\n", "output": "2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n"}, {"input": "10 1\n0 7 0 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\nTakahashi is organizing a party.\nAt the party, each guest will receive one or more snack pieces.\nTakahashi ...
[{"input": "100000 99999\n", "output": "9999900000\n"}, {"input": "110000 99999", "output": "10999890000\n"}, {"input": "110001 118998", "output": "4363299666\n"}, {"input": "110000 138162", "output": "7598910000\n"}, {"input": "110000 121574", "output": "6686570000\n"}, {"input": "111001 118998", "output": "1200808818...
code_stdio
[ { "content": "You are an expert Python programmer. 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 widely known among some people Belarusian sport programmer Yura possesses lots of information about cars. T...
[{"input": "10 10\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 1585 1564 3603 1095 1364 1029 3189 1331\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 1749\n0 3495 1540 641 1093 702 2249 983 1218 2108\n0 1397 1105 3119 1194 839 1286 2979 2941 1911\n0 1818 2264 631 3342 3511 2434 2960...
code_stdio
[ { "content": "You are an expert Python programmer. 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$ cities in Berland and some pairs of them are connected by two-way roads. It is guaranteed that ...
[{"input": "3\n7 7 3 5\n1 2\n2 3\n3 4\n4 5\n5 6\n6 7\n7 5\n4 5 2 3\n1 2\n2 3\n3 4\n4 1\n4 2\n4 3 2 1\n1 2\n2 3\n4 1\n", "output": "4\n0\n1\n"}, {"input": "3\n7 7 3 5\n1 2\n2 3\n3 4\n4 5\n5 6\n6 7\n7 5\n4 5 2 3\n1 2\n2 3\n4 4\n4 1\n4 2\n4 3 2 1\n1 2\n2 3\n4 1\n", "output": "4\n0\n1\n"}, {"input": "3\n7 7 3 5\n1 2\n2 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\nConstanze is the smartest girl in her village but she has bad eyesight.\n\nOne day, she was able to invent an...
[{"input": "nnnnnnnnnnnnnnnnnnnnnuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuunnnnnnnnnnnnnnnnnnnnnuuuuuuuuuunnunnu\n", "output": "281595619\n"}, {"input": "nnnnnnnnnnnnnnnnnnnnnuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuunnnnnnnnnnnnnnnnnnnnnuuuuuuuuuunnunnu\n", "output": "281595619\n"}, {"input": "unnunnuuuuuuuuuunnnnnnnn...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLengths are measures in Baden in inches and feet. To a length from centimeters it is enough to know that an i...
[{"input": "10000\n", "output": "277 9\n"}, {"input": "18864\n", "output": "524 0\n"}, {"input": "13473\n", "output": "374 3\n"}, {"input": "25368\n", "output": "704 8\n"}, {"input": "9999\n", "output": "277 9\n"}, {"input": "9876\n", "output": "274 4\n"}, {"input": "01000\n", "output": "27 9\n"}, {"input": "1233\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\nVery soon there will be a parade of victory over alien invaders in Berland. Unfortunately, all soldiers died ...
[{"input": "10\n18 18\n71 471\n121 362\n467 107\n138 254\n13 337\n499 373\n337 387\n147 417\n76 417\n", "output": "4\n"}, {"input": "10\n18 18\n71 471\n121 362\n467 107\n138 254\n13 337\n499 373\n337 387\n147 417\n76 417\n", "output": "4\n"}, {"input": "10\n18 30\n71 471\n121 362\n467 107\n170 127\n13 337\n499 373\n337...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nICPC Ranking\n\nYour mission in this problem is to write a program which, given the submission log of an ICPC...
[{"input": "300 19 8 5\n50 5 2 1\n70 5 2 0\n75 1 1 0\n100 3 1 0\n150 2 2 0\n240 5 5 7\n50 1 1 0\n60 2 2 0\n41 2 3 0\n90 1 3 0\n120 3 5 0\n196 4 1 0\n150 2 4 1\n180 3 5 4\n15 2 2 1\n20 2 2 1\n25 2 2 0\n60 1 1 0\n120 5 5 4\n15 5 4 1\n20 5 4 0\n40 1 1 0\n40 2 2 0\n120 2 3 4\n30 1 1 0\n40 2 1 0\n13 2 2 0\n60 1 2 0\n120 6 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\nWe have a sequence of N integers: x=(x_0,x_1,\\cdots,x_{N-1}). Initially, x_i=0 for each i (0 \\leq i \\leq N...
[{"input": "100001 50000", "output": "546347865\n"}, {"input": "100001 27098", "output": "949668337\n"}, {"input": "101000 27098", "output": "277745716\n"}, {"input": "101000 14296", "output": "338861381\n"}, {"input": "100011 27098", "output": "506486948\n"}, {"input": "101101 27098", "output": "454736313\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\nIn this Kata, you will create a function that converts a string with letters and numbers to the inverse of th...
[{"input": "\"1a2b3c4d5e6f7g8h9i10j11k12l13m14n15o16p17q18r19s20t21u22v23w24x25y26z\"", "output": "[\"a1b2c3d4e5f6g7h8i9j10k11l12m13n14o15p16q17r18s19t20u21v22w23x24y25z26\"]", "fn_name": "AlphaNum_NumAlpha"}, {"input": "\"abcdefghijklmnopqrstuvwxyz\"", "output": "[\"1234567891011121314151617181920212223242526\"]", "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 bracketed sequence is called correct (regular) if by inserting \"+\" and \"1\" you can get a well-formed ma...
[{"input": "100\n)()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(\n", "output": "100\n"}, {"input": "101\n(())))))()))()())(()))((())))((())(()()()(()()((()()((()((())))((()))()(())(()(())((()))(()))()(((()(\n", "output": "-1\n"}, {"input": "100\n)()()()()()()()()()()...
code_stdio