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\nLeha is planning his journey fro...
[{"type": "stdin_stdout", "input": "100\n3 3 3 4 7 8 8 8 9 9 10 12 12 13 14 14 15 15 16 17 17 20 21 21 22 22 23 25 29 31 36 37 37 38 39 10 41 41 41 42 43 44 45 46 46 47 47 49 49 49 51 52 52 53 54 55 59 59 59 60 62 63 63 64 66 69 70 71 71 72 74 76 76 77 77 78 78 79 80 81 81 82 82 84 85 86 87 87 87 89 91 92 92 92 92 97 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\nAt many competitions that have a...
[{"type": "stdin_stdout", "input": "QDpiNBmCRFWxpdbfGOzvvOcemjructoAdEwegTvbVbfWWRPGyEAxGdDRWVlqNyGWMWHMrHAIZpyxvgaflrsVZhhZRouvpxrKXFZa\n", "output": "5 20\nQDpiNBmCRFWxpdbfGOzv\nvOcemjructoAdEwegTvb\nVbfWWRPGyEAxGdDRWVlq\nNyGWMWHMrHAIZpyxvgaf\nlrsVZhhZRouvpxrKXFZa\n"}, {"type": "stdin_stdout", "input": "QDpiNBmCRFWxp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIlya lives in a beautiful city o...
[{"type": "stdin_stdout", "input": "41\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1\n", "output": "39\n"}, {"type": "stdin_stdout", "input": "41\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 16 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1\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\nIn this problem you have to solv...
[{"type": "stdin_stdout", "input": "-116\n", "output": "0\n1\n1\n0\n1\n1\n0\n1\n1\n1\n1\n1\n0\n1\n0\n1\n1\n1\n0\n1\n1\n1\n1\n1\n0\n1\n0\n1\n1\n1\n"}, {"type": "stdin_stdout", "input": "-132\n", "output": "0\n1\n1\n0\n1\n1\n0\n1\n1\n1\n1\n1\n0\n1\n0\n1\n1\n1\n0\n1\n1\n1\n1\n1\n0\n1\n0\n1\n1\n1\n"}, {"type": "stdin_stdou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 positive integer m, we s...
[{"type": "stdin_stdout", "input": "20\n55 41281776055438 9\n16 67246008464266 18\n69 91089644324882 2\n39 87960930222080 1\n36 88548139500148 9\n18 26775940243079 14\n10 82202722513992 12\n26 89451917375946 20\n69 77900225490904 18\n28 70399749705714 15\n95 177066709280014 8\n54 66641166632298 18\n83 54867502014847 19...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMethodius received an email from...
[{"type": "stdin_stdout", "input": "10\naaaa\naaaab\naaaa\nbaaaa\na\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\na\nb\naaaaa\naaaa\nabcdefghijklmnopqrstuvwxyz\nzabcdefghijklmnopqrstuvwxyz\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaba\naaaaaaaaaaaaaaaaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "50 15000\n142 -300\n20 -298\n560 -300\n1815 -292\n282 -297\n92 -293\n34 -284\n555 -299\n408 -293\n504 -284\n278 -284\n139 -291\n64 -298\n311 -293\n130 -293\n89 -298\n129 -294\n385 -295\n136 -288\n41 -293\n112 -290\n416 -295\n178 -294\n154 -300\n110 -300\n346 -299\n209 -294\n1394 -295...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBoy Dima gave Julian a birthday ...
[{"type": "stdin_stdout", "input": "10\n15 44 84 89 18 86 23 20 62 81\n", "output": "6\n 44 84 18 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWhile doing some spring cleaning...
[{"type": "stdin_stdout", "input": "3\n1 8\n378 590\n0 1001000\n", "output": "26\n3586\n3444149719\n"}, {"type": "stdin_stdout", "input": "3\n0 4\n378 590\n1 1000000\n", "output": "17\n3586\n3439863766\n"}, {"type": "stdin_stdout", "input": "3\n1 4\n323 590\n1 1000000\n", "output": "8\n4758\n3439863766\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\nAn integer sequence is called be...
[{"type": "stdin_stdout", "input": "139 140 2362 2360\n", "output": "YES\n0 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 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAshishgup and FastestFinger play...
[{"type": "stdin_stdout", "input": "100\n101\n102\n103\n104\n105\n106\n107\n108\n109\n110\n111\n112\n113\n114\n15\n116\n117\n118\n119\n120\n121\n122\n123\n124\n125\n126\n127\n128\n100\n130\n131\n132\n133\n134\n135\n136\n137\n120\n139\n140\n141\n142\n143\n144\n145\n146\n147\n148\n149\n150\n151\n152\n153\n154\n155\n156\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\nzscoder has a deck of n+m custom...
[{"type": "stdin_stdout", "input": "1999992 1999927\n", "output": "334593851\n"}, {"type": "stdin_stdout", "input": "1999968 1999941\n", "output": "499830706\n"}, {"type": "stdin_stdout", "input": "1999913 1999918\n", "output": "667185390\n"}, {"type": "stdin_stdout", "input": "2000000 2000000\n", "output": "507914970\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 "}, {"type": "stdin_stdout", "input": "10\n+\n- 1\n+\n+\n+\n+\n- 1\n- 7\n- 9\n- 10\n+\n+\n+\n- 7\n- 10\n- 8\n+\n+\n- 6\n- 2\n", "output": "NO\n"}, {"type": "st...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA robot is standing at the origi...
[{"type": "stdin_stdout", "input": "1000\n", "output": "251001\n"}, {"type": "stdin_stdout", "input": "777\n", "output": "303420\n"}, {"type": "stdin_stdout", "input": "999\n", "output": "501000\n"}, {"type": "stdin_stdout", "input": "998\n", "output": "250000\n"}, {"type": "stdin_stdout", "input": "795\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\nGiven a positive integer k, two ...
[{"type": "stdin_stdout", "input": "6 5 15\n2 5 6 7 8 15\n1 2\n1 1\n5 5\n5 6\n4 5\n", "output": "15\n14\n14\n19\n13\n"}, {"type": "stdin_stdout", "input": "6 5 15\n2 5 6 4 8 15\n1 2\n1 1\n5 5\n5 6\n4 5\n", "output": "15\n14\n14\n19\n16\n"}, {"type": "stdin_stdout", "input": "6 5 13\n2 4 6 7 8 12\n1 4\n1 3\n3 5\n2 2\n5 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe student council is preparing...
[{"type": "stdin_stdout", "input": "100\n9135 4978 1897 347 1835 10266 9413 1712 1496 347 8724 4978 7037 7498 9022 720 6342 927 6927 1712 1897 9022 6046 8549 726 6598 10764 9227 4319 4016 11900 4782 1785 4118 3120 568 9160 3015 195 3317 2463 4186 7037 2373 4025 2677 4118 4025 4168 9808 5235 9160 4308 9570 5607 9227 227...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n2^k teams participate in a playo...
[{"type": "stdin_stdout", "input": "3\n0110?11\n6\n5 1\n6 ?\n7 ?\n1 ?\n5 ?\n1 1\n", "output": "\n1\n2\n3\n3\n5\n4\n"}, {"type": "stdin_stdout", "input": "3\n0110?11\n6\n5 1\n6 ?\n7 ?\n2 ?\n5 ?\n1 1\n", "output": "1\n2\n3\n4\n5\n5\n"}, {"type": "stdin_stdout", "input": "3\n0110?11\n6\n5 1\n6 ?\n6 ?\n1 ?\n5 ?\n1 1\n", "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\nYou are given n segments on the ...
[{"type": "stdin_stdout", "input": "35\n-47 61\n-73 -15\n9 43\n43 -4\n13 -6\n48 -65\n49 -84\n-6 76\n40 6\n-41 11\n-63 -42\n-7 -7\n47 -98\n-17 61\n79 99\n47 -98\n61 31\n85 72\n-50 -17\n-67 45\n14 -50\n-45 61\n-6 -96\n-47 -83\n56 -58\n-24 -15\n14 20\n-95 -82\n47 93\n-4 -7\n70 9\n91 -18\n-71 31\n55 -20\n81 -8\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\nGena loves sequences of numbers....
[{"type": "stdin_stdout", "input": "73\n531 626 701 57 708 511 54 441 297 697 411 253 397 652 21 59 851 561 539 461 629 894 275 417 127 505 433 243 963 247 5 368 969 541 408 485 319 117 441 131 265 357 1 659 267 983 643 285 913 782 813 569 99 781 297 636 645 341 6 17 601 129 509 197 226 105 241 737 86 128 762 647 849\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 an array, consisting ...
[{"type": "stdin_stdout", "input": "100 10\n53 72 2 58 6 48 65 13 43 9 77 1 58 28 49 95 12 11 7 36 51 25 78 20 6 2 69 76 1 47 17 6 91 54 50 66 69 122 74 31 19 96 35 84 163 15 65 73 66 73 29 53 17 47 3 19 4 16 85 6 49 6 57 70 96 19 66 92 86 61 10 21 11 82 13 98 59 96 85 1 13 65 28 34 143 16 88 32 60 50 33 37 36 57 97 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\nYaroslav is playing a game calle...
[{"type": "stdin_stdout", "input": "22 1000\n22 609 173 244 930 515 169 56 192 974 923 749 652 987 145 447 1116 518 630 917\n13 93\n99 6\n41 -54\n67 -85\n24 38\n23 -65\n9 -60\n-29 -78\n-29 -32\n53 -70\n-83 -50\n31 1\n-85 16\n74 95\n-30 10\n114 -67\n70 -74\n-78 -73\n19 17\n97 4\n97 -27\n-4 -48\n", "output": "158000\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\nn soldiers stand in a circle. Fo...
[{"type": "stdin_stdout", "input": "88\n1000 1000 1000 1000 1000 998 998 1000 1000 1000 1000 999 999 1000 1000 1000 999 1000 997 999 997 1000 999 998 1000 999 1000 1000 1000 999 1000 999 999 1000 1000 999 1000 999 1000 1000 998 1000 1000 1000 998 998 1000 1000 999 1000 1000 1000 1000 1000 1000 1000 998 1000 1000 1000 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\nWe'll define S(n) for positive i...
[{"type": "stdin_stdout", "input": "10000000000000000 10000000000000000 1000000000\n", "output": "588235\n"}, {"type": "stdin_stdout", "input": "10000000000000000 10000000000000000 1\n", "output": "588235294117647\n"}, {"type": "stdin_stdout", "input": "10000000010000000 10000000000000000 1\n", "output": "5882352947058...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Physical education teacher a...
[{"type": "stdin_stdout", "input": "100\n246 485 -940 -186 -841 -98 711 429 -154 164 -244 -111 886 -447 22 480 224 -132 927 812 -243 -152 -843 403 -320 -346 -407 827 645 -903 -172 540 -359 498 270 18 374 -52 -983 -164 -707 -242 -159 -825 -889 661 -629 212 849 -891 -622 810 957 897 -110 -293 -257 822 690 369 -914 212 -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\nPeter has a sequence of integers...
[{"type": "stdin_stdout", "input": "99 1999\n1999 1998 1997 1996 1995 1994 1993 1992 1991 1990 1989 1988 1987 1986 1985 1984 1983 1982 1981 1980 1979 1978 1977 1976 1975 1974 1973 1972 1971 1970 1969 1968 1967 1966 1965 1964 1963 1962 1961 1960 1959 1958 1957 1956 1955 1954 1953 1952 1951 1950 1951 1952 1953 1954 1955 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 beautiful garden whe...
[{"type": "stdin_stdout", "input": "10 10\n1 0 1 1 1 1 1 1 1 1\n1 1 1 0 1 1 0 1 1 1\n1 0 1 0 1 1 1 1 0 1\n1 1 0 1 1 1 0 0 0 1\n0 1 0 1 1 1 0 1 1 1\n1 0 1 0 1 0 1 1 1 1\n1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 0 1 1\n1 1 1 1 0 1 1 1 1 1\n0 1 1 1 1 0 1 1 0 1\n10 10\n", "output": "79\n"}, {"type": "stdin_stdout", "input": "10 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBerland National Library has rec...
[{"type": "stdin_stdout", "input": "50\n+ 100\n- 100\n+ 100\n- 100\n+ 100\n- 100\n+ 100\n- 100\n+ 100\n- 100\n+ 100\n- 100\n+ 100\n- 100\n+ 100\n- 100\n+ 100\n- 100\n+ 100\n- 100\n+ 100\n- 100\n+ 100\n- 100\n+ 100\n- 100\n+ 100\n- 100\n+ 100\n- 100\n+ 100\n- 100\n+ 100\n- 100\n+ 100\n- 100\n+ 100\n- 100\n+ 100\n- 100\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPasha has a wooden stick of some...
[{"type": "stdin_stdout", "input": "1757577394\n", "output": "439394348\n"}, {"type": "stdin_stdout", "input": "1925088820\n", "output": "481272204\n"}, {"type": "stdin_stdout", "input": "1967345604\n", "output": "491836400\n"}, {"type": "stdin_stdout", "input": "1976637136\n", "output": "494159283\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 City company developing compu...
[{"type": "stdin_stdout", "input": "1000000000000000000\n", "output": "228571428571428571\n"}, {"type": "stdin_stdout", "input": "1000000010000000000\n", "output": "228571430857142858\n"}, {"type": "stdin_stdout", "input": "1334196189585702396\n", "output": "304959129048160547\n"}, {"type": "stdin_stdout", "input": "13...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn Berland recently a new collec...
[{"type": "stdin_stdout", "input": "5 100000000\n100000000 999999999 1 2 3\n", "output": "14138\n4 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 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\nVasily exited from a store and n...
[{"type": "stdin_stdout", "input": "amhppqxei543.370.32o544.196nocwgxticn776.562nm212.195dcftrrg635.773n646.814.94vrfmjjsgoi405.114k821.983.12rb749.955.62jifmdlgs615.101hg42.083.41gdqififg908.729qrrgopyn684.451avcjul727.150s864.068bcd196.732.37jd349.984.25ghn379.763.11dw881.650.19eysthrm790.534.68gilg546.048qs648.876pd...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSanta Claus has Robot which live...
[{"type": "stdin_stdout", "input": "26\nRURULRRURUDLULDLDLDURLRDDL\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "26\nRURULRRLRUDUULLLDLDURDRDLD\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "26\nLDDRLRUDLDLDLULDURURRLURUR\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "26\nLDDRLRLDLDLDL...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 army, it isn't easy to fo...
[{"type": "stdin_stdout", "input": "50 2\nYES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES\n", "output": "Aa Ab Ac Ad Ae Af Ag Ah Ai Aj Ak Al Am An Ao Ap Aq Ar As At Au Av A...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nZane the wizard is going to perf...
[{"type": "stdin_stdout", "input": "203948 2 14\n203948 203947\n39 47\n4959 3030\n1 203947\n2929 12381\n203944 203948\n203947 203944\n203944 203922\n203922 203948\n2495 20495\n29419 5959\n12949 12\n49 29292\n1 94\n1 203\n", "output": "203947\n"}, {"type": "stdin_stdout", "input": "203948 2 14\n203948 203947\n39 38\n495...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 the way to school, Karen beca...
[{"type": "stdin_stdout", "input": "1 100\n396 314 350 362 287 349 266 289 297 305 235 226 256 385 302 304 253 192 298 238 360 366 163 340 247 395 318 260 252 281 178 188 252 379 212 187 354 232 225 159 290 335 387 234 383 215 356 182 323 280 195 209 263 215 322 262 334 157 189 214 195 386 220 209 177 193 368 174 270 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\nLeha like all kinds of strange t...
[{"type": "stdin_stdout", "input": "7\n4 12 5 15 8 2 5\n2 1 2 0 1 1 1\n", "output": "4 12 2 15 8 5 5\n"}, {"type": "stdin_stdout", "input": "7\n4 12 5 8 10 2 3\n2 1 2 1 1 1 2\n", "output": "4 12 3 10 8 5 2\n"}, {"type": "stdin_stdout", "input": "7\n4 12 5 8 10 2 3\n2 2 2 1 1 1 2\n", "output": "5 4 3 12 10 8 2\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\nPetya has n positive integers a1...
[{"type": "stdin_stdout", "input": "50\ng\nha\nhd\ndi\nac\nfdhhb\ng\nhgeag\nafafb\nb\nb\najjj\ncaiadi\nhciifa\nhb\ncaih\ncdbbi\ngjff\nbfe\neddci\ndijfie\nacjj\nef\ng\njdc\nahg\ne\nhbbh\ncdc\njifdc\ne\nffaehj\nhjhi\ng\neag\nfbbc\nchg\njhahfg\nbb\njd\njchh\nbefifj\nejac\ne\nh\njfhb\nedhe\nf\nag\nca\n", "output": "2673136...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 team of N people. For...
[{"type": "stdin_stdout", "input": "1000000000 5000\n", "output": "642932262\n"}, {"type": "stdin_stdout", "input": "880895728 3537\n", "output": "266659411\n"}, {"type": "stdin_stdout", "input": "602436426 4445\n", "output": "582490088\n"}, {"type": "stdin_stdout", "input": "971407775 4325\n", "output": "905271522\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\nBrio got his house constructed n...
[{"type": "stdin_stdout", "input": "2\n4 7 -2 -1 \n1\n-1 13 -1 -1\n1\n\nDLOMCS", "output": "JUST MISSED\nJUST MISSED\n"}, {"type": "stdin_stdout", "input": "2\n10 1 -1 0 \n1\n2 1 0 0\n0\n\nEAMPMR", "output": "REPLANNING\nJUST MISSED\n"}, {"type": "stdin_stdout", "input": "2\n5 3 -5 5 \n4\n1 2 3 4\n5\n\nSAMPLE", "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\nDarshak (Dark) completed with hi...
[{"type": "stdin_stdout", "input": "5000\n1\n931733\n694459\n638630\n749751\n238760\n886106\n762142\n517246\n642611\n203388\n491378\n369474\n521162\n899808\n515894\n181906\n384967\n89477\n457040\n5247\n595890\n702862\n958156\n466119\n22392\n723141\n665357\n176213\n703604\n515031\n981604\n635338\n723694\n134439\n899293\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 two kind of bots in th...
[{"type": "stdin_stdout", "input": "2\n#A#B#B# A###B#B\n#A#B# #B#A#\n\nSAMPLE", "output": "Yes\nNo\n"}, {"type": "stdin_stdout", "input": "2\n#A#B#B# A###B#B\n#A#B# #B#A#\n\nS@MPLE", "output": "Yes\nNo\n"}, {"type": "stdin_stdout", "input": "2\n#A#B#A# A###B#B\n#A#B# #B#A#\n\nSAMPLE", "output": "No\nNo\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\nMike lost in a coding contest ju...
[{"type": "stdin_stdout", "input": "10\nwtqhatpvjsdgtbmathmxekisqvvgraxntnuuilrugwazxmatumqawysowoxnoucjjyfrkxlqtlrryrkufcuebmuzcroslqcuqhoagzsalktlddflhzpknjjsbzkopolgyzieadelpxyscdfkeuuuggmjfyzxnkfllprmswxhvycydhkiegekosvuqutffyqqpkeigepbctbfbnpfwtrknmgegzlnzegpokzuooxqibylonsmjjxwxdcffotesbvglucalbsvcsgtgyfrjepgisln...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 one is now a days playing ...
[{"type": "stdin_stdout", "input": "2 3 3\n10 20 31\n7 24 100\n11 13\n35 13\n010 1002\n\nSAMPLE", "output": "1\n1\n1\n"}, {"type": "stdin_stdout", "input": "2 3 3\n10 20 30\n3 14 100\n11 10\n19 13\n100 1002\n\nSAMPLE", "output": "1\n1\n3\n"}, {"type": "stdin_stdout", "input": "2 3 3\n10 20 30\n3 14 100\n11 10\n16 13\n1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi, who lives on the numb...
[{"type": "stdin_stdout", "input": "1000000000000000 1000100000000000 1000000000000000", "output": "1000000000000000\n"}, {"type": "stdin_stdout", "input": "1101110100000001 1010101001100000 1110001000000000", "output": "1101110100000001\n"}, {"type": "stdin_stdout", "input": "1101010100000001 1010101000100000 11100010...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConsider sequences \\\\{A_1,...,...
[{"type": "stdin_stdout", "input": "101000 100000", "output": "817082185\n"}, {"type": "stdin_stdout", "input": "101010 100000", "output": "781111243\n"}, {"type": "stdin_stdout", "input": "100000 100000", "output": "742202979"}, {"type": "stdin_stdout", "input": "10 280", "output": "563548517\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\nAtCoder Inc. has decided to lock...
[{"type": "stdin_stdout", "input": "19\n5546189040285140044", "output": "273\n"}, {"type": "stdin_stdout", "input": "19\n4753841743850076999", "output": "311\n"}, {"type": "stdin_stdout", "input": "19\n9039528710159876563", "output": "412\n"}, {"type": "stdin_stdout", "input": "19\n3616863455241776042", "output": "322\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nN of us are going on a trip, by ...
[{"type": "stdin_stdout", "input": "12 -13 -107", "output": "-156\n"}, {"type": "stdin_stdout", "input": "-1719 1 -2", "output": "-1719\n"}, {"type": "stdin_stdout", "input": "10 -2 -141", "output": "-141\n"}, {"type": "stdin_stdout", "input": "10 -2 -162", "output": "-162\n"}, {"type": "stdin_stdout", "input": "10 -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\nFind the number of ways to choos...
[{"type": "stdin_stdout", "input": "-2373", "output": "1407782\n"}, {"type": "stdin_stdout", "input": "-1265", "output": "400056\n"}, {"type": "stdin_stdout", "input": "-1867", "output": "871422\n"}, {"type": "stdin_stdout", "input": "-1056", "output": "278784\n"}, {"type": "stdin_stdout", "input": "-1235", "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\nTakahashi and Aoki are playing a...
[{"type": "stdin_stdout", "input": "4\n3141 59\n26535 897\n93 23\n10502 64", "output": "Takahashi\n"}, {"type": "stdin_stdout", "input": "4\n3141 59\n51840 1663\n73 23\n8462 64", "output": "Takahashi\n"}, {"type": "stdin_stdout", "input": "4\n3141 59\n26535 508\n93 23\n10502 64", "output": "Takahashi\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\nN cells are arranged in a row. S...
[{"type": "stdin_stdout", "input": "50\n10101000010011011110001001111110001101010111100110", "output": "11\n"}, {"type": "stdin_stdout", "input": "50\n10101000010011011010001001111110001101010111100100", "output": "10\n"}, {"type": "stdin_stdout", "input": "50\n10101110010101010110001001011111001001110111000000", "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 three words s_1, s...
[{"type": "stdin_stdout", "input": "resident retsiger number", "output": "RRN\n"}, {"type": "stdin_stdout", "input": "atcoder beginner contdst", "output": "ABC\n"}, {"type": "stdin_stdout", "input": "resident setsiger nuebmr", "output": "RSN\n"}, {"type": "stdin_stdout", "input": "resident setsiger rmbeun", "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 panels arranged in a...
[{"type": "stdin_stdout", "input": "10 3 10\n3 7 2 6 8 4 7 5 1 1000000000", "output": "10000000209\n"}, {"type": "stdin_stdout", "input": "10 3 10\n3 7 2 6 8 4 5 5 1 1000000000", "output": "10000000195\n"}, {"type": "stdin_stdout", "input": "10 3 5\n1 7 2 6 9 4 13 5 1 1000000100", "output": "5000000598\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\nWrite a program which computes t...
[{"type": "stdin_stdout", "input": "34 12\n234598000 42842091", "output": "2 204\n1 10050668864418000\n"}, {"type": "stdin_stdout", "input": "34 12\n234598000 60832539", "output": "2 204\n1 14271191984322000\n"}, {"type": "stdin_stdout", "input": "34 9\n234598000 42842091", "output": "1 306\n1 10050668864418000\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 of the square p...
[{"type": "stdin_stdout", "input": "2\n387\n615", "output": "Case 1:\n1497\n2410\n8081\n3025\n1506\n2680\n1824\n3269\n6863\n1007\nCase 2:\n3782\n3035\n2112\n4605\n2060\n2436\n9340\n2356\n5507\n3270\n"}, {"type": "stdin_stdout", "input": "2\n210\n567", "output": "Case 1:\n441\n1944\n7791\n6996\n9440\n1136\n2904\n4332\n7...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 have decided to introduce an ...
[{"type": "stdin_stdout", "input": "6 7\n1 2 3\n1 4 1\n2 3 5\n4 3 1\n3 6 2\n4 5 2\n5 6 1\n1 6 6\n1 6\n4 3\n4 6\n5 6\n2 6\n2 5", "output": "Yes\nYes\nYes\nYes\nNo\nNo"}, {"type": "stdin_stdout", "input": "6 0\n1 2 5\n1 4 2\n2 3 5\n4 3 1\n3 0 2\n1 5 2\n5 2 1\n1 4 6\n1 2\n4 3\n4 0\n5 6\n1 11\n2 5", "output": "No\nYes\nNo\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAnimation is one of methods for ...
[{"type": "stdin_stdout", "input": "1\ngalaxy_angel 0 1197\n1\ngalaxy_angel\n11\nA 0 600\nB 0 610\nC 0 610\nD 0 931\nE 0 640\nEE 0 700\nF 0 788\nG 0 710\nH 0 710\nI 0 740\nJ 0 750\n2\nB\nH\n42\nnchj 6 2620\nanhnnnmewbktthsrn 4 2515\ngntmdsh 1 1800\nachnnl 4 2540\nhnskirh 0 2200\naonexrcst 0 1700\ndgdys 6 2330\nhdnnara ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nE: Taiyaki-Master and Eater\n\ns...
[{"type": "stdin_stdout", "input": "3 3 0 19\n1 0 1 1\n2 2 1 2 1 2\n3 1 1 2\n4 0 4 1\n5 2 3 1 2 2\n6 2 0 1 3 0", "output": "0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n"}, {"type": "stdin_stdout", "input": "3 3 4 16\n1 0 1 2\n2 2 2 1 2 2\n3 1 0 1\n4 0 2 1\n5 2 2 1 2 2\n6 2 2 1 3 1", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWrite a program which manipulate...
[{"type": "stdin_stdout", "input": "6\n2 1 2\n2 3 5\n0\n0\n0\n1 4\n7\n1 1\n0 3 12\n1 2\n0 4 20\n1 3\n0 3 40\n1 4", "output": "0\n0\n44\n112\n"}, {"type": "stdin_stdout", "input": "6\n2 1 2\n2 3 5\n0\n0\n0\n1 4\n7\n1 1\n0 3 10\n1 2\n0 4 20\n1 3\n0 5 40\n1 4", "output": "0\n0\n40\n150"}, {"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\nBerland shop sells n kinds of ju...
[{"type": "stdin_stdout", "input": "25\n8 CA\n4 AB\n8 CA\n4 CA\n2 CB\n4 CB\n4 CB\n2 AC\n2 CA\n3 BC\n4 AC\n7 AB\n3 CA\n5 BC\n7 CB\n9 CA\n7 AB\n7 CA\n9 BA\n8 AC\n6 BA\n2 AC\n1 CB\n5 AB\n3 AB\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "25\n8 CA\n4 AB\n8 CA\n4 CA\n7 CB\n4 CB\n4 CB\n2 AC\n2 CA\n3 BC\n4 AC\n7 AB...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 special offer in Vasy...
[{"type": "stdin_stdout", "input": "16\n1 1 1 1\n1 1 1 1000000000\n1 1 1000000000 1\n1 1 1000000000 1000000000\n1 1000000000 1 1\n1 1000000000 1 1000000000\n1 1000000000 1000000000 1\n1 1000000000 1000000000 1000000000\n1000000000 1 1 1\n1000000000 1 1 1000000000\n1000000000 1 1000000000 1\n1000000000 1 1000000000 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.\n\nY...
[{"type": "stdin_stdout", "input": "7\n1\n14\n73\n30\n14\n39\n1000000000000000000\n", "output": "0\n-1\n-1\n6\n-1\n-1\n72\n"}, {"type": "stdin_stdout", "input": "7\n1\n7\n73\n52\n14\n39\n1000000000000000000\n", "output": "0\n-1\n-1\n-1\n-1\n-1\n72\n"}, {"type": "stdin_stdout", "input": "7\n1\n14\n73\n30\n14\n27\n100000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "10 4\n2 3 3 1 1 4 1 2 3 3\n", "output": "4\n4 1 3 2\n"}, {"type": "stdin_stdout", "input": "10 4\n2 3 3 1 1 2 1 2 5 3\n", "output": "4\n5 1 3 2\n"}, {"type": "stdin_stdout", "input": "10 4\n2 3 3 2 1 4 1 2 3 3\n", "output": "4\n4 1 3 2\n"}, {"type": "stdin_stdout", "input": "10 4\n2 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou're given two arrays a[1 ... ...
[{"type": "stdin_stdout", "input": "4\n6\n3 7 1 4 1 2\n3 7 3 6 3 2\n5\n1 1 1 1 1\n1 2 1 3 1\n2\n42 42\n42 42\n1\n7\n6\n", "output": "YES\nNO\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "4\n6\n3 7 1 4 1 2\n3 7 3 6 3 2\n5\n1 1 1 1 1\n1 2 1 3 1\n2\n42 42\n42 48\n1\n7\n6\n", "output": "YES\nNO\nYES\nNO\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\nThere are n railway stations in ...
[{"type": "stdin_stdout", "input": "10\n9 4\n5 7\n2 1\n3 4\n2 10\n6 3\n2 5\n1 3\n4 8\n8\n6 8 3\n10 5 3\n2 10 3\n3 5 2\n8 4 3\n1 9 3\n9 5 2\n3 10 2\n", "output": "3 1 2 3 3 3 3 3 3 \n"}, {"type": "stdin_stdout", "input": "10\n3 6\n3 2\n4 1\n1 10\n3 8\n5 2\n6 7\n2 1\n6 9\n7\n9 10 3\n5 7 1\n9 10 3\n7 4 1\n3 10 4\n3 6 4\n5...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTanya wants to go on a journey a...
[{"type": "stdin_stdout", "input": "10\n10 60 12 13 14 15 16 66 18 130\n", "output": "130\n"}, {"type": "stdin_stdout", "input": "10\n8 60 12 13 14 15 16 66 18 130\n", "output": "130\n"}, {"type": "stdin_stdout", "input": "9\n18 11 24 7 18 10 1 20 17\n", "output": "24\n"}, {"type": "stdin_stdout", "input": "9\n4 10 21 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConsider all binary strings of l...
[{"type": "stdin_stdout", "input": "5\n3 3\n010\n001\n111\n4 3\n000\n111\n100\n011\n1 1\n1\n1 1\n0\n3 2\n00\n01\n10\n", "output": "100\n010\n0\n1\n11\n"}, {"type": "stdin_stdout", "input": "5\n3 3\n010\n001\n110\n4 3\n000\n111\n100\n011\n1 1\n1\n1 1\n0\n3 2\n00\n01\n10\n", "output": "100\n010\n0\n1\n11\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\nThis is the hard version of the ...
[{"type": "stdin_stdout", "input": "5\n2\n01\n10\n5\n01011\n01101\n2\n01\n01\n10\n0111011011\n1000110100\n1\n0\n1\n", "output": "3 1 2 1\n6 1 4 3 1 2 1\n0\n11 1 10 8 7 6 1 5 4 1 3 1\n1 1\n"}, {"type": "stdin_stdout", "input": "5\n2\n01\n10\n5\n00011\n11100\n2\n01\n01\n10\n0110011001\n1000000100\n1\n0\n1\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 two sequences a_1,...
[{"type": "stdin_stdout", "input": "1\n45094381 58629867 47778466\n33028864 48902149 69571701\n", "output": "46602292\n"}, {"type": "stdin_stdout", "input": "3\n2 3 2\n3 3 1\n4 0 1\n2 3 0\n0 0 1\n0 0 1\n", "output": "4\n2\n0\n"}, {"type": "stdin_stdout", "input": "3\n2 3 2\n3 3 1\n4 0 1\n3 3 0\n0 0 1\n0 0 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\nThe Bubble Cup hypothesis stood ...
[{"type": "stdin_stdout", "input": "100\n751 557 779 329 39 213 844 289 137 50 951 284 671 474 829 906 736 395 366 22 133 418 552 649 636 109 974 775 852 971 384 945 335 961 472 651 335 543 560 135 85 952 558 838 147 644 688 727 940 978 309 705 409 27 774 951 92 277 835 804 589 103 529 11 304 171 655 378 792 876 1161 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\nPetya loves lucky numbers very m...
[{"type": "stdin_stdout", "input": "3 2\n1 47 47\n", "output": " 2\n"}, {"type": "stdin_stdout", "input": "20 7\n1 4 5 8 47 777777777 1 5 4 8 5 9 5 4 7 4 5 7 7 44474\n", "output": "29172\n"}, {"type": "stdin_stdout", "input": "20 7\n1 4 5 8 47 777777777 1 5 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKawashiro Nitori is a girl who l...
[{"type": "stdin_stdout", "input": "7\n5 2\nrwrwq\n2 0\nac\n3 1\nioi\n4 0\nibdp\n22 0\ndokidoktliteraiureclub\n19 0\necilbiahgaahsmnetmi\n6 2\naaaaaa\n", "output": "NO\nYES\nYES\nYES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "7\n5 1\nqwqwq\n2 0\nab\n3 1\nioi\n4 2\nipcc\n22 0\ncokidokiliteratureclub\n19 11\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\nCirno gave AquaMoon a chessboard...
[{"type": "stdin_stdout", "input": "6\n4\n0110\n6\n011011\n5\n01010\n20\n10001111110110111000\n20\n00110110100110111101\n20\n11001111011000100010\n", "output": "3\n6\n1\n1287\n1287\n1001\n"}, {"type": "stdin_stdout", "input": "6\n4\n0110\n6\n011011\n5\n01010\n20\n10001111110110110000\n20\n00110110100110111101\n20\n1100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Bolek has found a picture...
[{"type": "stdin_stdout", "input": "100 20\n2 3 0 4 0 1 0 6 3 4 3 6 4 6 0 9 0 6 2 7 3 8 7 10 2 9 3 9 5 6 5 10 3 7 1 5 2 8 3 7 2 3 1 6 0 8 3 8 0 4 1 8 3 7 1 9 5 9 5 8 7 8 5 6 5 8 1 9 8 9 8 10 7 10 5 8 6 10 2 6 3 9 2 6 3 10 5 9 3 10 1 3 2 11 8 9 8 10 1 8 7 11 0 9 5 8 4 5 0 7 3 7 5 9 5 10 1 7 1 9 1 6 3 8 2 4 1 4 2 6 0 4 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\nLiLand is a country, consisting ...
[{"type": "stdin_stdout", "input": "5 6\n1 2\n2 3\n3 5\n1 4\n4 5\n1 3\n", "output": "Yes\n1\n1\n2\n2\n2\n2\n"}, {"type": "stdin_stdout", "input": "4 4\n1 2\n2 3\n3 4\n1 3\n", "output": "Yes\n1\n1\n2\n2\n"}, {"type": "stdin_stdout", "input": "4 3\n1 2\n2 3\n3 4\n-1 -2\n", "output": "Yes\n2\n2\n2\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\nA motorcade of n trucks, driving...
[{"type": "stdin_stdout", "input": "20\n7892 2 0 24\n4201 1 2 23\n3667 1 3 22\n6388 1 4 21\n2406 1 5 20\n1148 1 6 19\n3958 1 7 18\n7363 1 8 17\n9025 2 9 15\n1909 1 11 14\n73 1 12 13\n5477 2 13 11\n1869 1 15 10\n107 1 16 9\n523 1 17 8\n6589 2 18 6\n6277 2 20 4\n3881 1 22 3\n5771 1 23 2\n622 2 24 0\n", "output": "20\n1 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\nLet's introduce the designation ...
[{"type": "stdin_stdout", "input": "10000000 1\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "10000000\n"}, {"type": "stdin_stdout", "input": "10000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIahub likes chess very much. He ...
[{"type": "stdin_stdout", "input": "155\n", "output": "12013\nC.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C\n.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C....
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Saratov State University Oly...
[{"type": "stdin_stdout", "input": "20 1\n5 0 4 2 2 3 2 1 2 4 1 3 5 5 5 4 4 1 3 0\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "20 2\n1 4 5 1 3 4 0 5 0 3 3 0 4 0 0 1 4 2 0 4\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "20 1\n5 0 8 2 2 3 2 1 2 4 1 3 5 5 5 4 4 1 3 0\n", "output": "5\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\nTwilight Sparkle was playing Lud...
[{"type": "stdin_stdout", "input": "100001 100000\n", "output": "100000.41802404786\n"}, {"type": "stdin_stdout", "input": "50000 100000\n", "output": "49999.843487110797\n"}, {"type": "stdin_stdout", "input": "99999 100000\n", "output": "99998.418042461126\n"}, {"type": "stdin_stdout", "input": "100000 100000\n", "out...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDreamoon loves summing up someth...
[{"type": "stdin_stdout", "input": "10000000 10000000\n", "output": "425362313\n"}, {"type": "stdin_stdout", "input": "10000000 9999999\n", "output": "930564389\n"}, {"type": "stdin_stdout", "input": "3865975 13943620\n", "output": "633381536\n"}, {"type": "stdin_stdout", "input": "6407688 3000816\n", "output": "895399...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTomorrow Peter has a Biology exa...
[{"type": "stdin_stdout", "input": "30 71\n1 3\n0 9\n3 5\n3 6\n2 4\n2 9\n2 3\n0 8\n2 5\n2 4\n2 3\n3 11\n0 0\n5 7\n0 2\n5 10\n-1 12\n4 7\n0 3\n3 7\n2 3\n4 5\n7 8\n7 7\n2 2\n1 3\n-1 1\n1 5\n3 7\n5 8\n", "output": "YES\n3 0 3 3 2 2 2 0 2 2 2 3 0 5 0 5 -1 4 0 3 2 4 7 7 2 1 -1 1 3 5 "}, {"type": "stdin_stdout", "input": "30...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 a hard day Vitaly got very...
[{"type": "stdin_stdout", "input": "100\nqDpInBmCrFwXpDbFgOzVvOcEmJrUcToAdEwEgTvBvBfWwRpGyEaXgDdRwVlQnYgWmWhMrHaIzPyXvGaFlRsVzHhZrOuVpXrKxFzAmWwPlFtNfPtJxVmLuHjKfYyArHrEnSwSzOvDpQhCgCqLlAcNpGhXrEeFuCmAqIkXyYtSsQwIxJzNiIuTgEbVuWrMwPrAlLyKaZ\n", "output": "42\n"}, {"type": "stdin_stdout", "input": "100\nqDpInBmCrFwXpDbFg...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 n problems. You have es...
[{"type": "stdin_stdout", "input": "15 4789415 23152928 140536\n502422 273992 449428 1752566 753047 681985 857134 243310 478052 77769 936151 642380 464695 281772 964693\n", "output": "15447\n"}, {"type": "stdin_stdout", "input": "15 4789415 22705612 140536\n502422 273992 449428 1752566 753047 681985 857134 243310 47805...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 often travels to hi...
[{"type": "stdin_stdout", "input": "100\n1 2 3 7 5 6 10 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 30 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 1 82 83 84 85 86 87 88 89 90 91 92 93 94 100 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\nZS the Coder loves mazes. Your j...
[{"type": "stdin_stdout", "input": "789730223053602816\n", "output": "41 41 214\n1 3 1 4\n1 4 2 4\n1 5 1 6\n2 4 2 5\n2 5 3 5\n2 6 2 7\n3 1 4 1\n3 5 3 6\n3 6 4 6\n3 7 3 8\n4 1 4 2\n4 2 5 2\n4 6 4 7\n4 7 5 7\n4 8 4 9\n5 1 6 1\n5 2 5 3\n5 3 6 3\n5 7 5 8\n5 8 6 8\n5 9 5 10\n6 2 7 2\n6 3 6 4\n6 4 7 4\n6 8 6 9\n6 9 7 9\n6 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\nPetr wants to make a calendar fo...
[{"type": "stdin_stdout", "input": "11 6\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "11 3\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "10 6\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "12 1\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "12 2\n", "output": "5\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\nWe have a string of letters 'a' ...
[{"type": "stdin_stdout", "input": "abaaaaaabaaaabbabbaaabbbbabababaaaaabbaabbaaaaabbbaababaaaaaaabbbbbaaaaabaababbabababbabbbbaabbaabbabbbabaabbaabbaaaaaab\n", "output": "235606597\n"}, {"type": "stdin_stdout", "input": "baaaaaabbaabbaababababbaabbaabbbbabbabababbabaabaaaaabbbbbaaaaaaababaabbbaaaaabbaabbaaaaababababbb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 shovels in Polycarp'...
[{"type": "stdin_stdout", "input": "499999999\n", "output": "1249999995\n"}, {"type": "stdin_stdout", "input": "452405440\n", "output": "1012027201\n"}, {"type": "stdin_stdout", "input": "1000000000\n", "output": "500000000\n"}, {"type": "stdin_stdout", "input": "499999998\n", "output": "1249999991\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\nAllen has a LOT of money. He has...
[{"type": "stdin_stdout", "input": "1000000000\n", "output": "10000000\n"}, {"type": "stdin_stdout", "input": "1230910855\n", "output": "12309112\n"}, {"type": "stdin_stdout", "input": "1199225057\n", "output": "11992256\n"}, {"type": "stdin_stdout", "input": "1100000000\n", "output": "11000000\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\nToday RK has to transport his N ...
[{"type": "stdin_stdout", "input": "10\n100\n125 70 77 47 113 84 56 91 44 21 7 70 77 106 56 63 14 84 56 14 77 77 63 70 14 7 28 91 63 16 21 105 21 56 62 98 96 84 98 14 7 56 49 28 91 98 7 56 5 162 14 98 49 28 72 8 98 98 26 70 35 44 63 16 7 63 63 56 91 98 35 42 42 35 64 35 42 14 63 21 77 105 42 77 35 34 56 20 28 84 56 60 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem:\n\nBlack and White are ...
[{"type": "stdin_stdout", "input": "96\n4978293 57077654 13779632 39203998 50091653 1\n330056655 133054953 8102946 39409316 45198702 -1\n31241018 58779281 7437322 75012605 16258100 2\n24093030 11941249 14270682 13824288 33816735 0\n930018290 6186719 81620229 939478848 66720282 -1\n35385960 35246971 19141396 3174023 182...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOz is in love with number theory...
[{"type": "stdin_stdout", "input": "1000\n204 188 114 382 862 941 149 900 1435 129 10 845 454 531 993 444 917 639 190 917 462 585 504 946 637 121 275 1337 737 815 753 598 632 871 995 565 920 998 760 659 841 708 769 110 92 926 645 491 931 474 45 62 431 524 65 519 963 128 842 297 800 832 111 1473 1162 284 210 496 445 231...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 hold fa...
[{"type": "stdin_stdout", "input": "130 -2 -1\n-2\n22\n0\n4", "output": "No\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\nNo\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSnuke has N integers: 1,2,\\ldot...
[{"type": "stdin_stdout", "input": "1 -159", "output": "161\n"}, {"type": "stdin_stdout", "input": "119 -1", "output": "121\n"}, {"type": "stdin_stdout", "input": "2 -107", "output": "110\n"}, {"type": "stdin_stdout", "input": "0 -159", "output": "160\n"}, {"type": "stdin_stdout", "input": "112 -1", "output": "114\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\nFor an n \\times n grid, let (r,...
[{"type": "stdin_stdout", "input": "240", "output": "120\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 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\nSnuke has an integer sequence, a...
[{"type": "stdin_stdout", "input": "3\n-3 5 -1", "output": "3\n2 1\n2 3\n2 3\n"}, {"type": "stdin_stdout", "input": "3\n-2 5 -1", "output": "2\n2 3\n3 3"}, {"type": "stdin_stdout", "input": "3\n-2 5 0", "output": "2\n2 1\n2 3\n"}, {"type": "stdin_stdout", "input": "2\n1 -11", "output": "2\n2 1\n2 1\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\nThere is a tree with N vertices,...
[{"type": "stdin_stdout", "input": "5\n0 12 -4 11 -1\n0 2\n1 3\n2 14\n3 5", "output": "1 2 5 \n"}, {"type": "stdin_stdout", "input": "5\n2 12 -2 4 3\n1 2\n1 3\n2 8\n4 5", "output": "1 2 4 \n"}, {"type": "stdin_stdout", "input": "5\n2 1 1 2 5\n1 2\n1 3\n2 4\n2 5", "output": "1 4 5 \n"}, {"type": "stdin_stdout", "input":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n vertical lines in th...
[{"type": "stdin_stdout", "input": "5\n2\n3\n9\n1010\n1001\n0100\n1001\n0010\n1000\n0000\n0101\n1010\n0", "output": "6 4\n"}, {"type": "stdin_stdout", "input": "5\n2\n3\n9\n1010\n1001\n1000\n1001\n0010\n1000\n0000\n0101\n1001\n0", "output": "5 1\n"}, {"type": "stdin_stdout", "input": "5\n2\n3\n9\n1010\n0001\n0000\n1001...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 finally got a magic pot, an ...
[{"type": "stdin_stdout", "input": "8\nwood 5003\nstring 1120\nrice 32\nwater -1\nracket 5000\nmicrophone 4961\nonigiri 140\nguitar 98000\n3\nracket 2 wood string\nonigiri 2 rice water\nguitar 3 tekcar microphone onigiri\nguitar\n1\ncomputer 112750\n-1\ncomputer\n0", "output": "4992\n112750\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\nI am a craftsman specialized in ...
[{"type": "stdin_stdout", "input": "1 -11", "output": "-10\n"}, {"type": "stdin_stdout", "input": "171 2", "output": "173\n"}, {"type": "stdin_stdout", "input": "120 3", "output": "121\n"}, {"type": "stdin_stdout", "input": "109 1", "output": "110\n"}, {"type": "stdin_stdout", "input": "119 1", "output": "120\n"}, {"ty...
code_stdio