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\nThere are some beautiful girls i...
[{"type": "stdin_stdout", "input": "64 118\n361 547 410 294 448 377 482 490 13 116 346 50 251 330 443 128 543 580 370 489 337 509 414 291 228 71 245 308 319 314 154 39 317 288 145 248 547 152 262 278 89 108 522 238 128 575 112 469 86 230 310 492 127 270 475 25 179 72 345 444 17 332 544 338\n", "output": "3\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\nSomething happened in Uzhlyandia...
[{"type": "stdin_stdout", "input": "100\n23 64 60 -45 -36 -64 -59 15 -75 69 -30 -7 -20 17 -77 58 93 -76 -98 -22 -31 16 -50 6 -20 -85 1 64 -88 -8 -15 -6 -57 25 91 10 2 -90 74 -66 -42 73 28 49 -85 59 96 79 -25 49 -59 -89 -75 12 -96 -33 -65 -8 -100 -81 17 99 -91 -5 7 -21 1 85 63 86 -26 85 -31 11 -75 35 -82 15 98 93 -55 66...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\"Eat a beaver, save a tree!\" β€”...
[{"type": "stdin_stdout", "input": "10\n91739 91402 94944 92279 91149 91709 96966 91401 97398 98822\n3 6\n9 6\n5 6\n1 6\n8 6\n7 6\n10 6\n4 6\n2 6\n2\n", "output": "183418\n"}, {"type": "stdin_stdout", "input": "10\n91739 91402 94944 92279 91149 91709 96966 91401 97398 98822\n3 6\n9 6\n5 6\n1 6\n8 6\n7 6\n10 6\n4 6\n2 6...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Cartesian coordinate system ...
[{"type": "stdin_stdout", "input": "3 4 5\n1 1 2\n2 3 0\n3 3 1\n0 1 1 100 100\n1 2 2 4 4\n2 2 1 4 7\n1 50 50 51 51\n", "output": "3\n3\n5\n0\n"}, {"type": "stdin_stdout", "input": "3 4 5\n1 1 2\n2 3 0\n3 3 1\n0 1 1 100 100\n1 2 2 4 4\n2 2 1 4 7\n1 60 50 51 51\n", "output": "3\n3\n5\n0\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\nA positive integer is called a 2...
[{"type": "stdin_stdout", "input": "1088391167 1934917632\n", "output": "17\n"}, {"type": "stdin_stdout", "input": "1088391168 1934917632\n", "output": "17\n"}, {"type": "stdin_stdout", "input": "1088391168 1934917633\n", "output": "17\n"}, {"type": "stdin_stdout", "input": "1088391169 1934917632\n", "output": "16\n"},...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA string is a palindrome if it r...
[{"type": "stdin_stdout", "input": "wobervhvvkihcuyjtmqhaaigvvgiaahqmtjyuchikvvhvrebow\n", "output": "49\n"}, {"type": "stdin_stdout", "input": "wobervhvvkihcuyjtmqhaaigvahheoqleromusrartldojsjvy\n", "output": "50\n"}, {"type": "stdin_stdout", "input": "wobervhvvkihcmyjtmqhaaigvvgiaahqutjyuchikvvhvrebow\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\nBholu the Pandit on this New Yea...
[{"type": "stdin_stdout", "input": "2\n3 10 17\n2 10 3\n\nSMAPLC", "output": "1 510\n1 60\n"}, {"type": "stdin_stdout", "input": "2\n3 16 17\n2 12 3\n\nSMAPLC", "output": "1 816\n1 72\n"}, {"type": "stdin_stdout", "input": "2\n3 8 17\n4 12 3\n\nSLAPLC", "output": "1 408\n1 144\n"}, {"type": "stdin_stdout", "input": "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\nBitoholic is an inhabitant of th...
[{"type": "stdin_stdout", "input": "2 \n0 -2 4 2 -1 \n13 -1 35 -1 0\n\nGKPNCR", "output": "Case #1: -2\nCase #2: -14\n"}, {"type": "stdin_stdout", "input": "2 \n-1 -3 3 2 -1 \n3 -2 16 -1 0\n\nHKPOCR", "output": "Case #1: -3\nCase #2: -5\n"}, {"type": "stdin_stdout", "input": "2 \n-1 -1 19 0 6 \n0 -1 35 0 0\n\nSBNQKF", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 time is 1st January 20000014...
[{"type": "stdin_stdout", "input": "3\n1410\n252\n60\n\nMAPJES", "output": "281474976710656\n512\n8\n"}, {"type": "stdin_stdout", "input": "3\n1327\n252\n60\n\nMAPJES", "output": "35184372088832\n512\n8\n"}, {"type": "stdin_stdout", "input": "3\n1169\n143\n30\n\nSAMPLE", "output": "549755813888\n32\n4\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\nMy flatmate, Sayan, went to the ...
[{"type": "stdin_stdout", "input": "710 8098 8685\n0.677856313989 0.300527362186 0.585422317594 0.579903380393 0.627528717602 0.767731549439 0.610653415599 0.885294351688 0.979034022518 0.13779743862 0.0340536649268 0.608253498417 0.742388417086 0.060505705684 0.558364356238 0.679584717746 0.0887531985081 0.12151157925...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 us denote by f(x, m) the rem...
[{"type": "stdin_stdout", "input": "10000000000 15 114525", "output": "676285714116240\n"}, {"type": "stdin_stdout", "input": "10000000000 16 114525", "output": "607349285587900\n"}, {"type": "stdin_stdout", "input": "10000000000 15 99959", "output": "500550769812856\n"}, {"type": "stdin_stdout", "input": "10000000000 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 wants to be a member o...
[{"type": "stdin_stdout", "input": "chokudai\nchokudaiz", "output": "Yes"}, {"type": "stdin_stdout", "input": "choktdai\nchokudaiz", "output": "No\n"}, {"type": "stdin_stdout", "input": "choktdai\nbhokudaiz", "output": "No\n"}, {"type": "stdin_stdout", "input": "iadtkohc\nbhokudaiz", "output": "No\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 are 2000001 stones placed ...
[{"type": "stdin_stdout", "input": "16 27", "output": "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\n"}, {"type": "stdin_stdout", "input": "15 21", "output": "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\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\nYou are given a string S of leng...
[{"type": "stdin_stdout", "input": "acc", "output": "cca\n"}, {"type": "stdin_stdout", "input": "acb", "output": "bca\n"}, {"type": "stdin_stdout", "input": "adb", "output": "bda\n"}, {"type": "stdin_stdout", "input": "`cb", "output": "bc`\n"}, {"type": "stdin_stdout", "input": "bc`", "output": "`cb\n"}, {"type": "stdi...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRingo has a string S.\n\nHe can ...
[{"type": "stdin_stdout", "input": "cassert\n4\n1 2\n3 4\n1 1\n2 0", "output": "YES\n"}, {"type": "stdin_stdout", "input": "cassert\n3\n1 2\n3 4\n1 1\n2 0", "output": "YES\n"}, {"type": "stdin_stdout", "input": "cassert\n4\n2 2\n3 4\n1 1\n2 2", "output": "YES\n"}, {"type": "stdin_stdout", "input": "cassert\n4\n2 4\n3 6...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string S of leng...
[{"type": "stdin_stdout", "input": "8\n)))(((((", "output": "((()))((((()))))\n"}, {"type": "stdin_stdout", "input": "8\n)))))(((", "output": "((((()))))((()))\n"}, {"type": "stdin_stdout", "input": "8\n))))))))", "output": "(((((((())))))))\n"}, {"type": "stdin_stdout", "input": "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\nLet x be a string of length at l...
[{"type": "stdin_stdout", "input": "adad", "output": "2\n3\n"}, {"type": "stdin_stdout", "input": "bbcc", "output": "1\n1\n"}, {"type": "stdin_stdout", "input": "ccbb", "output": "1\n1\n"}, {"type": "stdin_stdout", "input": "ccbc", "output": "1\n1\n"}, {"type": "stdin_stdout", "input": "cbbc", "output": "1\n1\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\nYour task is to develop a tiny l...
[{"type": "stdin_stdout", "input": "4\n52 26 16 20\n143 22 35 45\n45 78 54 36\n10 86 74 55\n4\n52 151 15 28\n86 22 24 45\n45 78 54 36\n16 86 74 55\n0", "output": " 52 26 16 20 114\n 143 22 35 45 245\n 45 78 54 36 213\n 10 86 74 55 225\n 250 212 179 156 797\n 52 151 15 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\nUnder the command \"Save Sergean...
[{"type": "stdin_stdout", "input": "7\n1 2 5\n2 3 2\n3 4 3\n1 5 13\n5 6 3\n5 7 11\n0", "output": "27\n"}, {"type": "stdin_stdout", "input": "7\n1 2 4\n2 4 2\n3 4 3\n1 5 13\n5 6 3\n5 7 11\n0", "output": "25\n"}, {"type": "stdin_stdout", "input": "7\n1 3 2\n2 3 1\n7 4 3\n1 5 10\n5 6 4\n5 7 15\n0", "output": "29\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\nDr. Hedro is astonished. Accordi...
[{"type": "stdin_stdout", "input": "2\n14\n0", "output": "24\n328\n"}, {"type": "stdin_stdout", "input": "2\n12\n0", "output": "24\n264\n"}, {"type": "stdin_stdout", "input": "2\n10\n0", "output": "24\n216\n"}, {"type": "stdin_stdout", "input": "2\n18\n0", "output": "24\n440\n"}, {"type": "stdin_stdout", "input": "2\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\nLong long ago, there lived a wiz...
[{"type": "stdin_stdout", "input": "7 7 0 2\n0 1 absa\n1 1 ohl\n2 -1 ket\n1 3 cada\n3 3 ea\n3 2 bra\n2 1 ket\n2 2 0 1\n0 0 a\n0 1 b\n7 6 2 0\n3 1 op\n3 2 op\n3 4 qpo\n1 0 st\n2 0 qr\n4 1 r\n2 1 0 1\n0 1 loooop\n0 0 0 0", "output": "absacadabra\nNO\nqr\nloooop\n"}, {"type": "stdin_stdout", "input": "7 7 0 2\n0 1 abra\n0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTwo experienced climbers are pla...
[{"type": "stdin_stdout", "input": "6\n0 -1\n3 4\n9 12\n17 10\n21 12\n33 -1\n5\n0 0\n12 0\n20 0\n30 0\n74 0\n10\n0 0\n1 2\n3 0\n6 3\n9 0\n11 2\n13 0\n15 2\n16 2\n35 0\n7\n0 0\n150 997\n300 1\n450 999\n600 2\n750 998\n900 0\n0", "output": "46.241105114034\n74.000000000000\n46.612166980266\n10078.072814085803\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\nHint\n\n* One grid may be filled...
[{"type": "stdin_stdout", "input": "23\n1 1 3 1\n3 1 3 3\n3 3 1 3\n1 3 1 5\n1 5 3 5\n5 2 7 2\n7 2 7 4\n7 4 5 4\n5 4 5 6\n5 6 7 6\n11 4 13 4\n13 0 15 0\n15 0 15 4\n18 2 18 2\n21 5 23 5\n21 5 21 7\n21 7 23 7\n23 7 23 8\n23 9 21 9\n24 0 26 0\n24 0 24 4\n24 4 26 4\n26 0 26 4", "output": "-328\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\nWind Corridor is a covered passa...
[{"type": "stdin_stdout", "input": "5 2\n0\n1 1\n1 4\n2 2\n2 2\n4\n3 2\n3 6\n2 4\n4 0\n0 0", "output": "5.00000000000000000000\n2.00000000000000000000\n4.00000000000000000000\n"}, {"type": "stdin_stdout", "input": "14 2\n4\n0 0\n1 2\n2 2\n2 0\n4\n3 2\n3 4\n2 6\n4 3\n0 0", "output": "11.00000000000000000000\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 a student looking for a ...
[{"type": "stdin_stdout", "input": "39989 6 999983 999979 999961 1 1000 2 1000\nSR 1 39989\nSC 1 39989\nRL\nRH\nRR\nRV", "output": "302732557\n"}, {"type": "stdin_stdout", "input": "39989 6 999983 999979 999961 1 1010 2 1000\nSR 1 39989\nSC 1 39989\nRL\nRH\nRR\nRV", "output": "239384648\n"}, {"type": "stdin_stdout", "i...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA: A-Z Cat / A-Z Cat\n\nstory\n\...
[{"type": "stdin_stdout", "input": "AOZUNYANPERIPERO", "output": "AZ\n"}, {"type": "stdin_stdout", "input": "OREQIRMQEAYNUYOA", "output": "-1\n"}, {"type": "stdin_stdout", "input": "OREPIREPNAYNUZOA", "output": "AZ\n"}, {"type": "stdin_stdout", "input": "OREPIRNPEAYNUZOA", "output": "AZ\n"}, {"type": "stdin_stdout", "i...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nproblem\n\nThere are many $ N $ ...
[{"type": "stdin_stdout", "input": "8 4\n46 70 57 10 174 41 130 43", "output": "193\n"}, {"type": "stdin_stdout", "input": "8 4\n46 70 57 10 174 33 130 43", "output": "201\n"}, {"type": "stdin_stdout", "input": "8 7\n46 70 57 3 174 25 130 43", "output": "1302\n"}, {"type": "stdin_stdout", "input": "8 4\n46 70 57 10 174...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDutch treat\n\nYou have organize...
[{"type": "stdin_stdout", "input": "3 300\n120 100 80\n3 30\n10 20 5\n4 1000\n100 200 300 400\n5 5\n2523 8430 3 4199 987\n0 0", "output": "280\n25\n800\n5\n"}, {"type": "stdin_stdout", "input": "3 276\n120 101 80\n3 5\n10 34 10\n4 1000\n100 200 159 400\n5 10\n183 8430 3 4199 632\n0 0", "output": "264\n3\n709\n10\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\nMultiplication of Big Integers\n...
[{"type": "stdin_stdout", "input": "2 -134", "output": "-268\n"}, {"type": "stdin_stdout", "input": "3 -134", "output": "-402\n"}, {"type": "stdin_stdout", "input": "6 -134", "output": "-804\n"}, {"type": "stdin_stdout", "input": "-124 4", "output": "-496\n"}, {"type": "stdin_stdout", "input": "-103 -1", "output": "103...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "54160187 106765305\n", "output": "3328\n17939 17938 17937 17936 17935 17934 17933 17932 17931 17930 17929 17928 17927 17926 17925 17924 17923 17922 17921 17920 17919 17918 17917 17916 17915 17914 17913 17912 17911 17910 17909 17908 17907 17906 17905 17904 17903 17902 17901 17900 1789...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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, Yuhao came across a pro...
[{"type": "stdin_stdout", "input": "30\n)(((())()())()(\n))(()()()(\n))()((\n)())(()\n())())((\n((((())\n(((()))(\n(())\n)()(((()(()\n((())))(\n)()()())((\n))))(()\n()(((()\n)()()(\n(())())\n(()()(())(\n)()((\n)(()(())))\n))))(())((\n)()(()(((((\n(()))((\n()())\n((()()()))\n()((((((((()\n)(()(\n)(((())(()\n)((((()(\n((...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "100 10000\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 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\nTwo integer sequences existed in...
[{"type": "stdin_stdout", "input": "12\n12 8 1 3 7 5 9 6 4 10 11 2\n", "output": "YES\n1 1 0 0 1 0 0 1 1 0 0 1 \n"}, {"type": "stdin_stdout", "input": "12\n12 10 1 3 7 5 9 6 4 10 11 2\n", "output": "YES\n1 1 0 0 1 0 0 1 1 0 0 1\n"}, {"type": "stdin_stdout", "input": "12\n12 10 1 3 7 5 9 6 4 10 22 2\n", "output": "YES\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe only difference between easy...
[{"type": "stdin_stdout", "input": "78 36\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 1 0 0 0 0 0 0 0 0 0 0\n1 52\n2 6\n9 43\n10 52\n4 63\n9 35\n10 67\n9 17\n3 43\n4 38\n1 27\n9 44\n6 74\n7 3\n8 18\n1 52\n1 68\n5 51\n5 2\n7 50\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\nYou are given 4n sticks, the len...
[{"type": "stdin_stdout", "input": "5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000\n", "output": "YES\nYES\nNO\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "5\n1\n1 1 2 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 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\nConsider the set of all nonnegat...
[{"type": "stdin_stdout", "input": "4\n10 10\n1 10\n6 9\n7 3\n", "output": "Infinite\nFinite\nInfinite\nFinite\n"}, {"type": "stdin_stdout", "input": "4\n10 10\n1 10\n3 9\n7 3\n", "output": "Infinite\nFinite\nInfinite\nFinite\n"}, {"type": "stdin_stdout", "input": "4\n10 8\n1 10\n6 9\n7 3\n", "output": "Infinite\nFinit...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nEvlampiy was gifted a rooted tre...
[{"type": "stdin_stdout", "input": "5\n0 1\n1 3\n2 1\n3 0\n2 0\n", "output": "YES\n2 5 3 1 4 \n"}, {"type": "stdin_stdout", "input": "5\n0 1\n1 3\n2 1\n3 0\n2 0\n", "output": "YES\n2 5 3 1 4 \n"}, {"type": "stdin_stdout", "input": "5\n0 2\n1 3\n2 1\n3 0\n2 0\n", "output": "YES\n3 5 2 1 4\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\nTo become the king of Codeforces...
[{"type": "stdin_stdout", "input": "140 149\n124 109 136 123 83 121 53 37 111 105 75 224 99 87 51 45 131 83 18 76 99 29 115 96 16 89 88 69 81 100 120 90 141 48 83 97 26 27 51 94 53 25 32 27 4 139 81 140 137 95 94 89 116 32 85 155 68 12 107 10 124 96 110 32 135 126 2 146 79 14 132 136 110 16 130 98 109 191 2 18 52 27 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\nOmkar is building a waterslide i...
[{"type": "stdin_stdout", "input": "3\n4\n5 3 2 1\n5\n1 2 3 10 3\n3\n1 1 1\n", "output": "4\n7\n0\n"}, {"type": "stdin_stdout", "input": "3\n4\n5 3 2 0\n5\n1 2 3 10 3\n3\n1 1 1\n", "output": "5\n7\n0\n"}, {"type": "stdin_stdout", "input": "3\n4\n5 3 2 0\n5\n1 2 3 10 3\n3\n2 1 1\n", "output": "5\n7\n1\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\nYou are given a square matrix of...
[{"type": "stdin_stdout", "input": "5\n3 2\n1 2 3\n2 3 1\n3 1 2\nDR\n3 2\n1 2 3\n2 3 1\n3 1 2\nLU\n3 1\n1 2 3\n2 3 1\n3 1 2\nI\n3 1\n1 2 3\n2 3 1\n3 1 2\nC\n3 16\n1 2 3\n2 3 1\n3 1 2\nLDICRUCILDICRUCI\n", "output": "\n2 3 1 \n3 1 2 \n1 2 3 \n\n3 1 2 \n1 2 3 \n2 3 1 \n\n1 2 3 \n3 1 2 \n2 3 1 \n\n1 3 2 \n2 1 3 \n3 2 1 \n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBased on a peculiar incident at ...
[{"type": "stdin_stdout", "input": "20\n-201268 40733 12\n279503 656971 20\n-193510 -603402 5\n414438 858084 13\n-331542 661690 3\n-249371 867695 16\n312886 681855 17\n-478053 280737 9\n279517 483377 8\n165271 255951 15\n937060 -423651 18\n-683788 -621091 1\n870049 502230 4\n681566 -890785 19\n215558 -577085 10\n788742...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis is an interactive problem.\...
[{"type": "stdin_stdout", "input": "16 15\n308016736 956290215 528410265 714807573 549801784 640036314 72785399 243731193 64286020 242735735 652383284 747302261 133040055 523901569 310398221 592433960\n", "output": "? 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 \n? 1 16 15 14 13 12 11 10 9 8 7 6 5 4 3 \n? 2 1 16 15 14 13 12 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\nTo get money for a new aeonic bl...
[{"type": "stdin_stdout", "input": "5 10 15\nDdunkjly\n13 12 4\n83 26 1\n63 42 3\n83 22 2\n57 33 0\n59 10 1\n89 31 1\n57 17 2\n98 79 5\n46 41 3\nFbpbc\n28 21 0\n93 66 5\n66 21 0\n68 58 0\n59 17 3\n57 23 1\n72 71 1\n55 51 2\n58 40 5\n70 67 2\nKeiotmh\n73 44 4\n98 14 0\n19 7 0\n55 10 5\n30 25 4\n66 48 2\n66 51 4\n82 79 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\nThe \"BerCorp\" company has got ...
[{"type": "stdin_stdout", "input": "100 100\n1 33\n0\n2 35 4\n2 40 78\n1 69\n0\n1 2\n0\n0\n2 81 34\n1 45\n0\n1 87\n1 50\n1 97\n0\n2 100 59\n0\n0\n0\n1 45\n0\n0\n0\n1 6\n1 54\n0\n0\n0\n4 79 96 52 84\n1 86\n0\n0\n0\n0\n0\n0\n0\n0\n3 90 2 80\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n1 2\n0\n1 64\n0\n1 78\n1 82\n0\n0\n0\n0\n0\n1 6\n0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe new \"Die Hard\" movie has j...
[{"type": "stdin_stdout", "input": "14\n25 25 25 25 25 25 25 50 50 50 100 100 100 100\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "10\n100 100 100 100 100 100 100 100 100 100\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "10\n25 25 25 25 25 25 25 25 25 25\n", "output": "YES\n"}, {"type": "stdin_...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have a positive integer m an...
[{"type": "stdin_stdout", "input": "101 298\n", "output": "10000000000000000000000000000000000000000000000000000000000000000000999999999999999999999999999999999 99999999999999999999999999999999910000000000000000000000000000000000000000000000000000000000000000000\n"}, {"type": "stdin_stdout", "input": "101 299\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\nOne company of IT City decided t...
[{"type": "stdin_stdout", "input": "700\n", "output": "16017044425409540\n"}, {"type": "stdin_stdout", "input": "776\n", "output": "33019955679376860\n"}, {"type": "stdin_stdout", "input": "666\n", "output": "11292070960994226\n"}, {"type": "stdin_stdout", "input": "777\n", "output": "33319741730082870\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\nA tree is a connected undirected...
[{"type": "stdin_stdout", "input": "11005 209 166\n", "output": "1 2\n2 3\n3 4\n4 5\n5 6\n6 7\n7 8\n8 9\n9 10\n10 11\n11 12\n12 13\n13 14\n14 15\n15 16\n16 17\n17 18\n18 19\n19 20\n20 21\n21 22\n22 23\n23 24\n24 25\n25 26\n26 27\n27 28\n28 29\n29 30\n30 31\n31 32\n32 33\n33 34\n34 35\n35 36\n36 37\n37 38\n38 39\n39 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\nOne tradition of ACM-ICPC contes...
[{"type": "stdin_stdout", "input": "7\n14000000003 1000000000000000000\n81000000000 88000000000\n5000000000 10778591928\n15000000000 39000000000\n46000000000 51000000000\n0 0000000000\n0 0\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "7\n14000000003 1000000000000000000\n81000000000 88000000000\n5000000000 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\nThe winter in Berland lasts n da...
[{"type": "stdin_stdout", "input": "100 50\n-7 -3 9 2 16 -19 0 -10 3 -11 17 7 -7 -10 -14 -14 -7 -15 -15 -8 8 -18 -17 -5 -19 -15 -14 0 8 -3 -19 -13 -3 11 -3 -16 16 -16 -12 -2 -17 7 -16 -14 -10 0 -10 -18 -16 -11 -2 -12 -15 -8 -1 -11 -3 -17 -14 -6 -9 -15 -14 -11 -20 -20 -4 -20 -14 -2 0 -2 -20 17 -17 2 0 1 2 6 -5 -13 -16 -...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDuring the breaks between compet...
[{"type": "stdin_stdout", "input": "2 6 3 3 5 5 2 6 1 1 12 4 4 4 2 4 6 5 3 1 2 5 3 1\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "5 2 6 1 5 3 5 3 1 1 3 6 6 2 4 2 5 4 4 2 1 3 4 10\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "2 6 3 3 5 5 2 6 2 1 12 4 4 4 2 4 6 5 3 1 2 5 3 1\n", "output": "NO\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\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\nMahmoud and Ehab play a game cal...
[{"type": "stdin_stdout", "input": "1001000000\n", "output": "Mahmoud\n"}, {"type": "stdin_stdout", "input": "1011000000\n", "output": "Mahmoud\n"}, {"type": "stdin_stdout", "input": "1165278070\n", "output": "Mahmoud\n"}, {"type": "stdin_stdout", "input": "1425124860\n", "output": "Mahmoud\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\nYou are given a string s of leng...
[{"type": "stdin_stdout", "input": "10 30\naccbaaccac\n6 8 3\n2 9 1\n6 8 3\n10 5 1\n6 2 2\n1 4 7\n3 10 1\n6 9 1\n7 7 3\n7 3 2\n8 4 1\n4 9 1\n7 6 4\n6 8 2\n10 2 1\n1 3 5\n5 10 1\n7 10 1\n4 1 2\n8 5 3\n9 8 1\n8 6 2\n6 9 2\n10 3 1\n3 9 1\n5 5 5\n1 5 6\n4 2 6\n10 7 1\n9 8 2\n", "output": "NO\nYES\nNO\nYES\nNO\nNO\nYES\nYES...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSee Russian Translation\n\nW.T.H...
[{"type": "stdin_stdout", "input": "6\ncagfuq\nto\nc\no\nzmip\naqsldxek\n15\nutdk fuqgbc es akrhnsxv kexdlsqa eeht ukiphhmlp kexdlsqa ftntpjvtt cbgquf ojpkwjuk zqq rcyuuqjy p zf", "output": "U.F.E.A.K.E.U.K.F.C.O.Z.R.P.Z\n"}, {"type": "stdin_stdout", "input": "6\ncagfuq\nto\nc\no\nzmip\naqsldxek\n15\nkdtu fuqgbc es akr...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRani has challenged Nandu to gen...
[{"type": "stdin_stdout", "input": "3\n\nSAMPLE", "output": "1 2 5 6 17 18 21 22 \n3 4 7 8 19 20 23 24 \n9 10 13 14 25 26 29 30 \n11 12 15 16 27 28 31 32 \n33 34 37 38 49 50 53 54 \n35 36 39 40 51 52 55 56 \n41 42 45 46 57 58 61 62 \n43 44 47 48 59 60 63 64 \n"}, {"type": "stdin_stdout", "input": "3\n\nSAMPKE", "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\nWe have a grid with H horizontal...
[{"type": "stdin_stdout", "input": "1 3\n3 10 127\n10 14 1\n2 4 3\n4 3 12", "output": "115\n"}, {"type": "stdin_stdout", "input": "1 3\n-1 10 120\n64 14 2\n1 4 0\n3 0 6", "output": "49\n"}, {"type": "stdin_stdout", "input": "1 3\n0 9 133\n132 19 1\n1 2 3\n4 2 12", "output": "10\n"}, {"type": "stdin_stdout", "input": "1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a simple connected...
[{"type": "stdin_stdout", "input": "4 4\n1 2\n2 3\n3 4\n4 1", "output": "1 2\n1 4\n3 2\n3 4"}, {"type": "stdin_stdout", "input": "10 2\n1 2\n1 3\n0 4\n3 5\n4 5", "output": "1 2\n1 3\n"}, {"type": "stdin_stdout", "input": "10 2\n1 2\n1 3\n0 2\n3 5\n4 5", "output": "1 2\n1 3\n"}, {"type": "stdin_stdout", "input": "7 2\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\nAlong a road running in an east-...
[{"type": "stdin_stdout", "input": "1 1 3\n1\n10000100000\n2\n9999999999\n5000000000", "output": "10000100000\n10000200000\n15000099998\n"}, {"type": "stdin_stdout", "input": "1 1 3\n1\n10000000000\n2\n9999999999\n1416092751", "output": "10000000000\n10000000000\n11416092749\n"}, {"type": "stdin_stdout", "input": "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\nWe have a 3Γ—3 square grid, where...
[{"type": "stdin_stdout", "input": "ant\nobe\nrfc", "output": "abc\n"}, {"type": "stdin_stdout", "input": "ddu\ncat\nion", "output": "dan\n"}, {"type": "stdin_stdout", "input": "ant\nobe\nrcf", "output": "abf\n"}, {"type": "stdin_stdout", "input": "ddu\ncat\nioo", "output": "dao\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\nGive you N cards. Only one natur...
[{"type": "stdin_stdout", "input": "3 3\n9 3 10\n12\n6\n1", "output": "10\n4\n0\n"}, {"type": "stdin_stdout", "input": "3 3\n6 2 16\n20\n7\n2", "output": "16\n6\n0\n"}, {"type": "stdin_stdout", "input": "3 3\n2 1 21\n20\n12\n2", "output": "2\n9\n1\n"}, {"type": "stdin_stdout", "input": "3 3\n9 3 8\n12\n12\n2", "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 north country is conquered b...
[{"type": "stdin_stdout", "input": "1 2\n10 8\n0 0\n0 1\n3 3\n1 3 5\n2 13 1\n1 0 2\n0 0\n0 2\n3 3\n1 2 4\n4 8 10\n1 1 2\n0 0\n1 2\n2 2\n1 2\n5 4\n1 0\n0 1\n2 3\n1 2 3\n5 5 6\n0 0\n1 2\n0 0", "output": "24\n14\n30\n11\n21\n"}, {"type": "stdin_stdout", "input": "1 2\n10 8\n0 0\n0 1\n3 3\n1 3 5\n2 13 1\n1 0 2\n0 0\n0 2\n3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYui Hirasawa, who attends privat...
[{"type": "stdin_stdout", "input": "3\n49 128 67 78 41\n29 59 100 45 84\n50 36 40 95 66\n2\n100 000 100 100 110\n0 0 -1 0 0\n1\n89 90 85 120 82\n0", "output": "363 287\n410 -1\n466 466\n"}, {"type": "stdin_stdout", "input": "3\n49 128 67 78 19\n29 59 100 45 84\n50 36 40 95 66\n2\n100 000 100 100 110\n0 0 -1 0 0\n1\n89 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n5\n\n\nOutpu...
[{"type": "stdin_stdout", "input": "304", "output": "10816520\n"}, {"type": "stdin_stdout", "input": "309", "output": "17426472\n"}, {"type": "stdin_stdout", "input": "352", "output": "45765225\n"}, {"type": "stdin_stdout", "input": "227", "output": "1542687\n"}, {"type": "stdin_stdout", "input": "280", "output": "6677...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKoto Municipal Subway\n\nKoto Mu...
[{"type": "stdin_stdout", "input": "2 1\n11 5\n7 6\n5 0\n76 1\n1 41\n0 0", "output": "0.414213562373\n2.81024967591\n0.0827625302982\n3.60555127546\n52.7401153702\n40.0\n"}, {"type": "stdin_stdout", "input": "2 1\n14 6\n5 4\n7 7\n76 3\n9 000\n0 0", "output": "0.414213562373\n3.89949493661\n0.123105625618\n0.0\n50.74011...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem statement\n\nThere is a ...
[{"type": "stdin_stdout", "input": "4\n1 2\n2 3\n1 4\n1 3 2 -1\n-5 2 9 -1", "output": "33\n"}, {"type": "stdin_stdout", "input": "4\n1 2\n2 3\n1 4\n0 3 0 -1\n-4 2 5 -1", "output": "23\n"}, {"type": "stdin_stdout", "input": "4\n1 2\n1 4\n3 4\n-1 3 2 0\n-8 4 8 -1", "output": "27\n"}, {"type": "stdin_stdout", "input": "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\n<image>\n\n\nA directed acyclic ...
[{"type": "stdin_stdout", "input": "26 0\n1 0\n0 6\n-1 1\n18 9\n12 1\n0 2", "output": "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n"}, {"type": "stdin_stdout", "input": "21 -1\n1 2\n0 6\n-1 1\n11 4\n7 1\n0 1", "output": "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 girl Tanya climbs the sta...
[{"type": "stdin_stdout", "input": "48\n1 2 3 4 1 2 3 1 1 2 3 1 2 3 4 1 1 2 3 4 1 2 3 4 1 2 3 4 1 1 1 1 2 1 2 1 1 2 1 2 1 2 3 1 1 1 2 1\n", "output": "22\n4 3 1 3 4 1 4 4 4 1 1 1 2 2 1 2 2 3 1 1 2 1 "}, {"type": "stdin_stdout", "input": "48\n1 2 3 4 1 2 3 1 1 2 1 1 2 3 4 1 1 2 3 4 1 2 3 4 1 2 3 4 1 1 2 1 2 1 2 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\nThis problem is interactive.\n\n...
[{"type": "stdin_stdout", "input": "123\n", "output": "1 204761410474\n1 2046\n1 6\n1 2\n1 1\n"}, {"type": "stdin_stdout", "input": "3\n", "output": "1 204761410474\n1 2046\n1 6\n1 2\n1 1\n"}, {"type": "stdin_stdout", "input": "6\n", "output": "1 204761410474\n1 2046\n1 6\n1 2\n1 1\n"}, {"type": "stdin_s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMr. F has n positive integers, a...
[{"type": "stdin_stdout", "input": "100\n95 94 31 65 35 95 70 78 81 36 69 97 39 28 89 62 36 23 35 21 36 11 65 39 13 34 79 87 91 70 43 82 24 97 6 87 49 140 60 92 63 9 16 6 31 90 6 5 55 48 27 86 65 66 45 8 67 17 24 44 34 93 26 32 82 54 72 83 94 81 79 79 15 9 4 59 42 83 80 67 28 62 56 58 87 67 34 3 61 10 62 19 94 31 74 97...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSasha is a very happy guy, that'...
[{"type": "stdin_stdout", "input": "84 15\n", "output": "2429 \n"}, {"type": "stdin_stdout", "input": "100 100\n", "output": "99 \n"}, {"type": "stdin_stdout", "input": "100 98\n", "output": "100 \n"}, {"type": "stdin_stdout", "input": "100 97\n", "output": "102 \n"}, {"type": "stdin_stdout", "input": "100 3\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\nYou are playing a computer game,...
[{"type": "stdin_stdout", "input": "53 1 27 3\n44 28 48 60 29 42 59 32 9 58 3 11 7 53 4 19 37 41 36 52 29 9 24 8 31 39 52 41 37 44 26 37 37 48 6 21 20 42 25 3 33 2 35 39 33 23 10 60 48 4 1 28 21\n1 1 11\n1 1 21\n1 1 3\n1 1 42\n1 1 16\n1 1 32\n1 1 52\n1 1 17\n1 1 39\n1 1 22\n1 1 31\n1 1 50\n1 1 23\n1 1 14\n1 1 41\n1 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\nThis is the hard version of the ...
[{"type": "stdin_stdout", "input": "10\nu\nxqpczgnzazxyrvx\ncfjgfhxmzqmjgzzjthziuomldylspyfuxvjlgdc\nooydbldio\nyvaamavy\nrzjjebcgotjffuzr\nhtfkwvihzuwxczopzqujdnaorgxibjfcmlzntskawxhyoymwynitukttewfpajuph\nfactnjajntcaf\nywowyovhrgradhtrqkgurkjpudnrrqhmmwiaqicfxnoyejdsmmurusdzqgjjntocryhqsgr\nqq\n", "output": "u\nxqx\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 monopole magnet is a magnet th...
[{"type": "stdin_stdout", "input": "18 22\n....................#.\n...................#..\n..........#...........\n..................#...\n..................#...\n..................#...\n......................\n......................\n...........#..........\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\nPolycarp and his friends want to...
[{"type": "stdin_stdout", "input": "7\n4 4\n0100\n4 4\n0100\n4 4\n0100\n4 4\n0100\n4 4\n0100\n4 4\n0100\n4 4\n0100\n", "output": "0\n0\n0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "6\n6 1\n100010\n6 2\n000000\n5 1\n10101\n3 1\n001\n2 2\n00\n1 1\n0\n", "output": "1\n2\n0\n1\n1\n1\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\nUncle Bogdan is in captain Flint...
[{"type": "stdin_stdout", "input": "2\n7 4\n1 0 1 1 0 1 0\n4 0 0 -1 0 -1 0\n1 2\n1 3\n1 4\n3 5\n3 6\n3 7\n5 11\n1 2 5 2 1\n-11 -2 -6 -2 -1\n1 2\n1 3\n1 4\n3 5\n", "output": "YES\nYES\n"}, {"type": "stdin_stdout", "input": "2\n7 4\n1 0 1 1 0 1 0\n4 0 -1 -1 0 -1 0\n1 2\n1 3\n1 4\n3 5\n3 6\n3 7\n5 11\n1 2 5 2 1\n-11 -2 -6...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two integers a and...
[{"type": "stdin_stdout", "input": "11\n5 5\n13 42\n18 4\n1337 420\n123456789 1000000000\n100500 9000\n5 5\n13 42\n18 4\n2524 420\n123456789 1000000000\n", "output": "0\n3\n2\n92\n87654322\n9150\n0\n3\n2\n211\n87654322\n"}, {"type": "stdin_stdout", "input": "11\n10 5\n4 42\n17 4\n1337 420\n123456789 1000000000\n100500 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHaving learned (not without some...
[{"type": "stdin_stdout", "input": "15 31 1\n--------R---------G------------\n-G----------------------------R\n--------------G--------------R-\n---G--------------------------R\n-----R---------G---------------\n--R--G-------------------------\n-----G-----------------R-------\n--R-------------------G--------\n-R---------...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGildong's town has a train syste...
[{"type": "stdin_stdout", "input": "3\n1 2\n1\n3 4\n3 2\n2 3 11\n2 1\n9 14\n2 12 16 28 42 57 59 86 99\n3 9 14 19 25 26 20 35 41 59 85 87 99 100\n", "output": "0\n1\n2\n"}, {"type": "stdin_stdout", "input": "3\n1 2\n1\n3 4\n3 2\n1 3 4\n2 4\n9 14\n2 7 16 28 33 57 59 86 99\n3 9 14 19 25 26 28 35 41 59 85 87 99 100\n", "ou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n lanterns in a row. T...
[{"type": "stdin_stdout", "input": "16\n4\n1 0 3 3\n4\n3 0 3 0\n4\n1 4 4 0\n4\n2 2 2 0\n4\n3 0 2 2\n6\n2 6 2 0 3 0\n5\n0 1 1 1 0\n14\n12 0 5 4 0 5 0 0 0 0 0 14 0 5\n7\n0 0 0 -1 0 0 0\n14\n0 0 9 0 -1 12 0 0 0 4 0 0 1 5\n18\n0 0 0 0 0 13 0 0 0 0 0 -1 0 0 0 0 0 18\n6\n0 0 0 5 0 0\n2\n1 1\n7\n3 2 0 6 1 6 2\n10\n0 0 0 0 0 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\nThere are n cities numbered from...
[{"type": "stdin_stdout", "input": "30\n13 1\n111 5\n50 5\n61 0\n76 98\n110 1\n17 1\n4 17\n72 28\n75 90\n16 0\n13 12\n57 0\n47 12\n34 13\n61 120\n3 1\n134 100\n89 94\n88 10\n42 3\n93 33\n6 5\n81 48\n31 17\n32 0\n11 5\n69 1\n58 1\n3 21\n", "output": "750\n"}, {"type": "stdin_stdout", "input": "30\n13 1\n59 5\n50 5\n61 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\nGiven an integer n, find the max...
[{"type": "stdin_stdout", "input": "1\n168457447\n", "output": "134217727\n"}, {"type": "stdin_stdout", "input": "1\n276490162\n", "output": "268435455\n"}, {"type": "stdin_stdout", "input": "1\n109011159\n", "output": "67108863\n"}, {"type": "stdin_stdout", "input": "1\n99888383\n", "output": "67108863\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\nAny resemblance to any real cham...
[{"type": "stdin_stdout", "input": "MYCXFLPTHVGWDSRXCOI BERLAND 5:9\nSPSHVVQLXQNRUB BERLAND 0:5\nSPSHVVQLXQNRUB MYCXFLPTHVGWDSRXCOI 4:6\nZPIIZCGCLCHNLIXCPBRM MYCXFLPTHVGWDSRXCOI 7:5\nZPIIZCGCLCHNLIXCPBRM SPSHVVQLXQNRUB 3:9\n", "output": "1:0"}, {"type": "stdin_stdout", "input": "VJWNNQCMHKJVXAPRVAD BERLAND 9:3\nVJWNNQC...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNumbers k-bonacci (k is integer,...
[{"type": "stdin_stdout", "input": "615693473 3\n", "output": "22\n334745777 181997601 53798080 29249425 8646064 4700770 1389537 755476 223317 121415 35890 19513 5768 3136 927 504 149 81 24 13 4 2 "}, {"type": "stdin_stdout", "input": "999999999 30\n", "output": "21\n536870912 268435456 134217728 33554432 16777216 8388...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 number is a number forme...
[{"type": "stdin_stdout", "input": "141441441\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "141414141\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1000000000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "111111111\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "11411414...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSereja loves all sorts of algori...
[{"type": "stdin_stdout", "input": "yxzyzxzzxyyzzxxxzyyzzyzxxzxyzyyzxyzxyxxyzxyxzyzxyzxyyxzzzyzxyyxyzxxy\n10\n17 67\n6 42\n12 45\n56 56\n14 13\n44 49\n1 1\n50 54\n3 33\n19 40\n", "output": "NO\nNO\nNO\nYES\nYES\nYES\nYES\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "yxzyzxzzxyyzzxxxzyyzzyzxxzxyzyyzxyzxyxxyzxyxz...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nInna loves sweets very much. Tha...
[{"type": "stdin_stdout", "input": "50 37 500\n", "output": "10544\n(1,1) (2,1) (3,1) (4,1) (4,2) (4,3) (4,4) (4,5) (4,6) (4,7) (4,8) (4,9) (4,10) (4,11) (4,12) (4,13) (4,14) (4,15) (4,16) (4,17) (4,18) (4,19) (4,20) (4,21) (4,22) (4,23) (4,24) (4,25) (4,26) (4,27) (4,28) (4,29) \n(1,1) (2,1) (3,1) (3,2) (3,3) (3,4) (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\nDevelopers often face with regul...
[{"type": "stdin_stdout", "input": "100\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\n?b\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 is Devu's birthday. For ce...
[{"type": "stdin_stdout", "input": "40\n37 15\n48 10\n16 5\n30 23\n32 20\n24 4\n46 19\n16 13\n1 1\n37 22\n44 29\n24 6\n27 10\n39 16\n28 13\n5 4\n31 22\n9 2\n30 26\n23 16\n16 12\n43 5\n29 1\n20 5\n40 12\n18 14\n22 15\n29 2\n3 2\n6 3\n45 28\n42 34\n43 32\n10 10\n12 8\n10 8\n4 1\n17 17\n16 7\n8 7\n", "output": "796297179\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 industrial factory is reform...
[{"type": "stdin_stdout", "input": "100000 100000\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "100000 101000\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "32768 65536\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "65535 65536\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAn n Γ— n table a is defined as f...
[{"type": "stdin_stdout", "input": "010\n", "output": "48620\n"}, {"type": "stdin_stdout", "input": "10\n", "output": "48620\n"}, {"type": "stdin_stdout", "input": "9\n", "output": "12870\n"}, {"type": "stdin_stdout", "input": "8\n", "output": "3432\n"}, {"type": "stdin_stdout", "input": "7\n", "output": "924\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\nPolycarp and Vasiliy love simple...
[{"type": "stdin_stdout", "input": "100000 100000 100000 123228\n", "output": "Polycarp\n"}, {"type": "stdin_stdout", "input": "100000 99999 100000 100000\n", "output": "Polycarp\n"}, {"type": "stdin_stdout", "input": "100000 99999 100010 100000\n", "output": "Polycarp\n"}, {"type": "stdin_stdout", "input": "100000 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\nThe 9-th grade student Gabriel n...
[{"type": "stdin_stdout", "input": "43951 66098\n1604 35654\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "28473 80380\n2568 95212\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "35413 75637\n4087 30166\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "25401 103980\n957 30449\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 broken clock. Yo...
[{"type": "stdin_stdout", "input": "12\n17:30\n", "output": "07:30\n"}, {"type": "stdin_stdout", "input": "24\n99:99\n", "output": "09:09\n"}, {"type": "stdin_stdout", "input": "24\n17:30\n", "output": "17:30\n"}, {"type": "stdin_stdout", "input": "12\n90:32\n", "output": "10:32\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\nGenerous sponsors of the olympia...
[{"type": "stdin_stdout", "input": "10\n-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000\n7 8\n5 10\n8 6\n1 5\n7 9\n3 9\n2 10\n2 6\n4 3\n", "output": "Impossible"}, {"type": "stdin_stdout", "input": "10\n1000000000 1000000000 1000000000 1000000000 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAccording to an old legeng, a lo...
[{"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\nVladik had started reading a com...
[{"type": "stdin_stdout", "input": "20 20\n18 17 2 3 16 15 1 9 12 8 20 11 13 14 4 5 19 7 10 6\n13 15 15\n1 1 1\n2 2 2\n11 14 11\n10 11 10\n2 8 6\n12 18 16\n4 8 8\n2 2 2\n5 11 11\n4 18 9\n5 6 6\n3 20 12\n8 8 8\n6 16 11\n9 18 18\n8 18 17\n1 1 1\n2 6 5\n1 4 3\n", "output": "No\nYes\nYes\nNo\nYes\nYes\nNo\nNo\nYes\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\nThere are some ambiguities when ...
[{"type": "stdin_stdout", "input": "101\nukuu\nh\nouuo\no\nkkuo\nko\nu\nh\nhku\nh\nh\nhuo\nuhoh\nkuu\nhu\nhkko\nuhuk\nkoho\nh\nhukk\noohu\nkk\nkko\nou\noou\nh\nuuu\nuh\nkhuk\nokoo\nouou\nuo\nkk\noo\nhuok\no\nu\nhok\nhu\nhhuu\nkuu\nooho\noku\nhuoh\nhhkh\nuuuh\nouo\nhou\nhhu\nh\no\nokou\nuo\nh\nukk\nu\nhook\nh\noouk\noku...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 family consisting of father be...
[{"type": "stdin_stdout", "input": "100 57 30 51\n", "output": "104\n103\n51\n"}, {"type": "stdin_stdout", "input": "100 99 98 97\n", "output": "196\n195\n98"}, {"type": "stdin_stdout", "input": "99 98 80 97\n", "output": "196\n195\n97\n"}, {"type": "stdin_stdout", "input": "100 50 19 13\n", "output": "100\n50\n19\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\nArkady decided to buy roses for ...
[{"type": "stdin_stdout", "input": "30 15\n7926 577 5009 7237 4395 3239 8994 4429 8126 2925 139 320 4442 3397 1292 2800 9505 6043 5946 8058 4031 6871 4689 1977 73 440 5320 5290 4707 387\nOOWOWWORRWOWORWRRRRWORROOWWROW\n", "output": "91633\n"}, {"type": "stdin_stdout", "input": "30 15\n7926 577 5009 7237 4395 3239 8994 ...
code_stdio