messages
listlengths
1
1
ground_truth
stringlengths
88
726k
dataset
stringclasses
2 values
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNavi is a counter strike pro. He...
[{"type": "stdin_stdout", "input": "1\n3 3 5\n-1 1\n2 1\n3 0\n1 0\n-1 0\n4 0\n\nSAMPLF", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1\n3 3 5\n1 1\n2 2\n3 0\n2 0\n-1 -1\n2 0\n\nSAMPLF", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1\n3 3 5\n1 1\n2 2\n3 0\n4 0\n-1 -1\n2 0\n\nSAMPLF", "output": "YES\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRanjan came to know about compet...
[{"type": "stdin_stdout", "input": "3000\n8786 8705\n8419 7334\n8091 7406\n9692 8580\n2185 1951\n9195 8840\n1469 1159\n9424 2726\n9847 945\n8894 7210\n8680 6646\n9303 2351\n3298 1409\n6306 1275\n9130 8907\n8654 6048\n9652 9408\n9813 9686\n8678 742\n9955 1422\n8401 7395\n8562 4408\n7556 6839\n6595 5439\n6136 4626\n9629 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nN Snukes called Snuke 1, Snuke 2...
[{"type": "stdin_stdout", "input": "23 -3\n0\n1 0\n-1\n-1", "output": "23\n"}, {"type": "stdin_stdout", "input": "12 -2\n1\n-1 0\n0\n-1", "output": "12\n"}, {"type": "stdin_stdout", "input": "12 -2\n0\n-1 0\n0\n-1", "output": "12\n"}, {"type": "stdin_stdout", "input": "12 -2\n0\n-1 0\n0\n-2", "output": "12\n"}, {"type"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven are two strings S and T co...
[{"type": "stdin_stdout", "input": "gumu humu", "output": "humugumu\n"}, {"type": "stdin_stdout", "input": "gumt humu", "output": "humugumt\n"}, {"type": "stdin_stdout", "input": "gums humu", "output": "humugums\n"}, {"type": "stdin_stdout", "input": "gums muhu", "output": "muhugums\n"}, {"type": "stdin_stdout", "input...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N squares arranged in ...
[{"type": "stdin_stdout", "input": "1\n1000010000", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1\n1000011000", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1\n1000011100", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1\n1000001100", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSnuke has an empty sequence a.\n...
[{"type": "stdin_stdout", "input": "9\n1 1 1 1 2 1 2 3 2", "output": "1\n2\n2\n3\n1\n2\n1\n1\n1\n"}, {"type": "stdin_stdout", "input": "9\n1 1 1 2 1 1 2 3 2", "output": "1\n2\n2\n3\n1\n1\n2\n1\n1\n"}, {"type": "stdin_stdout", "input": "9\n1 1 1 1 2 1 4 3 2", "output": "1\n2\n1\n3\n2\n4\n1\n1\n1\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are 2N points evenly space...
[{"type": "stdin_stdout", "input": "20 10\n10 18\n11 17\n14 7\n4 5\n30 28\n19 24\n29 22\n25 32\n38 34\n36 39", "output": "681816493\n"}, {"type": "stdin_stdout", "input": "20 10\n10 18\n21 17\n14 7\n4 5\n30 28\n19 24\n29 22\n25 32\n38 34\n36 39", "output": "676141768\n"}, {"type": "stdin_stdout", "input": "20 10\n10 18...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string S of leng...
[{"type": "stdin_stdout", "input": "cab", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "acb", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "cba", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "bca", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "abc", "output": "Yes"}, {"type": "stdin_...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi is now competing in a ...
[{"type": "stdin_stdout", "input": "5 13", "output": "195788800\n"}, {"type": "stdin_stdout", "input": "3 10", "output": "18739200\n"}, {"type": "stdin_stdout", "input": "10 7", "output": "1740800\n"}, {"type": "stdin_stdout", "input": "110 5", "output": "640000\n"}, {"type": "stdin_stdout", "input": "15 7", "output": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSnuke has N integers. Among them...
[{"type": "stdin_stdout", "input": "13 -10 2", "output": "133\n"}, {"type": "stdin_stdout", "input": "125 -2 0", "output": "247\n"}, {"type": "stdin_stdout", "input": "109 0 1", "output": "108\n"}, {"type": "stdin_stdout", "input": "109 0 2", "output": "215\n"}, {"type": "stdin_stdout", "input": "19 -7 -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\nSolve the following coding problem using the programming language python:\n\nSnuke is going to open a contest...
[{"type": "stdin_stdout", "input": "AtCoder Befinner Contest", "output": "ABC\n"}, {"type": "stdin_stdout", "input": "AtCoder sennifeB Cpntest", "output": "AsC\n"}, {"type": "stdin_stdout", "input": "AtCoder rennigeB Contest", "output": "ArC\n"}, {"type": "stdin_stdout", "input": "AtCoder Aeifnnes Cpnsest", "output": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven a string t, we will call i...
[{"type": "stdin_stdout", "input": "aoctder", "output": "-1 -1\n"}, {"type": "stdin_stdout", "input": "aecteop", "output": "-1 -1\n"}, {"type": "stdin_stdout", "input": "actoder", "output": "-1 -1\n"}, {"type": "stdin_stdout", "input": "aocuder", "output": "-1 -1\n"}, {"type": "stdin_stdout", "input": "aecueor", "outpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe tablet interface technology,...
[{"type": "stdin_stdout", "input": "3 3\nR G B\nG G G\nG B B\n2 4\nR G\nG G\nR B\nB R\n4 3\nF G B R\nG R R G\nB G G R\n0 0", "output": "2\n4\n5\n"}, {"type": "stdin_stdout", "input": "3 3\nR G B\nG G G\nG B B\n2 4\nS G\nG G\nR B\nB R\n4 3\nG G B R\nG R R G\nB G G R\n0 0", "output": "2\n4\n4\n"}, {"type": "stdin_stdout"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCreate a program that converts d...
[{"type": "stdin_stdout", "input": "3\nA a\n0 5\n5 4\n10\nB\nB\nC\n0\n1\n4\n5\na\nb\nA\n3\nA a\n0 5\n5 4\n10\nA\nB\nC\n0\n1\n4\n5\na\nb\nA\n0", "output": "BBC5144aba\naBC5144aba\n"}, {"type": "stdin_stdout", "input": "3\nA a\n0 0\n5 4\n10\nB\nB\nC\n0\n1\n4\n5\na\nb\nA\n3\nA a\n0 5\n5 4\n10\nA\nB\nC\n0\n1\n4\n5\na\nb\nA...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTokyo has a very complex railway...
[{"type": "stdin_stdout", "input": "4 4 2 1 4\n1 2 2 1\n3 3 2 1\n3 1 5 1\n2 4 4 2\n3 1\n3 11\n10 5 3\n\n10\n2 0 1 1 2\n1\n\n1\n4 5 2 4 1\n4 3 10 1\n3 2 2 1\n3 4 1 2\n3 2 5 2\n2 1 10 1\n3 3\n20 30\n3 2 1\n5 10\n4 2 1\n5 5 2 1 5\n2 2 10 2\n1 3 20 2\n1 4 32 1\n3 4 10 1\n4 5 20 1\n2 2\n20\n10 1\n20\n3 1\n0 0 0 0 0", "outpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYour master went to the town for...
[{"type": "stdin_stdout", "input": "5 7\nRRCABXT\nAABMFAB\nRROMJAC\nAPTADAB\nYABADAO\n3 13\nABCDEFGHIJKLM\nYMADAMIMADAMY\nACEGIKMOQSUWY\n3 4\nDEFG\nACAB\nHIJK\n3 6\nFEDCB@\nHHIAKL\nMNOPQR\n10 19\nJFZODYDXMZZPEYTRNCW\nXVGHPOKEYNZTQFZJKOD\nEYEHHQKHFZOVNRGOOLP\nQFZOIHRQMGHPNISHXOC\nDRGILJHSQEHHQLYTILL\nNCSHQMKHTZZIHRPAUJA...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHint\n\nIn solving this problem,...
[{"type": "stdin_stdout", "input": "6 101\n111 101 101 101 001 101 101 001 101 101", "output": "444444\n"}, {"type": "stdin_stdout", "input": "5 100\n101 101 101 101 001 101 101 101 101 101", "output": "44444\n"}, {"type": "stdin_stdout", "input": "5 100\n101 101 101 101 101 101 001 101 101 101", "output": "66666\n"}, ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou built an apartment. The apar...
[{"type": "stdin_stdout", "input": "1 000\n0 86400 1\n1 110\n135105 86400 1\n0 0", "output": "1.0000000000\n0.0000000000\n"}, {"type": "stdin_stdout", "input": "1 101\n0 86400 2\n1 000\n68972 86400 -2\n0 0", "output": "2.0000000000\n0.0000000000\n"}, {"type": "stdin_stdout", "input": "1 100\n1 29656 1\n1 100\n111003 86...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem Statement\n\nMr. Takatsu...
[{"type": "stdin_stdout", "input": "8 24\n05:30 Kyoto 06:37 Maibara\n06:50 Maibara 07:36 Tsuruga\n07:42 Tsuruga 10:03 Kanazawa\n10:58 Kanazawa 12:07 Toyama\n12:15 Toyama 14:12 Naoetsu\n14:29 Noaetsu 15:57 Nagaoka\n16:11 Nagaoka 17:14 Niitsu\n17:38 Niitsu 20:06 AizuWakamatsu", "output": "2\nKanazawa 55\nNiitsu 24\n"}, {...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA: Hokkaido University Easy\n\nN...
[{"type": "stdin_stdout", "input": "3 3\nA.B\n..B\n.BB", "output": "3\n"}, {"type": "stdin_stdout", "input": "3 3\nB.B\n..B\n-BB", "output": "4\n"}, {"type": "stdin_stdout", "input": "1 3\nAB.\n.B.\n.BB", "output": "0\n"}, {"type": "stdin_stdout", "input": "3 3\nA.B\nA..\n.CB", "output": "2\n"}, {"type": "stdin_stdout"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWrite a program which manipulate...
[{"type": "stdin_stdout", "input": "9 5\n1 0 1 1\n1 1 4 3\n0 0 2 2\n0 1\n1 1", "output": "2147483647\n2147483647\n2147483647\n2147483647\n"}, {"type": "stdin_stdout", "input": "9 5\n1 0 1 1\n1 0 4 3\n0 0 2 2\n0 1\n1 1", "output": "2147483647\n2147483647\n2147483647\n2147483647\n"}, {"type": "stdin_stdout", "input": "9 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Head Chef is receiving a lot...
[{"type": "stdin_stdout", "input": "2\n1\n210", "output": "0\n2628\n"}, {"type": "stdin_stdout", "input": "2\n1\n198", "output": "0\n2484\n"}, {"type": "stdin_stdout", "input": "2\n1\n175", "output": "0\n2288\n"}, {"type": "stdin_stdout", "input": "2\n2\n175", "output": "2\n2288\n"}, {"type": "stdin_stdout", "input": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIvan is collecting coins. There ...
[{"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000 1000010000000000000 1000000000000000000\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "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\nSolve the following coding problem using the programming language python:\n\nAs a German University in Cairo ...
[{"type": "stdin_stdout", "input": "65 173 136\n26 18 8 11 1 22 44 6 15 22 13 49 30 36 37 41 25 27 9 36 36 1 45 20 7 47 28 30 30 21 33 32 9 11 16 5 19 12 44 40 25 40 32 36 15 34 4 43 28 19 29 33 7 11 18 13 40 18 10 26 1 48 20 38 1 20 34 8 46 8 32 35 16 49 26 36 11 16 4 29 35 44 14 21 22 42 10 1 3 12 35 30 14 45 2 24 32...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's denote a function f(x) in ...
[{"type": "stdin_stdout", "input": "1000000000\n", "output": "91\n"}, {"type": "stdin_stdout", "input": "1472811722\n", "output": "57\n"}, {"type": "stdin_stdout", "input": "1660033091\n", "output": "63\n"}, {"type": "stdin_stdout", "input": "1100000000\n", "output": "90\n"}, {"type": "stdin_stdout", "input": "15164332...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis morning Tolik has understoo...
[{"type": "stdin_stdout", "input": "812 19\n", "output": "1 1\n812 19\n1 2\n812 18\n1 3\n812 17\n1 4\n812 16\n1 5\n812 15\n1 6\n812 14\n1 7\n812 13\n1 8\n812 12\n1 9\n812 11\n1 10\n812 10\n1 11\n812 9\n1 12\n812 8\n1 13\n812 7\n1 14\n812 6\n1 15\n812 5\n1 16\n812 4\n1 17\n812 3\n1 18\n812 2\n1 19\n812 1\n2 1\n811 19\n2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an array a_1, a_2,...
[{"type": "stdin_stdout", "input": "44 2 531595322\n926215961 -385821837 -278841122 -422772006 -509196878 -81824369 -101501043 -33095577 -520514931 402836017 48602657 881104200 -110528684 52550046 -208588735 -814534121 -548420443 410430115 -636402169 -848516069 -70639158 775203498 -679440929 -427359667 33598904 6568726...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIt's Petya's birthday party and ...
[{"type": "stdin_stdout", "input": "100\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 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "65 199\n199 197\n197 195\n195 193\n193 191\n191 189\n189 187\n18...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne day in the IT lesson Anna an...
[{"type": "stdin_stdout", "input": "hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhihhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two strings s and ...
[{"type": "stdin_stdout", "input": "16\n3\naaa\naaa\n3\nabb\naab\n3\naab\nbaa\n3\naab\naba\n3\naca\naba\n3\naba\nbaa\n3\naba\naab\n3\nabb\nabb\n3\nabb\nbab\n3\nabb\nbba\n3\nabc\nabc\n3\ncba\nbad\n3\nabc\ndab\n3\nabc\nacb\n3\ncba\ncba\n3\nabc\nbca\n", "output": "0\n-1\n1\n1\n-1\n1\n1\n0\n1\n2\n0\n-1\n-1\n1\n0\n2\n"}, {"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe only difference between easy...
[{"type": "stdin_stdout", "input": "32\n3 1 3\n2 2 1\n3 1 3\n2 2 2\n3 1 3\n2 2 3\n3 1 3\n2 3 1\n3 1 3\n2 3 2\n3 1 3\n2 3 3\n3 1 3\n3 1 1\n3 1 3\n3 1 2\n3 1 3\n3 1 3\n3 1 3\n3 2 1\n3 1 3\n3 2 2\n3 1 3\n3 2 3\n3 1 3\n3 3 1\n3 1 3\n3 3 2\n3 1 3\n3 3 3\n3 2 1\n1 1 1\n3 2 1\n1 1 2\n3 2 1\n1 1 3\n3 2 1\n1 2 1\n3 2 1\n1 2 2\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA bitstring is a string consisti...
[{"type": "stdin_stdout", "input": "9\n6 4\n100110\n3 2\n1?1\n3 2\n1?0\n4 4\n????\n7 4\n1?0??1?\n10 10\n11??11??11\n4 4\n1??1\n4 4\n?0?0\n6 2\n????00\n", "output": "YES\nYES\nNO\nYES\nYES\nNO\nYES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "9\n6 4\n100110\n3 2\n1?1\n3 2\n0?1\n4 4\n????\n7 4\n1?0??1?\n10 10\n11???1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlice and Bob have decided to pl...
[{"type": "stdin_stdout", "input": "1000000000\n156489182 145117627 698393191\n584283682 217785715 197930603\n", "output": "282676873 885890491\n"}, {"type": "stdin_stdout", "input": "931934723\n512340462 202375672 217218589\n24862054 655510760 251561909\n", "output": "235916499 739578188\n"}, {"type": "stdin_stdout", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA country called Berland consist...
[{"type": "stdin_stdout", "input": "10 45 9\n2 1 428\n3 1 610\n3 2 357\n4 1 855\n4 2 528\n4 3 508\n5 1 425\n5 2 185\n5 3 349\n5 4 845\n6 1 206\n6 2 969\n6 3 153\n6 4 854\n6 5 640\n7 1 87\n7 2 250\n7 3 953\n7 4 456\n7 5 742\n7 6 588\n8 1 641\n8 2 898\n8 3 396\n8 4 960\n8 5 654\n8 6 410\n8 7 640\n9 1 707\n9 2 707\n9 3 70...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a program that con...
[{"type": "stdin_stdout", "input": "2\n8 4\n-+--+--+\n1 8\n2 8\n2 5\n1 1\n4 10\n+-++\n1 1\n1 2\n2 2\n1 3\n2 3\n3 3\n1 4\n2 4\n3 4\n4 4\n", "output": "\n1\n2\n4\n4\n3\n3\n4\n2\n3\n2\n1\n2\n2\n2\n"}, {"type": "stdin_stdout", "input": "2\n8 4\n-+--+--+\n2 8\n2 8\n2 5\n1 1\n4 10\n+-++\n1 1\n1 2\n2 2\n1 3\n2 3\n3 3\n1 4\n2 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an integer k and a...
[{"type": "stdin_stdout", "input": "20 2\n3 14\n13 1\n4 3\n13 5\n12 20\n19 12\n6 3\n12 15\n11 2\n11 17\n9 5\n19 7\n6 11\n17 5\n16 18\n16 7\n12 8\n19 11\n16 10\n", "output": "122844\n"}, {"type": "stdin_stdout", "input": "20 2\n6 14\n13 1\n4 3\n13 5\n12 20\n19 12\n6 3\n12 15\n11 2\n11 17\n9 5\n19 7\n6 11\n17 5\n16 18\n1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's call an integer array a_1,...
[{"type": "stdin_stdout", "input": "10\n20000 -431912570 597469643\n20000 -13928452 414987414\n20000 -472808872 367983694\n20000 -84913058 517394906\n20000 -514402152 597357115\n20000 -720971736 526102810\n20000 -416160739 748291750\n20000 -665939649 743938438\n20000 -80741314 634025883\n20000 -824743396 138091345\n", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Little Elephant has array a,...
[{"type": "stdin_stdout", "input": "100 25\n457 226 629 226 147 284 72 23 247 76 972 829 173 591 581 373 533 474 521 219 181 278 890 27 345 478 595 678 971 157 776 156 970 955 584 786 692 774 228 459 118 419 671 24 128 76 677 66 923 800 870 124 420 528 609 131 88 118 19 807 288 973 896 305 268 486 830 149 529 399 894 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\nSolve the following coding problem using the programming language python:\n\nPolycarpus is a system administr...
[{"type": "stdin_stdout", "input": "14\n1 7 3\n1 0 10\n1 7 3\n1 1 9\n2 2 8\n2 0 10\n1 1 9\n2 8 2\n2 6 4\n1 3 7\n1 3 7\n2 6 4\n2 1 9\n2 7 3\n", "output": "DEAD\nDEAD\n"}, {"type": "stdin_stdout", "input": "14\n1 5 3\n1 0 10\n1 7 3\n1 1 9\n2 2 8\n2 0 10\n1 1 9\n2 8 2\n2 6 4\n1 3 7\n1 3 7\n2 6 4\n2 1 9\n2 7 3\n", "output"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs a big fan of Formula One, Cha...
[{"type": "stdin_stdout", "input": "100000 100000 1\n", "output": "3.999900002193968e-05\n"}, {"type": "stdin_stdout", "input": "15566 14608 0\n", "output": "0.061604676559388505\n"}, {"type": "stdin_stdout", "input": "100000 100000 10\n", "output": "0.00120926220494\n"}, {"type": "stdin_stdout", "input": "100000 10000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYaroslav, Andrey and Roman can p...
[{"type": "stdin_stdout", "input": "10\n00000000000111111111\n00000000011111111111\n", "output": "Draw\n"}, {"type": "stdin_stdout", "input": "4\n01100000\n10010011\n", "output": "Second\n"}, {"type": "stdin_stdout", "input": "4\n01111000\n11111010\n", "output": "Second\n"}, {"type": "stdin_stdout", "input": "4\n010101...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIahub recently has learned Bubbl...
[{"type": "stdin_stdout", "input": "100\n36 48 92 87 28 85 42 10 44 41 39 3 79 9 14 56 1 16 46 35 93 8 82 26 100 59 60 2 96 52 13 98 70 81 71 94 54 91 17 88 33 30 19 50 18 73 65 29 78 21 61 7 99 97 45 89 57 27 76 11 49 72 84 69 43 62 4 22 75 6 66 83 38 34 86 15 40 51 37 74 67 31 20 63 77 80 12 53 5 25 58 90 68 24 64 23...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe clique problem is one of the...
[{"type": "stdin_stdout", "input": "12\n66 4\n12 7\n60 1\n24 4\n48 4\n-1 4\n36 4\n30 4\n6 4\n54 4\n42 2\n18 4\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "12\n67 4\n12 7\n60 1\n24 4\n48 4\n-1 4\n36 4\n30 4\n6 4\n54 4\n42 2\n18 4\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "12\n67 8\n12 7\n60 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\nSolve the following coding problem using the programming language python:\n\nLuke Skywalker got locked up in ...
[{"type": "stdin_stdout", "input": "9999 10000 10000 10010\n", "output": "4.9975012493753125e-05\n"}, {"type": "stdin_stdout", "input": "2173 2176 10001 9989\n", "output": "0.00015007503751875937\n"}, {"type": "stdin_stdout", "input": "9999 10000 10000 10000\n", "output": "0.000050000000000 \n"}, {"type": "stdin_stdout...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIt was recycling day in Kekoland...
[{"type": "stdin_stdout", "input": "235810013 344493922 0 0 975204641 211157253\n18\n977686151 621301932\n408277582 166435161\n595105725 194278844\n967498841 705149530\n551735395 659209387\n492239556 317614998\n741520864 843275770\n585383143 903832112\n272581169 285871890\n339100580 134101148\n920610054 824829107\n6579...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs we all know Barney's job is \...
[{"type": "stdin_stdout", "input": "12\n254904759290707697 475737283258450340 533306428548398547 442127134828578937 779740159015946254 272877594683860919 93000149670491971 349640818793278778 498293278222136720 551099726729989816 149940343283925029 1677751211246811281\n", "output": "144527324/433581971\n"}, {"type": "st...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya plays the LionAge II. He w...
[{"type": "stdin_stdout", "input": "emrvvhupytoxzhqxmuop 1\n49\ng g -558\nd g 845\nd k -745\nb g -773\nf f -733\nb s -491\na s -894\ng d -565\ns k -756\nb a 373\nb d 398\nk f 250\na b 531\nf g -27\nf b 125\na g -555\ns f 540\ng b 194\nk s -636\ns b -955\nd a -520\ng f -97\nf s -204\ns a 171\nb k -304\ns g -160\na a -56...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nEach New Year Timofey and his fr...
[{"type": "stdin_stdout", "input": "10\n5 7\n4 5\n10 2\n3 6\n1 2\n3 4\n8 5\n4 9\n2 3\n15 15 15 15 5 15 26 18 15 15\n", "output": "YES\n5\n"}, {"type": "stdin_stdout", "input": "10\n5 7\n1 5\n10 2\n3 6\n1 2\n3 4\n8 5\n4 9\n2 3\n15 15 15 15 5 15 26 18 15 15\n", "output": "YES\n5\n"}, {"type": "stdin_stdout", "input": "10...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIt's been almost a week since Po...
[{"type": "stdin_stdout", "input": "10 5\n1384 1129 1780 1960 1567 1928 12 1523 1165 344\n", "output": "6931.333333333333030"}, {"type": "stdin_stdout", "input": "10 4\n127 1459 718 1183 880 1044 1857 1340 725 1496\n", "output": "4574.428571428571558"}, {"type": "stdin_stdout", "input": "10 8\n127 1459 718 1183 880 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\nSolve the following coding problem using the programming language python:\n\nn people are standing on a coord...
[{"type": "stdin_stdout", "input": "26 10\n495492 7 1\n256604 5 2\n511773 3 2\n590712 4 1\n206826 7 2\n817878 4 2\n843915 1 1\n349160 3 1\n351298 4 1\n782251 8 2\n910928 4 1\n662354 4 2\n468621 2 2\n466991 7 2\n787303 6 2\n221623 8 2\n343518 6 1\n141123 7 1\n24725 6 1\n896603 3 2\n918129 8 2\n706071 6 2\n512369 2 2\n60...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHelen works in Metropolis airpor...
[{"type": "stdin_stdout", "input": "10 6\n2226 89307 11261 28772 23196 30298 10832 43119 74662 24028\n", "output": "1246672\n16 7 14 11 13 10 15 8 9 12\n"}, {"type": "stdin_stdout", "input": "10 5\n66220 81797 38439 54881 86879 94346 8802 59094 57095 41949\n", "output": "2484818\n9 8 14 12 7 6 15 10 11 13\n"}, {"type":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDanil decided to earn some money...
[{"type": "stdin_stdout", "input": "10\n1 1 3 1 3 1 4 6 3\n0 1 1 1 1 1 1 1 0 0\n10\nget 9\nget 10\nget 4\nget 5\nget 5\nget 5\nget 10\nget 7\nget 5\nget 2\n", "output": "0\n0\n2\n1\n1\n1\n0\n1\n1\n1\n"}, {"type": "stdin_stdout", "input": "10\n1 1 3 1 3 1 4 6 3\n0 1 1 1 1 1 1 1 1 0\n10\nget 9\nget 10\nget 4\nget 5\nget ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlice has a string consisting of...
[{"type": "stdin_stdout", "input": "AAAAAA\nAAAAAA\n30\n3 4 1 2\n3 3 4 4\n5 6 3 4\n3 3 2 3\n5 6 1 5\n2 4 4 6\n1 6 2 5\n6 6 3 4\n3 5 1 4\n4 5 3 6\n2 3 2 4\n3 4 4 4\n6 6 4 6\n3 3 2 5\n1 5 3 3\n4 6 1 2\n6 6 6 6\n3 3 3 4\n6 6 6 6\n5 6 4 4\n6 6 5 5\n2 3 1 4\n3 6 4 5\n3 5 6 6\n4 5 2 6\n5 6 6 6\n1 4 2 5\n4 5 2 5\n4 5 1 3\n2 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAfter the big birthday party, Ka...
[{"type": "stdin_stdout", "input": "727\nbaabbabbbababbbbaaaabaabbaabababaaababaaababbbbababbbbbbbbbbaaabaabbbbbbbbaaaabaabbaaabaabbabaa\nddcdcccccccdccdcdccdddcddcddcddddcdddcdcdccddcdddddccddcccdcdddcdcccdccccccdcdcdccccccdccccccdc\nfffeefeffeefeeeeffefffeeefffeefffefeefefeeeffefefefefefefffffffeeeeeffffeefeeeeffffee...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string s consist...
[{"type": "stdin_stdout", "input": "26 1\nabcdefghijklmnopqrstuvwxyz\n", "output": "bcdefghijklmnopqrstuvwxyz\n"}, {"type": "stdin_stdout", "input": "26 1\nabcdefghijklmnopqrsuuvwxyz\n", "output": "bcdefghijklmnopqrsuuvwxyz\n"}, {"type": "stdin_stdout", "input": "26 2\nabcdefghijklmnopqrstuvwxyz\n", "output": "cdefghij...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBenny is a little pig. She usual...
[{"type": "stdin_stdout", "input": "4\n1 1 2\n2\n6 19 7\n5 9 0 8 4 2 \n1 4 3\n0 \n1 1 2\n1 \n\nSAMPLE", "output": "Impossible\nImpossible\nImpossible\nImpossible\n"}, {"type": "stdin_stdout", "input": "4\n1 1 2\n2\n6 12 12\n7 0 0 8 4 0 \n1 4 1\n1 \n1 12 8\n1 \n\nSAMPLE", "output": "Impossible\nImpossible\n1\nImpossible...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNOTE: All quotes are for clarity...
[{"type": "stdin_stdout", "input": "29 99 64\n5248 63776 10752 92000 53632 12672 69184 -57824 51136 31392 30240 2560 79968 53856 75008 62848 83360 28576 17856 95808 46048 69312 99456 19584 -37376 84896 29888 95648 23904 46560 97216 80928 90688 76864 39232 48736 85376 66272 80480 66432 73984 -47808 9216 82624 62144 9699...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a magical shop owned by...
[{"type": "stdin_stdout", "input": "122 110\n111\n\nSL@LVC", "output": "102\n"}, {"type": "stdin_stdout", "input": "105 111\n111\n\nSL@LVD", "output": "105\n"}, {"type": "stdin_stdout", "input": "11 111\n011\n\nDR@LLV", "output": "110\n"}, {"type": "stdin_stdout", "input": "11 111\n001\n\nDR@LLV", "output": "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\nSolve the following coding problem using the programming language python:\n\nGiven is an integer sequence of ...
[{"type": "stdin_stdout", "input": "10\n0 -1 1 1 3 3 4 8 13 23 34", "output": "360\n"}, {"type": "stdin_stdout", "input": "10\n-1 0 1 0 2 3 5 8 13 21 34", "output": "421\n"}, {"type": "stdin_stdout", "input": "10\n0 -1 1 1 3 4 4 8 13 23 34", "output": "358\n"}, {"type": "stdin_stdout", "input": "10\n-1 0 1 0 2 3 5 8 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\nSolve the following coding problem using the programming language python:\n\nAtCoder's head office consists o...
[{"type": "stdin_stdout", "input": "315", "output": "1\n2\n1\n3\n1\n2\n1\n4\n1\n2\n1\n3\n1\n2\n1\n5\n1\n2\n1\n3\n1\n2\n1\n4\n1\n2\n1\n3\n1\n2\n1\n6\n1\n2\n1\n3\n1\n2\n1\n4\n1\n2\n1\n3\n1\n2\n1\n5\n1\n2\n1\n3\n1\n2\n1\n4\n1\n2\n1\n3\n1\n2\n1\n7\n1\n2\n1\n3\n1\n2\n1\n4\n1\n2\n1\n3\n1\n2\n1\n5\n1\n2\n1\n3\n1\n2\n1\n4\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\nSolve the following coding problem using the programming language python:\n\nFind the number, modulo 99824435...
[{"type": "stdin_stdout", "input": "102 205", "output": "214138673\n"}, {"type": "stdin_stdout", "input": "169 205", "output": "909969555\n"}, {"type": "stdin_stdout", "input": "613 159", "output": "832714847\n"}, {"type": "stdin_stdout", "input": "325 205", "output": "688557253\n"}, {"type": "stdin_stdout", "input": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi has a strong stomach. ...
[{"type": "stdin_stdout", "input": "-2 -1 10", "output": "dangerous\n"}, {"type": "stdin_stdout", "input": "-1 13 12", "output": "delicious\n"}, {"type": "stdin_stdout", "input": "-1 7 12", "output": "dangerous\n"}, {"type": "stdin_stdout", "input": "-1 7 14", "output": "dangerous\n"}, {"type": "stdin_stdout", "input":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs a New Year's gift, Dolphin re...
[{"type": "stdin_stdout", "input": "gaiku,atcoder,tasks", "output": "gaiku atcoder tasks\n"}, {"type": "stdin_stdout", "input": "abgde,fchihgf,edcba", "output": "abgde fchihgf edcba\n"}, {"type": "stdin_stdout", "input": "ha,pypnewyear,enjoy", "output": "ha pypnewyear enjoy\n"}, {"type": "stdin_stdout", "input": "gaiku...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string S consist...
[{"type": "stdin_stdout", "input": "9999999999", "output": "12656242944"}, {"type": "stdin_stdout", "input": "1333", "output": "1952\n"}, {"type": "stdin_stdout", "input": "1455", "output": "2280\n"}, {"type": "stdin_stdout", "input": "1573", "output": "2576\n"}, {"type": "stdin_stdout", "input": "1479", "output": "240...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDr .: Peter, I've finally done i...
[{"type": "stdin_stdout", "input": "10 0 82 - /\n4 5 - 31 1 5 * * *\n0 -2 1 + +", "output": "-0.121951\n-155.000000\n-1.000000\n"}, {"type": "stdin_stdout", "input": "10 0 82 - /\n4 5 - 60 1 5 * * *\n0 -2 1 + +", "output": "-0.121951\n-300.000000\n-1.000000\n"}, {"type": "stdin_stdout", "input": "10 0 82 - /\n4 0 - 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\nSolve the following coding problem using the programming language python:\n\nThere is an ice cream shop named...
[{"type": "stdin_stdout", "input": "15\n2\n6\n7\n0\n1\n9\n8\n7\n4\n8\n9\n1\n9\n4\n2\n1\n2\n1\n0\n0", "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"}, {"type": "stdin_stdout", "input": "15\n1\n6\n7\n0\n1\n9\n8\n7\n4\n8\n9\n1\n9\n4\n2\n1\n2\n1\n0\n0", "output...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn the year 30XX, an expedition ...
[{"type": "stdin_stdout", "input": "25\nneihsokcpuziafoytisrevinu\nuniversityofaizupckoshhen", "output": "4\n"}, {"type": "stdin_stdout", "input": "25\nuniversityofaiztpckoshien\nuniversityofaizupbkoshhen", "output": "0\n"}, {"type": "stdin_stdout", "input": "25\nuniversityofaiztpckoshien\nnehhsokbpuziafoytisrevinu", "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAn bydrocarbon is an organic com...
[{"type": "stdin_stdout", "input": "1\n30", "output": "1\n14348906\n"}, {"type": "stdin_stdout", "input": "1\n30", "output": "1\n14348906\n"}, {"type": "stdin_stdout", "input": "1\n25", "output": "1\n1062881\n"}, {"type": "stdin_stdout", "input": "1\n29", "output": "1\n9565937\n"}, {"type": "stdin_stdout", "input": "1\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIt is said that a legendary trea...
[{"type": "stdin_stdout", "input": "4\n1 1\n2 0 -1\n2 4 2\n3 2 16 10\n0", "output": "-1\n"}, {"type": "stdin_stdout", "input": "4\n1 1\n2 0 0\n2 4 2\n3 2 16 10\n0", "output": "-1\n"}, {"type": "stdin_stdout", "input": "4\n1 1\n2 0 -1\n2 4 2\n3 2 16 2\n0", "output": "-1\n"}, {"type": "stdin_stdout", "input": "4\n1 1\n2 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA dial lock is a kind of lock wh...
[{"type": "stdin_stdout", "input": "4\n1433 4680\n6\n777777 003330\n0", "output": "4\n2\n"}, {"type": "stdin_stdout", "input": "4\n1357 4680\n6\n509138 003330\n0", "output": "1\n4\n"}, {"type": "stdin_stdout", "input": "4\n1357 4680\n6\n297443 003330\n0", "output": "1\n5\n"}, {"type": "stdin_stdout", "input": "4\n1357 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMr. A wants to get to the destin...
[{"type": "stdin_stdout", "input": "196 2 133", "output": "133\n"}, {"type": "stdin_stdout", "input": "128 12 16", "output": "16\n"}, {"type": "stdin_stdout", "input": "134 22 13", "output": "13\n"}, {"type": "stdin_stdout", "input": "134 22 21", "output": "21\n"}, {"type": "stdin_stdout", "input": "50 40 68", "output"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem statement\n\nAOR Ika got...
[{"type": "stdin_stdout", "input": "16 6 10 -1\n24 1 4 -1 0", "output": "1\n"}, {"type": "stdin_stdout", "input": "16 6 10 -1\n24 1 5 -1 0", "output": "1\n"}, {"type": "stdin_stdout", "input": "21 10 0 4\n5 2 13 -1 0", "output": "3\n"}, {"type": "stdin_stdout", "input": "16 6 10 -1\n24 1 4 0 1", "output": "1\n"}, {"typ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nN: Mail order\n\nMr. Komozawa bo...
[{"type": "stdin_stdout", "input": "2 2\n-1 11\n10 12", "output": "19\n"}, {"type": "stdin_stdout", "input": "2 2\n-4 0\n0 -2", "output": "-10\n"}, {"type": "stdin_stdout", "input": "2 2\n-1 2\n2 -1", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2 2\n-1 2\n2 -2", "output": "-3\n"}, {"type": "stdin_stdout", "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\nSolve the following coding problem using the programming language python:\n\nProblem\n\nThere are coins with ...
[{"type": "stdin_stdout", "input": "12 110 467", "output": "469611202\n"}, {"type": "stdin_stdout", "input": "12 100 467", "output": "732809678\n"}, {"type": "stdin_stdout", "input": "12 13 187", "output": "455459798\n"}, {"type": "stdin_stdout", "input": "12 60 467", "output": "654858060\n"}, {"type": "stdin_stdout", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFind common tangent lines of two...
[{"type": "stdin_stdout", "input": "1 1 1\n6 2 2", "output": "0.6153846154 1.9230769231\n1.0000000000 0.0000000000\n1.4183420913 1.9082895434\n1.7355040625 0.3224796874"}, {"type": "stdin_stdout", "input": "-1 -6 2\n1 0 2", "output": "-2.89736660 -5.36754447\n-2.06969385 -4.31010205\n0.86969385 -5.28989795\n0.89736660 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor a dictionary $M$ that stores...
[{"type": "stdin_stdout", "input": "7\n0 blue 4\n0 red -1\n0 white 9\n1 red\n1 blue\n0 black 11\n1 black", "output": "-1\n4\n11\n"}, {"type": "stdin_stdout", "input": "7\n0 blue 15\n0 red 1\n0 whiue 5\n1 red\n1 blue\n0 black 11\n1 black", "output": "1\n15\n11\n"}, {"type": "stdin_stdout", "input": "7\n0 blue 4\n0 red -...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an undirected tree...
[{"type": "stdin_stdout", "input": "7\n1 2\n2 3\n3 4\n3 5\n3 6\n3 7\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "7\n1 2\n2 3\n2 4\n4 5\n4 6\n5 7\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "7\n1 2\n1 3\n2 4\n2 5\n3 6\n1 7\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "7\n1 2\n2 3\n2 4\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAfter all the events in Orlando ...
[{"type": "stdin_stdout", "input": "15 10 15\n1\n2\n3\n4\n5\n6\n12\n8\n9\n10\n11\n12\n13\n14\n15\n", "output": ".X.X.XXX.XXXXXX"}, {"type": "stdin_stdout", "input": "15 10 15\n1\n2\n5\n6\n5\n6\n7\n12\n9\n10\n11\n12\n13\n14\n15\n", "output": ".X.X.X.X.XXXXXX"}, {"type": "stdin_stdout", "input": "17 10 15\n1\n2\n5\n6\n5\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n[The Duck song](https://www.yout...
[{"type": "stdin_stdout", "input": "100000 100000 100000\n100000 100000 100000\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "100000 99999 100000\n100000 100000 100000\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "100000 100000 99999\n100000 100000 100000\n", "output": "YES\n"}, {"type": "stdin...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecently Lynyrd and Skynyrd went...
[{"type": "stdin_stdout", "input": "3 6 3\n2 1 3\n1 2 3 1 2 3\n1 5\n2 6\n3 5\n", "output": "110\n"}, {"type": "stdin_stdout", "input": "3 6 3\n2 1 3\n1 1 3 1 2 3\n1 5\n2 6\n3 5\n", "output": "110\n"}, {"type": "stdin_stdout", "input": "3 6 3\n2 1 3\n1 2 3 1 2 3\n1 5\n3 6\n3 5\n", "output": "100\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nInaka has a disc, the circumfere...
[{"type": "stdin_stdout", "input": "30000 28\n10601 1119\n11119 20601\n9493 25771\n14351 4869\n13101 3619\n23101 13619\n29869 9351\n6119 15601\n3101 23619\n1851 22369\n11851 2369\n8619 18101\n19579 12933\n18619 28101\n16851 7369\n8101 28619\n24869 4351\n24351 14869\n2690 6851\n9869 19351\n5601 26119\n3976 21301\n21851 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVova is playing a computer game....
[{"type": "stdin_stdout", "input": "20\n1000000001 510000100 2 1\n1000000000 500000000 2 1\n1000000000 500000000 2 1\n1000000000 500000000 2 1\n1000000000 500000000 2 1\n1000000000 684100035 2 1\n1000000100 500000000 2 1\n1000000000 690764083 2 1\n1000000000 500000000 2 1\n1000000000 167868648 2 1\n1000000001 999999995...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGildong has bought a famous pain...
[{"type": "stdin_stdout", "input": "9 9\nBWBBWWWXW\nBWAWWWWWW\nWBWBBBBBB\nWWBBBWWWB\nWWBWBXBWW\nWBWWBBWWB\nWWWBWBWBW\nBBWBBBWWW\nWBWBBWWWW\n", "output": "18\n"}, {"type": "stdin_stdout", "input": "9 9\nBWBBWWWXW\nBWAWWWWWW\nWBWBBBBBB\nWWBBBWWWB\nWWBWBXBWW\nWBWWBBWWB\nWWWBWBWBW\nWWWBBBWBB\nWBWBBWWWW\n", "output": "18\n"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlan decided to get in shape for...
[{"type": "stdin_stdout", "input": "5 00000\n10000 30000 30000 40000 19505\n27261\n14 2 8 5 6\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "5 00000\n10000 30000 30000 40000 19505\n27261\n14 0 8 5 6\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "5 10000\n10000 37530 30000 30000 20000\n10000\n5 2 8...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nUjan has a lot of numbers in his...
[{"type": "stdin_stdout", "input": "5\n10 -251 650 475 -114 364 -75754 -982 -532 -151 -484\n10 -623 -132 -317561 -438 20 -275 -323 -530089 -311 -587\n10 450900 -519 903 -401 -789 -606529 277 -267 -682 -161\n10 -246 873 -641 838 719 234 789 -74 -287288 -772972\n10 186 741 -927 -866 -855 578 -1057019 202 162962 -458\n", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOh, New Year. The time to gather...
[{"type": "stdin_stdout", "input": "10\n10 7 10 10 7 10 7 7 10 10\n", "output": "2 6\n"}, {"type": "stdin_stdout", "input": "10\n10 7 10 10 7 10 7 5 10 10\n", "output": "2 7\n"}, {"type": "stdin_stdout", "input": "10\n1 2 3 4 5 6 7 8 9 10\n", "output": "4 10\n"}, {"type": "stdin_stdout", "input": "10\n1 2 3 4 5 6 9 8 9...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string s. Each c...
[{"type": "stdin_stdout", "input": "7\n0\n0\n0\n0\n0\n0\n0\n", "output": "0\n0\n0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "7\n0\n0\n0\n0\n1\n0\n0\n", "output": "0\n0\n0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "3\n010011\n0\n1111000\n", "output": "2\n0\n0\n"}, {"type": "stdin_stdout", "input": "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\nSolve the following coding problem using the programming language python:\n\nKarl likes Codeforces and subseq...
[{"type": "stdin_stdout", "input": "10000100000000000\n", "output": "ccccccccccccccccccccccccccccccccccccccccooooooooooooooooooooooooooooooooooooooooddddddddddddddddddddddddddddddddddddddddeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeffffffffffffffffffffffffffffffffffffffffoooooooooooooooooooooooooooooooooooooooorrrrrrrrrrr...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two lists of segme...
[{"type": "stdin_stdout", "input": "3\n3 5\n1 2\n3 4\n2 1000000000\n1 1\n999999999 999999999\n10 3\n5 10\n7 8\n", "output": "7\n2000000000\n0\n"}, {"type": "stdin_stdout", "input": "3\n3 5\n1 2\n3 4\n1 1000000000\n1 1\n999999999 999999999\n10 3\n5 10\n7 8\n", "output": "7\n2000000000\n0\n"}, {"type": "stdin_stdout", "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\nSolve the following coding problem using the programming language python:\n\nGerald is setting the New Year t...
[{"type": "stdin_stdout", "input": "10 1000 236\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1 1484 1100\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1 1484 0100\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "100 821 25\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKavi has 2n points lying on the ...
[{"type": "stdin_stdout", "input": "1000000\n", "output": "126330412"}, {"type": "stdin_stdout", "input": "372544\n", "output": "214345447\n"}, {"type": "stdin_stdout", "input": "315936\n", "output": "256195953\n"}, {"type": "stdin_stdout", "input": "446167\n", "output": "461428149\n"}, {"type": "stdin_stdout", "input"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA new cottage village called «Fl...
[{"type": "stdin_stdout", "input": "50 1\n-967 7\n696 7\n-366 4\n557 1\n978 2\n800 4\n-161 2\n-773 2\n-248 2\n134 3\n869 6\n-932 2\n-262 14\n191 3\n669 2\n72 5\n0 1\n757 8\n859 2\n-131 8\n-169 3\n543 10\n-120 2\n-87 8\n-936 6\n-620 3\n-281 11\n684 3\n886 10\n497 4\n380 4\n833 1\n-727 6\n470 11\n584 9\n66 6\n-609 12\n-6...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA widely known among some people...
[{"type": "stdin_stdout", "input": "15\na b c d e f g h i j k l m n o\n1\n221 n g m h n f d a b a m d o n e e c c i a f f f i h m b o l j b d f m f i j c g d k l i b d a h l j e n b d b j o c c b c e c o g n h a b l m m h n a a a n e k m m a e b l i k a g h k k f d j c n g c d k b f k k a k g m b a j b n m f c f f o a ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are less than 60 years lef...
[{"type": "stdin_stdout", "input": "1000000000 208196592308 1000000000000 1000000001\n", "output": "668826609\n"}, {"type": "stdin_stdout", "input": "7417434 671183669261 881538048766 3606057091\n", "output": "5978569\n"}, {"type": "stdin_stdout", "input": "220688329 777936720815 906371247466 123531039142\n", "output":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarpus has been working in t...
[{"type": "stdin_stdout", "input": "100\n-76 -48 -63 -62 -94 -37 -54 -67 -9 -52 -83 -1 -87 -36 -94 -10 -19 -55 -93 -23 -2 -87 -15 -59 -60 -87 -63 -18 -62 -92 -10 -61 -12 -89 -85 -38 -37 -3 -71 -22 -94 -96 -100 -47 -20 -93 -28 77 -35 -74 -50 -72 -38 -29 -58 -80 -24 -9 -59 -4 -93 -65 -31 -47 -36 -13 -89 -96 -99 -83 -99 -...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIt is known that there are k fis...
[{"type": "stdin_stdout", "input": "100 50 11\n7 15 0 1 6 7 9 2 4 6 7 7 3 9 4 5 0 7 8 19 4 1 3 6 8 10 4 6 6 1 6 6 7 4 10 3 10 1 3 1 10 6 9 9 5 2 9 2 9 8 10 2 10 3 3 2 3 8 6 2 7 10 7 2 7 2 8 9 6 2 5 4 4 5 3 3 9 10 9 4 9 3 9 5 3 11 6 2 3 6 10 3 10 2 6 13 10 10 4 8\n3 3 2 9 4 4 10 2 7 3 3 2 6 3 3 4 7 4 1 2 3 8 1 6 14 7 2 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFox Ciel is playing a card game ...
[{"type": "stdin_stdout", "input": "36 30\nATK 116\nATK 120\nATK 122\nATK 120\nATK 116\nATK 118\nATK 123\nDEF 2564\nATK 123\nDEF 1810\nATK 124\nATK 120\nDEF 2598\nATK 119\nDEF 2103\nATK 123\nATK 118\nATK 118\nATK 123\nDEF 1988\nATK 122\nATK 120\nDEF 2494\nATK 122\nATK 124\nATK 117\nATK 121\nATK 118\nATK 117\nATK 122\nA...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarpus adores TV series. Rig...
[{"type": "stdin_stdout", "input": "10\n3 8 10 1 7 9 6 5 2\n", "output": " 4"}, {"type": "stdin_stdout", "input": "5\n5 2 4 3\n", "output": " 1"}, {"type": "stdin_stdout", "input": "5\n5 4 3 2\n",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's define logical OR as an op...
[{"type": "stdin_stdout", "input": "7 10\n1 0 1 0 0 0 1 0 1 0\n1 0 1 0 0 0 1 0 1 0\n1 1 1 1 1 1 1 1 1 1\n1 0 1 0 0 0 1 0 1 0\n1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1\n", "output": "YES\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n1 0 1 0 0 0 1 0 1 0\n0 0 0 0 0 0 0 0 0 0\n1 0 1 0 0 0 1 0 1 0\n1 0 1 0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a rectangular boar...
[{"type": "stdin_stdout", "input": "14 16\n", "output": "112\n"}, {"type": "stdin_stdout", "input": "15 16\n", "output": "120\n"}, {"type": "stdin_stdout", "input": "16 16\n", "output": "128\n"}, {"type": "stdin_stdout", "input": "14 15\n", "output": "105\n"}, {"type": "stdin_stdout", "input": "15 15\n", "output": "112...
code_stdio