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\nHint\n\n* One grid may be filled more than once\n* Even if it can be represented by one line segment such as ...
[{"input": "23\n1 1 3 1\n3 1 3 3\n3 3 1 3\n1 3 1 5\n1 5 3 5\n5 2 7 2\n7 2 7 4\n7 4 5 4\n5 4 5 6\n5 6 7 6\n11 4 13 4\n13 0 15 0\n15 0 15 4\n18 2 18 2\n21 5 23 5\n21 5 21 7\n21 7 23 7\n23 7 23 8\n23 9 21 9\n24 0 26 0\n24 0 24 4\n24 4 26 4\n26 0 26 4", "output": "-328\n"}, {"input": "23\n1 1 3 1\n3 1 3 3\n3 3 1 3\n1 3 1 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 towers in the town where Ikta lives. Each tower is given a different number from 0 to N-1, and th...
[{"input": "7\n0 1\n0 2\n2 3\n0 4\n0 5\n0 6", "output": "2071\n"}, {"input": "7\n0 1\n0 2\n1 3\n0 4\n1 5\n0 6", "output": "1303\n"}, {"input": "7\n0 1\n0 2\n0 3\n0 4\n0 5\n0 6", "output": "4683\n"}, {"input": "7\n0 1\n0 2\n0 3\n2 4\n0 5\n0 6", "output": "2071\n"}, {"input": "7\n0 1\n0 2\n0 3\n3 4\n0 5\n0 6", "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$n$ students are taking an exam. The highest possible score at this exam is $m$. Let $a_{i}$ be the score of ...
[{"input": "27\n1 1\n0\n1 2\n0\n1 5\n0\n1 10\n0\n1 50\n0\n1 100\n0\n1 500\n0\n1 1000\n0\n1 5000\n0\n1 10000\n0\n1 50000\n0\n1 100000\n0\n1 5\n4\n1 5\n5\n1 10\n9\n1 10\n10\n1 100000\n9999\n1 100000\n100000\n1 4999\n386\n1 100000\n1\n4 5\n1 0 0 0\n4 5\n0 1 0 0\n4 5\n0 0 0 0\n4 5\n5 5 5 5\n4 5\n4 4 5 5\n4 5\n5 4 4 4\n4 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\nWe have a string S of length N consisting of R, G, and B.\nFind the number of triples (i,~j,~k)~(1 \\leq i < ...
[{"input": "4000\nGBRBRGGRRBRGBBGGRRGBRGGBRGGGBBGRGBRBRGGBGGGGRRGGBGGRGGGGRRGGRRGBBBGGRBGRRBBGGBRRBGGGGGBGGBGGRBBBGBGRGGRBGGRGRRRBRGBBBGGGRRBGRBBGGRGGRGRBGRRBGGRBRGGBBRGBRGRRGGRBGBRGBRGRRBGBRRBGRGBBGBRBGBBRBBGBBGBGGRBBRGRRGGRRBBBBRBBGBBGGRGRBBGGGBGGGGRRBBRGBBBBBRGGGBGGBBBRGRGRBGGGGBGBRGGBRGBRRRBGGBBRBBGGRRRBRRBRGGBGBBR...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIgor K. always used to trust his favorite Kashpirovsky Antivirus. That is why he didn't hesitate to download ...
[{"input": "10110010010001110110110111100100011101101110010100100010110101011001011101111001\n1001000100\n1011001001\n0101100101\n0001110110\n1000101101\n0110110000\n0000010011\n1101111001\n1101010111\n1110010100\n", "output": "13739427\n"}, {"input": "0001010110111011010110011010110001010110001010111100010101101001101...
code_stdio
[ { "content": "You are an expert Python programmer. 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 piles of stones. The i-th pile has A_i stones.\nAoki and Takahashi are about to use them to play ...
[{"input": "300\n384661649102 749740371860 182994067519 635480054507 188947792922 485525176794 78108687147 989617350189 631154348796 697481765405 265428579953 267391231487 298335916571 638840284853 801747319246 75872927591 763161973616 67416808051 855953652500 952149595553 120076702790 865269978523 188163722408 6683657...
code_stdio
[ { "content": "You are an expert Python programmer. 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 consisting of n integers. You may partition this sequence into two sequences b and...
[{"input": "100\n-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 -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\nDo the following for a four-digit number N consisting of numbers 0-9.\n\n1. Let L be the number obtained as a...
[{"input": "6174\n3985\n3333\n0000", "output": "0\n3\nNA\n"}, {"input": "6174\n1779\n3333\n0000", "output": "0\n6\nNA\n"}, {"input": "6174\n1794\n3333\n0000", "output": "0\n5\nNA\n"}, {"input": "6174\n1542\n3333\n0000", "output": "0\n2\nNA\n"}, {"input": "6174\n2326\n3333\n0000", "output": "0\n7\nNA\n"}, {"input": "617...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGena loves sequences of numbers. Recently, he has discovered a new type of sequences which he called an almos...
[{"input": "73\n531 626 701 57 708 511 54 441 297 697 411 253 397 652 21 59 851 561 539 461 629 894 275 417 127 960 433 243 963 247 5 368 969 541 408 485 319 117 441 131 265 357 1 659 267 983 643 285 913 782 813 569 99 781 297 636 645 341 6 17 601 129 509 197 226 105 241 737 86 128 762 647 849\n", "output": "4\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\nThe T9 typing predictor helps with suggestions for possible word combinations on an old-style numeric keypad ...
[{"input": "[\"gone\", \"hood\", \"good\", \"old\"]\n\"4663\"", "output": "[[\"gone\", \"hood\", \"good\"]]", "fn_name": "T9"}, {"input": "[\"goNe\", \"hood\", \"GOOD\", \"old\"]\n\"4663\"", "output": "[[\"goNe\", \"hood\", \"GOOD\"]]", "fn_name": "T9"}, {"input": "[\"good\", \"home\", \"new\"]\n\"4663\"", "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\nIlya is working for the company that constructs robots. Ilya writes programs for entertainment robots, and hi...
[{"input": "129341234876124184 1 2\n1 3 3\n1 1 2\n1 2 3\n3 1 1\n3 1 3\n3 2 3\n", "output": "64670617438062091 64670617438062093\n"}, {"input": "129341234876124184 1 2\n1 3 3\n1 1 2\n1 2 3\n3 1 1\n3 1 3\n3 2 3\n", "output": "64670617438062091 64670617438062093\n"}, {"input": "1000000000000000000 2 1\n3 1 2\n2 3 3\n1 2 3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe map of Bertown can be represented as a set of n intersections, numbered from 1 to n and connected by m on...
[{"input": "20 50\n20 3\n5 16\n1 3\n10 11\n10 15\n15 9\n20 9\n14 6\n16 5\n13 4\n11 5\n3 20\n13 17\n11 8\n11 6\n12 14\n16 18\n17 13\n18 7\n3 1\n8 10\n17 15\n7 2\n9 13\n5 11\n6 1\n2 16\n8 18\n10 8\n4 13\n9 15\n14 12\n1 6\n9 20\n7 18\n6 14\n7 6\n18 16\n2 7\n3 11\n15 17\n3 12\n14 10\n4 14\n19 4\n11 15\n4 19\n8 12\n17 8\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\nYou are given an integer N.\n\nFor two positive integers A and B, we will define F(A,B) as the larger of the ...
[{"input": "10000000000\n", "output": "6\n"}, {"input": "9999999967\n", "output": "10\n"}, {"input": "53937807463", "output": "10\n"}, {"input": "9876543210\n", "output": "6\n"}, {"input": "6983776800\n", "output": "5\n"}, {"input": "1881548213\n", "output": "6\n"}, {"input": "1483485061\n", "output": "7\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 the International System of Units (SI), various physical quantities are expressed in the form of \"numeric...
[{"input": "7\n12.729479136172973 kilo metfrt\n0.45 mega sttaw\n0.000000000000000000000001 yotta mrags\n1000000000000000000000000 yocto seconds\n42 amperes\n0.951642419825234 joulfs\n1234.56789012345678901234567890 hecto pascals", "output": "1.2729479136172973 * 10^4 metfrt\n4.5 * 10^5 sttaw\n1 * 10^0 mrags\n1.00000000...
code_stdio
[ { "content": "You are an expert Python programmer. 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 call a positive integer number fair if it is divisible by each of its nonzero digits. For example, $102$ i...
[{"input": "100\n95\n94\n31\n65\n35\n95\n70\n78\n81\n36\n69\n97\n39\n28\n89\n62\n36\n23\n35\n21\n36\n11\n65\n39\n13\n34\n79\n87\n91\n70\n43\n82\n24\n97\n6\n87\n49\n81\n60\n92\n63\n9\n16\n6\n31\n90\n6\n5\n70\n48\n27\n86\n65\n66\n45\n8\n67\n17\n24\n44\n34\n93\n26\n32\n82\n54\n72\n83\n94\n81\n79\n79\n9\n9\n4\n59\n42\n83\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\nWriting light novels is the most important thing in Linova's life. Last night, Linova dreamed about a fantast...
[{"input": "20 2\n9 7\n3 7\n15 9\n1 3\n11 12\n18 7\n17 18\n20 1\n4 11\n2 11\n12 18\n8 18\n13 2\n19 2\n10 11\n6 13\n5 8\n14 1\n16 13\n", "output": "16\n"}, {"input": "20 7\n9 7\n3 13\n15 9\n1 3\n11 9\n18 7\n17 18\n20 1\n4 11\n2 11\n12 18\n8 18\n13 2\n19 1\n10 14\n6 13\n5 8\n14 1\n16 13\n", "output": "46\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\nYou have decided to write a book introducing good restaurants.\nThere are N restaurants that you want to intr...
[{"input": "100\nsjcgcvldl 23\niyzgsoes 80\nu 82\nceooyrdyri 34\nhfzlpcs 100\nykfpusci 17\nvkke 94\nqnartzvpb 86\njqxf 35\nvsemwdhc 31\njuteior 78\nbvdq 3\nocnma 84\nkidwanqdvn 52\nmjopq 57\ntqfq 38\nikrqwzh 61\nxlcbfaszw 96\nceooyrdyri 10\nrdz 98\nxxywgn 64\nfbft 74\nebh 29\npio 95\nebh 88\nph 50\naqapninv 40\ncvvpogp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVladik was bored on his way home and decided to play the following game. He took n cards and put them in a ro...
[{"input": "120\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5\n", "output": "120\n"}, {"input": "120\n8 8 8 8 8 8 8 8 8 8 8 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\nValera wanted to prepare a Codesecrof round. He's already got one problem and he wants to set a time limit (T...
[{"input": "68 85\n43 55 2 4 72 45 19 56 53 81 18 90 11 87 47 8 94 88 24 4 67 9 21 70 25 66 65 27 46 13 8 51 65 99 37 77 71 59 71 79 22 56 49 43 57 85 95 81 40 28 60 36 72 81 60 40 16 78 61 37 29 26 15 95 70 27 50 97\n6 6 48 72 54 31 1 50 29 64 93 9 29 93 66 63 25 90 52 1 66 13 70 44 24 87 32 90 84 72 44 13 25 45 31 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\nAlexandra has a paper strip with n numbers on it. Let's call them a_{i} from left to right.\n\nNow Alexandra ...
[{"input": "2 1000000000 2\n-1000000000 1000000000\n", "output": "-1\n"}, {"input": "2 0000000000 2\n-1000000000 1000000000\n", "output": "-1\n"}, {"input": "2 0000100000 2\n-1000000000 1000000000\n", "output": "-1\n"}, {"input": "2 0000000000 3\n-1000000000 1000000000\n", "output": "-1\n"}, {"input": "2 1000000000 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\n**Story** \nOn some island lives a chameleon population. Chameleons here can be of only one of three colors ...
[{"input": "[673905669, 673905681, 174867657]\n2", "output": "[673905681]", "fn_name": "chameleon"}, {"input": "[1, 2147483646, 1]\n1", "output": "[1]", "fn_name": "chameleon"}, {"input": "[34, 32, 35]\n0", "output": "[35]", "fn_name": "chameleon"}, {"input": "[34, 32, 35]\n1", "output": "[-1]", "fn_name": "chameleon"}...
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\nImp is watching a documentary about cave painting. [Image] \n\nSome numbers, carved in chaotic order, immedia...
[{"input": "1000000000000000000 1000000000000000000\n", "output": "No\n"}, {"input": "1000000000000000000 1000000000000000000\n", "output": "No\n"}, {"input": "1000000000000000000 1000000000000100000\n", "output": "No\n"}, {"input": "1174471498216289354 375019787446735639\n", "output": "No\n"}, {"input": "1218163628470...
code_stdio
[ { "content": "You are an expert Python programmer. 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 graph with $n$ nodes and $m$ directed edges. One lowercase letter is assigned to each node. W...
[{"input": "10 50\nebibwbjihv\n1 10\n1 2\n5 4\n1 8\n9 7\n5 6\n1 8\n8 7\n2 6\n5 4\n1 9\n3 2\n3 3\n5 6\n5 9\n2 4\n2 7\n3 9\n1 2\n1 7\n1 10\n3 7\n1 8\n3 10\n8 6\n1 7\n10 6\n1 6\n10 8\n1 5\n2 10\n3 9\n1 8\n8 3\n3 7\n5 2\n1 10\n1 4\n5 3\n3 2\n1 2\n5 8\n10 4\n2 10\n8 2\n1 9\n1 8\n1 2\n3 4\n1 8\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\nWilliam has two arrays $a$ and $b$, each consisting of $n$ items.\n\nFor some segments $l..r$ of these arrays...
[{"input": "10 10\n894887111 146743785 109114345 815955099 968902979 475266442 919978438 174336213 986559256 952162378\n894887111 146743785 820647914 104421530 968902979 475266442 919978438 908881640 252013829 952162378\n7 10\n6 9\n5 9\n1 7\n2 9\n1 3\n3 10\n1 10\n3 7\n2 4\n", "output": "734545427\n734545427\n734545427\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nBaby Ehab is known for his love for a certain operation. He has an array $a$ of length $n$, and he decided to...
[{"input": "15\n2\n660632533 660632533\n2\n774306959 774306959\n2\n971739496 784083784\n2\n775353256 672614891\n2\n403290217 403290217\n2\n651261320 651261320\n2\n894672621 894672621\n2\n46281693 620415865\n2\n92929999 409128591\n2\n26890011 630323358\n2\n443724284 443724284\n2\n308822599 308822599\n2\n895967167 895967...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nDo you know Just Odd Inventions? The business of this company is to \"just odd inventions\". Here ...
[{"input": "5\n2 2 1 2\n6 5\n1 17\n3 2 2 1\n11 1 20\n10 18 3\n8\n5 4 1 3\n5 5 4 5 2\n8 2 1 9 7\n1 1 3 5 1\n7 2 7 1 3\n6 5 6 2\n2 3 5 8 2 7\n1 6 9 4 5 1\n2 5 1 4 2 2\n5 4 2 5 3 3\n12 1 5 1 5 6\n6\n3 3 2 2\n2 17 2\n9 1 9\n2 9 2\n2 2 1 1\n1 3\n5 7\n0", "output": "17\n4\n9\n"}, {"input": "5\n2 2 1 2\n6 5\n1 17\n3 2 2 1\n6 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is data of up to 100 characters per line, consisting of half-width alphabetic character strings. Some l...
[{"input": "abcba\nsx\nabcddcba\nrstrd", "output": "2\n"}, {"input": "abcca\nsw\nabcddcba\nrstrd", "output": "1\n"}, {"input": "abcca\nxt\nadcbdcba\nrdsrt", "output": "0\n"}, {"input": "abcba\nsw\nabcddcba\nrstrd", "output": "2\n"}, {"input": "accba\nsw\nabcddcba\nrstrd", "output": "1\n"}, {"input": "accba\nsx\nabcddcb...
code_stdio
[ { "content": "You are an expert Python programmer. 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 Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algori...
[{"input": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n", "output": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"}, {"input": "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy\n", "output": "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy\n"}, {"input": "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy\n", "output": "yyyyyyyyyyyyyyyy...
code_stdio
[ { "content": "You are an expert Python programmer. 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 watched TV-show where k jury members one by one rated a participant by adding him a certain number o...
[{"input": "20 20\n-1012 625 39 -1747 -1626 898 -1261 180 -876 -1417 -1853 -1510 -1499 -561 -1824 442 -895 13 1857 1860\n-1269013 -1270956 -1264151 -1266004 -1268121 -1258341 -1269574 -1271851 -1258302 -1271838 -1260049 -1258966 -1271398 -1267514 -1269981 -1262038 -1261675 -1262734 -1260777 -1261858\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\nMountaineers Mr. Takahashi and Mr. Aoki recently trekked across a certain famous mountain range. The mountain...
[{"input": "10\n1 3776 3776 8848 8848 8848 8848 8848 8848 8848\n8848 8848 8848 8848 8848 8848 8848 8848 3776 5", "output": "884111967"}, {"input": "5\n16 0 4 -1 2\n19 24 -3 0 -11", "output": "0\n"}, {"input": "5\n16 0 1 -1 2\n19 24 -3 0 -11", "output": "0\n"}, {"input": "5\n16 0 2 -1 2\n19 24 -3 0 -11", "output": "0\n"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAt a break Vanya came to the class and saw an array of $n$ $k$-bit integers $a_1, a_2, \\ldots, a_n$ on the b...
[{"input": "20 30\n30095551 418501267 319405832 181290086 651729244 244371014 1160853882 491522284 582219539 1510068105 512276151 438340777 293617992 759003208 759003208 1 1043646272 1073741823 1431280338 1073741823\n", "output": "210\n"}, {"input": "20 30\n30095551 418501267 319405832 181290086 651729244 1073741823 12...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are going to be given a word. Your job will be to make sure that each character in that word has the exac...
[{"input": "\"AbcabcC\"", "output": "[false]", "fn_name": "validate_word"}, {"input": "\"abcabcd\"", "output": "[false]", "fn_name": "validate_word"}, {"input": "\"abc!abc!\"", "output": "[true]", "fn_name": "validate_word"}, {"input": "\"abc:abc\"", "output": "[false]", "fn_name": "validate_word"}, {"input": "\"abcabc...
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 set $T$, which is a subset of $U$. The set $U$ consists of $0, 1, ... n-1$. Print all sets, e...
[{"input": "4\n0 -1 -1", "output": "0:\n1: 0\n2: 1\n3: 0 1\n4: 2\n5: 0 2\n6: 1 2\n7: 0 1 2\n8: 3\n9: 0 3\n10: 1 3\n11: 0 1 3\n12: 2 3\n13: 0 2 3\n14: 1 2 3\n15: 0 1 2 3\n"}, {"input": "4\n0 -2 -1", "output": "0:\n1: 0\n2: 1\n3: 0 1\n4: 2\n5: 0 2\n6: 1 2\n7: 0 1 2\n8: 3\n9: 0 3\n10: 1 3\n11: 0 1 3\n12: 2 3\n13: 0 2 3\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\nYou have a string $s$ β€” a sequence of commands for your toy robot. The robot is placed in some cell of a rect...
[{"input": "3\nDSAWWAW\nD\nWA\n", "output": "8\n2\n4\n"}, {"input": "3\nDSAWWAW\nD\nAW\n", "output": "8\n2\n4\n"}, {"input": "3\nWSAWDAW\nD\nAW\n", "output": "4\n2\n4\n"}, {"input": "3\nDAAWWSW\nD\nAW\n", "output": "6\n2\n4\n"}, {"input": "3\nWAWWASD\nD\nWA\n", "output": "8\n2\n4\n"}, {"input": "3\nASAWWDW\nD\nWA\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 blocks arranged in a row, numbered 1 to N from left to right. Each block has a weight, and the we...
[{"input": "10\n1 2 4 16 20 26 89 128 21 512", "output": "455264577\n"}, {"input": "10\n1 2 5 16 20 26 89 128 21 512", "output": "468151137\n"}, {"input": "10\n1 2 5 16 30 26 89 128 21 512", "output": "603626337\n"}, {"input": "10\n1 2 4 8 20 32 89 128 21 512", "output": "429828417\n"}, {"input": "10\n1 2 4 8 20 26 89 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 problem we assume the Earth to be a completely round ball and its surface a perfect sphere. The lengt...
[{"input": "10\n20000 South\n20000 North\n20000 South\n20000 North\n20000 South\n20000 North\n20000 South\n20000 North\n20000 South\n20000 North\n", "output": "YES\n"}, {"input": "10\n20000 South\n20000 North\n20000 South\n20000 North\n20000 South\n20000 North\n20000 South\n20000 North\n20000 South\n20000 North\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\nMuch cooler than your run-of-the-mill Fibonacci numbers, the Triple Shiftian are so defined: `T[n] = 4 * T[n-...
[{"input": "[6, 7, 2]\n35", "output": "[-21379280887590]", "fn_name": "triple_shiftian"}, {"input": "[1, 1, 1]\n35", "output": "[10127083068293]", "fn_name": "triple_shiftian"}, {"input": "[1, 2, 3]\n35", "output": "[17037073417493]", "fn_name": "triple_shiftian"}, {"input": "[3, 2, 1]\n35", "output": "[23471258855679]...
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#### Task:\n\nYour job here is to implement a function `factors`, which takes a number `n`, and outputs an ar...
[{"input": "100", "output": "[[[2, 5, 10], []]]", "fn_name": "factors"}, {"input": "16", "output": "[[[2, 4], [2]]]", "fn_name": "factors"}, {"input": "81", "output": "[[[3, 9], [3]]]", "fn_name": "factors"}, {"input": "80", "output": "[[[2, 4], [2]]]", "fn_name": "factors"}, {"input": "120", "output": "[[[2], [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\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n* 1 \\leq a, b, c \\leq 10^9\n* All values in ...
[{"input": "-10 -1 1", "output": "Yes\n"}, {"input": "-10 -1 0", "output": "Yes\n"}, {"input": "-16 -1 0", "output": "Yes\n"}, {"input": "110 -1 -3", "output": "No\n"}, {"input": "-1 -14 2", "output": "Yes\n"}, {"input": "111 -1 -3", "output": "No\n"}, {"input": "-1 -1 9", "output": "Yes\n"}, {"input": "-1 -2 9", "outp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have a Petri dish with bacteria and you are preparing to dive into the harsh micro-world. But, unfortunat...
[{"input": "8 1000000\n1 1 5 1000000 1000000 2 2 2\n", "output": "2\n"}, {"input": "8 1000000\n1 1 5 1000000 1000000 2 2 2\n", "output": "2\n"}, {"input": "8 1000000\n2 1 5 1000000 1000000 2 2 2\n", "output": "2\n"}, {"input": "15 1\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "15\n"}, {"input": "15 1\n1 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\nYour friend has been out shopping for puppies (what a time to be alive!)... He arrives back with multiple dog...
[{"input": "100", "output": "[\"Woah that's a lot of dogs!\"]", "fn_name": "how_many_dalmatians"}, {"input": "80", "output": "[\"Woah that's a lot of dogs!\"]", "fn_name": "how_many_dalmatians"}, {"input": "26", "output": "[\"More than a handful!\"]", "fn_name": "how_many_dalmatians"}, {"input": "14", "output": "[\"Mor...
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 responsible for installing a gas pipeline along a road. Let's consider the road (for simplicity) as a...
[{"input": "4\n8 2 5\n00110010\n8 1 1\n00110010\n9 100000000 100000000\n010101010\n2 5 1\n00\n", "output": "94\n25\n2900000000\n13\n"}, {"input": "4\n8 2 5\n00110010\n8 1 1\n01110010\n9 100000000 100000000\n010101010\n2 5 1\n00\n", "output": "94\n26\n2900000000\n13\n"}, {"input": "4\n8 2 5\n00110010\n8 1 1\n00111010\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\nPolycarp has recently created a new level in this cool new game Berlio Maker 85 and uploaded it online. Now p...
[{"input": "1\n99\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 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\nDoubly linked list is one of the fundamental data structures. A doubly linked list is a sequence of elements,...
[{"input": "100\n0 0\n0 0\n0 0\n97 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 29\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n12 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLet's call the following process a transformation of a sequence of length $n$.\n\nIf the sequence is empty, t...
[{"input": "40471\n", "output": "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 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...
code_stdio
[ { "content": "You are an expert Python programmer. 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 point $A$ with coordinate $x = n$ on $OX$-axis. We'd like to find an integer point $B$ (also on $OX...
[{"input": "6\n0 0\n5 8\n0 1000000\n1 0\n2 0\n0000000 1000000\n", "output": "0\n3\n1000000\n1\n0\n1000000\n"}, {"input": "6\n6 0\n0 8\n0 1000000\n0 0\n1 0\n0000000 1000000\n", "output": "0\n8\n1000000\n0\n1\n1000000\n"}, {"input": "6\n0 0\n5 8\n1 1000000\n1 0\n2 0\n0000000 1000000\n", "output": "0\n3\n999999\n1\n0\n100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nG: Working\n\nKou decided to do the same number of jobs every day for the next $ N $.\n\n$ A_i $ jobs are add...
[{"input": "5\n6 -27 -3 -2 -29", "output": "-11\n"}, {"input": "5\n6 -27 -3 -1 -29", "output": "-10\n"}, {"input": "5\n4 -31 0 -1 -28", "output": "-13\n"}, {"input": "5\n-2 -12 7 -1 32", "output": "-7\n"}, {"input": "5\n3 -31 0 -1 -1", "output": "-14\n"}, {"input": "5\n3 -35 0 -1 -1", "output": "-16\n"}, {"input": "5\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nEveryone knows that 2010 FIFA World Cup is being held in South Africa now. By the decision of BFA (Berland's ...
[{"input": "4\nTeMnHVvWKpwlpubwyhzqvc\nAWJwc\nbhbxErlydiwtoxy\nEVASMeLpfqwjkke\nAWJwc-TeMnHVvWKpwlpubwyhzqvc 43:73\nbhbxErlydiwtoxy-TeMnHVvWKpwlpubwyhzqvc 38:99\nbhbxErlydiwtoxy-AWJwc 33:84\nEVASMeLpfqwjkke-TeMnHVvWKpwlpubwyhzqvc 79:34\nEVASMeLpfqwjkke-AWJwc 243:7\nEVASMeLpfqwjkke-bhbxErlydiwtoxy 3:6\n", "output": "EVA...
code_stdio
[ { "content": "You are an expert Python programmer. 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 Group C of the 3rd year, we decided to use the \"class flag\" used at the sports festival on November 10, ...
[{"input": "50\n5576\n6063\n5578", "output": "3C11\n3C38\n3C18\n3C01\n"}, {"input": "50\n5576\n6063\n515", "output": "3C11\n3C38\n3C18\n3C08\n"}, {"input": "50\n1864\n13193\n39", "output": "3C11\n3C31\n3C11\n3C39\n"}, {"input": "50\n5576\n5577\n5578", "output": "3C11\n3C38\n3C39\n3C01"}, {"input": "50\n5576\n6063\n39",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nE869120's and square1001's 16-th birthday is coming soon.\n\nTakahashi from AtCoder Kingdom gave them a round...
[{"input": "-2 -1", "output": "Yay!\n"}, {"input": "-3 -1", "output": "Yay!\n"}, {"input": "-6 -1", "output": "Yay!\n"}, {"input": "-4 -1", "output": "Yay!\n"}, {"input": "5 4\n", "output": "Yay!\n"}, {"input": "8 8\n", "output": "Yay!\n"}, {"input": "1 1\n", "output": "Yay!\n"}, {"input": "6 7\n", "output": "Yay!\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\nDo you remember how Kai constructed the word \"eternity\" using pieces of ice as components?\n\nLittle Sheldo...
[{"input": "2569\n09629965966225566262579565696595696954525955599926383255926955906666526913925296256629966292216925259225261263256229509529259756291959568892569599592218262625256926619266669279659295979299556965525222\n", "output": "44\n"}, {"input": "2559\n5255599526926555569592225552599525525955525925256265562252629...
code_stdio
[ { "content": "You are an expert Python programmer. 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 have received three big piles of candies as a gift. Now they want to divide these candies as fa...
[{"input": "4\n1 3 4\n1 10 100\n10000000000000000 10000000000000000 10000000000000000\n23 34 45\n", "output": "4\n55\n15000000000000000\n51\n"}, {"input": "4\n1 3 4\n1 10 100\n10000000000000000 10000000000000000 10000000000000000\n23 34 22\n", "output": "4\n55\n15000000000000000\n39\n"}, {"input": "4\n1 1 4\n1 10 100\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\nJavaScript provides a built-in parseInt method.\n\nIt can be used like this:\n\n- `parseInt(\"10\")` returns ...
[{"input": "\"5 friends\"", "output": "[\"NaN\"]", "fn_name": "my_parse_int"}, {"input": "\"5friends\"", "output": "[\"NaN\"]", "fn_name": "my_parse_int"}, {"input": "\"I <3 u\"", "output": "[\"NaN\"]", "fn_name": "my_parse_int"}, {"input": "\"17.42\"", "output": "[\"NaN\"]", "fn_name": "my_parse_int"}, {"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\nA little girl loves problems on bitwise operations very much. Here's one of them.\n\nYou are given two intege...
[{"input": "259703440079833303 1004763675266938032\n", "output": "1152921504606846975\n"}, {"input": "190442232278841373 980738846929096255\n", "output": "1152921504606846975\n"}, {"input": "462451489958473150 957447393463701191\n", "output": "1152921504606846975\n"}, {"input": "491113582000560303 858928223424873439\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 people standing in a queue from west to east.\nGiven is a string S of length N representing the d...
[{"input": "95617 23923\nRRRLRRRLLRRLRRLRLRRLLLRLLLRRRRRRRLLRRRRLRRRLLRLLRLLLRLLRLRLRRRRRLRRLRRRLRRRLRRLLRLLRLLRLRLRRLRRRLRLRLRLRLLLLRRLRLRRRRLRLLLLLLRLRRRLRLRRLRLLRLLRRLRRRRRRLRRRLRLRLRRRLLLRLRLRLLLLLRRRLRLLLLRLLRRLLLLRRLRLRLRLLRLLLLLLRRLRRRRLLLRLLLRLRRRRLRRRRLLRLRRRRRLRLRRLLRLLLRLRLRRLLLRRRRRRLRRLLLLRRLRLLRLLLRLRRLRL...
code_stdio
[ { "content": "You are an expert Python programmer. 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 be given a string and your task will be to return the length of the longest prefix tha...
[{"input": "\"abcdabcc\"", "output": "[0]", "fn_name": "solve"}, {"input": "\"abcdabc\"", "output": "[3]", "fn_name": "solve"}, {"input": "\"abcabca\"", "output": "[1]", "fn_name": "solve"}, {"input": "\"abcabc\"", "output": "[3]", "fn_name": "solve"}, {"input": "\"acbacc\"", "output": "[0]", "fn_name": "solve"}, {"inp...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nJeff's friends know full well that the boy likes to get sequences and arrays for his birthday. Thus, Jeff got...
[{"input": "53\n-3 2 -3 -5 -2 7 0 -2 1 6 -1 2 5 -3 3 -6 -2 -5 -3 -6 4 -4 -2 6 1 -7 -6 -4 0 2 -5 -1 -2 -6 2 2 7 -2 -3 1 0 -4 3 4 -2 7 -3 7 1 3 -10 -5 3\n", "output": "298\n"}, {"input": "53\n-3 2 -3 -5 -2 7 0 -2 1 6 -1 2 5 -3 3 -6 -2 -5 -3 -6 4 -4 -2 6 1 -3 -6 -4 0 2 -5 -1 -2 -6 2 2 7 -2 -3 1 0 -6 3 4 -2 7 -3 7 1 3 -10 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWrite a function `count_vowels` to count the number of vowels in a given string.\n\n### Notes:\n\n- Return `n...
[{"input": "\"asdfdsaf asdfsasdfdsafgjlsdjf asdfdsf daf 13243242 dsafdsafds\"", "output": "[9]", "fn_name": "count_vowels"}, {"input": "\"asdfviosdfopsiewrwwer asdf asdfdsaf)(asdflkajdsf \"", "output": "[12]", "fn_name": "count_vowels"}, {"input": "\"asdfdsaf asdfsdaf 13243242 dsafdsafds\"", "output": "[6]",...
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\nGive the summation of all even numbers in a Fibonacci sequence up to, but not including, the maximum value.\n...
[{"input": "2147483647", "output": "[1485607536]", "fn_name": "even_fib"}, {"input": "1000000000", "output": "[350704366]", "fn_name": "even_fib"}, {"input": "100000000", "output": "[82790070]", "fn_name": "even_fib"}, {"input": "1000000", "output": "[1089154]", "fn_name": "even_fib"}, {"input": "1000", "output": "[798...
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\nFrom beginning till end, this message has been waiting to be conveyed.\n\nFor a given unordered multiset of n...
[{"input": "100101\n", "output": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLiLand is a country, consisting of n cities. The cities are numbered from 1 to n. The country is well known b...
[{"input": "5 6\n1 2\n2 3\n3 5\n1 4\n4 5\n1 3\n", "output": "Yes\n1\n1\n2\n2\n2\n2\n"}, {"input": "4 4\n1 2\n2 3\n3 4\n1 3\n", "output": "Yes\n1\n1\n2\n2\n"}, {"input": "4 3\n1 2\n2 3\n3 4\n-1 -2\n", "output": "Yes\n2\n2\n2\n"}, {"input": "4 3\n1 2\n2 3\n3 4\n-1 -4\n", "output": "Yes\n2\n2\n2\n"}, {"input": "4 3\n1 2\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou get a new job working for Eggman Movers. Your first task is to write a method that will allow the admin ...
[{"input": "\"Dipper Pines\"", "output": "[\"Does not work here!\"]", "fn_name": "find_employees_role"}, {"input": "\"Bell Jewel\"", "output": "[\"Does not work here!\"]", "fn_name": "find_employees_role"}, {"input": "\"Bell Anna\"", "output": "[\"Does not work here!\"]", "fn_name": "find_employees_role"}, {"input": "\...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA boy Bob likes to draw. Not long ago he bought a rectangular graph (checked) sheet with n rows and m columns...
[{"input": "50 1\n.\n*\n*\n*\n.\n.\n*\n.\n*\n*\n*\n*\n*\n*\n*\n.\n*\n*\n*\n*\n*\n*\n*\n*\n*\n*\n*\n*\n*\n.\n.\n.\n.\n*\n*\n.\n*\n*\n.\n.\n.\n.\n*\n*\n.\n.\n.\n.\n.\n.\n", "output": "*\n*\n*\n.\n.\n*\n.\n*\n*\n*\n*\n*\n*\n*\n.\n*\n*\n*\n*\n*\n*\n*\n*\n*\n*\n*\n*\n*\n.\n.\n.\n.\n*\n*\n.\n*\n*\n.\n.\n.\n.\n*\n*\n"}, {"inp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nQwerty the Ranger took up a government job and arrived on planet Mars. He should stay in the secret lab and c...
[{"input": "1000000 1000000 1000000 1000000\n", "output": "1000000\n"}, {"input": "1000000 1000000 1000000 1010000\n", "output": "1000000\n"}, {"input": "100000 100000 1000000 1000000\n", "output": "999999\n"}, {"input": "126480 295416 829274 421896\n", "output": "829273\n"}, {"input": "722229 410423 118215 838505\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\n12:17 (UTC): The sample input 1 and 2 were swapped. The error is now fixed. We are very sorry for your inconv...
[{"input": "4 13\n4 1 2 1\n4 1 10 1", "output": "714238057\n"}, {"input": "4 30\n3 1 1 1\n4 2 10 1", "output": "605469785\n"}, {"input": "4 12\n3 1 2 1\n11 1 5 2", "output": "809171659\n"}, {"input": "4 13\n4 1 2 1\n4 1 12 1", "output": "191070997\n"}, {"input": "4 21\n3 1 1 1\n4 2 10 1", "output": "278753645\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\nAfter learning about polynomial hashing, Heidi decided to learn about shift-xor hashing. In particular, she c...
[{"input": "111\n011101111010100111111000010101011110011000010101010001001011000111100101111000010110010011110100000111000100101\n", "output": "108\n"}, {"input": "111\n001101111000100111111000010101011110011000010101010001001011000111100101111101000110000011110110100111000100101\n", "output": "72\n"}, {"input": "111\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 Chelyabinsk lives a much respected businessman Nikita with a strange nickname \"Boss\". Once Nikita decide...
[{"input": "20 30\n4 13 78 11\n13 19 56 41\n15 15 46 83\n4 9 74 72\n17 20 97 7\n15 20 29 64\n8 17 44 85\n4 18 26 46\n16 17 13 90\n16 16 39 89\n13 14 46 125\n14 18 67 18\n12 20 84 48\n10 20 49 32\n10 14 14 11\n6 18 80 84\n3 20 13 97\n12 20 62 42\n7 14 64 71\n5 19 38 17\n17 18 99 18\n11 15 83 22\n4 11 65 99\n8 16 89 45\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\nRead problems statements in Mandarin Chinese and Russian. \n\nGrapes of Coderpur are very famous. Devu went ...
[{"input": "2\n2 19\n5 10\n3 10\n10 3 17", "output": "23\n10\n"}, {"input": "2\n2 19\n5 10\n3 18\n10 3 17", "output": "23\n24\n"}, {"input": "2\n2 19\n5 10\n3 18\n10 3 11", "output": "23\n30\n"}, {"input": "2\n2 19\n8 10\n3 18\n10 3 11", "output": "20\n30\n"}, {"input": "2\n2 14\n5 10\n3 10\n10 3 17", "output": "13\n10...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSometimes one has to spell email addresses over the phone. Then one usually pronounces a dot as dot, an at si...
[{"input": "atatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatat\n", "output": "at@atatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatat\n"}, {"input": "sdfuiopguoidfbhuihsregftuioheguodpsfhgvuherasuihfsduphguatwruheruopsghuiofhb...
code_stdio
[ { "content": "You are an expert Python programmer. 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 strongness of an even number is the number of times we can successively divide by 2 until we reach an odd n...
[{"input": "1151592177\n2129680158", "output": "[1610612736]", "fn_name": "strongest_even"}, {"input": "2085422641\n2128923730", "output": "[2113929216]", "fn_name": "strongest_even"}, {"input": "1082012216\n1876572332", "output": "[1610612736]", "fn_name": "strongest_even"}, {"input": "1806570867\n2067832928", "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\nProblem statement\n\nAOR Ika-chan is in a bad mood lately. Apparently, I don't like the ratio of the number o...
[{"input": "19 139 3", "output": "120\n"}, {"input": "47 194 1", "output": "147\n"}, {"input": "32 118 1", "output": "86\n"}, {"input": "47 118 1", "output": "71\n"}, {"input": "116 2 2", "output": "112\n"}, {"input": "116 2 3", "output": "110\n"}, {"input": "19 128 3", "output": "45\n"}, {"input": "175 51 2", "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\nThis is the hard version of the problem. The only difference between the two versions is the constraint on n....
[{"input": "10100 0 0\n", "output": "10099\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n1 9\n1 10\n1 11\n1 12\n1 13\n1 14\n1 15\n1 16\n1 17\n1 18\n1 19\n1 20\n1 21\n1 22\n1 23\n1 24\n1 25\n1 26\n1 27\n1 28\n1 29\n1 30\n1 31\n1 32\n1 33\n1 34\n1 35\n1 36\n1 37\n1 38\n1 39\n1 40\n1 41\n1 42\n1 43\n1 44\n1 45\n1 46\n1 47\n1 48\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\nWrite a program which finds the greatest common divisor of two natural numbers a and b\n\nHint\n\nYou can use...
[{"input": "124 31", "output": "31\n"}, {"input": "252 63", "output": "63\n"}, {"input": "32 192", "output": "32\n"}, {"input": "110 11", "output": "11\n"}, {"input": "110 90", "output": "10\n"}, {"input": "506 22", "output": "22\n"}, {"input": "13 130", "output": "13\n"}, {"input": "147 115", "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\nFox Ciel is playing a mobile puzzle game called \"Two Dots\". The basic levels are played on a board of size ...
[{"input": "50 2\nAA\nCD\nEE\nFC\nED\nAF\nFC\nAD\nBA\nAF\nBF\nDA\nAC\nFC\nFA\nBF\nAD\nBB\nDC\nAF\nAA\nAD\nEE\nED\nCD\nFC\nFB\nBB\nDD\nEB\nBE\nCF\nDE\nAE\nFD\nAB\nFB\nAE\nBE\nFA\nCF\nFB\nDE\nED\nAD\nFA\nBB\nBF\nDA\nEE\n", "output": "No\n"}, {"input": "50 2\nAA\nCD\nEE\nFC\nED\nAF\nFC\nAD\nBA\nAF\nBF\nDA\nAC\nFC\nFA\nBF\...
code_stdio
[ { "content": "You are an expert Python programmer. 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$. You can perform a sequence of operations: during the first operation ...
[{"input": "3\n1 3\n11 11\n30 20\n", "output": "3\n0\n4\n"}, {"input": "3\n0 3\n11 11\n30 20\n", "output": "2\n0\n4\n"}, {"input": "3\n1 3\n11 11\n30 20\n", "output": "3\n0\n4\n"}, {"input": "3\n1 3\n11 1\n30 20\n", "output": "3\n4\n4\n"}, {"input": "3\n1 3\n11 0\n30 20\n", "output": "3\n5\n4\n"}, {"input": "3\n1 6\n11...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOne Sunday Petr went to a bookshop and bought a new book on sports programming. The book had exactly n pages....
[{"input": "1000\n1000 1000 1000 1000 1000 1000 1000\n", "output": "1\n"}, {"input": "1000\n1000 1000 1000 1000 1000 1000 1100\n", "output": "1\n"}, {"input": "1000\n1000 1100 1000 1000 1000 1000 1000\n", "output": "1\n"}, {"input": "1\n1000 1000 1000 1000 1000 1000 1000\n", "output": "1\n"}, {"input": "1\n1001 1000 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\nCrazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + bi...
[{"input": "841746 527518\n595261 331297\n10\n-946901 129987 670374\n-140388 -684770 309555\n-302589 415564 -387435\n-777580 -72069 -395358\n-523453 -511446 854898\n-846967 -749453 -341866\n-1178673 434663 264157\n-638453 625357 344195\n-255265 -676356 -772398\n-824723 -319141 33585\n", "output": "0\n"}, {"input": "841...
code_stdio
[ { "content": "You are an expert Python programmer. 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 certain video game, the player controls a hero characterized by a single integer value: power. The hero ...
[{"input": "2\n1\n1 127\n2\n3 19 13 0\n2 12 11\n", "output": "128\n18\n"}, {"input": "2\n1\n1 146\n2\n3 19 16 0\n2 21 2\n", "output": "147\n20\n"}, {"input": "2\n1\n1 204\n2\n3 19 16 0\n2 21 2\n", "output": "205\n20\n"}, {"input": "2\n1\n1 204\n2\n3 19 16 1\n2 12 2\n", "output": "205\n18\n"}, {"input": "2\n1\n1 204\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\nMr. Chanek wants to knit a batik, a traditional cloth from Indonesia. The cloth forms a grid a with size n Γ— ...
[{"input": "1110000000 1000100001 1000000001 170714 999995\n683808635 1423426790 555555553 555555554\n", "output": "220052742\n"}, {"input": "1110000000 1001100001 1000000001 170714 999995\n683808635 1423426790 555555553 555555554\n", "output": "972770006\n"}, {"input": "1000000000 1000000000 1000000000 999987 999995\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\nVasya has his favourite number $n$. He wants to split it to some non-zero digits. It means, that he wants to ...
[{"input": "1000\n", "output": "1000\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 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 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 assume that we have a pair of numbers (a, b). We can get a new pair (a + b, b) or (a, a + b) from the g...
[{"input": "1000000\n", "output": "30\n"}, {"input": "999998\n", "output": "30\n"}, {"input": "123455\n", "output": "26\n"}, {"input": "998756\n", "output": "30\n"}, {"input": "999879\n", "output": "30\n"}, {"input": "345612\n", "output": "28\n"}, {"input": "999997\n", "output": "30\n"}, {"input": "990001\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\nVasya has recently learned at school what a number's divisor is and decided to determine a string's divisor. ...
[{"input": "asdkjjaskldjklasjdhasjdasdas\nasdjahsgdjslkdaygsudhasdkasnjdbayusvduasdklmadlsk\n", "output": "0\n"}, {"input": "asdkjjaskldjklasjdhasjdasdas\nasdjahsgdjslkdaygsudhasdkasnjdbayusvduasdklmaklsd\n", "output": "0"}, {"input": "aaaaaaaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "3"}, {"input": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\nTakaha...
[{"input": "25 100\n", "output": "Yes\n"}, {"input": "50 100\n", "output": "Yes\n"}, {"input": "25 98\n", "output": "Yes\n"}, {"input": "51 100\n", "output": "No\n"}, {"input": "32 96\n", "output": "Yes\n"}, {"input": "2 100\n", "output": "No\n"}, {"input": "24 98\n", "output": "No\n"}, {"input": "50 98\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\nBike is interested in permutations. A permutation of length n is an integer sequence such that each integer f...
[{"input": "5745\n", "output": "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLittle Petya often visits his grandmother in the countryside. The grandmother has a large vertical garden, wh...
[{"input": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 8, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 8...
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 flea is sitting at one of the n hassocks, arranged in a circle, at the moment. After minute number k the fl...
[{"input": "1000\n", "output": "NO\n"}, {"input": "512\n", "output": "YES\n"}, {"input": "256\n", "output": "YES\n"}, {"input": "512\n", "output": "YES\n"}, {"input": "1000\n", "output": "NO\n"}, {"input": "256\n", "output": "YES\n"}, {"input": "1001\n", "output": "NO\n"}, {"input": "688\n", "output": "NO\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\nD: Is greed the best?\n\nstory\n\nIn Japan, where there are 1, 5, 10, 50, 100, 500 yen coins, it is known tha...
[{"input": "42 1010", "output": "1050\n"}, {"input": "133 178", "output": "266\n"}, {"input": "16 102", "output": "112\n"}, {"input": "24 128", "output": "144\n"}, {"input": "18 102", "output": "108\n"}, {"input": "24 109", "output": "120\n"}, {"input": "35 128", "output": "140\n"}, {"input": "17 112", "output": "119\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\nVladimir wants to modernize partitions in his office. To make the office more comfortable he decided to remov...
[{"input": "100 2619\n1207 5971 951 8250 6594 219 9403 9560 2368 289 3502 6626 1009 828 2378 615 3092 3751 841 7454 8001 1345 1644 1021 7088 7083 2805 1971 7456 6494 3805 9279 8737 8994 2975 2566 6490 1720 3595 8721 8500 4850 9716 2076 9532 1077 8370 2809 2885 1838 6081 667 900 9786 5600 3707 8818 7580 6067 2215 1726 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\nTakahashi loves gold coins. He gains 1000 happiness points for each 500-yen coin he has and gains 5 happiness...
[{"input": "1000000000\n", "output": "2000000000\n"}, {"input": "999999999\n", "output": "1999999495\n"}, {"input": "999999994\n", "output": "1999999490\n"}, {"input": "999999499\n", "output": "1999998495\n"}, {"input": "849598327\n", "output": "1699196325\n"}, {"input": "822889311\n", "output": "1645778310\n"}, {"inpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nJohnny has a younger sister Anne, who is very clever and smart. As she came home from the kindergarten, she t...
[{"input": "100 21 30 65\n", "output": "IMPOSSIBLE\n"}, {"input": "52 10 19 139\n", "output": "IMPOSSIBLE\n"}, {"input": "110 21 30 65\n", "output": "IMPOSSIBLE\n"}, {"input": "11 30 79 43\n", "output": "IMPOSSIBLE\n"}, {"input": "13 49 69 15\n", "output": "IMPOSSIBLE\n"}, {"input": "95 20 21 43\n", "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\nPaul is at the orchestra. The string section is arranged in an r Γ— c rectangular grid and is filled with viol...
[{"input": "10 10 10 1\n8 10\n2 9\n1 10\n3 1\n8 5\n10 1\n4 10\n10 2\n5 3\n9 3\n", "output": "1787\n"}, {"input": "14 10 10 1\n8 10\n2 9\n1 10\n3 1\n8 5\n10 1\n4 10\n10 2\n5 3\n9 3\n", "output": "3411\n"}, {"input": "10 10 10 1\n1 10\n10 8\n7 4\n7 2\n1 3\n6 6\n10 1\n2 7\n9 3\n3 10\n", "output": "1991\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\nYou came to the exhibition and one exhibit has drawn your attention. It consists of $n$ stacks of blocks, whe...
[{"input": "50 1000000000\n824428839 821375880 831521735 868908015 86990853 248293447 886713846 425716910 443947914 504402098 40124673 774093026 271211165 873482658 592754073 490097471 947930201 69692739 145291746 418475785 80274059 696889747 854947829 231642778 141525047 57563878 92067934 387507168 522358804 37616740 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 positive integers N and K. How many multisets of rational numbers satisfy all of the follow...
[{"input": "2969 2889\n", "output": "450491977\n"}, {"input": "2987 2897\n", "output": "524709859\n"}, {"input": "2919 2863\n", "output": "393849245\n"}, {"input": "2992 2938\n", "output": "678074080\n"}, {"input": "2963 2909\n", "output": "678074080\n"}, {"input": "2996 2919\n", "output": "500305582\n"}, {"input": "12...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThis is the easy version of the problem. The only difference between easy and hard versions is the constraint...
[{"input": "54 53\n8192 2147483648 134217728 8589934592 64 131072 137438953472 67108864 16384 536870912 256 4096 1099511627776 549755813888 32768 2 1048576 8 4194304 4294967296 262144 268435456 8388608 140737488355328 1073741824 4398046511104 512 2199023255552 2048 281474976710656 16777216 70368744177664 1 112589990684...
code_stdio
[ { "content": "You are an expert Python programmer. 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 an attempt to control the rise in population, Archer was asked to come up with a plan. This time he is tar...
[{"input": "3\njohn johanna\nria ria\nkayla jayla", "output": "YES\nYES\nNO\n"}, {"input": "3\njohn johanna\nria ria\nkayma jayla", "output": "YES\nYES\nNO\n"}, {"input": "3\njohn johanna\nria ria\nkaylb jayla", "output": "YES\nYES\nNO\n"}, {"input": "3\njohn johanna\nira ira\nkayla jayla", "output": "YES\nYES\nNO\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\nAs Will is stuck in the Upside Down, he can still communicate with his mom, Joyce, through the Christmas ligh...
[{"input": ")?(??((???????()?(?????????)??(????????((?)?????)????)??????(?????)?)?????)??????(??()??????)????????)?)()??????????????())????????(???)??)????????????????????(?????)??)???)??(???????????????)???)??)?\n", "output": "8314\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\nThe stardate is 1983, and Princess Heidi is getting better at detecting the Death Stars. This time, two Rebel...
[{"input": "10 5\nsomer\nandom\nnoise\nmayth\neforc\nebewi\nthyou\nhctwo\nagain\nnoise\nsomermayth\nandomeforc\nnoiseebewi\nagainthyou\nnoisehctwo\n", "output": "4 6\n"}, {"input": "10 5\nsomer\nandom\nnoise\nmayth\neforc\nebewi\nthyou\nhctwo\nagain\nooise\nsomermayth\nandomeforc\nnoiseebewi\nagainthyou\nnoisehctwo\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\nWelcome to Rockport City!\n\nIt is time for your first ever race in the game against Ronnie. To make the race...
[{"input": "4\n1 11\n1 2\n4 0\n20 10\n", "output": "10 1\n1 0\n4 0\n10 0\n"}, {"input": "4\n1 11\n1 2\n4 0\n22 10\n", "output": "10 1\n1 0\n4 0\n12 2\n"}, {"input": "4\n1 11\n1 2\n2 0\n22 10\n", "output": "10 1\n1 0\n2 0\n12 2\n"}, {"input": "4\n6 11\n1 2\n4 3\n20 10\n", "output": "5 1\n1 0\n1 0\n10 0\n"}, {"input": "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\nWelcome to PC Koshien, players. This year marks the 10th anniversary of Computer Koshien, but the number of q...
[{"input": "1\n2\n-1\n-9\n-1\n2\n-1\n-32\n-1\n1", "output": "-39\n"}, {"input": "1\n2\n0\n-38\n-1\n1\n-1\n-17\n0\n1", "output": "-52\n"}, {"input": "1\n2\n0\n-38\n-1\n1\n-1\n-32\n0\n1", "output": "-67\n"}, {"input": "1\n2\n-1\n-9\n-1\n2\n-1\n-32\n0\n1", "output": "-38\n"}, {"input": "1\n1\n-2\n-1\n-1\n3\n11\n-2\n6\n-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\nThe Little Girl loves problems on games very much. Here's one of them.\n\nTwo players have got a string s, co...
[{"input": "opfokvwzpllctflkphutcrkferbjyyrasqqkrcvoymyrxwaudgsugcqveccymdplxmtlzfoptmrapfeizpnnhbzlkuyznwacnswibxhqunazbhdvrlidghisuqunstbuevjzimvlfvopgqxrvahhngnaumgywscfrfwfpnfxwhfrelbunmedvkssykwjyartxjiplerntzkpiiaalijiwhyuhxlvhxpkgfypvrpqqsacuwocdampnnhvibsbolyduvscsjfayxpldyvqzjbqojjxdvxtctwtifcdfcaoonzbgegyllng...
code_stdio