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\nTaro is planning a long trip by ...
[{"type": "stdin_stdout", "input": "6 5\n1 2 200 12\n1 4 400 15\n1 5 250 25\n2 4 100 10\n4 5 150 20\n3 5 300 21\n2\n1 5 0\n1 5 0\n0 0", "output": "250\n250\n"}, {"type": "stdin_stdout", "input": "6 14\n1 2 200 10\n2 4 103 22\n2 3 250 13\n2 3 100 10\n4 5 178 10\n3 3 300 30\n2\n2 5 0\n1 5 1\n0 0", "output": "281\n42\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 supercomputer system L in th...
[{"type": "stdin_stdout", "input": "1 0\n4\n-153 -1\n8 13\n-1 -1", "output": "0\n"}, {"type": "stdin_stdout", "input": "1 0\n4\n-153 -1\n8 13\n-1 1", "output": "0\n"}, {"type": "stdin_stdout", "input": "1 0\n4\n-153 -1\n8 13\n-1 0", "output": "0\n"}, {"type": "stdin_stdout", "input": "1 0\n4\n-91 -1\n8 13\n-1 -1", "out...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMr. Denjiro is a science teacher...
[{"type": "stdin_stdout", "input": "2\n5\n15 43\n35 20\n50 45\n70 30\n80 10\n3\n20 3\n34 2\n65 2\n6\n40 5237\n25 1753\n10 18000\n90 7000\n25 15000\n14 22000\n5\n15 40\n23 20\n50 45\n70 43\n80 10\n0\n60 4\n75 1\n3\n60 6000\n17 6000\n85 6000", "output": "24.93809524\n14.60833333\n45.00000000\n0.00000000\n45.00000000\n50....
code_stdio
[ { "content": "You are an expert Python programmer. 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 play a stone removing game...
[{"type": "stdin_stdout", "input": "12 2 3\n100 15522 98\n10000 10000 10000\n0 0 0", "output": "10\n89\n2019\n"}, {"type": "stdin_stdout", "input": "12 2 3\n100 15914 98\n10000 10000 10000\n0 0 0", "output": "10\n16\n2019\n"}, {"type": "stdin_stdout", "input": "12 2 3\n100 15914 98\n10001 10000 10000\n0 0 0", "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\nScores of Final Examination\n\nI...
[{"type": "stdin_stdout", "input": "5 2\n10 14 60 40 50\n15 25 68 85 55\n6 3\n10 20 30 20 46 126\n21 34 11 28 20 0\n27 29 4 11 23 10\n4 2\n1 0 -1 -1\n0 0 0 0\n0 0", "output": "128\n136\n1\n"}, {"type": "stdin_stdout", "input": "5 2\n8 20 34 74 50\n15 25 35 127 55\n6 3\n10 20 30 15 25 15\n21 34 11 52 20 0\n27 15 42 10 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\nSolve the following coding problem using the programming language python:\n\nTraining is indispensable for ac...
[{"type": "stdin_stdout", "input": "5 10\n..A.......\n.......B..\n..........\n..B.......\n..A.CC....", "output": "4"}, {"type": "stdin_stdout", "input": "5 7\nNBTUUOR\nQT.SZSQ\nASNAGIP\nMBYGDML\nKKLIODP", "output": "14\n"}, {"type": "stdin_stdout", "input": "5 7\nNUTUBOR\nQT.SZRQ\nSANAGIP\nLMDGZBM\nLKKIODP", "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 an English learner, sometimes...
[{"type": "stdin_stdout", "input": "6 7\nappreciate\nappropriate\nacceptance\nace\nacm\nacetylene\nappr iate\na e\na a\nac ce\nace e\nacceptance acceptance\non match", "output": "2\n5\n0\n2\n2\n1\n0\n"}, {"type": "stdin_stdout", "input": "6 7\nappreciate\nappropriate\nacceptance\nace\nacm\nacetylene\nappr eati\na e\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\nProblem\n\nDen, the phone number...
[{"type": "stdin_stdout", "input": "11\n129483884450", "output": "125\n694\n738\n"}, {"type": "stdin_stdout", "input": "11\n128935478480", "output": "123\n689\n745\n"}, {"type": "stdin_stdout", "input": "11\n18396312558", "output": "124\n857\n369\n"}, {"type": "stdin_stdout", "input": "11\n24764186449", "output": "318\...
code_stdio
[ { "content": "You are an expert Python programmer. 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 given three integers $a, b, ...
[{"type": "stdin_stdout", "input": "-30 -1 -1", "output": "-30 -1\n"}, {"type": "stdin_stdout", "input": "-22 -1 -1", "output": "-22 -1\n"}, {"type": "stdin_stdout", "input": "-22 -2 -2", "output": "-22 -2\n"}, {"type": "stdin_stdout", "input": "-2 10 -1", "output": "-2 10\n"}, {"type": "stdin_stdout", "input": "-2 28 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 description\nAs a holida...
[{"type": "stdin_stdout", "input": "2\n2 2\n1 6", "output": "3.000000\n6.000000\n"}, {"type": "stdin_stdout", "input": "2\n-1 21\n-1 13", "output": "19.0\n11.0\n"}, {"type": "stdin_stdout", "input": "2\n0 1\n18 101", "output": "0.0\n118.0\n"}, {"type": "stdin_stdout", "input": "2\n0 13\n-1 13", "output": "12.0\n11.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\nSolve the following coding problem using the programming language python:\n\nRecently Vasya found a golden ti...
[{"type": "stdin_stdout", "input": "100\n0809740931424957283280264749151125408689778966769781910603952566405858112111930579193115510555198933\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "100\n4818858843973413173925628155746968198939484726544502550668299768135121284562358161389491805498328723\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\nPalo Alto is an unusual city bec...
[{"type": "stdin_stdout", "input": "1 4\n2 4 6 10 15\n1 1 1 1 0\n", "output": "0 0 0 1\n"}, {"type": "stdin_stdout", "input": "1 4\n2 4 6 10 14\n1 1 1 1 0\n", "output": "0 0 0 1\n"}, {"type": "stdin_stdout", "input": "1 4\n3 4 6 10 15\n1 1 1 1 0\n", "output": "0 0 0 1\n"}, {"type": "stdin_stdout", "input": "1 4\n2 4 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\nYou are given an angle ang. \n\n...
[{"type": "stdin_stdout", "input": "69\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n", "output": "180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nReziba has many magic gems. Each...
[{"type": "stdin_stdout", "input": "1000000000000000000 100\n", "output": "161502719\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 42\n", "output": "683499162\n"}, {"type": "stdin_stdout", "input": "288230376151711743 100\n", "output": "626842151\n"}, {"type": "stdin_stdout", "input": "1000000000000000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecently Vasya learned that, giv...
[{"type": "stdin_stdout", "input": "5\n1 0\n1 -1\n0 -1\n-1 0\n-1 -1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1\n-751115 -16747294\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1\n-751115 -11499666\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1\n-751115 -14990265\n", "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\nSolve the following coding problem using the programming language python:\n\nKuro has just learned about perm...
[{"type": "stdin_stdout", "input": "69\n1034 414 632 614 62 855 915 385 1098 8 462 1750 1227 960 450 25 1307 578 37 262 482 1143 844 696 1004 1008 70 1137 509 1217 561 557 192 513 792 794 1335 1201 1290 543 698 55 119 536 1088 162 1074 676 246 457 662 595 1054 1252 778 165 703 1222 326 158 145 272 729 381 1087 1261 717...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nHeidi and Doctor Who hopped out ...
[{"type": "stdin_stdout", "input": "1 2\n1156621358\n561572949 6885\n312543334 3629\n", "output": "10514\n"}, {"type": "stdin_stdout", "input": "1 2\n458828651\n209599643 7592\n208642144 8751\n", "output": "16343\n"}, {"type": "stdin_stdout", "input": "1 2\n754725914\n561572949 6885\n312543334 3629\n", "output": "10514...
code_stdio
[ { "content": "You are an expert Python programmer. 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 binary strings...
[{"type": "stdin_stdout", "input": "4\n1010\n11\n10001\n110\n1\n1\n1010101010101\n11110000\n", "output": "1\n3\n0\n0\n"}, {"type": "stdin_stdout", "input": "4\n1010\n11\n10001\n110\n1\n1\n1010101010100\n11110000\n", "output": "1\n3\n0\n0\n"}, {"type": "stdin_stdout", "input": "4\n1010\n11\n10001\n110\n1\n1\n10101010101...
code_stdio
[ { "content": "You are an expert Python programmer. 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 development of a text editor...
[{"type": "stdin_stdout", "input": "21\n(RRRRR)LLLL(RRR)LL(R)\n", "output": "-1 -1 -1 -1 -1 -1 1 1 1 1 1 -1 -1 -1 -1 2 2 2 -1 -1 3 "}, {"type": "stdin_stdout", "input": "11\n'R)R(R)Ra)c\n", "output": "0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1\n"}, {"type": "stdin_stdout", "input": "11\n'R)R(R(Ra)c\n", "output": "0 0 -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\nSolve the following coding problem using the programming language python:\n\nToday, Mezo is playing a game. Z...
[{"type": "stdin_stdout", "input": "13\nLRLLLLRRLLRLR\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "13\nLRLRLLRLLLRLR\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "13\nRLRLLRRLLLLRL\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "13\nLRLRLLRLRLRLL\n", "output": "14\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\nGildong owns a bulgogi restauran...
[{"type": "stdin_stdout", "input": "4\n3 0\n5 1 2\n7 2 5\n10 -1 0\n2 12\n4 7 10\n10 16 20\n3 -100\n100 0 0\n100 -50 50\n200 100 100\n1 100\n122 -100 -1\n", "output": "YES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "4\n3 0\n5 1 2\n7 2 5\n10 -1 0\n2 12\n4 7 10\n10 16 20\n3 -100\n100 0 0\n100 -50 50\n200 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\nSolve the following coding problem using the programming language python:\n\nLee was cleaning his house for t...
[{"type": "stdin_stdout", "input": "5\n10\n0010111111\n4\n0000\n8\n01011111\n10\n1011010100\n1\n0\n", "output": "000111111\n0000\n0011111\n0\n0\n"}, {"type": "stdin_stdout", "input": "5\n10\n0010111111\n4\n1111\n8\n01011111\n10\n1011010100\n1\n0\n", "output": "000111111\n1111\n0011111\n0\n0\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 permutation of length n is an ...
[{"type": "stdin_stdout", "input": "100\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n2\n13\n14\n23\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n90\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n69\n50\n51\n52\n53\n80\n55\n56\n57\n58\n59\n51\n61\n62\n103\n64\n65\n66\n67\n68\n69\n72\n71\n72\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\nTenten runs a weapon shop for ni...
[{"type": "stdin_stdout", "input": "10\n+\n- 3\n+\n+\n+\n+\n- 1\n- 7\n- 9\n- 10\n+\n+\n+\n- 4\n- 5\n- 8\n+\n- 6\n+\n- 2\n", "output": "YES\n3 10 9 7 1 8 5 4 6 2\n"}, {"type": "stdin_stdout", "input": "10\n+\n- 3\n+\n+\n+\n+\n- 2\n- 8\n- 9\n- 10\n+\n+\n+\n- 4\n- 10\n- 1\n+\n+\n- 6\n- 4\n", "output": "NO\n"}, {"type": "s...
code_stdio
[ { "content": "You are an expert Python programmer. 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 sequence a consi...
[{"type": "stdin_stdout", "input": "6\n4 1\n2 3 5 4\n5 6\n1 1 3 4 4\n1 10\n2\n2 10\n11 9\n2 10\n12 11\n5 18\n81 324 218 413 324\n", "output": "\n3\n0\n0\n-1\n1\n3\n"}, {"type": "stdin_stdout", "input": "6\n4 1\n2 3 5 4\n5 6\n1 1 3 4 4\n1 10\n2\n2 10\n11 9\n2 10\n12 11\n5 18\n81 324 218 413 412\n", "output": "3\n0\n0\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 are given an array a of leng...
[{"type": "stdin_stdout", "input": "5\n6\n1 6 1 1 4 4\n2\n1 2\n2\n1 1\n5\n4 5 4 5 4\n6\n2 3 2 1 3 1\n", "output": "\n0\n0\n2\n1\n0\n"}, {"type": "stdin_stdout", "input": "5\n6\n2 6 1 1 4 4\n2\n1 2\n2\n1 1\n5\n4 5 4 5 4\n6\n2 3 2 1 3 1\n", "output": "0\n0\n2\n1\n0\n"}, {"type": "stdin_stdout", "input": "5\n6\n2 6 1 1 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\nOne day little Vasya found mom's...
[{"type": "stdin_stdout", "input": "30 10\nUTNTGOKZYJ\nQHOUHNYZVW\nLTVGHJRZVW\nMZHYHOLZYJ\nERYEUEPZYE\nUZDBFTURYJ\nRVSMQTIZGW\nWDJQHMIRYY\nKCORHQPZYE\nRRPLFOZZVY\nJTXMFNNNYJ\nMVTGGOZZVV\nEHAFFNUZVF\nLBRNWJZNYE\nJVMOHTPZYJ\nWTARFJLZVV\nLVJCWOURVW\nLCLQFJYRVV\nQVBVGNJRYF\nNTZGHOLRYE\nMGQKHOUPYJ\nRRSSBXPZYJ\nRYCRGTLZYJ\nJ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 studies divisibility rules...
[{"type": "stdin_stdout", "input": "30 100\n", "output": "2-type\n2\n"}, {"type": "stdin_stdout", "input": "10 100\n", "output": "2-type\n2\n"}, {"type": "stdin_stdout", "input": "10 10\n", "output": "2-type\n1\n"}, {"type": "stdin_stdout", "input": "10 25\n", "output": "2-type\n2\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\nValera's lifelong ambition was t...
[{"type": "stdin_stdout", "input": "50 50\n6 10\n10 0\n1 9\n8 2\n4 9\n0 7\n2 0\n7 5\n4 8\n13 7\n2 4\n5 6\n6 8\n3 2\n4 6\n7 8\n6 9\n7 7\n7 3\n9 5\n3 10\n7 2\n4 3\n2 0\n6 5\n5 3\n1 7\n1 7\n9 1\n10 4\n10 5\n4 2\n10 10\n0 7\n1 2\n10 1\n1 7\n3 7\n8 7\n5 2\n6 1\n3 1\n4 7\n7 10\n1 5\n10 8\n5 5\n5 1\n3 3\n1 6\n2 1\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\nYou've got two rectangular table...
[{"type": "stdin_stdout", "input": "14 28\n1000000010111011101010010101\n1110010011000011000110001001\n0001100110101000010110110011\n0101101011010101110100100101\n0100100101000011011111100010\n0001111000100000101000110101\n1011100111110101000110101010\n1111011011110100100000101000\n0011111101110001010010001110\n1011100...
code_stdio
[ { "content": "You are an expert Python programmer. 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 \"BerCorp\" company has got ...
[{"type": "stdin_stdout", "input": "100 100\n1 33\n0\n2 35 4\n2 40 78\n1 69\n0\n1 2\n0\n0\n2 81 34\n1 45\n0\n1 87\n1 50\n1 97\n0\n2 100 59\n0\n0\n0\n1 45\n0\n0\n0\n1 6\n1 54\n0\n0\n0\n4 79 96 52 84\n1 86\n0\n0\n0\n0\n0\n0\n0\n0\n3 90 2 80\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n1 2\n0\n1 64\n0\n1 78\n1 82\n0\n0\n0\n0\n0\n1 6\n0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne day Bob got a letter in an e...
[{"type": "stdin_stdout", "input": "21\n280810160 291988863\n760364563 140163983\n16417017 364832782\n400253359 677358550\n597688496 794948223\n400253359 603304541\n589408417 603304541\n385039298 307729574\n293170375 805849550\n140163983 219301181\n732214548 760364563\n307729574 280810160\n131915938 219301181\n4615652 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 cube of size k ×...
[{"type": "stdin_stdout", "input": "46\n", "output": "wwbbwwbbwwbbwwbbwwbbwwbbwwbbwwbbwwbbwwbbwwbbww\nwwbbwwbbwwbbwwbbwwbbwwbbwwbbwwbbwwbbwwbbwwbbww\nbbwwbbwwbbwwbbwwbbwwbbwwbbwwbbwwbbwwbbwwbbwwbb\nbbwwbbwwbbwwbbwwbbwwbbwwbbwwbbwwbbwwbbwwbbwwbb\nwwbbwwbbwwbbwwbbwwbbwwbbwwbbwwbbwwbbwwbbwwbbww\nwwbbwwbbwwbbwwbbwwbbwwbbww...
code_stdio
[ { "content": "You are an expert Python programmer. 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 mathematics, a subsequence is...
[{"type": "stdin_stdout", "input": "KOROXDDWEUVYWJIXSFPEJFYZJDDUXISOFJTIFJSBTWIJQHMTQWLAGGMXTFALRXYCMGZNKYQRCDVTPRQDBAALTWAXTNLDPYWNSFKE\nNHZGRZFMFQGSAYOJTFKMMUPOOQXWCPPAIVRJHINJPHXTTBWRIYNOHMJKBBGXVXYZDBVBBTQRXTOFLBBCXGNICBKAAGOKAYCCJYCW\nXCXLBESCRBNKWYGFDZFKWYNLFAKEWWGRUIAQGNCFDQXCHDBEQDSWSNGVKUFOGGSPFFZWTXGZQMMFJXDW...
code_stdio
[ { "content": "You are an expert Python programmer. 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 Tower of Hanoi is a well-kno...
[{"type": "stdin_stdout", "input": "0 10000 10000\n10000 0 10000\n10000 10000 0\n40\n", "output": "10995116277750000\n"}, {"type": "stdin_stdout", "input": "0 00000 10000\n10000 0 10000\n10000 10000 0\n40\n", "output": "8551757104850000\n"}, {"type": "stdin_stdout", "input": "0 4499 7885\n10073 0 8400\n8724 2588 0\n40\...
code_stdio
[ { "content": "You are an expert Python programmer. 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 holiday. Mashmokh and his b...
[{"type": "stdin_stdout", "input": "17599 51115547\n", "output": "51106749 102213498 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 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\nGiga Tower is the tallest and de...
[{"type": "stdin_stdout", "input": "-1000000000\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "-1325769607\n", "output": "9\n"}, {"type": "stdin_stdout", "input": "-1737641826\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "-408490162\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "-41005838...
code_stdio
[ { "content": "You are an expert Python programmer. 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 participating in a p...
[{"type": "stdin_stdout", "input": "178\n5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 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\nKarafs is some kind of vegetable...
[{"type": "stdin_stdout", "input": "469 128038 4\n143 914502 747\n74 1244223 74477\n835 246699 1021\n7 477777 444444\n", "output": "-1\n-1\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "469 128038 4\n82 914502 747\n80 1244223 74477\n1360 246699 1021\n7 477777 444444\n", "output": "-1\n-1\n-1\n-1\n"}, {"type": "stdin_s...
code_stdio
[ { "content": "You are an expert Python programmer. 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 bought two very rare pain...
[{"type": "stdin_stdout", "input": "965 1000\n606 895\n533 394\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "958 1000\n326 461\n836 674\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "993 1000\n201 307\n692 758\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "808 1000\n583 676\n527 416...
code_stdio
[ { "content": "You are an expert Python programmer. 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 mobile application store has...
[{"type": "stdin_stdout", "input": "1\n100 26\ns................PPPP.CCCCC..UUUUUU.........YYYQQQQQQQ...GGGGG............MMM.....JJJJ..............\n.OOOOOO....EEE....................................................SSSSSS........LLLLLL......NNNIIII.\n......FFFFFF...VVVV..ZZZBBB...KKKKK..WWWWWWWXXX..RRRRRRR......AAAAADD...
code_stdio
[ { "content": "You are an expert Python programmer. 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 spirit of the holidays, S...
[{"type": "stdin_stdout", "input": "200\nNESENEESEESWWWNWWSWSWNWNNWNNESWSWNNWNWNENESENNESSWSESWWSSSEEEESSENNNESSWWSSSSESWSWWNNEESSWWNNWSWSSWWNWNNEENNENWWNESSSENWNESWNESWNESEESSWNESSSSSESESSWNNENENESSWWNNWWSWWNESEENWWWWNWWNWWNENESESSWWSWWSES\nNWNESESSENNNESWNWWSWWWNWSESSSWWNWWNNWSENWSWNENNNWWSWWSWNNNESWWWSSESSWWWSSENWSE...
code_stdio
[ { "content": "You are an expert Python programmer. 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<image>\n\nYou can preview the i...
[{"type": "stdin_stdout", "input": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\n", "output": "-1300\n"}, {"type": "stdin_stdout", "input": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzyzzzzzzzzzzzzzzzzzz\n", "output": "-1299\n"}, {"type": "stdin_stdout", "input": "zzzzzzyzzzzzzzzzzzzzzzzzzzzzzzzyzzzzzzzzzzzzzzzzzz\n", "outp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given n points on the st...
[{"type": "stdin_stdout", "input": "10 10\n2 52 280 401 416 499 721 791 841 943\n246 348 447 486 507 566 568 633 953 986\n", "output": "244\n"}, {"type": "stdin_stdout", "input": "10 10\n4 52 280 401 416 499 721 791 841 943\n246 348 447 486 507 566 568 633 953 986\n", "output": "242\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\nYou are given a string s, consis...
[{"type": "stdin_stdout", "input": "5\nvbidtenkzctwzegvahvxyxuspzjgwutolxuatnxyrygnxyjpfjcrguiwklbrrcujgeuveyuarplsegrescvqmynrgtvpcwaqdjjw\n", "output": "aaaabbcccccddeeeeeefggggggghiijjjjjjkklllmnnnnoppppqqrrrrrrrssstttttu\n"}, {"type": "stdin_stdout", "input": "5\nwjjdqawypvtgrncmqvcsergermprauyevcegjtcrrblkwiugrcjf...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nInnokentiy likes tea very much a...
[{"type": "stdin_stdout", "input": "70000 2748 31589 38411\n", "output": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...
code_stdio
[ { "content": "You are an expert Python programmer. 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 has the sequence consistin...
[{"type": "stdin_stdout", "input": "100 14\n8192 8192 8192 8192 8191 8192 8192 8192 8192 8192 8191 8191 8191 8192 8191 8191 8191 8192 8192 8192 8192 8192 8191 8191 8191 8192 8191 8192 8192 8192 8192 8192 8192 8191 8191 8192 8192 8191 8191 8192 8192 8192 8191 8191 8192 8191 8191 8191 8191 8191 8191 8192 8191 8191 8192 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\nBankopolis is an incredible city...
[{"type": "stdin_stdout", "input": "10 7\n50\n4 7 655\n7 3 220\n3 5 15\n5 10 811\n10 1 490\n1 2 800\n7 10 200\n1 5 377\n1 4 656\n6 4 432\n3 7 563\n1 8 122\n2 9 777\n3 2 157\n5 8 912\n9 8 496\n9 2 740\n3 2 201\n6 7 653\n1 7 554\n6 9 660\n3 2 622\n6 10 227\n9 1 42\n2 6 346\n2 7 944\n3 10 654\n5 2 501\n1 6 786\n3 8 306\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\nSolve the following coding problem using the programming language python:\n\nA few years ago, Hitagi encounte...
[{"type": "stdin_stdout", "input": "100 5\n175 30 124 0 12 111 6 0 119 108 0 38 127 3 151 114 95 54 4 128 91 11 168 120 80 107 18 21 149 169 0 141 195 20 78 157 33 118 17 69 105 130 197 57 74 110 138 84 71 172 132 93 191 44 152 156 24 101 146 26 2 36 143 122 104 42 103 97 39 116 115 0 155 87 53 85 7 43 65 196 136 154 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\nValery is very interested in mag...
[{"type": "stdin_stdout", "input": "150\n0 -2 1 -2 0 0 0 0 -2 0 -2 -1 0 0 2 0 1 -2 1 -1 0 0 0 2 -2 2 -1 0 0 0 -2 0 2 0 1 0 -2 0 -2 -1 -1 -2 -2 2 0 0 1 -2 -2 -1 -2 0 2 1 1 -1 1 0 -2 2 0 0 0 1 -1 0 -2 -1 0 -2 2 1 1 0 0 2 0 0 2 -1 0 0 2 0 2 0 -2 -1 1 -2 1 0 0 -2 -1 -1 0 0 2 -1 -1 -1 -1 -2 0 0 2 -1 -1 1 0 0 1 -1 0 0 -1 2 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn an embassy of a well-known ki...
[{"type": "stdin_stdout", "input": "2 7 1\n10 3 10\n100\n3 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 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nVlad likes to eat in cafes very ...
[{"type": "stdin_stdout", "input": "8\n200000 1 200000 1 200000 1 200000 2\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n100 1000 1000 1000 1000\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "5\n100 1000 1000 1100 1000\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "5\n100 1000 1000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an integer N. Cons...
[{"type": "stdin_stdout", "input": "100\n", "output": "2550\n"}, {"type": "stdin_stdout", "input": "68\n", "output": "1190\n"}, {"type": "stdin_stdout", "input": "75\n", "output": "1444\n"}, {"type": "stdin_stdout", "input": "73\n", "output": "1369\n"}, {"type": "stdin_stdout", "input": "70\n", "output": "1260\n"}, {"t...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nLittle Bob comes to you for cand...
[{"type": "stdin_stdout", "input": "20 1000\n10 20 15 40 50 60 70 80 113 100 200 300 400 500 1031 914 110 120 130 400", "output": "10 13 14\n"}, {"type": "stdin_stdout", "input": "20 1000\n10 35 30 40 29 107 70 80 113 100 43 26 400 617 356 700 110 120 130 400", "output": "6 8 9 16\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\nAmer cabs has released a scheme ...
[{"type": "stdin_stdout", "input": "684\n2924\n7062\n7105\n4716\n9111\n6913\n1421\n9429\n2378\n4540\n9243\n544\n2898\n298\n6607\n4585\n1940\n8635\n5490\n8456\n4913\n5788\n9975\n9536\n1810\n5396\n103\n7349\n438\n1916\n1105\n8690\n6767\n1869\n8552\n4652\n5591\n890\n4494\n4695\n3567\n7945\n3752\n7690\n8886\n4504\n5411\n13...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPeter visited Big Bazar and he w...
[{"type": "stdin_stdout", "input": "10000\n9849 9230 1777 2478 1745 1296 9825 3102 8646 2739 3434 4276 1177 10690 2252 89 9216 5323 6358 9138 3506 7476 2649 8172 84 885 337 251 7113 5283 2881 3314 4514 4658 2145 2611 5954 1970 5714 952 1061 5500 5228 8591 8552 7480 8680 7769 2804 1390 6907 6310 5218 5908 835 1655 6793 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 N integers A_1,\\ldots...
[{"type": "stdin_stdout", "input": "4\n141421356 17320508 22360679 176612", "output": "432841470\n"}, {"type": "stdin_stdout", "input": "4\n141421356 17320508 44188846 176612", "output": "442072669\n"}, {"type": "stdin_stdout", "input": "4\n141421356 15438004 10545868 176612", "output": "309796111\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\nIt is known that the area of a r...
[{"type": "stdin_stdout", "input": "270", "output": "218700\n"}, {"type": "stdin_stdout", "input": "256", "output": "196608\n"}, {"type": "stdin_stdout", "input": "203", "output": "123627\n"}, {"type": "stdin_stdout", "input": "196", "output": "115248\n"}, {"type": "stdin_stdout", "input": "251", "output": "189003\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\nTakahashi likes the sound when h...
[{"type": "stdin_stdout", "input": "011 -1 106", "output": "-1\n"}, {"type": "stdin_stdout", "input": "001 -1 106", "output": "-1\n"}, {"type": "stdin_stdout", "input": "101 -1 106", "output": "-1\n"}, {"type": "stdin_stdout", "input": "111 -1 33", "output": "-1\n"}, {"type": "stdin_stdout", "input": "001 11 13", "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\nSolve the following coding problem using the programming language python:\n\nYou are given strings S and T co...
[{"type": "stdin_stdout", "input": "abcdefghijklmnopqrstuvwxyz\nunomzpgwdtsjxlcvakerfqhybi", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "zyxwvutsrqponmlkjihgfedcba\nunomzpgwdtsjxlcvakerfqhybi", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "zxywvutsrqponmlkjihgfedcba\nunomzpgwdtsjxlcvakerfqhybi", "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\nSolve the following coding problem using the programming language python:\n\nTakahashi, Aoki and Snuke love c...
[{"type": "stdin_stdout", "input": "1390 180 1200", "output": "1\n"}, {"type": "stdin_stdout", "input": "1390 180 2246", "output": "1\n"}, {"type": "stdin_stdout", "input": "1390 180 2625", "output": "0\n"}, {"type": "stdin_stdout", "input": "1390 213 2625", "output": "0\n"}, {"type": "stdin_stdout", "input": "1390 213...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nConstruct an N-gon that satisfie...
[{"type": "stdin_stdout", "input": "8\n90\n90\n270\n90\n90\n90\n270\n90", "output": "0 0\n2 0\n2 1\n3 1\n3 2\n1 2\n1 1\n0 1"}, {"type": "stdin_stdout", "input": "3\n-1\n-4\n-14", "output": "-1\n"}, {"type": "stdin_stdout", "input": "3\n-1\n-1\n-14", "output": "-1\n"}, {"type": "stdin_stdout", "input": "3\n-1\n-2\n-14",...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nIroha has a sequence of N string...
[{"type": "stdin_stdout", "input": "3 3\ndxx\naxx\ndxx", "output": "axxdxxdxx\n"}, {"type": "stdin_stdout", "input": "3 3\ndxx\naxx\nxxd", "output": "axxdxxxxd\n"}, {"type": "stdin_stdout", "input": "3 3\ndxx\nxxa\nxxd", "output": "dxxxxaxxd\n"}, {"type": "stdin_stdout", "input": "3 3\ncxx\nxxa\nxxd", "output": "cxxxxa...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nYuta is addicted to the popular ...
[{"type": "stdin_stdout", "input": "2 2\n0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1\n1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0\n0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1\n1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0\n2 2\n0 0 1 0 1 1 1 1 0 0 1 0 0 0 1 0\n0 1 0 1 0 1 1 1 0 1 0 1 0 0 1 1\n0 0 1 1 1 1 0 0 0 0 1 0 0 0 1 1\n0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0\n5 3\n0 0 0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBrave Ponta has finally arrived ...
[{"type": "stdin_stdout", "input": "2\n1 1\n5 5\n4\n1.0 1.0317956219670807\n1.5068159031079704 3.2675997669892194\n4.150171138530334 2.1332708795299036\n3.0 3.589169796022375\n1\n2.6727744925703703 2.0\n0", "output": "impossible\n4.57812033\nimpossible\n"}, {"type": "stdin_stdout", "input": "2\n1 1\n5 5\n4\n1.0 1.03179...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nSuppose that there are some ligh...
[{"type": "stdin_stdout", "input": "12 5 4\n0 10 0 1\n1 3 0 2\n1 4 0 2\n0 0 0 2\n10 0 0 1\n3 -1 0 2\n5 -1 0 2\n10 10 0 15\n-1 -10 0 1\n10 -10 0 1\n-10 -10 0 1\n10 10 0 1\n0 10 0 240\n10 0 0 200\n10 -2 0 52\n-10 0 0 100\n1 0 0 2\n-1 1 0\n12 5 4\n0 10 0 1\n1 5 0 2\n1 4 0 2\n0 0 0 2\n10 0 0 1\n3 -1 0 2\n5 -1 0 2\n10 10 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\nBackgorund\n\nThe super popular ...
[{"type": "stdin_stdout", "input": "4 5\nBYYGG\nRRRRR\nRRBRR\nYYGGB\n2\n4 1\n3 1", "output": ".....\nBYYBG\n..G..\nYYGBG\n"}, {"type": "stdin_stdout", "input": "4 5\nBYYGG\nRRRRR\nRBRRR\nYYGGB\n2\n3 1\n3 1", "output": ".....\nBYY..\n.B...\nYYB..\n"}, {"type": "stdin_stdout", "input": "4 5\nBYYGG\nRRRRR\nRBRRR\nYYGGB\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 survived several months of e...
[{"type": "stdin_stdout", "input": "9\n315\n0", "output": "2\n11\n"}, {"type": "stdin_stdout", "input": "9\n256\n0", "output": "2\n0\n"}, {"type": "stdin_stdout", "input": "9\n160\n0", "output": "2\n1\n"}, {"type": "stdin_stdout", "input": "9\n213\n0", "output": "2\n3\n"}, {"type": "stdin_stdout", "input": "9\n200\n0",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n2 2\n1 2 0\n...
[{"type": "stdin_stdout", "input": "8 0\n-2 0 1\n12 2 12", "output": "680445551\n"}, {"type": "stdin_stdout", "input": "4 0\n-2 0 -1\n12 2 5", "output": "15400\n"}, {"type": "stdin_stdout", "input": "4 0\n-2 0 1\n12 2 10", "output": "15400\n"}, {"type": "stdin_stdout", "input": "4 0\n1 0 1\n9 -1 -1", "output": "15400\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\nConstraints\n\n* 1 ≤ |V| ≤ 100\n...
[{"type": "stdin_stdout", "input": "15 6\n1 2 2\n1 3 -5\n1 2 3\n1 11 4\n2 0 1\n3 2 12", "output": "0 INF INF INF INF INF INF INF INF INF INF INF INF INF INF\n4 0 3 -5 INF INF INF INF INF INF INF 4 INF INF INF\n1 INF 0 INF INF INF INF INF INF INF INF INF INF INF INF\n13 INF 12 0 INF INF INF INF INF INF INF INF INF INF 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\nYou are standing near a very str...
[{"type": "stdin_stdout", "input": "2\n9 72 53\n98 73 69", "output": "125\n27\n"}, {"type": "stdin_stdout", "input": "2\n9 82 69\n98 116 69", "output": "33\n11\n"}, {"type": "stdin_stdout", "input": "2\n9 82 100\n98 116 69", "output": "1\n11\n"}, {"type": "stdin_stdout", "input": "2\n9 90 80\n100 73 69", "output": "125...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nColossal! — exclaimed Hawk-nose....
[{"type": "stdin_stdout", "input": "9\n3\n2\n2\n228\n1\n1\n0\n16\n1488\n", "output": "4\n2\n2\n16\n2\n2\n1\n2\n32\n"}, {"type": "stdin_stdout", "input": "9\n2\n1\n2\n228\n1\n6\n8\n16\n1488\n", "output": "2\n2\n2\n16\n2\n4\n2\n2\n32\n"}, {"type": "stdin_stdout", "input": "9\n3\n2\n2\n272\n1\n1\n15\n3\n1488\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\nHiasat registered a new account ...
[{"type": "stdin_stdout", "input": "64 2\n1\n1\n2 csxom\n1\n2 csxom\n1\n1\n1\n1\n1\n2 yl\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "61 1\n1\n2 wrlc...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nPolycarp is going to participate...
[{"type": "stdin_stdout", "input": "01:02\n03:02\n", "output": "02:02\n"}, {"type": "stdin_stdout", "input": "11:10\n11:12\n", "output": "11:11\n"}, {"type": "stdin_stdout", "input": "10:00\n11:00\n", "output": "10:30\n"}, {"type": "stdin_stdout", "input": "09:10\n09:12\n", "output": "09:11\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\nNow Serval is a junior high scho...
[{"type": "stdin_stdout", "input": "100\n0 1 0 0 1 0 1 0 0 0 0 0 1 0 0 1 1 1 1 0 0 1 0 1 1 0 1 0 0 0 0 1 0 1 1 1 1 0 0 1 0 1 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 1 1 1 1 0 0 1 0 1 1 1 0 1 0 0 1 1 0 0 1 0 0 1 1 0 0 0 1 1 1 0 0 0 1\n1 2 3 4 2 6 5 5 4 8 10 8 1 14 5 16 3 11 13 11 12 8 11 22 8 17 19 5 15 27 14 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\nAt first, there was a legend rel...
[{"type": "stdin_stdout", "input": "3\n3 2\n1 2 5\n2 1\n1 1000000000\n1 0\n11\n", "output": "3\n500000000\n11\n"}, {"type": "stdin_stdout", "input": "3\n3 2\n1 2 5\n2 1\n1 1000000000\n1 0\n13\n", "output": "3\n500000000\n13\n"}, {"type": "stdin_stdout", "input": "3\n3 2\n0 2 5\n2 1\n1 1000000000\n1 0\n11\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\nYou are given a picture consisti...
[{"type": "stdin_stdout", "input": "9\n5 5\n..*..\n..*..\n*****\n..*..\n..*..\n3 4\n****\n.*..\n.*..\n4 3\n***\n*..\n*..\n*..\n5 5\n*****\n*.*.*\n*****\n..*.*\n..***\n1 4\n****\n5 5\n.....\n..*..\n.***.\n..*..\n.....\n5 3\n...\n.*.\n.*.\n***\n.*.\n3 3\n.*.\n*.*\n.*.\n4 4\n*.**\n....\n*.**\n*.**\n", "output": "0\n0\n0\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 problem was inspired by Pied...
[{"type": "stdin_stdout", "input": "6\n7\ncontest\nntecost\n7\ncontest\nnsttdco\n7\ncontest\ntnsteco\n7\ncontess\ncotestn\n7\ncontest\ncontest\n7\nontestc\ncontest\n", "output": "3\n-1\n4\n-1\n0\n1\n"}, {"type": "stdin_stdout", "input": "6\n7\ncontest\nntecost\n7\ncontest\nnstteco\n7\ncontest\ntnsteco\n7\ncontess\ncote...
code_stdio
[ { "content": "You are an expert Python programmer. 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 non-empty string...
[{"type": "stdin_stdout", "input": "10\nonetwonetwooneooonetwooo\ntwo\none\ntwooooo\nttttwo\nttwwoo\nooone\nonnne\noneeeee\noneeeeeeetwooooo\n", "output": "6\n2 6 10 13 18 21 \n1\n2 \n1\n2 \n1\n2 \n1\n5 \n0\n\n1\n4 \n0\n\n1\n2 \n2\n2 11 \n"}, {"type": "stdin_stdout", "input": "10\nonetwonetwooneooonetwooo\ntwo\none\ntw...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nMishka wants to buy some food in...
[{"type": "stdin_stdout", "input": "6\n1\n10\n19\n9876\n12345\n1000000000\n", "output": "1\n11\n21\n10973\n13716\n1111111111\n"}, {"type": "stdin_stdout", "input": "6\n1\n10\n33\n9876\n12345\n1000000000\n", "output": "1\n11\n36\n10973\n13716\n1111111111\n"}, {"type": "stdin_stdout", "input": "6\n1\n10\n24\n9876\n12345\...
code_stdio
[ { "content": "You are an expert Python programmer. 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 have a tree of n vertices. Y...
[{"type": "stdin_stdout", "input": "28\n2 24\n2 4\n2 3\n1 2\n1 17\n1 21\n1 22\n10 22\n22 23\n22 26\n25 26\n16 25\n7 26\n5 7\n5 8\n5 15\n5 14\n5 12\n10 20\n11 4\n9 25\n6 9\n12 19\n9 28\n13 14\n18 28\n27 28\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "28\n2 24\n2 4\n2 3\n1 2\n1 17\n1 21\n1 22\n10 22\n22 23\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\nWe call two numbers x and y simi...
[{"type": "stdin_stdout", "input": "7\n4\n11 14 16 23\n2\n1 8\n4\n1 1 1 1\n4\n1 4 5 6\n2\n12 13\n6\n0 6 3 10 5 8\n6\n1 12 3 10 0 16\n", "output": "YES\nNO\nYES\nYES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "7\n4\n11 14 16 12\n2\n1 2\n4\n1 1 1 1\n4\n1 2 5 6\n2\n12 13\n6\n1 6 3 10 9 8\n6\n1 12 3 10 5 14\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\nThere are n warriors in a row. T...
[{"type": "stdin_stdout", "input": "23 5\n10 3 4\n2 1 4 11 8 10 5 6 7 9 12 3 14 13 16 18 21 15 17 19 20 23 22\n4 6 3 18 23\n", "output": "64\n"}, {"type": "stdin_stdout", "input": "23 5\n10 3 3\n2 1 4 11 8 10 5 6 7 9 12 3 14 13 16 18 21 15 17 19 20 23 22\n4 6 3 18 23\n", "output": "56\n"}, {"type": "stdin_stdout", "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\nSolve the following coding problem using the programming language python:\n\nYou are given an array a_1, a_2 ...
[{"type": "stdin_stdout", "input": "2\n5\n2 2 2 2 2\n6\n1 3 3 1 2 3\n", "output": "5\n2\n"}, {"type": "stdin_stdout", "input": "2\n5\n2 2 2 4 2\n6\n1 3 3 1 2 3\n", "output": "1\n2\n"}, {"type": "stdin_stdout", "input": "2\n5\n2 2 3 4 2\n6\n2 3 3 1 2 3\n", "output": "0\n2\n"}, {"type": "stdin_stdout", "input": "2\n5\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\n// We decided to drop the legend...
[{"type": "stdin_stdout", "input": "100 5000\n101 168 189 84 24 14 195 139 200 76 73 177 95 9 39 117 32 82 166 37 68 70 123 110 119 129 37 35 200 44 149 46 164 6 71 81 159 160 103 184 139 75 92 162 173 10 129 122 37 150 97 60 4 172 73 146 61 167 127 141 163 132 22 102 127 75 5 104 42 101 162 52 195 140 83 134 142 153 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\nOn a weekend, Qingshan suggests ...
[{"type": "stdin_stdout", "input": "50\n3 10 13 26 31 27 22 20 9 8 33 30 12 21 16 7 17 11 6 24 14 5 19 25 29 36 37 40 41 44 45 46 47 48 49 50 43 42 39 38 35 34 32 28 23 18 15 4 2 1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "40\n5 29 12 16 25 36 18 37 27 32 34 40 20 3 1 24 26 19 33 9 6 22 8 13 15 21 28 7 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\nBajtek is learning to skate on i...
[{"type": "stdin_stdout", "input": "40\n685 711\n433 403\n703 710\n491 485\n616 619\n288 282\n884 871\n367 352\n500 511\n977 982\n51 31\n576 564\n508 519\n755 762\n22 20\n368 353\n232 225\n953 955\n452 436\n311 330\n967 988\n369 364\n791 803\n150 149\n651 661\n118 93\n398 387\n748 766\n852 852\n230 228\n555 545\n515 51...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nOverall there are m actors in Be...
[{"type": "stdin_stdout", "input": "50 25\n8 18 41 25 16 39 2 47 49 37 40 23 3 35 15 7 11 28 22 48 10 17 38 46 44\n4\nswyzirxhx\n28\n43 32 14 5 0 17 25 39 0 0 36 0 0 34 27 22 6 13 26 0 0 41 12 16 0 0 0 23\nzyn\n3\n36 12 47\np\n33\n38 0 35 0 6 20 43 9 15 37 17 23 2 0 0 0 0 0 34 0 28 10 33 0 5 4 7 12 36 46 0 0 45\nycaqpk...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nSquirrel Liss is interested in s...
[{"type": "stdin_stdout", "input": "49\n10 34 58 72 126 166 176 180 198 200 208 228 238 248 302 332 340 344 350 354 380 406 418 428 438 442 482 532 536 544 546 554 596 626 642 682 684 704 714 792 804 820 862 880 906 946 954 966 970\n", "output": "49\n"}, {"type": "stdin_stdout", "input": "44\n1 5 37 97 107 147 185 187 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nLittle penguin Polo loves his ho...
[{"type": "stdin_stdout", "input": "1000 8\n", "output": "339760446\n"}, {"type": "stdin_stdout", "input": "1000 6\n", "output": "834332109\n"}, {"type": "stdin_stdout", "input": "1000 1\n", "output": "760074701\n"}, {"type": "stdin_stdout", "input": "1000 5\n", "output": "583047503\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\nQuite recently, a very smart stu...
[{"type": "stdin_stdout", "input": "1809 1302 7164 6122\n3144121413113111223311232232114144321414421243443243422322144324121433444342231344234443332241322442\n", "output": "420780\n"}, {"type": "stdin_stdout", "input": "1809 1302 8936 6122\n3144121413113111223311232232114144321414421243443243422322144324121433444342231...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nTwilight Sparkle learnt that the...
[{"type": "stdin_stdout", "input": "10 10\n1 2\n3 1\n4 3\n1 5\n6 5\n7 4\n8 7\n9 5\n10 4\n6 10\n1 0 0 1 1 0 1 1 0 0\n", "output": "33\n8 7 4 10 6 5 9 5 9 5 1 3 1 3 1 2 1 2 1 5 6 5 6 10 6 10 4 10 4 7 8 7 8 \n"}, {"type": "stdin_stdout", "input": "10 10\n1 2\n3 1\n4 3\n1 5\n6 1\n7 4\n8 7\n9 5\n10 4\n6 10\n1 0 0 1 1 0 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\nSolve the following coding problem using the programming language python:\n\nDreamoon wants to climb up a sta...
[{"type": "stdin_stdout", "input": "10000 10\n", "output": "5000\n"}, {"type": "stdin_stdout", "input": "24634 6\n", "output": "12318\n"}, {"type": "stdin_stdout", "input": "48898 6\n", "output": "24450\n"}, {"type": "stdin_stdout", "input": "26032 9\n", "output": "13023\n"}, {"type": "stdin_stdout", "input": "20108 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\nVasya studies positional numeral...
[{"type": "stdin_stdout", "input": "1000 1000\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "1000 539\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "999 1000\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "1000 999\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "998 1000\n", "outpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA social network for dogs called...
[{"type": "stdin_stdout", "input": "10 10\n999999991 1000000000\n999999992 1000000000\n999999993 1000000000\n999999994 1000000000\n999999995 1000000000\n999999996 1000000000\n999999997 1000000000\n999999998 1000000000\n999999999 1000000000\n1000000000 1000000000\n", "output": "1999999991\n1999999992\n1999999993\n199999...
code_stdio
[ { "content": "You are an expert Python programmer. 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 Hedgehog recently remembered...
[{"type": "stdin_stdout", "input": "20 20\nABBBAAABABAAAAABBABB\nBABABBAABAABBAAABABB\nBABBBAABAABBABBBBABA\nBAAABBAAABABBABBAAAA\nABBAABAABBBBAAABBBAA\nBAAAAAAAABABBAAAAABB\nAAAAAAABABBBBBAABAAB\nABBBBABAABBAAAAABAAA\nBAAAAABBABAAAAABAAAB\nABABAABABBBABBAABBAA\nBAAABBBAAAABBBBBABAA\nAAABBABABAABBABAABAB\nABBABABABABAA...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nToday Patrick waits for a visit ...
[{"type": "stdin_stdout", "input": "100000000 100000000 100000000\n", "output": "300000000\n"}, {"type": "stdin_stdout", "input": "73676138 150324676 35182\n", "output": "147422640\n"}, {"type": "stdin_stdout", "input": "73676138 230952454 17921\n", "output": "147388118\n"}, {"type": "stdin_stdout", "input": "73676138 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 Romans have attacked again. ...
[{"type": "stdin_stdout", "input": "97\n800 771 66 126 231 306 981 96 196 229 253 35 903 739 461 962 979 347 152 424 934 586 225 838 103 178 524 400 156 149 560 629 697 417 717 738 181 430 611 513 754 595 847 464 356 640 24 854 138 481 98 371 142 460 194 288 220 41 999 581 441 407 301 651 271 226 457 393 980 166 272 25...
code_stdio
[ { "content": "You are an expert Python programmer. 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 revolution took place on the B...
[{"type": "stdin_stdout", "input": "50 50 50 49 26\n205 221 199 178 191 202 180 192 185 204 183 194 215 216 185 200 182 170 190 180 176 204 166 164 194 174\n", "output": "YES\naaaaabbbbccccddddeeffffgggghhhhiiiijjjjkkkkllllmmmmnnnnooooppppqqqqrrrrsssstttuuuvvvvwwwwxxxxyyyyzzz\naaaaabbbbccccddddeeffffgggghhhhiiiijjjjkkk...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nLittle Artem found a grasshopper...
[{"type": "stdin_stdout", "input": "10\n>>>>>>>>><\n1 1 1 1 1 1 1 1 1 6\n", "output": "INFINITE\n"}, {"type": "stdin_stdout", "input": "10\n>>>>>>>>><\n2 1 1 1 1 1 1 1 1 5\n", "output": "INFINITE\n"}, {"type": "stdin_stdout", "input": "10\n>>>>>>>>>>\n1 1 1 1 1 1 2 1 1 100\n", "output": "FINITE\n"}, {"type": "stdin_std...
code_stdio