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\nPolycarp has n dice d1, d2, ...,... | [{"type": "stdin_stdout", "input": "10 20\n1 1 1 1 5 100 1 1 1 1\n", "output": "0 0 0 0 0 95 0 0 0 0\n"}, {"type": "stdin_stdout", "input": "10 20\n1 1 1 1 10 100 1 1 1 1\n", "output": "0 0 0 0 0 90 0 0 0 0"}, {"type": "stdin_stdout", "input": "10 20\n1 1 1 1 11 100 1 1 1 1\n", "output": "0 0 0 0 0 89 0 0 0 0"}, {"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\nGiant chess is quite common in G... | [{"type": "stdin_stdout", "input": "100 10 30\n40 4\n15 3\n75 3\n88 10\n32 1\n16 5\n81 8\n45 2\n72 8\n11 6\n86 4\n50 2\n9 4\n11 1\n20 3\n47 3\n2 4\n68 3\n90 5\n85 2\n88 1\n88 5\n86 3\n70 9\n49 3\n34 4\n5 7\n77 5\n50 1\n87 5\n", "output": "402737011\n"}, {"type": "stdin_stdout", "input": "100 10 30\n40 4\n15 3\n75 3\n88... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nGennady is one of the best child... | [{"type": "stdin_stdout", "input": "10\n9 8 8\n2 9 33\n10 7 42\n7 2 18\n3 5 82\n9 9 25\n3 2 86\n3 5 49\n5 3 72\n4 4 71\n", "output": "10\n1 2 3 4 5 6 7 8 9 10 "}, {"type": "stdin_stdout", "input": "10\n9 8 8\n2 9 33\n10 7 42\n7 2 18\n3 5 82\n9 9 25\n3 2 86\n3 2 49\n5 3 72\n4 4 71\n", "output": "10\n1 2 3 4 5 6 7 8 9 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\nThere are n beacons located at d... | [{"type": "stdin_stdout", "input": "11\n110 90\n100 70\n148 10\n80 10\n70 1\n60 1\n50 10\n40 1\n30 1\n10 1\n20 1\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "11\n110 61\n100 70\n90 10\n80 10\n70 1\n60 1\n50 10\n40 1\n30 1\n10 1\n20 1\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "11\n110 90\n100 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\nLimak is a little polar bear. He... | [{"type": "stdin_stdout", "input": "50\n1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000\n", "output": "NO"}, {"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\nThe rules of Sith Tournament are... | [{"type": "stdin_stdout", "input": "7\n0.000000 0.311935 0.623164 0.667542 0.225988 0.921559 0.575083\n0.688065 0.000000 0.889215 0.651525 0.119843 0.635314 0.564710\n0.376836 0.110785 0.000000 0.583317 0.175043 0.795995 0.836790\n0.332458 0.348475 0.416683 0.000000 0.263615 0.469602 0.883191\n0.774012 0.880157 0.82495... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 three friend living on... | [{"type": "stdin_stdout", "input": "131 21 80\n", "output": "110\n"}, {"type": "stdin_stdout", "input": "138 23 56\n", "output": "115\n"}, {"type": "stdin_stdout", "input": "149 93 35\n", "output": "114\n"}, {"type": "stdin_stdout", "input": "29 97 147\n", "output": "118\n"}, {"type": "stdin_stdout", "input": "149 93 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\nJon fought bravely to rescue the... | [{"type": "stdin_stdout", "input": "1125899906842623 1125899906742623 1125899906842623\n", "output": "100001\n"}, {"type": "stdin_stdout", "input": "95173251245550 106288351347530 106288351372022\n", "output": "16565\n"}, {"type": "stdin_stdout", "input": "33534354842198 32529564319236 32529564342569\n", "output": "222... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 cities situated alon... | [{"type": "stdin_stdout", "input": "20\n105619866 106083760 106090730 105809555 106115212 105155938 105979518 106075627 106145216 105637844 105925719 105498536 105927000 106155938 106134226 106125969 106130588 105464813 106145509 106114971\n", "output": "241 1\n"}, {"type": "stdin_stdout", "input": "20\n105619866 10608... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 his trip to Luxor and Aswan, ... | [{"type": "stdin_stdout", "input": "90 61394040\n2480 6212 4506 829 8191 797 5336 6722 3178 1007 5849 3061 3588 6684 5983 5452 7654 5321 660 2569 2809 2179 679 4858 6887 2580 6880 6120 4159 5542 4999 8703 2386 8221 7046 1229 1662 4542 7089 3548 4298 1973 1854 2473 5507 241 359 5248 7907 5201 9624 4596 1723 2622 4800 47... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 friend has n cards.\n\nYou ... | [{"type": "stdin_stdout", "input": "kaq7jyialrfp4ilkni90eq8v3amcbygon7py0hb8z26fbl8ss1\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "l3rw91a4m25l8iytxyeuixsegzcbm4h41ornf3pixkrmwznrzc\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "qwertyuioplkjhgfdsazxcvbnmqwertyuioplkjhgfdsazxcvb\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\nArcady is a copywriter. His toda... | [{"type": "stdin_stdout", "input": "thun-thun-thunder, thunder, thunder\nthunder, thun-, thunder\nthun-thun-thunder, thunder\nthunder, feel the thunder\nlightning then the thunder\nthunder, feel the thunder\nlightning then the thunder\nthunder, thunder\n", "output": "183\n"}, {"type": "stdin_stdout", "input": "thun-thu... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 stardate is 1977 and the sci... | [{"type": "stdin_stdout", "input": "10\nXXXOXOOXXX\nOOXXOXXOXO\nOOOOXOOXOX\nXOOXOXOOXX\nXOXXOXOOXX\nOOOXXOXOXX\nOOOXOOOOXO\nOOXOOXXOXX\nXXOXOOXOOX\nOXXXOOXOXX\nXXOXOOXXXO\nXOOXOOXOXX\nXXOXXOOXOO\nOXOOOOXOOO\nXXOXOXXOOO\nXXOOXOXXOX\nXXOOXOXOOX\nXOXOOXOOOO\nOXOXXOXXOO\nXXXOOXOXXX\n", "output": "Yes\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\nMy flatmate, Sayan, once invited... | [{"type": "stdin_stdout", "input": "1\n899 188\n8 12 19 22 27 28 29 34 35 38 42 43 53 54 55 60 61 62 64 65 67 68 75 80 81 84 87 88 89 99 106 111 115 128 140 146 150 151 153 155 156 166 167 174 177 181 185 188 190 194 208 216 219 224 231 242 246 254 257 258 261 266 270 284 286 287 292 302 306 310 312 313 317 322 323 328... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 Bear has received a home ... | [{"type": "stdin_stdout", "input": "10\n99\n3925363 2\n2603576 6\n1234862 8\n1520732 1\n4483784 7\n7951627 7\n5033890 8\n7389953 2\n7757037 9\n9773067 8\n3635251 0\n5114761 8\n1307214 1\n2858867 7\n3249775 8\n629201 9\n730520 4\n2575426 1\n1862434 4\n5440118 4\n5414712 5\n7536692 5\n2483418 0\n6733653 7\n8914139 3\n508... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nSingh is getting bored at work. ... | [{"type": "stdin_stdout", "input": "274 1100990", "output": "176\n"}, {"type": "stdin_stdout", "input": "507 1100990", "output": "150\n"}, {"type": "stdin_stdout", "input": "23 13769055", "output": "11\n"}, {"type": "stdin_stdout", "input": "39 18832367", "output": "13\n"}, {"type": "stdin_stdout", "input": "120 103385... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 deposit of 100 y... | [{"type": "stdin_stdout", "input": "1000010000000000000", "output": "3760\n"}, {"type": "stdin_stdout", "input": "1100010000000000000", "output": "3770\n"}, {"type": "stdin_stdout", "input": "1110000100001111000", "output": "3771\n"}, {"type": "stdin_stdout", "input": "1010010000000010000", "output": "3761\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\nThere are N+1 towns. The i-th to... | [{"type": "stdin_stdout", "input": "3\n0 34 -2 -1\n-1 111 14", "output": "30\n"}, {"type": "stdin_stdout", "input": "3\n0 14 -2 -1\n0 111 14", "output": "11\n"}, {"type": "stdin_stdout", "input": "3\n0 27 -2 -1\n0 111 14", "output": "24\n"}, {"type": "stdin_stdout", "input": "3\n0 27 -3 -1\n0 111 14", "output": "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\nYou are given a string S of leng... | [{"type": "stdin_stdout", "input": "5\naabbc", "output": "17\n"}, {"type": "stdin_stdout", "input": "5\nabcda", "output": "23\n"}, {"type": "stdin_stdout", "input": "5\nbdacf", "output": "31\n"}, {"type": "stdin_stdout", "input": "5\nabcaa", "output": "15\n"}, {"type": "stdin_stdout", "input": "5\nabbaa", "output": "11... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 integers N and M.\... | [{"type": "stdin_stdout", "input": "000001 1010001101", "output": "1010001101\n"}, {"type": "stdin_stdout", "input": "000001 1010011101", "output": "1010011101\n"}, {"type": "stdin_stdout", "input": "000001 1110110010", "output": "1110110010\n"}, {"type": "stdin_stdout", "input": "000001 1110111010", "output": "1110111... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 smallest possible sum o... | [{"type": "stdin_stdout", "input": "10989", "output": "27\n"}, {"type": "stdin_stdout", "input": "79992", "output": "36"}, {"type": "stdin_stdout", "input": "37450", "output": "3\n"}, {"type": "stdin_stdout", "input": "70620", "output": "6\n"}, {"type": "stdin_stdout", "input": "11849", "output": "5\n"}, {"type": "stdi... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 a total of W x H squar... | [{"type": "stdin_stdout", "input": "10 10\n...*....**\n..........\n**....**..\n........*.\n..*.......\n**........\n.*........\n..........\n....*..***\n.*....*...\n10 10\n..*....*..\n.*.*...*..\n*****..*..\n*...*..*..\n*...*..*..\n..........\n.***.*..**\n..*..*...*\n.*...*...*\n****..***.\n2 3\n...\n...\n0 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\nThere are n sheets of square pap... | [{"type": "stdin_stdout", "input": "5\n29\n0", "output": "5\n4 1\n3 2\n3 1 1\n2 2 1\n2 1 1 1\n1 1 1 1 1\n29\n28 1\n27 2\n27 1 1\n26 3\n26 2 1\n26 1 1 1\n25 4\n25 3 1\n25 2 2\n25 2 1 1\n25 1 1 1 1\n24 5\n24 4 1\n24 3 2\n24 3 1 1\n24 2 2 1\n24 2 1 1 1\n24 1 1 1 1 1\n23 6\n23 5 1\n23 4 2\n23 4 1 1\n23 3 3\n23 3 2 1\n23 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\nMathematical expressions appeari... | [{"type": "stdin_stdout", "input": "4\n........4...2..........\n(.1.-.----.)..*.-.5.+.6\n........2..............\n.......3...............\n3\n...3.\n-.---\n...4.\n4\n.3.+.4.*.-.2.\n-------------\n..........2..\n...-.1.-.2...\n2\n...2..3\n(.4..).\n1\n2.+.3.*.5.-.7.+.9\n1\n(.2.+.3.).*.(.5.-.7.).+.9\n3\n.2....3.\n4..+.---... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nHeiankyo is known as a town with... | [{"type": "stdin_stdout", "input": "4\n0 2\n0\n1 2\n2\n0 0 0 1\n0 0 1 0\n4 0\n4\n1 0 0 0\n3 5 2 3\n4 0 4 0\n0 2 0 4\n15 5\n0", "output": "1\nMiserable Hokusai!\nMiserable Hokusai!\n15504\n"}, {"type": "stdin_stdout", "input": "4\n2 2\n0\n1 2\n2\n0 0 0 1\n0 0 1 0\n4 0\n4\n1 0 0 0\n3 3 2 3\n4 0 4 0\n0 2 0 3\n15 3\n0", "o... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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's Random Number\n\nE869120... | [{"type": "stdin_stdout", "input": "5\n15 -1 21 0 20", "output": "2\n"}, {"type": "stdin_stdout", "input": "5\n15 -1 21 0 22", "output": "2\n"}, {"type": "stdin_stdout", "input": "5\n-2 -1 -1 14 2", "output": "2\n"}, {"type": "stdin_stdout", "input": "5\n-2 -1 -1 21 2", "output": "2\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\nNatasha travels around Mars in t... | [{"type": "stdin_stdout", "input": "60\nAND 20 4\nNOT 42\nAND 48 59\nOR 17 7\nIN 0\nAND 36 37\nIN 1\nIN 0\nIN 1\nNOT 47\nAND 52 49\nOR 44 35\nIN 0\nIN 1\nAND 33 56\nIN 0\nIN 0\nIN 0\nAND 31 41\nOR 15 3\nOR 43 46\nIN 1\nXOR 22 28\nIN 1\nIN 1\nIN 1\nAND 34 21\nIN 0\nIN 1\nIN 0\nXOR 51 23\nXOR 10 54\nOR 57 40\nIN 0\nNOT 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\nOnce upon a time there was only ... | [{"type": "stdin_stdout", "input": "10\n1 2 2 4 5 5 6 4 7\n", "output": "1 2 4 5 7 10\n"}, {"type": "stdin_stdout", "input": "10\n1 2 2 4 5 5 6 1 7\n", "output": "1 2 4 5 7 10\n"}, {"type": "stdin_stdout", "input": "10\n1 2 2 4 5 5 9 1 7\n", "output": "1 2 4 5 7 10\n"}, {"type": "stdin_stdout", "input": "10\n1 2 2 4 5 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPetya loves lucky numbers. We al... | [{"type": "stdin_stdout", "input": "100\n3 2 4 2 2 2 3 1 2 3 1 4 1 4 1 2 3 3 3 2 3 1 2 1 2 3 3 4 2 3 1 4 2 1 4 3 1 1 3 2 1 1 4 1 1 4 4 2 2 3 4 4 1 4 3 1 3 1 4 3 2 1 2 4 4 2 2 1 4 2 2 2 3 3 2 2 3 2 2 1 2 3 2 1 4 1 1 1 2 3 2 4 1 1 3 4 2 1 1 1\n", "output": "189\n96 1\n1 8\n8 2\n2 11\n11 3\n3 13\n13 4\n4 15\n15 5\n5 22\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\nToad Ivan has m pairs of integer... | [{"type": "stdin_stdout", "input": "10 10\n1 3\n1 3\n1 3\n1 3\n1 3\n2 3\n1 5\n2 7\n2 7\n2 9\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10 10\n1 3\n1 3\n1 3\n1 3\n1 3\n2 3\n1 5\n2 3\n2 7\n2 9\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10 10\n1 3\n1 3\n1 3\n1 4\n1 3\n2 3\n1 5\n2 7\n2 7\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\nOmkar is building a house. He wa... | [{"type": "stdin_stdout", "input": "21 16\n6\n1 7\n8 8\n9 9\n10 12\n13 15\n16 16\n3\n1 1\n2 8\n9 16\n2\n1 13\n14 16\n3\n1 9\n10 13\n14 16\n3\n1 2\n3 15\n16 16\n2\n1 15\n16 16\n4\n1 6\n7 11\n12 13\n14 16\n4\n1 1\n2 10\n11 15\n16 16\n4\n1 7\n8 9\n10 13\n14 16\n3\n1 2\n3 10\n11 16\n2\n1 9\n10 16\n2\n1 2\n3 16\n3\n1 2\n3 5... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHave you ever used the chat appl... | [{"type": "stdin_stdout", "input": "100 61 71\n11 18 0 47 33 75 91 13 8 21 73 64 50 97 62 50 2 36 68 32 64 74 32 77 81 41 23 44 40 36 45 33 21 68 57 79 75 23 67 37 99 27 30 56 75 62 75 63 46 19 79 42 11 66 21 25 2 12 89 48 75 7 57 85 80 14 82 29 66 47 29 10 1 84 79 39 33 81 73 51 80 67 52 25 38 68 57 53 38 83 83 3 86 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\nThere are n detachments on the s... | [{"type": "stdin_stdout", "input": "23\n-1000000000 -964752353\n-967012509 -1000000000\n34021744 1000000000\n-931956512 -34021744\n-1034253 967204159\n-1034253 -34021744\n-1034253 -1000000000\n-931956512 -1000000000\n-967012509 1000000000\n964944003 1225903\n1000000000 1225903\n-967012509 1225903\n-1034253 -964752353\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 a positive (greate... | [{"type": "stdin_stdout", "input": "61728395061728395061728395061728395061345382132589\n", "output": "5012\n"}, {"type": "stdin_stdout", "input": "80460506176325884697749506233871685211117789752006\n", "output": "3588\n"}, {"type": "stdin_stdout", "input": "72917818180005527197542750304849028146262772062284\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 have a card deck of n cards,... | [{"type": "stdin_stdout", "input": "5 15\n1 2 3 4 5\n5 5 5 5 5 5 5 5 5 5 5 5 5 5 5\n", "output": "5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 "}, {"type": "stdin_stdout", "input": "5 15\n1 2 3 4 5\n5 5 5 5 5 5 5 5 2 5 5 5 5 5 5\n", "output": "5 1 1 1 1 1 1 1 3 2 1 1 1 1 1 "}, {"type": "stdin_stdout", "input": "5 15\n1 2 3 4 5\n5 5 5... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n people participating... | [{"type": "stdin_stdout", "input": "10\n2000000000 2000000000 2000000000\n2000000000 1 2000000000\n2000000000 1 1999999998\n1999999990 1 2000000000\n1033089747 3 2000000000\n2000000000 1520188178 1999999998\n1 1 0\n99990 10 1000000\n100000 20000 2000000000\n998 1 2000000000\n", "output": "1999999999\n199999999900000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 you very well know, the whole... | [{"type": "stdin_stdout", "input": "1\n1000 1010 1000\n", "output": "0.33222591362126247 0.33554817275747506 0.33222591362126247\n"}, {"type": "stdin_stdout", "input": "1\n1000 1011 1000\n", "output": "0.33211557622052473 0.33576884755895053 0.33211557622052473\n"}, {"type": "stdin_stdout", "input": "1000\n1319 1000 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\nThe Little Elephant loves permut... | [{"type": "stdin_stdout", "input": "125 8\n111 69 3 82 24 38 4 39 42 22 92 6 16 10 8 45 17 91 84 53 5 46 124 47 18 57 43 73 114 102 121 105 118 95 104 98 72 20 56 60 123 80 103 70 65 107 67 112 101 108 99 49 12 94 2 68 119 109 59 40 86 116 88 63 110 14 13 120 41 64 89 71 15 35 81 51 113 90 55 122 1 75 54 33 28 7 125 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're a mikemon breeder current... | [{"type": "stdin_stdout", "input": "9 8\n38030772\n697T83S2\n8T626741\n86T02062\n05402864\nT7504180\n3T368E08\n90637446\n12709560\n", "output": "195\n"}, {"type": "stdin_stdout", "input": "9 8\n38030772\n697T83S2\n8T626741\n86T02062\n05402864\nT7504180\n3T368E08\n90637446\n12793622\n", "output": "197\n"}, {"type": "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\nOne day Jeff got hold of an inte... | [{"type": "stdin_stdout", "input": "12\n10 19 7 3 1 8 15 17 14 9 4 5\n", "output": "12\n1 0\n3 0\n4 0\n5 0\n7 0\n8 0\n9 0\n10 0\n14 0\n15 0\n17 0\n19 0\n"}, {"type": "stdin_stdout", "input": "12\n10 19 7 3 1 8 15 17 14 15 4 5\n", "output": "11\n1 0\n3 0\n4 0\n5 0\n7 0\n8 0\n10 0\n14 0\n15 3\n17 0\n19 0\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\nVanya got n cubes. He decided to... | [{"type": "stdin_stdout", "input": "10001\n", "output": "38\n"}, {"type": "stdin_stdout", "input": "10000\n", "output": "38"}, {"type": "stdin_stdout", "input": "8333\n", "output": "35\n"}, {"type": "stdin_stdout", "input": "5943\n", "output": "31\n"}, {"type": "stdin_stdout", "input": "1802\n", "output": "21\n"}, {"ty... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 collects coins: he has exa... | [{"type": "stdin_stdout", "input": "149\n9 120 122 97 93 70 85 56 102 16 103 112 88 84 118 135 113 62 65 19 89 15 108 73 82 21 147 27 115 130 136 6 1 90 29 94 149 17 53 132 99 123 64 95 71 67 141 126 59 8 10 114 121 134 107 87 128 79 66 55 72 39 31 111 60 137 2 4 23 129 133 47 12 54 100 77 98 30 86 125 11 5 45 148 57 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\nYou are given n segments on the ... | [{"type": "stdin_stdout", "input": "10 1\n-260424665 -168566709\n299109864 663179811\n769984405 942516913\n-998905510 -707148023\n-167958021 60599275\n658861231 718845364\n79407402 279078536\n13652788 79756488\n-676213666 -339118351\n-349156760 -258185154\n", "output": "5\n-998905510 -707148023\n-676213666 -168566709\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\nEvery Codeforces user has rating... | [{"type": "stdin_stdout", "input": "50\n67 1\n89 2\n83 1\n-26 1\n88 2\n-22 2\n-98 2\n-83 1\n58 2\n26 2\n-37 1\n-51 2\n29 1\n47 2\n-70 1\n81 2\n36 1\n52 2\n93 2\n-12 2\n-12 1\n5 2\n91 1\n3 1\n-27 1\n18 1\n-60 1\n-15 1\n17 1\n-33 1\n-74 2\n5 2\n-62 2\n72 1\n-22 1\n-58 1\n-9 1\n57 1\n-18 2\n-11 1\n-103 2\n74 2\n-20 2\n21 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nPupils decided to go to amusemen... | [{"type": "stdin_stdout", "input": "100 1000 1000\n0000010100101100110100101111001111111111100101111100111011110001011110110111111010000000101000111000\n", "output": "100000\n"}, {"type": "stdin_stdout", "input": "100 1000 1001\n0000010100101100110100101111001111111111100101111100111011110001011110110111111010000000101... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 some game by Playrix it takes... | [{"type": "stdin_stdout", "input": "1000 1000 1000 1000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1000 1000 1001 1000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1000 1000 1 1000\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1000 1001 1 1000\n", "output": "YES\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\nSometimes Mister B has free even... | [{"type": "stdin_stdout", "input": "12 12 876543210 1000000000\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "10 12 220000011 220000032\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "5 10 1000000000 1000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "11 3 378541409 1077499882\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\nThis is an interactive problem.\... | [{"type": "stdin_stdout", "input": "10 3 632584719\n378382911 9\n978367651 -1\n176599346 7\n557138623 8\n441019502 4\n823417558 2\n244832688 10\n702148024 6\n385598339 5\n357778234 1\n", "output": "? 3\n? 9\n! 978367651\n"}, {"type": "stdin_stdout", "input": "10 3 632584719\n378382911 9\n978367651 -1\n176599346 7\n5571... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nAttention: we lost all the test ... | [{"type": "stdin_stdout", "input": "100000\n", "output": "199998 2\n1 2\n"}, {"type": "stdin_stdout", "input": "99991\n", "output": "199980 2\n1 2\n"}, {"type": "stdin_stdout", "input": "99992\n", "output": "199982 2\n1 2\n"}, {"type": "stdin_stdout", "input": "99971\n", "output": "199940 2\n1 2\n"}, {"type": "stdin_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\nYou are preparing for an exam on... | [{"type": "stdin_stdout", "input": "10 481\n6 25\n0 85\n8 96\n6 7\n1 16\n4 32\n2 5\n3 42\n9 126\n7 70\n", "output": "5\n5\n4 1 10 3 9"}, {"type": "stdin_stdout", "input": "10 481\n6 25\n0 85\n8 96\n6 7\n1 16\n4 32\n2 9\n3 42\n9 126\n7 70\n", "output": "5\n5\n4 1 10 3 9"}, {"type": "stdin_stdout", "input": "10 481\n6 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\nAncient Egyptians are known to h... | [{"type": "stdin_stdout", "input": "107 100000\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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\nMagnus decided to play a classic... | [{"type": "stdin_stdout", "input": "3\n101\n010\n101\n\n101\n010\n101\n\n101\n010\n101\n\n101\n010\n101\n", "output": "18\n"}, {"type": "stdin_stdout", "input": "3\n000\n000\n000\n\n111\n111\n111\n\n111\n111\n111\n\n000\n000\n000\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "3\n101\n010\n101\n\n101\n010\n10... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWalking along a riverside, Mino ... | [{"type": "stdin_stdout", "input": "128 108\n01100.110...000.0001.1.11.11.010010.01100.0.1.01.0.0011.11001.000101...1.0.0..100.0110.0110.0.0101.0.0.0001.01100.110...100.0001\n", "output": "01100011000000000001010110110010010001100000100100000110110010000101000100000010000110001100000101000000001001100111011110010001\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 particular name-recording syst... | [{"type": "stdin_stdout", "input": "10\n100 12\nytdaebgvxwcv\nesqdzhghepjd\nauatffaboemo\nppmwbbkruczy\nybktiiniqdxy\nkoyvegambcby\ndeuacvpcncem\ndexcuwvrblyj\ntvcvbyvofdtb\ndxdzymuxymbg\nweupfgkewdpj\ngtdqvgybjaqy\nfbcfyvsccahy\nesbwylzqscvy\ndgtaaolcxadg\ndgrhcnaaysqs\nczyfvilexdpv\nfbdgbaejbhvv\nshxfzvlaiwel\nwpcnvb... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nRoy has played a lot of Mario th... | [{"type": "stdin_stdout", "input": "1\n48\n\nFKQUAM", "output": "171507379\n"}, {"type": "stdin_stdout", "input": "1\n49\n\nAKOFTM", "output": "568701031\n"}, {"type": "stdin_stdout", "input": "1\n42\n\nSDAPLM", "output": "641778114\n"}, {"type": "stdin_stdout", "input": "1\n45\n\nAKPFSM", "output": "774313734\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\nAnton and Artur are old friends.... | [{"type": "stdin_stdout", "input": "3\n1 1\n1 1\n100 1393\n\nEAPMLS", "output": "YES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "3\n1 1\n1 1\n101 1393\n\nEAPMLS", "output": "YES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "3\n2 4\n1 1\n101 1393\n\nRLMPAE", "output": "YES\nYES\nNO\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\nM-kun is a competitor in AtCoder... | [{"type": "stdin_stdout", "input": "1359", "output": "4\n"}, {"type": "stdin_stdout", "input": "1855", "output": "1\n"}, {"type": "stdin_stdout", "input": "1485", "output": "3\n"}, {"type": "stdin_stdout", "input": "1125", "output": "5\n"}, {"type": "stdin_stdout", "input": "1764", "output": "2\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\nGiven is a positive integer L. F... | [{"type": "stdin_stdout", "input": "999", "output": "36926037.000000000000"}, {"type": "stdin_stdout", "input": "-143", "output": "-108303.962963\n"}, {"type": "stdin_stdout", "input": "-188", "output": "-246098.962963\n"}, {"type": "stdin_stdout", "input": "-1", "output": "-0.037037037037\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\nX and A are integers between 0 a... | [{"type": "stdin_stdout", "input": "11 -1", "output": "10\n"}, {"type": "stdin_stdout", "input": "10 -1", "output": "10\n"}, {"type": "stdin_stdout", "input": "19 -1", "output": "10\n"}, {"type": "stdin_stdout", "input": "-1 -1", "output": "10\n"}, {"type": "stdin_stdout", "input": "10 -2", "output": "10\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\nYou are given three strings A, B... | [{"type": "stdin_stdout", "input": "9\ncjfferent\ndifferent\ntnereffid", "output": "10\n"}, {"type": "stdin_stdout", "input": "9\ntneredfic\nciffeernt\ndifferent", "output": "11\n"}, {"type": "stdin_stdout", "input": "9\ntnedergia\ncifreefnt\ndifsnfeet", "output": "14\n"}, {"type": "stdin_stdout", "input": "9\ntnedergi... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 decided to distrib... | [{"type": "stdin_stdout", "input": "111 136", "output": "1\n"}, {"type": "stdin_stdout", "input": "110 112", "output": "1\n"}, {"type": "stdin_stdout", "input": "011 127", "output": "1\n"}, {"type": "stdin_stdout", "input": "100 13", "output": "1\n"}, {"type": "stdin_stdout", "input": "000 16", "output": "0\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\nThere are N balls in the xy-plan... | [{"type": "stdin_stdout", "input": "5\n20\n14 12 16 17 15", "output": "52\n"}, {"type": "stdin_stdout", "input": "5\n20\n14 10 16 17 15", "output": "56\n"}, {"type": "stdin_stdout", "input": "5\n20\n14 10 20 17 15", "output": "48\n"}, {"type": "stdin_stdout", "input": "5\n20\n14 18 20 17 15", "output": "32\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\nThree poles stand evenly spaced ... | [{"type": "stdin_stdout", "input": "-1 -1 -1", "output": "YES\n"}, {"type": "stdin_stdout", "input": "-2 -3 -4", "output": "YES\n"}, {"type": "stdin_stdout", "input": "-1 -2 -1", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-1 -3 -1", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-2 -4 -1", "output": "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven a sequence of numbers a1, ... | [{"type": "stdin_stdout", "input": "7\n-4\n-4\n6\n14\n15\n-8\n-14\n13\n1\n0\n3\n2\n-3\n-1\n1\n1\n5\n3\n0\n-6\n2\n3\n1100\n-200\n145\n0", "output": "35\n12\n1100\n"}, {"type": "stdin_stdout", "input": "7\n-5\n-4\n6\n8\n15\n-6\n-12\n13\n1\n2\n3\n2\n-2\n-1\n1\n1\n3\n2\n0\n-4\n2\n3\n1100\n-200\n145\n0", "output": "29\n12\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\nCreate a program to determine th... | [{"type": "stdin_stdout", "input": "1 1\n6 0\n3 3\n3 0\n3\n3 11\n1 3\n11 16\n12 4\n5\n15 4\n17 12\n22 5\n7 22\n3\n5 13\n16 2\n16 9\n5 3\n1\n0 0", "output": "b\nd\nd\nd\n"}, {"type": "stdin_stdout", "input": "1 1\n6 0\n3 3\n3 2\n3\n3 11\n1 3\n11 16\n12 7\n5\n15 3\n17 7\n22 5\n7 12\n4\n5 13\n13 2\n16 9\n5 3\n2\n0 0", "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\nWelcome to PC Koshien, players. ... | [{"type": "stdin_stdout", "input": "0000 1000 1000", "output": "2000\n"}, {"type": "stdin_stdout", "input": "0000 0000 1000", "output": "1000\n"}, {"type": "stdin_stdout", "input": "0001 0000 1000", "output": "1001\n"}, {"type": "stdin_stdout", "input": "0101 0000 1000", "output": "1101\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\nproblem\n\nThere are fine icicle... | [{"type": "stdin_stdout", "input": "1 56\n4\n-1\n-1\n-1", "output": "52\n"}, {"type": "stdin_stdout", "input": "2 71\n14\n6\n0\n0", "output": "122\n"}, {"type": "stdin_stdout", "input": "2 30\n14\n6\n3\n0", "output": "40\n"}, {"type": "stdin_stdout", "input": "2 17\n2\n3\n3\n-1", "output": "29\n"}, {"type": "stdin_stdo... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nEvil organizations that attempt ... | [{"type": "stdin_stdout", "input": "4\n0.200 3 1.3409251190635834\n0.38744720010760914 0 0.400\n0.900 1 1.000\n0.400 2 0.902270275623373\n2\n1.4849846876484776 1 1.1947768336367894\n0.500 0 1.000\n9\n0.200 7 0.600\n0.400 0 0.500\n1.540928395286643 8 1.727681009880635\n0.100 4 0.400\n0.200 2 0.600\n0.100 6 1.20624050513... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nGaccho owns an N-side... | [{"type": "stdin_stdout", "input": "5 100 3\n2 2 4 5 100\n50 40 20 10 1", "output": "309\n"}, {"type": "stdin_stdout", "input": "5 100 3\n2 2 4 5 110\n50 40 20 10 1", "output": "319\n"}, {"type": "stdin_stdout", "input": "5 110 3\n2 2 4 5 110\n50 40 20 10 1", "output": "329\n"}, {"type": "stdin_stdout", "input": "5 110... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 grid that consists of... | [{"type": "stdin_stdout", "input": "2 4 1\n2 2\n2 11 0\n2 2\n0 0 0", "output": "Case 1: 2\nCase 2: 512\nCase 3: 1\n"}, {"type": "stdin_stdout", "input": "5 9 1\n2 1\n4 3 0\n2 2\n0 0 0", "output": "Case 1: 195\nCase 2: 0\nCase 3: 1\n"}, {"type": "stdin_stdout", "input": "2 9 1\n2 1\n4 3 0\n2 2\n0 0 0", "output": "Case 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\nYou are given a tree $T$ and an ... | [{"type": "stdin_stdout", "input": "12 2\n1 2\n2 3\n3 4\n4 5\n3 6\n6 7\n7 8\n8 9\n2 10\n10 11\n11 12", "output": "3\n"}, {"type": "stdin_stdout", "input": "12 0\n1 2\n2 3\n3 4\n4 5\n3 6\n6 7\n7 8\n8 9\n6 10\n10 11\n11 12", "output": "4\n"}, {"type": "stdin_stdout", "input": "12 2\n1 2\n2 3\n3 4\n4 5\n3 6\n6 7\n7 8\n3 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\nFind places where a string P is ... | [{"type": "stdin_stdout", "input": "aaaaaa\naa", "output": "0\n1\n2\n3\n4\n"}, {"type": "stdin_stdout", "input": "aaaaab\naa", "output": "0\n1\n2\n3\n"}, {"type": "stdin_stdout", "input": "`aaaaa\naa", "output": "1\n2\n3\n4\n"}, {"type": "stdin_stdout", "input": "aaabaa\naa", "output": "0\n1\n4\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\nWrite a program which reads a re... | [{"type": "stdin_stdout", "input": "-2 -1 0 10 -18", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-2 -1 0 11 -18", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-2 1 3 10 -18", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-2 0 3 10 -18", "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\nYou are given a ternary string (... | [{"type": "stdin_stdout", "input": "100022202\n", "output": "000122202\n"}, {"type": "stdin_stdout", "input": "11222121\n", "output": "11112222\n"}, {"type": "stdin_stdout", "input": "2112120\n", "output": "1112220\n"}, {"type": "stdin_stdout", "input": "100210\n", "output": "001120\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 an array a of leng... | [{"type": "stdin_stdout", "input": "125\n1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0\n", "output": "YES\n26\n120 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\nEgor came up with a new chips pu... | [{"type": "stdin_stdout", "input": "2 3\n0 0 0\n011 1 0\n0 0 1\n011 0 0\n", "output": "28\n1 2 1 1\n1 3 1 1\n2 1 1 1\n2 1 1 1\n2 1 1 1\n1 1 1 2\n1 1 1 2\n1 1 1 2\n1 1 2 1\n1 1 2 1\n1 1 1 2\n2 2 2 1\n2 3 1 3\n1 3 1 2\n1 2 1 3\n1 3 2 3\n1 2 2 2\n2 1 1 1\n2 1 1 1\n1 2 1 1\n2 1 1 1\n1 2 1 1\n1 2 1 1\n1 1 2 1\n1 1 2 1\n1 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\nVasya has a tree consisting of n... | [{"type": "stdin_stdout", "input": "19\n2 1\n3 2\n4 1\n5 1\n6 5\n7 4\n8 1\n9 2\n10 9\n11 9\n12 4\n13 10\n14 2\n15 9\n16 6\n17 13\n18 16\n19 8\n23\n16 259531913 13\n9 484727538 7\n2 174952922 9\n16 555559835 9\n4 835692337 2\n5 656716001 1\n11 981357393 3\n1 281380171 17\n6 150928639 18\n19 431687604 19\n9 609377645 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\n\n\nInput\n\nThe input contains ... | [{"type": "stdin_stdout", "input": "011\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "010\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "46\n", "output": "YES"}, {"type": "stdin_stdout", "input": "43\n", "output": "YES"}, {"type": "stdin_stdout", "input": "30\n", "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\nThere are n students in the firs... | [{"type": "stdin_stdout", "input": "20\ngrkbifiedubnohaektjo\nizxghhzkwfpbsmfsrvzr\njjkvyqppaqotfnqkogvs\ngphjvgjewixdzonunipv\nilfwfngxaiwutzafueot\nirbntjytnvppbgyyllmk\njotpbafckwsufccigskt\njbzfmhjzeoxruiebctsj\nijvxpeybbhrezjuajkkp\njdqriujmuvcvphlcsxfm\nykwqjokeljlnyqpirlvp\nyhcczukakwarzzloccim\nmmygnzejmxmoksms... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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": "izoiweukqszkkhwapzxyotbaarpqxbybsjxilhylbbjbvoedrezyluaabsfzvtxxvncdwxrlfdtfvbfoqwlzqwneimwzpoygfdcldmxdhoxzensxlspituzocvzzrfomhggrwurdccgfoorvhyzsdkpjhwakuoxwdjhzaalanyzwuuqwlrtmvmdraleyusjqdyxuztvc\nizoiweukqszkkhwapzxyotbaarpqxbybsjxilhylbbjbvoedrezyluaabsfzvtxxvncdwxrlfdtfvbfoqw... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nWhen Serezha was three years old... | [{"type": "stdin_stdout", "input": "400\nzzzerrzrzzrozrezooreroeoeezerrzeerooereezeeererrezrororoorrzezoeerrorzrezzrzoerrzorrooerzrzeozrrorzzzzeoeereeroeozezeozoozooereoeorrzoroeoezooeerorreeorezeozeroerezoerooooeerozrrorzozeroereerozeozeoerroroereeeerzzrzeeozrezzozeoooeerzzzorozrzezrrorozezoorzzerzroeeeerorreeoezoeroe... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nConstanze is the smartest girl i... | [{"type": "stdin_stdout", "input": "nnnnnnnnnnnnnnnnnnnnnuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuunnnnnnnnnnnnnnnnnnnnnuuuuuuuuuunnunnu\n", "output": "281595619\n"}, {"type": "stdin_stdout", "input": "unnunnuuuuuuuuuunnnnnnnnnnnnnnnnnnnnnuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuunnnnnnnnnnnnnnnnnnnnn\n", "output": "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\nA string is called beautiful if ... | [{"type": "stdin_stdout", "input": "23\n?\n??\n???\n????\n????\n?a\n?b\n?c\na?\nb?\nc?\n?a?\n?b?\n?c?\na?a\na?b\na?c\nb?a\nb?b\nb?c\nc?a\nc?b\nc?c\n", "output": "a\nab\naba\nabab\nabab\nba\nab\nac\nab\nba\nca\nbab\naba\naca\naba\nacb\nabc\nbca\nbab\nbac\ncba\ncab\ncac\n"}, {"type": "stdin_stdout", "input": "23\n?\n??\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKuroni is the coordinator of the... | [{"type": "stdin_stdout", "input": "8955 1107458\n", "output": "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 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\nLittle Petya very much likes pla... | [{"type": "stdin_stdout", "input": "1110110101111111001111111110111011100001110111011001011111111111011010011111?111111?011111110001010110011111010111100111?111101010011101010?011111101010111111111101111010111?1111111100110110001111101111100100110011101111011110111000111?011110?111110?1011010111101111101111010100111110... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 is an interactive problem.\... | [{"type": "stdin_stdout", "input": "25\n1\n1 1\n1 2\n1 3\n2 3\n2 4\n3 4\n3 5\n3 6\n3 7\n4 7\n5 7\n5 8\n6 8\n7 8\n7 9\n8 9\n9 9\n9 10\n9 11\n9 12\n9 13\n10 13\n11 13\n11 14\n11 15\n11 16\n11 17\n12 17\n13 17\n14 17\n15 17\n15 18\n16 18\n17 18\n17 19\n17 20\n17 21\n18 21\n18 22\n19 22\n20 22\n21 22\n21 23\n22 23\n23 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\nβ Hey folks, how do you like thi... | [{"type": "stdin_stdout", "input": "3\n2 2\n2 1\n3 5\n1 3 3\n3 12\n1 2 2\n", "output": "0\n4\n20\n"}, {"type": "stdin_stdout", "input": "3\n2 2\n1 1\n3 10\n1 2 4\n3 7\n3 2 2\n", "output": "1\n14\n4\n"}, {"type": "stdin_stdout", "input": "3\n2 2\n2 1\n3 5\n1 3 3\n3 24\n1 2 2\n", "output": "0\n4\n44\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\nYou are given a matrix a of size... | [{"type": "stdin_stdout", "input": "10 20 69\n7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7\n7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7\n7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7\n7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7\n7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7\n7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7\n7 7 7 7 7 7 7 7 7 7 7 7 7 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\nAfter your debut mobile game \"N... | [{"type": "stdin_stdout", "input": "3 5\n3 0\n0 1\n2 2\n0 0\n1 1\n2 2\n3 3\n5 4\n", "output": "\nLOSE\nWIN\nLOSE\nWIN\nLOSE\n"}, {"type": "stdin_stdout", "input": "3 5\n3 0\n0 1\n2 2\n0 0\n1 1\n2 2\n3 3\n10 4\n", "output": "LOSE\nWIN\nLOSE\nWIN\nWIN\n"}, {"type": "stdin_stdout", "input": "3 5\n3 0\n0 1\n2 2\n0 0\n1 1\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne day you wanted to read somet... | [{"type": "stdin_stdout", "input": "100\n82 51 81 14 37 17 78 92 64 15 8 86 89 8 87 77 66 10 15 12 100 25 92 47 21 78 20 63 13 49 41 36 41 79 16 87 87 69 3 76 80 60 100 49 70 59 72 8 38 71 45 97 71 14 76 54 81 4 59 46 39 29 92 3 49 22 53 99 59 52 74 31 92 43 42 23 44 9 82 47 7 40 12 9 3 55 37 85 46 22 84 52 98 41 21 77... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nTwo players play a game. The gam... | [{"type": "stdin_stdout", "input": "100 100 1 1 100 100\n", "output": "Second\n"}, {"type": "stdin_stdout", "input": "100 100 10 10 13 14\n", "output": "Second\n"}, {"type": "stdin_stdout", "input": "110 100 1 1 100 100\n", "output": "Second\n"}, {"type": "stdin_stdout", "input": "99 100 24 1 24 100\n", "output": "Seco... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 loves sortin... | [{"type": "stdin_stdout", "input": "47\n703599938 780784195 912005704 957182560 961181825 964876912 996677776 997012583 999004240 999888999 999980718 999997556 999997940 999999989 999999991 999999991 999999999 999999999 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 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\nOnce Bob needed to find the seco... | [{"type": "stdin_stdout", "input": "99\n10 -84 -100 -100 73 -64 -100 -94 33 -100 -100 -100 -100 71 64 24 7 -100 -32 -100 -100 77 -100 62 -12 55 45 -100 -100 -80 -100 -100 -100 -100 -100 -100 -100 -100 -100 -39 -48 -100 -34 47 -100 -100 -100 -100 -100 -77 -100 -100 -100 -100 -100 -100 -52 40 -55 -100 -44 -100 72 33 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\nPetya has got 2n cards, each car... | [{"type": "stdin_stdout", "input": "100\n8 6 7 8 7 9 1 7 3 3 5 8 7 8 5 4 8 4 8 1 2 8 3 7 8 7 6 5 7 9 6 10 7 6 7 8 6 8 9 5 1 5 6 1 4 8 4 8 7 2 6 2 6 6 2 8 2 8 7 1 5 4 4 6 4 9 7 5 1 8 1 3 9 2 3 2 4 7 6 10 5 3 4 10 8 9 6 7 2 7 10 1 8 10 4 1 1 1 2 7 5 4 9 10 6 8 3 1 10 9 9 6 1 5 8 6 6 3 3 4 10 10 8 9 7 10 9 3 7 6 3 2 10 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\nIahub and Iahubina went to a dat... | [{"type": "stdin_stdout", "input": "16663\n", "output": "16663 16664 16665 16666 16667 16668 16669 16670 16671 16672 16673 16674 16675 16676 16677 16678 16679 16680 16681 16682 16683 16684 16685 16686 16687 16688 16689 16690 16691 16692 16693 16694 16695 16696 16697 16698 16699 16700 16701 16702 16703 16704 16705 16706... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nWhen new students come to the Sp... | [{"type": "stdin_stdout", "input": "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||+||=||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\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\nDuring the \"Russian Code Cup\" ... | [{"type": "stdin_stdout", "input": "7\n0 2\n0 3\n0 2\n0 1\n0 10\n1 10\n0 5\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "7\n0 2\n0 5\n0 2\n0 1\n0 10\n1 10\n0 5\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "4\n1 2\n2 100000\n1 2\n-1 100000\n", "output": "NO\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\nAnn has recently started commuti... | [{"type": "stdin_stdout", "input": "1000 1 1000 1000\n", "output": "1000000\n"}, {"type": "stdin_stdout", "input": "1000 3 1000 1000\n", "output": "334000\n"}, {"type": "stdin_stdout", "input": "1000 3 1001 1000\n", "output": "334000\n"}, {"type": "stdin_stdout", "input": "1000 5 1000 1000\n", "output": "200000\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 traveler is planning a water h... | [{"type": "stdin_stdout", "input": "19 2\n1 73\n2 96\n3 24\n5 96\n11 13\n14 96\n16 31\n17 60\n34 69\n39 41\n60 40\n61 96\n66 7\n67 56\n70 28\n73 12\n74 81\n78 77\n95 99\n", "output": "2 3 4 6 7 8 11 12 14 15 17 18 19\n"}, {"type": "stdin_stdout", "input": "20 8\n2 37\n9 28\n13 63\n14 85\n27 27\n29 90\n34 96\n36 60\n41 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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\nNowadays, most of the internet a... | [{"type": "stdin_stdout", "input": "5\n3778 9170\n2657 6649\n4038 9722\n3392 7255\n4890 8961\n", "output": "6938.4627241726648\n"}, {"type": "stdin_stdout", "input": "5\n4787 9531\n3133 9597\n1754 9725\n4335 7124\n4269 7752\n", "output": "7046.2404831918329\n"}, {"type": "stdin_stdout", "input": "5\n2194 6947\n2062 824... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.