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\nLittle Chris is a huge fan of li...
[{"type": "stdin_stdout", "input": "5\n1 0 1 0 1\n0 1 0 1 -1\n1 0 1 0 1\n0 1 0 1 0\n1 0 1 0 1\n7\n3\n2 4\n1 3\n3\n1 5\n1 5\n3\n", "output": "111\n"}, {"type": "stdin_stdout", "input": "5\n1 0 1 0 1\n0 1 0 1 -1\n1 0 1 0 1\n0 0 0 1 0\n1 0 1 0 1\n7\n3\n2 4\n1 3\n3\n1 5\n1 5\n3\n", "output": "111\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\nYou have a string s = s1s2...s|s...
[{"type": "stdin_stdout", "input": "AAAAAAAAAAAAAAAAXAAAAAAAAAAAAAAAAAAAAAAA\n", "output": "17\n1 39\n2 37\n3 35\n4 33\n5 31\n6 29\n7 27\n8 25\n9 23\n10 21\n11 19\n12 17\n13 15\n14 13\n15 11\n16 9\n40 1\n"}, {"type": "stdin_stdout", "input": "GERALDPAVELGERALDPAVEL\n", "output": "2\n11 2\n22 1\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\nAlex doesn't like boredom. That'...
[{"type": "stdin_stdout", "input": "100\n4 8 10 1 8 8 8 1 10 3 1 8 6 8 6 1 10 3 3 3 3 7 2 1 1 4 10 1 7 9 8 10 3 8 6 2 2 6 7 6 10 8 9 11 2 3 10 5 3 9 10 5 10 8 8 5 7 8 2 5 3 9 9 2 7 8 1 10 4 9 2 8 10 19 5 8 5 1 7 3 4 5 2 5 9 3 2 5 6 2 3 10 1 5 9 6 10 4 10 8\n", "output": "383\n"}, {"type": "stdin_stdout", "input": "100\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNew Year is coming in Line World...
[{"type": "stdin_stdout", "input": "120 104\n41 15 95 85 34 11 25 42 65 39 77 80 74 17 66 73 21 14 36 63 63 79 45 24 65 7 63 80 51 21 2 19 78 28 71 2 15 23 17 68 62 18 54 39 43 70 3 46 34 23 41 65 32 10 13 18 10 3 16 48 54 18 57 28 3 30 44 50 15 2 20 22 45 44 3 29 2 27 11 2 12 25 25 31 1 2 32 4 11 30 13 16 26 21 1 13 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\nImplication is a function of two...
[{"type": "stdin_stdout", "input": "200\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 polyline going throug...
[{"type": "stdin_stdout", "input": "1000000000 999999999\n", "output": "999999999.5000000000\n"}, {"type": "stdin_stdout", "input": "1000000000 111111111\n", "output": "111111111.1000000000\n"}, {"type": "stdin_stdout", "input": "999999999 111111111\n", "output": "111111111.0000000000\n"}, {"type": "stdin_stdout", "inp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecently personal training sessi...
[{"type": "stdin_stdout", "input": "7\n4 19 14 8 21 16 2 18 1 15 3 17 13 5 6 10 9 7 12 11 20\n4 19 10\n14 8 3\n21 17 9\n16 6 12\n2 13 20\n18 1 7\n15 5 11\n21\n", "output": "3 4 8 9 10 14 17 1 2 5 6 7 11 12 13 15 16 18 19 20\n"}, {"type": "stdin_stdout", "input": "6\n6 4 10 16 14 11 13 1 7 17 18 15 5 3 9 12 2 8\n6 10 1\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nToday, Wet Shark is given n bish...
[{"type": "stdin_stdout", "input": "10\n646 171\n816 449\n375 934\n950 299\n702 232\n657 81\n885 306\n660 304\n369 371\n798 657\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "10\n646 171\n816 449\n375 934\n950 299\n702 232\n657 81\n885 306\n660 304\n369 371\n886 657\n", "output": "0\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\nLittle Vasya's uncle is a postma...
[{"type": "stdin_stdout", "input": "20\n10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10\n10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10\n", "output": "20\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 \n"}, {"type": "stdin_stdout", "input": "20\n31 16 20 30 19 35 8 11 20 45 10 26 21 39 29 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's call a string \"s-palindro...
[{"type": "stdin_stdout", "input": "mmmmmmmmmmmmmmmm\n", "output": "NIE\n"}, {"type": "stdin_stdout", "input": "mmmmmmmmmmmmmmmn\n", "output": "NIE\n"}, {"type": "stdin_stdout", "input": "nnnnnnnnnnnnn\n", "output": "NIE\n"}, {"type": "stdin_stdout", "input": "onnnnnnnnnnnn\n", "output": "NIE\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\nZS the Coder loves to read the d...
[{"type": "stdin_stdout", "input": "LLVYUOXHBHUZSAPUMQEKWSQAFRKSMEENXDQYOPQFXNNFXSRBGXFUIRBFJDSDKQIDMCPPTWRJOZCRHZYZPBVUJPQXHNALAOCJDTTBDZWYDBVPMNSQNVMLHHUJAOIWFSEJEJSRBYREOZKHEXTBAXPTISPGIPOYBFFEJNAKKXAEPNGKWYGEJTNEZIXAWRSCEIRTKNEWSKSGKNIKDEOVXGYVEVFRGTNDFNWIFDRZQEJQZYIWNZXCONVZAKKKETPTPPXZMIVDWPGXOFODRNJZBATKGXAPXYHT...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA new innovative ticketing syste...
[{"type": "stdin_stdout", "input": "10\n13\n45\n46\n60\n103\n115\n126\n150\n256\n516\n", "output": "20\n20\n10\n0\n20\n0\n0\n20\n20\n10\n"}, {"type": "stdin_stdout", "input": "7\n000\n138\n279\n308\n381\n718\n1185\n", "output": "20\n20\n20\n20\n20\n20\n0\n"}, {"type": "stdin_stdout", "input": "7\n100\n138\n279\n308\n39...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecently, Dima met with Sasha in...
[{"type": "stdin_stdout", "input": "100\n98 52 63 2 18 96 31 58 84 40 41 45 66 100 46 71 26 48 81 20 73 91 68 76 13 93 17 29 64 95 79 21 55 75 19 85 54 51 89 78 15 87 43 59 36 1 90 35 65 56 62 28 86 5 82 49 3 99 33 9 92 32 74 69 27 22 77 16 44 94 34 6 57 70 23 12 61 25 8 11 67 47 83 88 10 14 30 7 97 60 42 37 24 38 53 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\nIt is nighttime and Joe the Elus...
[{"type": "stdin_stdout", "input": "95 97575868 5\n4612 1644 3613 5413 5649 2419 5416 3926 4610 4419 2796 5062 2112 1071 3790 4220 3955 2142 4638 2832 2702 2115 2045 4085 3599 2452 5495 4767 1368 2344 4625 4132 5755 5815 2581 6259 1330 4938 815 5430 1628 3108 4342 3692 2928 1941 3714 4498 4471 4842 1822 867 3395 2587 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\nYou have an array a consisting o...
[{"type": "stdin_stdout", "input": "70\n4 65 66 30 67 16 39 35 57 14 42 51 5 21 61 53 63 13 60 29 68 70 69 46 20 2 43 47 49 52 26 44 54 62 25 19 12 28 27 24 18 36 6 33 7 8 11 1 45 32 64 38 23 22 56 59 15 9 41 37 40 55 3 31 34 48 50 10 17 58\n111111101101111111111110101111111111111101101111010010110011011110010\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\nOleg writes down the history of ...
[{"type": "stdin_stdout", "input": "01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010\n", "output": "1\n245 1 2 3 4 5 6 7 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\nFatland is a town that started w...
[{"type": "stdin_stdout", "input": "910\n845\n320 116\n616 455\n607 218\n542 586\n762 51\n450 256\n475 864\n386 824\n133 762\n695 875\n127 190\n184 350\n187 583\n107 869\n491 470\n130 569\n522 35\n503 448\n846 77\n401 752\n509 443\n819 370\n469 531\n246 619\n665 842\n872 527\n639 299\n309 270\n156 909\n478 233\n526 320...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Magic Fraction for N is one th...
[{"type": "stdin_stdout", "input": "200", "output": "179994270852429\n"}, {"type": "stdin_stdout", "input": "192", "output": "39256782497101\n"}, {"type": "stdin_stdout", "input": "188", "output": "26062642963789\n"}, {"type": "stdin_stdout", "input": "111", "output": "1586718029\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\nOur hero - Maga is going to make...
[{"type": "stdin_stdout", "input": "100\n1000 487 496 124\n1000 955 57 16\n1000 123 729 34\n1000 930 1 0\n1000 617 985 798\n1000 350 499 403\n1000 533 124 30\n1000 851 773 745\n1000 310 521 358\n1000 784 714 498\n1000 159 409 397\n1000 487 589 341\n1000 493 105 72\n1000 190 252 125\n1000 417 241 191\n1000 257 733 109\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecently Watson learned the conc...
[{"type": "stdin_stdout", "input": "10\n50\n30 9 21 27 20 34 13 30 10 22 41 35 14 2 26 26 1 35 29 18 9 40 16 10 24 49 26 28 48 23 28 21 9 26 42 24 30 18 26 23 13 40 5 16 30 26 21 26 45 11\n50\n26 5 7 20 7 19 28 46 30 12 22 20 50 43 23 16 50 15 11 40 43 46 36 46 44 49 9 41 5 44 7 22 1 34 36 48 17 23 3 1 5 25 32 9 5 36 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\nXenny had a list of N strings of...
[{"type": "stdin_stdout", "input": "3\n96 69 70\nqbhesygzakrsloihfigftfojmuhbnnziovfbgorczlrlelcxcnwbwdbvnnnyitoeigmzpixaycjrymltjbcflu\ngmuajozobpgxxvyzeilbzjjwkssjtfvtxhfdcgxwhktxvzbxuyjfwklcatveycdlyfyydksbmuysczboyeqzuf\niqfoijdbcdijccrhqlwpkdctmbqetmnbfjbvbwjcvkxxxecbsyiiadyqzkgzvdpclqyhfnilsohodnmoulsyqf\nqafeydv...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 sequence of integers ...
[{"type": "stdin_stdout", "input": "2\n10000100 10000000", "output": "YES\n"}, {"type": "stdin_stdout", "input": "2\n10000100 10001000", "output": "YES\n"}, {"type": "stdin_stdout", "input": "2\n10000100 10101000", "output": "YES\n"}, {"type": "stdin_stdout", "input": "2\n10010100 10101000", "output": "YES\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\nSnuke received a positive intege...
[{"type": "stdin_stdout", "input": "1000010000000", "output": "2716922731275\n"}, {"type": "stdin_stdout", "input": "1000011000000", "output": "3307289212967\n"}, {"type": "stdin_stdout", "input": "1100011000000", "output": "2999416055122\n"}, {"type": "stdin_stdout", "input": "1110011000000", "output": "3146654438234\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "45\ntgxgtqkyjfhyzutjjdllptdpxrbrylqfqjynmfbfucbio", "output": "10\n"}, {"type": "stdin_stdout", "input": "45\nbnxgtqkykfhyzutjjdllptdpxrtrylqfqjygmfbftcbio", "output": "11\n"}, {"type": "stdin_stdout", "input": "45\nblxhtqkyjehxzutkjdmlpidpurtrzlbfribgmhqfzcyto", "output": "12\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\nSnuke and Raccoon have a heap of...
[{"type": "stdin_stdout", "input": "6\n1 30 1 10 -1 6", "output": "15\n"}, {"type": "stdin_stdout", "input": "6\n1 36 1 10 -1 6", "output": "21\n"}, {"type": "stdin_stdout", "input": "6\n1 36 1 10 -1 1", "output": "26\n"}, {"type": "stdin_stdout", "input": "6\n0 3 3 7 1 24", "output": "10\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\nSnuke has decided to play with a...
[{"type": "stdin_stdout", "input": "149696127901", "output": "27217477801"}, {"type": "stdin_stdout", "input": "86483718001", "output": "15724312364\n"}, {"type": "stdin_stdout", "input": "79402108049", "output": "14436746918\n"}, {"type": "stdin_stdout", "input": "59146214190", "output": "10753857126\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\nAizuwakamatsu City is known as t...
[{"type": "stdin_stdout", "input": "4\n4\n0,1,1500\n0,2,2000\n1,2,600\n2,3,500\n0", "output": "23\n"}, {"type": "stdin_stdout", "input": "4\n4\n0,1,1500\n0,2,2000\n1,2,600\n2,3,400\n0", "output": "22\n"}, {"type": "stdin_stdout", "input": "4\n4\n0,1,0500\n0,2,2000\n0,2,600\n2,3,400\n0", "output": "12\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\nIn 40XX, the Earth was invaded b...
[{"type": "stdin_stdout", "input": "110 5\n111 101 5 5\n110 110 2 3\n-112 -100 5 11\n-208 160 109 90\n-110 159 10 3\n26 11\n15 -1 5 2\n25 0 5 1\n35 0 5 1\n118 0 5 1\n55 0 5 1\n65 0 5 1\n149 -1 5 1\n169 0 1 1\n90 0 5 1\n-19 -1 5 20\n-30 0 500 5\n0 0", "output": "1\n4\n"}, {"type": "stdin_stdout", "input": "100 5\n111 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\nYou are given a string and a num...
[{"type": "stdin_stdout", "input": "pckoshien\n16", "output": "cehikposn\n"}, {"type": "stdin_stdout", "input": "pckoshien\n30", "output": "cehiknops\n"}, {"type": "stdin_stdout", "input": "pckosiien\n26", "output": "ceiiknops\n"}, {"type": "stdin_stdout", "input": "pckoshien\n14", "output": "cehkopisn\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 art exhibition will be held i...
[{"type": "stdin_stdout", "input": "3\n1 12\n26 -1\n2 0", "output": "12\n"}, {"type": "stdin_stdout", "input": "3\n1 11\n80 0\n2 -1", "output": "11\n"}, {"type": "stdin_stdout", "input": "3\n0 17\n14 1\n13 2", "output": "17\n"}, {"type": "stdin_stdout", "input": "3\n0 16\n54 3\n5 1", "output": "16\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\nProf. Hachioji has devised a new...
[{"type": "stdin_stdout", "input": "10\nxi x8i\ni 9i\nc2x2i 5c9x8i\nm2ci 4m7c9x8i\n8c9x8i i\ni 9m9c9x8i\nm i\ni m\nm9i i\n8m9c7xi c1x8i", "output": "2x9i\nx\n7c2x\n5m9c9x9i\n8c9x9i\n9m9c9x9i\nmi\nmi\nmx\n9m8x9i\n"}, {"type": "stdin_stdout", "input": "10\nxi x8i\ni 9i\nc2x3i 5c8x8i\nm2ci 4m7c9x8i\n9c8x9i i\ni 9m9c9x8i\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\nYour task in this problem is to ...
[{"type": "stdin_stdout", "input": "8\n1 1\n4 4\n1 1 4 1\n1 1 1 4\n3 1 3 4\n4 3 5 3\n2 4 3 5\n4 1 4 4\n3 3 2 2\n1 4 4 4\n9\n1 5\n5 1\n5 4 5 1\n1 5 1 1\n1 5 5 1\n2 3 2 4\n5 4 1 5\n1 2 2 1\n4 2 4 1\n1 1 5 1\n5 3 4 3\n11\n5 5\n1 0\n3 1 5 1\n4 3 4 2\n3 1 5 5\n2 3 2 2\n1 0 1 2\n1 2 3 4\n3 4 5 5\n1 0 5 2\n4 0 4 1\n5 5 5 1\n2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nN people run a marathon. There a...
[{"type": "stdin_stdout", "input": "3 2 100\n-1 2 2\n50 -1 1\n83 2 2", "output": "0.9767033300\n0.0000000000\n-0.0005526700\n"}, {"type": "stdin_stdout", "input": "3 5 010\n-1 2 2\n55 0 1\n22 2 2", "output": "0.7318185458\n-0.0000007555\n-0.0143144522\n"}, {"type": "stdin_stdout", "input": "3 3 111\n-1 1 2\n1 0 2\n126 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 a secret agent from the ...
[{"type": "stdin_stdout", "input": "10 1\n3\n1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "7 1\n6\n-1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "11 1\n3\n1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "6 2\n10\n3", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "7 1\n6\n-2",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou received a card with an inte...
[{"type": "stdin_stdout", "input": "62118", "output": "1280\n"}, {"type": "stdin_stdout", "input": "83160", "output": "5120"}, {"type": "stdin_stdout", "input": "10614", "output": "128\n"}, {"type": "stdin_stdout", "input": "20928", "output": "112\n"}, {"type": "stdin_stdout", "input": "11016", "output": "560\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\nFor given two segments s1 and s2...
[{"type": "stdin_stdout", "input": "3\n-1 -1 -1 -6 -1 1 1 1\n0 -1 18 -1 2 0 -1 2\n-11 1 2 -1 0 2 -1 0", "output": "2.0000000000\n1.0000000000\n0.5322001449\n"}, {"type": "stdin_stdout", "input": "3\n-1 -1 -1 -6 -1 1 1 1\n0 -1 18 -1 2 0 -1 2\n-11 1 3 -1 0 2 -1 0", "output": "2.0000000000\n1.0000000000\n0.4242640687\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\nWrite a program which reads a se...
[{"type": "stdin_stdout", "input": "8\n0 12 -4 1 20 -1 2 1\n1\n5 1\n-3 -1", "output": "0 12 -4 1 20 -1 2 1\n"}, {"type": "stdin_stdout", "input": "8\n0 12 -4 1 20 -1 2 0\n0\n5 1\n-3 -1", "output": "0 12 -4 1 20 -1 2 0\n"}, {"type": "stdin_stdout", "input": "8\n0 12 -2 1 20 -1 2 0\n0\n5 3\n-3 -1", "output": "0 12 -2 1 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\nYou are looking at the floor pla...
[{"type": "stdin_stdout", "input": "100000000 100000000 100000000 100000000 1\n100000000 100000000 100001000 1\n", "output": "100000999\n"}, {"type": "stdin_stdout", "input": "100000000 100000000 100000000 100000000 1\n100000000 100000000 100000000 1\n", "output": "99999999\n"}, {"type": "stdin_stdout", "input": "3 6 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\nAcingel is a small town. There w...
[{"type": "stdin_stdout", "input": "20 5\n8 1 13 19 3 14 5 2 4 6 12 18 20 17 16 15 11 10 7 9\n12 18 20 17 16 15 11 10 7 9 8 1 13 19 3 14 5 2 4 6\n5 2 4 6 12 18 20 17 16 15 11 10 7 9 8 1 13 19 3 14\n5 2 4 6 12 18 20 17 16 15 11 10 7 9 8 1 13 19 3 14\n8 1 13 19 3 14 5 2 4 6 12 18 20 17 16 15 11 10 7 9\n", "output": "86\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\nVova's house is an array consist...
[{"type": "stdin_stdout", "input": "187 64\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 got really tired of these ...
[{"type": "stdin_stdout", "input": "22 936\n20 743\n55 46\n83 282\n157 3\n168 979\n241 338\n293 113\n312 292\n333 509\n339 632\n345 149\n347 109\n384 846\n420 151\n619 923\n647 336\n706 935\n726 600\n760 45\n804 126\n810 739\n906 341\n", "output": " 3371\n"}, {...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an array a consist...
[{"type": "stdin_stdout", "input": "42 0\n286046708 375522374 -729242288 -594215986 -417878652 197367358 -252467864 -633931002 396498018 -511564535 -989028451 133570042 -189524845 -823874429 -29495943 609283144 349227466 -228464789 -326269641 -837429605 310547279 27725681 -167613209 -86658444 900798243 607258117 280296...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlice is the leader of the State...
[{"type": "stdin_stdout", "input": "100\n100 48 48 22 21 27 51 43 53 34 54 37 45 37 27 53 39 53 37 44 55 44 31 36 55 47 45 23 40 32 55 54 40 38 30 25 28 20 39 20 53 50 41 26 29 37 42 55 23 27 51 30 39 50 24 30 22 50 56 32 60 45 50 43 27 25 52 59 47 58 28 56 49 39 33 52 26 46 23 42 45 58 42 50 49 25 28 30 46 43 26 32 40...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlice and Bob have received thre...
[{"type": "stdin_stdout", "input": "4\n1 3 4\n1 10 100\n10000000000000000 10000000000000000 10000000000000000\n23 34 45\n", "output": "4\n55\n15000000000000000\n51\n"}, {"type": "stdin_stdout", "input": "4\n1 3 4\n1 10 100\n10000000000000000 10000000000000000 10000000000000000\n23 34 22\n", "output": "4\n55\n1500000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp is reading a book consi...
[{"type": "stdin_stdout", "input": "7\n1 1\n10 1\n100 3\n1024 14\n998244353 1337\n123 144\n1234312817382646 13\n", "output": "1\n45\n153\n294\n3359835\n0\n427262129093995\n"}, {"type": "stdin_stdout", "input": "7\n1 1\n10 2\n100 3\n1024 14\n998244353 1337\n123 144\n1234312817382646 13\n", "output": "1\n20\n153\n294\n33...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlice got a new doll these days....
[{"type": "stdin_stdout", "input": "10 10 70\n10 4\n5 5\n6 10\n8 9\n3 8\n10 9\n10 10\n8 2\n2 10\n7 2\n7 3\n10 2\n8 3\n9 8\n2 9\n3 1\n6 5\n6 9\n2 8\n10 7\n8 4\n8 6\n7 6\n5 6\n9 10\n3 9\n5 8\n4 8\n3 10\n10 5\n5 2\n5 4\n8 8\n3 2\n3 6\n2 3\n1 9\n6 6\n2 4\n6 2\n5 3\n6 4\n7 9\n2 2\n5 9\n7 10\n7 8\n3 3\n2 6\n7 5\n8 10\n3 4\n6...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis is the harder version of th...
[{"type": "stdin_stdout", "input": "100\n61 28 67 53 13 6 70 5 79 82 60 60 27 17 80 25 82 82 69 76 81 43 58 86 18 78 4 25 8 30 33 87 91 18 90 26 62 11 28 66 9 33 58 66 47 48 80 38 25 57 4 84 79 71 54 159 63 32 97 62 26 68 5 69 54 93 25 26 100 73 24 94 118 39 30 45 95 80 0 29 57 98 92 15 17 76 69 11 57 56 48 10 28 7 63 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 integers a and...
[{"type": "stdin_stdout", "input": "3\n1 3\n11 11\n30 20\n", "output": "3\n0\n4\n"}, {"type": "stdin_stdout", "input": "3\n0 3\n11 11\n30 20\n", "output": "2\n0\n4\n"}, {"type": "stdin_stdout", "input": "3\n1 3\n11 1\n30 20\n", "output": "3\n4\n4\n"}, {"type": "stdin_stdout", "input": "3\n1 3\n11 0\n30 20\n", "output":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string s consist...
[{"type": "stdin_stdout", "input": "100\naaaaaabbcccccccddffffhhhhhhhhiiiiiikkkkkkkkmmmmmmooooooopppprrrrrrrrrttttttvvvvvvvvvvvvxxxxxxxzzzzzz\n", "output": "21\n"}, {"type": "stdin_stdout", "input": "100\nbabaababbaabbabababbabbbababababbaabababaaababaababbbaaababbaabbababababbababbabaabbaabaaaaabbababba\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\nDenis, after buying flowers and ...
[{"type": "stdin_stdout", "input": "10 10\n1101001\n0110000\n0111010\n0010000\n1010000\n0111000\n1011011\n1010010\n1101011\n1111110\n", "output": "9941743758\n"}, {"type": "stdin_stdout", "input": "10 10\n0101111\n0000000\n1111011\n1011011\n1011011\n1111011\n0010010\n1010010\n1101111\n0000000\n", "output": "8993391761\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAmong Johnny's numerous hobbies,...
[{"type": "stdin_stdout", "input": "6\n4\n1 0 2 5\n6\n10 7 14 16 0 12\n2\n0 1\n3\n1 2 6\n6\n1 4 6 10 11 20\n2\n0 1023\n", "output": "-1\n-1\n1\n-1\n-1\n1023\n"}, {"type": "stdin_stdout", "input": "6\n4\n1 0 2 6\n6\n10 7 27 16 1 12\n2\n0 1\n3\n1 2 6\n6\n0 8 6 10 11 33\n2\n0 1023\n", "output": "-1\n11\n1\n-1\n-1\n1023\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 the hard version of the ...
[{"type": "stdin_stdout", "input": "5\n2\n01\n10\n5\n01011\n11100\n2\n01\n01\n10\n0110011011\n1000110100\n1\n0\n1\n", "output": "3 1 2 1\n5 1 2 3 5 3\n4 1 2 2 1\n11 1 3 5 7 8 10 8 7 6 4 1\n1 1\n"}, {"type": "stdin_stdout", "input": "5\n2\n01\n10\n5\n01011\n11100\n2\n01\n01\n10\n0110011011\n1000110100\n1\n0\n1\n", "outp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have given an array a of len...
[{"type": "stdin_stdout", "input": "1\n20 9\n288 279 252 279 288 207 261 270 297 288 276 265 209 217 214 300 227 221 215 271\n", "output": "7833\n"}, {"type": "stdin_stdout", "input": "1\n20 9\n288 279 252 279 288 207 261 270 297 288 276 265 209 217 214 300 227 221 215 113\n", "output": "7675\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\nYou are given n rectangles, each...
[{"type": "stdin_stdout", "input": "2\n5 16\n1 2 8 4 8\n6 10\n2 8 8 2 2 8\n", "output": "\n2\n3\n"}, {"type": "stdin_stdout", "input": "2\n5 20\n1 2 16 2 8\n6 12\n4 8 8 4 2 8\n", "output": "2\n3\n"}, {"type": "stdin_stdout", "input": "2\n5 13\n2 2 8 2 8\n6 23\n1 16 8 2 2 1\n", "output": "2\n2\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\nPolycarp has 26 tasks. Each task...
[{"type": "stdin_stdout", "input": "5\n3\nABA\n11\nDDBBCCCBBEZ\n7\nFFGZZZY\n1\nZ\n2\nAB\n", "output": "\nNO\nNO\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "1\n24\nDEBOOFORCEDMETODOTHISSMH\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1\n11\nDEBOOFORCEDMETODOTHISSMH\n", "output": "No\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 an array of positi...
[{"type": "stdin_stdout", "input": "1\n97\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1\n97\n1 1 1 1 1 1 1 1 1 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe country Treeland consists of...
[{"type": "stdin_stdout", "input": "15\n15 6\n2 15\n14 15\n15 12\n1 2\n10 15\n14 4\n13 7\n11 1\n5 2\n7 2\n3 2\n14 8\n9 15\n", "output": "7\n11 13\n"}, {"type": "stdin_stdout", "input": "15\n15 6\n2 15\n14 15\n15 12\n1 2\n10 15\n14 4\n13 7\n11 1\n5 2\n7 2\n3 2\n7 8\n9 15\n", "output": "7\n11 13\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\nPolycarpus is the director of a ...
[{"type": "stdin_stdout", "input": "123\n0 6361 8903 10428 0 258 0 10422 0 0 2642 1958 0 0 0 0 0 8249 1958 0 0 2642 0 0 0 11566 4709 1847 3998 0 1331 0 0 10289 2739 6135 3450 0 0 10994 6069 4337 5854 1331 5854 0 630 630 11244 5928 2706 0 683 214 0 9080 0 0 0 10422 683 11566 10994 0 0 3450 11244 11542 3998 1847 2708 987...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSmart Beaver decided to be not o...
[{"type": "stdin_stdout", "input": "200\n1 2 1 1 2 2 1 1 1 1 1 1 2 1 2 2 2 2 2 1 2 2 1 1 2 2 2 2 2 1 2 1 1 2 2 2 1 2 2 2 1 1 2 2 2 1 2 2 1 2 1 2 2 1 2 2 2 2 2 1 2 2 1 2 1 1 2 2 2 2 2 2 2 1 2 2 2 1 1 2 1 2 2 1 1 2 2 1 1 1 2 2 1 1 2 2 1 1 2 2 2 1 2 2 2 1 2 1 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 2 2 2 1 1 2 2 2 2 2 1 2 1 2 1 1 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nXenia the beginner programmer ha...
[{"type": "stdin_stdout", "input": "2 10\n47 17 22 0\n2 15\n2 42\n1 9\n3 13\n3 28\n1 20\n1 13\n1 50\n2 20\n2 12\n", "output": "57\n57\n61\n38\n55\n34\n51\n38\n42\n34\n"}, {"type": "stdin_stdout", "input": "2 10\n47 17 22 0\n4 15\n2 42\n1 9\n3 13\n3 28\n1 20\n1 13\n1 50\n2 20\n2 12\n", "output": "32\n48\n52\n36\n52\n33\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 boy Petya loves chess very muc...
[{"type": "stdin_stdout", "input": "6\nK.......\n........\n.##..##.\n#..##..#\n........\n...##...\n.#....#.\n..####.K\n\n.......K\n........\n.##..##.\n#..##..#\n........\n...##...\n.#....#.\nK.####..\n\nK.......\n........\n.##..##.\n#..##..#\n........\n...##...\n.#....#.\nK.####..\n\n.......K\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\nLittle Chris is participating in...
[{"type": "stdin_stdout", "input": "8 30\n10 4\n3 8\n3 2\n10 1\n3 5\n3 4\n5 1\n8 2\n8 4\n3 10\n7 9\n3 6\n9 5\n5 10\n7 6\n7 5\n9 1\n2 7\n9 10\n1 4\n9 8\n6 2\n2 1\n7 1\n6 4\n4 5\n2 14\n10 8\n7 8\n5 2\n", "output": "3 5 1\n10 5 7\n4 5 2\n5 9 1\n10 9 8\n3 6 2\n4 6 7\n9 7 1\n8 7 2\n3 2 1\n14 2 8\n4 8 10\n8 3 10\n3 4 1\n4 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\nOne day Dima and Alex had an arg...
[{"type": "stdin_stdout", "input": "4\n4 2\n6 1\n2 6\n-2 11\n", "output": "Happy Alex\n"}, {"type": "stdin_stdout", "input": "4\n4 1\n6 2\n2 5\n-1 4\n", "output": "Happy Alex\n"}, {"type": "stdin_stdout", "input": "4\n4 1\n6 2\n2 5\n-2 4\n", "output": "Happy Alex\n"}, {"type": "stdin_stdout", "input": "4\n4 1\n6 2\n2 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\nThere are r red and g green bloc...
[{"type": "stdin_stdout", "input": "136749 183300\n", "output": "906576609\n"}, {"type": "stdin_stdout", "input": "200000 199999\n", "output": "396481680\n"}, {"type": "stdin_stdout", "input": "199585 199585\n", "output": "199771918\n"}, {"type": "stdin_stdout", "input": "107344 159729\n", "output": "849320920\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\nEverybody knows that the capital...
[{"type": "stdin_stdout", "input": "2000 10000\n8000 4000 4000\n", "output": "2.828427124746\n"}, {"type": "stdin_stdout", "input": "5527 8154\n3974 3550 1639\n", "output": "1.555031897139\n"}, {"type": "stdin_stdout", "input": "9788 8432\n2795 2025 3436\n", "output": "0.863942827831\n"}, {"type": "stdin_stdout", "inpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given the current time i...
[{"type": "stdin_stdout", "input": "00:00\n10000\n", "output": "22:40\n"}, {"type": "stdin_stdout", "input": "12:34\n10000\n", "output": "11:14\n"}, {"type": "stdin_stdout", "input": "00:00\n00000\n", "output": "00:00\n"}, {"type": "stdin_stdout", "input": "14:32\n10000\n", "output": "13:12\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\nThe term of this problem is the ...
[{"type": "stdin_stdout", "input": "80 979\n2 1 1 1 2 1 1 1 3 1 4 4 2 1 1 3 1 1 2 1 4 1 1 2 5 4 8 1 3 6 5 7 2 3 4 1 2 2 6 1 2 2 4 1 1 2 3 2 8 1 1 3 3 4 1 1 2 1 4 4 1 4 3 2 6 5 2 1 4 1 2 3 2 1 3 3 2 2 1 3\n498 976 513 869 917 914 664 656 957 893 981 947 985 693 576 958 987 822 981 718 884 729 295 683 485 998 730 894 731...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nR3D3 spent some time on an inter...
[{"type": "stdin_stdout", "input": "100000000 100000000 100000000\n", "output": "266578227200000000\n"}, {"type": "stdin_stdout", "input": "100000000 100000010 100000000\n", "output": "266578239852872360\n"}, {"type": "stdin_stdout", "input": "100000000 50000000 100000000\n", "output": "191720992950000000\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\n<image>\n\nInput\n\nThe input co...
[{"type": "stdin_stdout", "input": "0\n1\n1\n0\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1\n0\n0\n1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "0\n1\n0\n0\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1\n1\n0\n1\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "0\n1\n0\n1\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have a string of letters 'a' ...
[{"type": "stdin_stdout", "input": "abaaaaaabaaaabbabbaaabbbbabababaaaaabbaabbaaaaabbbaababaaaaaaabbbbbaaaaabaababbabababbabbbbabbbaabbabbbabaabbaabbaaaaaab\n", "output": "502032780\n"}, {"type": "stdin_stdout", "input": "abaaaaaabaaaabbabbaaabbababababaaaaabbaabbaaaaabbbaababaaaaaaabbbbbaaaaabbababbabababbabbbbabbbaab...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIt is known that passages in Sin...
[{"type": "stdin_stdout", "input": "181\n", "output": "421742777\n"}, {"type": "stdin_stdout", "input": "261\n", "output": "952127278\n"}, {"type": "stdin_stdout", "input": "121\n", "output": "631667314\n"}, {"type": "stdin_stdout", "input": "351\n", "output": "625447969\n"}, {"type": "stdin_stdout", "input": "141\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\nWinnie-the-Pooh likes honey very...
[{"type": "stdin_stdout", "input": "100\n100\n100\n100\n", "output": "9900\n"}, {"type": "stdin_stdout", "input": "100\n100\n110\n100\n", "output": "9900\n"}, {"type": "stdin_stdout", "input": "100\n100\n111\n100\n", "output": "9900\n"}, {"type": "stdin_stdout", "input": "100\n100\n010\n100\n", "output": "990\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\nPeter likes to travel by train. ...
[{"type": "stdin_stdout", "input": "aababaaababaabbaabababaaababaabababbaabbabaabababaabbabbbababbababababababaabababaababaaaabababaabab\nabaabababaa\nabaabbaa\n", "output": "backward\n"}, {"type": "stdin_stdout", "input": "aababaaababaabbaabababaaababaabababbaabbabaabababaabbabbbababbababababababaabababaababaaaabababa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIgor K. always used to trust his...
[{"type": "stdin_stdout", "input": "10110010010001110110110111100100011101101110010100100010110101011001011101111001\n1001000100\n1011001001\n0101100101\n0001110110\n1000101101\n0110110000\n0000010011\n1101111001\n1101010111\n1110010100\n", "output": "13739427\n"}, {"type": "stdin_stdout", "input": "0001010110111011010...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an undirected grap...
[{"type": "stdin_stdout", "input": "17 15\n1 8\n1 12\n5 11\n11 9\n11 15\n15 5\n4 13\n3 10\n4 3\n15 16\n7 10\n16 7\n14 3\n14 4\n17 6\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "32 15\n1 5\n1 12\n5 11\n11 9\n9 15\n15 5\n4 13\n2 10\n4 3\n10 20\n7 10\n21 7\n14 3\n14 4\n17 11\n", "output": "0\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\nChandu has been appointed as the...
[{"type": "stdin_stdout", "input": "1000\n3003\n4638\n1156\n4277\n1903\n1654\n1306\n3643\n4615\n2707\n1861\n2651\n1617\n1686\n2909\n3456\n1055\n1670\n2693\n1270\n4358\n4731\n4420\n4965\n1190\n2568\n4704\n2147\n3198\n2315\n1524\n4715\n2378\n3484\n3424\n1558\n3095\n3548\n1093\n3555\n1806\n1568\n4759\n1776\n4024\n4925\n22...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 the league stage of the world...
[{"type": "stdin_stdout", "input": "3\n3 1 1\n14 0 10\n0 2 1\n\nS@MPLE", "output": "32\n"}, {"type": "stdin_stdout", "input": "3\n10 1 1\n0 1 3\n0 0 2\n\nLEPMAS", "output": "30\n"}, {"type": "stdin_stdout", "input": "3\n3 2 1\n10 1 3\n1 0 1\n\nSAMPLE", "output": "28\n"}, {"type": "stdin_stdout", "input": "3\n12 0 1\n2 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRamesh is a hard-working employe...
[{"type": "stdin_stdout", "input": "7 2\n10 2 16 19 6 11 10\n29 25\n\nSAMPLE", "output": "7\n"}, {"type": "stdin_stdout", "input": "7 2\n10 2 16 19 6 11 10\n29 25\n\nELPMAS", "output": "7\n"}, {"type": "stdin_stdout", "input": "7 2\n10 2 7 19 6 11 10\n2 20\n\nELPMAS", "output": "11\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 temples in a straigh...
[{"type": "stdin_stdout", "input": "967 615\n6749 6417 199 5907 7677 8590 8796 3463 721 963 1779 8646 4529 7831 8222 1665 3941 4397 6286 2971 1613 2501 6285 3381 1438 5360 160 9400 5006 5423 9949 3213 3181 4385 1901 1111 191 4089 5685 1396 8701 3277 1481 517 6253 1313 2255 5948 6085 7201 5310 1105 985 748 9271 2883 734...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 N boxes numbered 1 to N,...
[{"type": "stdin_stdout", "input": "5 5\n1 4 1\n3 1 2\n0 3 1\n1 8 1\n12 4 1", "output": "5\n"}, {"type": "stdin_stdout", "input": "4 5\n1 4 1\n3 1 2\n0 3 1\n1 8 1\n12 4 1", "output": "5\n"}, {"type": "stdin_stdout", "input": "5 5\n1 15 2\n3 1 1\n0 3 1\n1 5 1\n7 4 1", "output": "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\nRaccoon is fighting with a monst...
[{"type": "stdin_stdout", "input": "210 3\n31 41 59 26 53", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "210 3\n31 55 59 26 53", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "210 5\n31 41 59 26 53", "output": "Yes"}, {"type": "stdin_stdout", "input": "211 5\n31 33 59 26 53", "output": "No\n"}, {"type...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven is a permutation P of \\\\...
[{"type": "stdin_stdout", "input": "8\n8 1 7 3 4 5 6 2", "output": "135\n"}, {"type": "stdin_stdout", "input": "8\n8 2 7 3 4 5 6 1", "output": "136"}, {"type": "stdin_stdout", "input": "5\n1 3 2 4 5", "output": "29\n"}, {"type": "stdin_stdout", "input": "5\n2 3 1 4 5", "output": "28\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 sequence (P_1,P_...
[{"type": "stdin_stdout", "input": "8\n6\n3\n2\n1\n7\n4\n8\n5", "output": "5\n"}, {"type": "stdin_stdout", "input": "8\n6\n3\n1\n2\n5\n4\n8\n7", "output": "6\n"}, {"type": "stdin_stdout", "input": "8\n6\n3\n2\n1\n4\n7\n8\n5", "output": "5\n"}, {"type": "stdin_stdout", "input": "8\n6\n3\n2\n1\n7\n4\n5\n8", "output": "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\nN contestants participated in a ...
[{"type": "stdin_stdout", "input": "7\n1\n2\n2\n3\n1\n4", "output": "4\n"}, {"type": "stdin_stdout", "input": "7\n1\n4\n2\n3\n1\n3", "output": "5\n"}, {"type": "stdin_stdout", "input": "7\n1\n4\n2\n3\n1\n4", "output": "4\n"}, {"type": "stdin_stdout", "input": "7\n1\n4\n2\n3\n1\n7", "output": "4\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\nIf the strings are consecutive, ...
[{"type": "stdin_stdout", "input": "ab@5C1@8050\n@99+1=1@90", "output": "abCCCCC10000000050\n999999999+1=1000000000"}, {"type": "stdin_stdout", "input": "ab@5C1@8050\n@99,1=1@90", "output": "abCCCCC10000000050\n999999999,1=1000000000"}, {"type": "stdin_stdout", "input": "ab@5C2@8050\n@99,1=1@90", "output": "abCCCCC2000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMr. A came to Aizu for sightseei...
[{"type": "stdin_stdout", "input": "8 4\n2 1 3 1 1 5 1 3\n2 3 2 4 1 0 2 1\n0 3 -1 2 1 1 4 2\n1 2 3 2 1 1 5 4\n0 2 0 1 1 3 2 1\n1 3 1 2 2 4 3 2\n5 1 2 1 4 1 1 5\n4 1 1 -1 1 2 2 1\n2 -1 -1 -1\n0 3 -1 -1\n-1 2 2 4\n-1 1 -1 1\n5 3\n1 0 2 3 5\n2 3 7 2 1\n2 5 4 2 2\n8 9 0 3 3\n3 6 0 4 7\n-1 -1 2\n-1 3 5\n0 4 -1\n0 0", "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\nCompute A + B.\n\nConstraints\n\...
[{"type": "stdin_stdout", "input": "1 2\n10 5\n101 20", "output": "3\n15\n121\n"}, {"type": "stdin_stdout", "input": "1 2\n10 4\n101 20", "output": "3\n14\n121\n"}, {"type": "stdin_stdout", "input": "1 2\n10 4\n101 37", "output": "3\n14\n138\n"}, {"type": "stdin_stdout", "input": "1 2\n11 4\n101 37", "output": "3\n15\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\nRJ Freight, a Japanese railroad ...
[{"type": "stdin_stdout", "input": "4\n_e\na`ba\nebbf\neddea", "output": "2\n12\n12\n13\n"}, {"type": "stdin_stdout", "input": "4\ne]\na`ba\nebbf\needea", "output": "2\n12\n12\n14\n"}, {"type": "stdin_stdout", "input": "4\n_f\n`db_\nfecf\nhaefg", "output": "2\n12\n12\n18\n"}, {"type": "stdin_stdout", "input": "4\naa\nd...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 mayor of Amida, the City of ...
[{"type": "stdin_stdout", "input": "4 3 1\n3 1 2\n0 1 3\n4 3 4\n1 0 1\n0 0 0", "output": "2\n1\n"}, {"type": "stdin_stdout", "input": "4 3 1\n3 1 1\n0 1 3\n4 3 4\n1 0 1\n0 0 0", "output": "3\n1\n"}, {"type": "stdin_stdout", "input": "6 4 1\n3 -1 2\n2 2 3\n3 3 4\n0 2 4\n0 0 0", "output": "1\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\nAngry Birds is a mobile game of ...
[{"type": "stdin_stdout", "input": "2 1 10 2\n-1 4 1 2", "output": "No\n"}, {"type": "stdin_stdout", "input": "2 3 4 2\n-1 2 1 2", "output": "No\n"}, {"type": "stdin_stdout", "input": "2 1 4 2\n-1 2 1 2", "output": "No\n"}, {"type": "stdin_stdout", "input": "2 1 4 2\n-1 4 1 2", "output": "No\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\nIn Manhattan, roads run where th...
[{"type": "stdin_stdout", "input": "10.685123853325852", "output": "15.1110470690\n"}, {"type": "stdin_stdout", "input": "10.702511281748821", "output": "15.1356366061\n"}, {"type": "stdin_stdout", "input": "10.804121325601631", "output": "15.2793349082\n"}, {"type": "stdin_stdout", "input": "11.285119341606524", "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\nD: Sontaku (Surmise)\n\nSome twi...
[{"type": "stdin_stdout", "input": "5\n5 12 0 2 18", "output": "4\n"}, {"type": "stdin_stdout", "input": "5\n2 12 0 2 18", "output": "5\n"}, {"type": "stdin_stdout", "input": "5\n5 12 1 2 12", "output": "3\n"}, {"type": "stdin_stdout", "input": "5\n5 12 1 2 18", "output": "3\n"}, {"type": "stdin_stdout", "input": "5\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\nWrite a program which reads $n$ ...
[{"type": "stdin_stdout", "input": "5\n105 24 C 1500000000000 white\n100 23 C 1500000000000 blue\n105 23 A 1480000000000 pink\n110 25 B 1500000000000 black\n110 20 A 1484487224415 gree", "output": "100 23 C 1500000000000 blue\n105 23 A 1480000000000 pink\n105 24 C 1500000000000 white\n110 20 A 1484487224415 gree\n110 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\nA sequence a_1, a_2, ..., a_n is...
[{"type": "stdin_stdout", "input": "10\n3 10 14 1 10 12 5 16 5 2\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "10\n3 10 14 1 10 8 5 16 5 2\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "10\n3 10 9 1 10 8 5 16 5 2\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "10\n2 10 9 1 10 4 5 8 5 4\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 t consist...
[{"type": "stdin_stdout", "input": "50 68\npyndtohzaimzvqkvdkwlmccauhlmmljruldlobtadxclrvncea\n", "output": "pyndtohzaimzvqkvdkwlmccauhlmmljruldlobtadxclrvnceapyndtohzaimzvqkvdkwlmccauhlmmljruldlobtadxclrvnceapyndtohzaimzvqkvdkwlmccauhlmmljruldlobtadxclrvnceapyndtohzaimzvqkvdkwlmccauhlmmljruldlobtadxclrvnceapyndtohzaim...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 a galaxy far, far away Lesha ...
[{"type": "stdin_stdout", "input": "79256157 81208498\n", "output": "5171\n17914 17913 17912 17911 17910 17909 17908 17907 17906 17905 17904 17903 17902 17901 17900 17899 17898 17897 17896 17895 17894 17893 17892 17891 17890 17889 17888 17887 17886 17885 17884 17883 17882 17881 17880 17879 17878 17877 17876 17875 17874...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMishka is trying really hard to ...
[{"type": "stdin_stdout", "input": "200\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\n", "output": "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 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 f_{x} = c^{2x-6} ⋅ f_{x-1} ⋅...
[{"type": "stdin_stdout", "input": "1000000000000000000 1000000000 1000000000 1000000000 1000000000\n", "output": "607659049"}, {"type": "stdin_stdout", "input": "1440135023384277212 298741808 401572465 730243936 632306255\n", "output": "694201657\n"}, {"type": "stdin_stdout", "input": "1440135023384277212 298741808 71...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJack has become a soldier now. U...
[{"type": "stdin_stdout", "input": "RXLLRXXLLRLRLLXXXXRXXRLLRRRRXLLRRLXXLRXXLXLRLLLLLRXLRXLXRXLXLRRXXRRLXLXLRLRXRXLXXXLRXLLXLRRRRXRLLXRRLLRRXRRRLRLLRLRXXXRLXLXLLLRXXLLXLRXXLLLRLXRRXRLXLXXXXXXLXRXXRXXXRXLXXRRXLLXRRXLXXRRXLXXRLXLXXLXRXXRLRLLXLXLXLRXLXLXLLLRLXXLXLLRLLLLRLRRRRXRRLLRLXLXXRLRRLXRRXXXRLLXRRRXXRRRXXLRXRLLXRRRX...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNew Year is coming and you are e...
[{"type": "stdin_stdout", "input": "5\n3 55\n22 30\n21 10\n20 21\n19 59\n", "output": "1205\n90\n170\n219\n241\n"}, {"type": "stdin_stdout", "input": "5\n4 55\n22 30\n21 10\n20 21\n19 59\n", "output": "1145\n90\n170\n219\n241\n"}, {"type": "stdin_stdout", "input": "5\n15 14\n22 45\n21 2\n0 21\n19 59\n", "output": "526\...
code_stdio