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\nBeroffice text editor has a wide...
[{"type": "stdin_stdout", "input": "bddabcdfaccdabcdfadddabcdfabbdabcdfacddabcdfacdbabcdfacbbabcdfacbcabcdfacbdabcdfadbbabcdfabdbabcdfabdcabcdfabbcabcdfabccabcdfabbbabcdfaddcabcdfaccbabcdfadbdabcdfacccabcdfadcdabcdfadcbabcdfabcbabcdfadbcabcdfacdcabcdfabcdabcdfadccabcdfaddb\n", "output": "bd dabc dfacc dabc dfadddabc df...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 has found one more cool...
[{"type": "stdin_stdout", "input": "101 9\n3 2 2 1 4 1 3 2 3 4 3 2 3 1 4 4 1 1 4 1 3 3 4 1 2 1 1 3 1 2 2 4 3 1 4 3 1 1 4 4 1 2 1 1 4 2 3 4 1 2 1 4 4 1 4 3 1 4 2 1 2 1 4 3 4 3 4 2 2 4 3 2 1 1 4 3 2 2 4 3 3 2 4 1 3 2 2 4 1 3 4 2 1 3 3 2 2 1 1 3 1\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "101 9\n3 2 2 1 4 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\nStudents went into a class to wr...
[{"type": "stdin_stdout", "input": "101 4\n", "output": "YES\n2 4 1 3 \n7 5 8 6 \n10 12 9 11 \n15 13 16 14 \n18 20 17 19 \n23 21 24 22 \n26 28 25 27 \n31 29 32 30 \n34 36 33 35 \n39 37 40 38 \n42 44 41 43 \n47 45 48 46 \n50 52 49 51 \n55 53 56 54 \n58 60 57 59 \n63 61 64 62 \n66 68 65 67 \n71 69 72 70 \n74 76 73 75 \n7...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWhen registering in a social net...
[{"type": "stdin_stdout", "input": "ELioO1lOoOIOiLoooi1iolul1O\n7\nOoEIuOIl1ui1010uiooOoi0Oio001L0EoEolO0\nOLIoOEuoE11u1u1iLOI0oO\nuEOuO0uIOOlO01OlEI0E1Oo0IO1LI0uE0LILO0\nEOo0Il11iIOOOIiuOiIiiLOLEOOII001EE\niOoO0LOulioE0OLIIIulli01OoiuOOOoOlEiI0EiiElIIu0\nlE1LOE1Oil\n1u0EOliIiIOl1u110il0l1O0u\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\nAn atom of element X can exist i...
[{"type": "stdin_stdout", "input": "50 42\n257 258 350 375 1014 1017 1051 1097 1169 1177 1223 1836 1942 1983 2111 2131 2341 2418 2593 2902 2948 3157 3243 3523 3566 4079 4499 4754 5060 5624 6279 6976 7011 7071 7278 7366 7408 7466 7526 7837 7934 8532 8577 8680 9221 9271 9327 9411 9590 9794\n", "output": "0.918918918919\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're given a tree with n verti...
[{"type": "stdin_stdout", "input": "10\n7 1\n8 4\n8 10\n4 7\n6 10\n9 3\n3 5\n2 10\n2 5\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "10\n8 1\n8 4\n8 10\n4 7\n6 10\n9 3\n3 5\n2 10\n2 5\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "10\n4 1\n10 4\n8 10\n4 7\n6 5\n9 2\n3 5\n2 10\n2 5\n", "output": "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\nAgain a simple task from Oz! He ...
[{"type": "stdin_stdout", "input": "10\nIAADIGED\nFGAAAJFH\nGAEDDHCD\nICICDCDH\nJAAHBJGH\nFBEIIJBE\nAEHAHAHD\nEIAHJCDJ\nGEGEEDGE\nHEJJIHFA\nAHJHHGEC\nGEDBGBAE\nGBIFIIIB\nCBHJDAGG\nCBJCCJBA\nFHEDFDBD\nEAAHFJEB\nBBEFGDBB\nJCGHCGHG\nAGCEDGGA", "output": "11\n11\n13\n16\n20\n20\n15\n19\n14\n20\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\nAfter a furious battle Pirate Ja...
[{"type": "stdin_stdout", "input": "hack\n\nSAMPLE", "output": "-105 -98 -100 -108 \n"}, {"type": "stdin_stdout", "input": "hjca\n\nSAMPLE", "output": "-105 -107 -100 -98 \n"}, {"type": "stdin_stdout", "input": "ackh\n\nELNPAR", "output": "-98 -100 -108 -105 \n"}, {"type": "stdin_stdout", "input": "acki\n\nELNPAR", "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\nYou are the top spy of AtCoder K...
[{"type": "stdin_stdout", "input": "32\n3 1 8 1 5 9 4 2 3 3 9 8 11 7 16 4 2 4 8 2 4 4 7 7 3 3 30 4 4 7 2 8", "output": "13\n"}, {"type": "stdin_stdout", "input": "32\n3 1 8 1 5 2 7 2 3 3 9 8 11 7 16 4 2 4 8 2 4 4 7 7 3 3 30 4 4 7 2 8", "output": "12\n"}, {"type": "stdin_stdout", "input": "32\n3 1 4 1 8 11 8 6 5 3 5 8 9...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAt an arcade, Takahashi is playi...
[{"type": "stdin_stdout", "input": "30 6\n325 234 123\nrspsspspsrpspsppprpsprpssprpsr", "output": "6328\n"}, {"type": "stdin_stdout", "input": "30 6\n325 177 123\nrspsspspsrpspsppprpsprpssprpsr", "output": "5758\n"}, {"type": "stdin_stdout", "input": "30 13\n13 228 123\nssprpssprpsprpppspsprspspsspsr", "output": "2569\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 2020, AtCoder Inc. with an an...
[{"type": "stdin_stdout", "input": "1", "output": "Hello World"}, {"type": "stdin_stdout", "input": "2\n-2\n116", "output": "114\n"}, {"type": "stdin_stdout", "input": "2\n-2\n178", "output": "176\n"}, {"type": "stdin_stdout", "input": "2\n-2\n184", "output": "182\n"}, {"type": "stdin_stdout", "input": "2\n-2\n143", "o...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given sequences A and B ...
[{"type": "stdin_stdout", "input": "3\n11 3\n-1 1\n2 8", "output": "9\n"}, {"type": "stdin_stdout", "input": "3\n8 3\n-1 1\n5 8", "output": "9\n"}, {"type": "stdin_stdout", "input": "3\n8 3\n-1 0\n4 8", "output": "8\n"}, {"type": "stdin_stdout", "input": "3\n8 3\n0 1\n4 8", "output": "9"}, {"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\nTakahashi is an expert of Clone ...
[{"type": "stdin_stdout", "input": "4\n2 1\n16 20\n6 56\n13 0", "output": "13\n"}, {"type": "stdin_stdout", "input": "4\n1 7\n5 10\n6 50\n10 1", "output": "12\n"}, {"type": "stdin_stdout", "input": "4\n1 7\n5 10\n6 50\n10 0", "output": "12\n"}, {"type": "stdin_stdout", "input": "4\n1 7\n5 16\n6 50\n10 0", "output": "12...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 string s of length 3 ...
[{"type": "stdin_stdout", "input": "bceab", "output": "Second\n"}, {"type": "stdin_stdout", "input": "bacba", "output": "First\n"}, {"type": "stdin_stdout", "input": "badba", "output": "First\n"}, {"type": "stdin_stdout", "input": "cadba", "output": "First\n"}, {"type": "stdin_stdout", "input": "dadba", "output": "Firs...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 children in AtCoder ...
[{"type": "stdin_stdout", "input": "-465", "output": "107880\n"}, {"type": "stdin_stdout", "input": "-792", "output": "313236\n"}, {"type": "stdin_stdout", "input": "-937", "output": "438516\n"}, {"type": "stdin_stdout", "input": "-845", "output": "356590\n"}, {"type": "stdin_stdout", "input": "-647", "output": "208981...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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. Suzuki has opened a new mobi...
[{"type": "stdin_stdout", "input": "5\n-2\n45\n162\n2\n15\n0", "output": "73\n"}, {"type": "stdin_stdout", "input": "5\n-2\n32\n30\n2\n12\n0", "output": "52\n"}, {"type": "stdin_stdout", "input": "5\n-1\n-1\n4\n106\n0\n0", "output": "-3\n"}, {"type": "stdin_stdout", "input": "5\n4\n31\n14\n11\n14\n0", "output": "91\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\nConsider the following game. The...
[{"type": "stdin_stdout", "input": "2 1 0 5\n3 1 2 6\n2 2 1 3\n0 0 0 0", "output": "0.50000\n0.833333\n1.000\n"}, {"type": "stdin_stdout", "input": "2 1 1 5\n3 1 1 6\n2 2 1 3\n0 0 0 0", "output": "1.00000\n0.833333\n1.000\n"}, {"type": "stdin_stdout", "input": "2 1 1 5\n3 1 1 6\n2 2 0 3\n0 0 0 0", "output": "1.00000\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\nNantendo Co., Ltd. has released ...
[{"type": "stdin_stdout", "input": "CBA\ncba\ncCa\nX\nYZ\nZ\n-", "output": "BbA\nYX\n"}, {"type": "stdin_stdout", "input": "CBA\ncba\ncCa\nY\nYZ\nZ\n-", "output": "BbA\nYY\n"}, {"type": "stdin_stdout", "input": "CBA\ncca\ncCa\nX\nZY\nZ\n-", "output": "BcA\nXY\n"}, {"type": "stdin_stdout", "input": "CAB\ncba\ncCa\nX\nYZ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAmber Claes Maes, a patissier, o...
[{"type": "stdin_stdout", "input": "3 5\n###.#\n#####\n###..\n4 5\n.#.##\n####.\n####.\n##.#.\n8 8\n.#.#.#.#\n########\n.######.\n########\n.######.\n########\n.######.\n########\n8 8\n.#.#.#.#\n########\n.##.#.#.\n##....##\n.##.###.\n##...###\n.##.###.\n###.#.##\n4 4\n####\n####\n####\n####\n0 0", "output": "3\n5\n11\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\n-1 2\n12 0\n1 -3\n3 13", "output": "-39\n"}, {"type": "stdin_stdout", "input": "4\n-2 4\n7 1\n-1 8\n2 25", "output": "-25\n"}, {"type": "stdin_stdout", "input": "4\n-1 -2\n2 3\n3 2\n2 22", "output": "-28\n"}, {"type": "stdin_stdout", "input": "4\n-1 -2\n2 5\n3 2\n2 22", "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\nProblem Statement\n\nDo you know...
[{"type": "stdin_stdout", "input": "5\n11110101011100110010111100010011", "output": "13\n"}, {"type": "stdin_stdout", "input": "5\n11110101011100110010111100000010", "output": "12\n"}, {"type": "stdin_stdout", "input": "5\n10111101011100110010111100000010", "output": "14\n"}, {"type": "stdin_stdout", "input": "5\n10111...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\n3\naab\nczc\...
[{"type": "stdin_stdout", "input": "3\naab\nccz\nbaa", "output": "aac\n"}, {"type": "stdin_stdout", "input": "3\nbba\nzcc\nbaa", "output": "aaz\n"}, {"type": "stdin_stdout", "input": "3\nabb\nzbc\nbaa", "output": "aab\n"}, {"type": "stdin_stdout", "input": "3\nbbb\nzcd\nbaa", "output": "abc\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\nB: Dansunau www --Dance Now!-\n\...
[{"type": "stdin_stdout", "input": "9\n9 8 7 6 9 5 3 2 1\n1 1 1\n3 4 2\n4 3 3\n4 0 4\n5 10 5\n12 9 7\n7 7 7\n8 11 8\n9 11 9", "output": "3\n"}, {"type": "stdin_stdout", "input": "9\n9 8 7 6 9 5 3 2 1\n1 1 1\n3 4 2\n4 3 3\n4 0 4\n5 10 5\n12 9 7\n7 7 7\n8 8 8\n9 11 9", "output": "3\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\nD: Two Colors Sort\n\nproblem\n\...
[{"type": "stdin_stdout", "input": "1 0\n1 -1 18", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1 0\n2 -1 18", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "2 0\n1 2 11", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "2 0\n1 2 14", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "2 0\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\nWrite a program which manipulate...
[{"type": "stdin_stdout", "input": "3 5\n0 1 1 0\n0 2 3 2\n0 2 3 3\n1 2 3\n1 2 3", "output": "10\n10\n"}, {"type": "stdin_stdout", "input": "3 5\n0 1 2 1\n0 2 3 2\n0 2 3 3\n1 1 2\n1 2 3", "output": "7\n11\n"}, {"type": "stdin_stdout", "input": "3 5\n0 1 1 1\n0 2 3 2\n0 2 3 3\n1 1 2\n1 2 3", "output": "6\n10\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\nNatasha is going to fly on a roc...
[{"type": "stdin_stdout", "input": "90\n35\n1 68 16 30 24 1 1 1 35 1 1 67 1 1 1 1 33 16 37 77 83 1 77 26 1 1 68 67 70 62 1 47 1 1 1 84 1 65 1 32 83 1 1 1 28 1 71 76 84 1 1 5 1 74 10 1 1 1 38 87 13 1 7 66 81 49 1 9 1 11 1 25 1 1 1 1 7 1 1 36 61 47 51 1 1 69 40 1 37 1\n40 1 21 1 19 51 37 52 64 1 86 1 5 24 1 1 1 19 36 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\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 81 60 92 63 9 16 6 31 90 6 5 70 48 27 86 65 66 45 8 67 17 24 44 34 93 26 32 82 54 72 83 94 81 79 79 9 9 4 59 42 83 80 67 28 62 56 58 87 67 34 3 61 14 62 19 94 31 74 97 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\nPolycarp, Arkady's friend, prepa...
[{"type": "stdin_stdout", "input": "2\n4\n1.9585346052548882 31.000\n12 0\n11 6\n30 1\n5 1\n3\n1.360280845492949 30.337801087585063\n0 10\n10 8\n20 8\n", "output": "7\n18\n"}, {"type": "stdin_stdout", "input": "2\n4\n1.557488533293537 31.000\n12 0\n11 6\n30 1\n5 1\n3\n1.360280845492949 30.337801087585063\n0 10\n10 8\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\nAs a German University in Cairo ...
[{"type": "stdin_stdout", "input": "65 173 136\n26 18 8 11 1 22 44 6 15 22 13 49 30 36 37 41 25 27 9 36 36 1 45 20 7 47 28 30 30 21 33 32 9 11 16 5 19 12 44 40 25 40 32 36 15 34 4 43 28 19 29 33 7 11 18 13 40 18 10 26 1 48 20 38 1 20 34 8 46 8 32 35 16 49 26 36 11 16 4 29 35 44 14 21 22 42 10 1 3 12 35 30 14 45 2 24 32...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPetya loves lucky numbers. We al...
[{"type": "stdin_stdout", "input": "691900\n", "output": "4444477777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAt the first holiday in spring, ...
[{"type": "stdin_stdout", "input": "100 15 6 10\n6 9 1 7 6 4 1 9 3 2 4 6 2 5 3 10 9 2 9 1 6 5 6 2 3 10 7 10 7 4 5 4 4 4 4 7 1 10 8 4 8 3 10 10 7 4 4 10 6 1 8 5 4 6 2 3 10 3 2 5 7 5 6 10 10 3 4 7 4 3 3 1 7 8 10 10 10 10 8 3 7 4 2 1 8 6 5 6 5 8 7 9 2 1 5 2 4 6 10 8\n6 9 7 8 7 1 4 3 5 8\n", "output": "2\n76 77 \n"}, {"typ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 favorite shop sells n Kinde...
[{"type": "stdin_stdout", "input": "4\n1 1 1\n1000000000 1000000000 1000000000\n1000000000 999999999 1\n1247516660 666666667 666666666\n", "output": "1\n1\n1000000000\n580849995\n"}, {"type": "stdin_stdout", "input": "4\n1 1 1\n1000000000 1000000000 1000000000\n1000000000 999999999 1\n999999999 666666667 666666666\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 an environmental activis...
[{"type": "stdin_stdout", "input": "4\n1\n100\n50 1\n49 1\n100\n8\n100 200 100 200 100 200 100 100\n10 2\n15 3\n107\n3\n1000000000 1000000000 1000000000\n50 1\n50 1\n3000000000\n5\n200 100 100 100 100\n69 5\n31 2\n90\n", "output": "-1\n6\n3\n4\n"}, {"type": "stdin_stdout", "input": "4\n1\n100\n50 1\n49 1\n100\n8\n100 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\nByteburg Senate elections are co...
[{"type": "stdin_stdout", "input": "11 14\n8 4 17 5 14 9 13 3 17 21 27\n5 16 1 4 24 14 8 32 29 19 17\n11 6 12 0 16 31 27 11 4 7 32\n2 9 2 31 30 12 21 11 29 29 26\n9 21 4 25 26 14 28 16 12 26 23\n31 22 30 5 6 29 31 11 20 18 29\n5 21 27 13 23 23 9 6 25 21 25\n8 16 29 5 26 14 2 15 3 15 22\n19 18 18 21 5 31 14 1 8 3 19\n16...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 has a cute cat. To keep he...
[{"type": "stdin_stdout", "input": "6\n3 2 2 2\n0 0 -2 -2 2 2\n3 1 4 1\n0 0 -1 -1 1 1\n1 1 1 1\n1 1 1 1 1 1\n0 0 0 1\n0 0 0 0 0 1\n5 1 1 1\n0 0 -100 -100 0 100\n1 1 5 1\n0 0 -100 -100 100 0\n", "output": "Yes\nNo\nNo\nYes\nYes\nYes\n"}, {"type": "stdin_stdout", "input": "6\n3 2 2 2\n0 1 -2 -2 2 2\n3 1 4 1\n0 0 -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 are n candies in a row, th...
[{"type": "stdin_stdout", "input": "7\n11\n3 1 4 1 5 9 1 4 10 3 5\n1\n1000\n3\n1 2 1\n13\n1 2 3 4 5 6 7 8 9 10 11 12 13\n2\n2 1\n6\n1 1 1 1 1 2\n7\n1 2 1 1 1 1 1\n", "output": "6 23 23\n1 1000 0\n2 1 3\n6 45 46\n2 2 1\n4 4 3\n4 4 4\n"}, {"type": "stdin_stdout", "input": "7\n11\n3 1 4 2 5 9 1 4 10 3 5\n1\n1000\n3\n1 2 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\nIn Omkar's last class of math, h...
[{"type": "stdin_stdout", "input": "10\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n", "output": "500000000 500000000\n500000000 500000000\n500000000 500000000\n500000000 500000000\n500000000 500000000\n500000000 500000000\n500000000 500000000\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBoboniu gives you\n\n * r red b...
[{"type": "stdin_stdout", "input": "4\n0 1 1 1\n8 1 9 3\n0 0 0 0\n1000000000 1000000000 1000000000 1000000000\n", "output": "No\nYes\nYes\nYes\n"}, {"type": "stdin_stdout", "input": "4\n0 1 1 1\n8 1 9 5\n0 0 0 0\n1000000000 1000000000 1000000000 1000000000\n", "output": "NO\nYES\nYES\nYES\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\nPolycarp has a string s[1 ... n]...
[{"type": "stdin_stdout", "input": "6\n8\n20192020\n8\n22019020\n4\n2020\n5\n20002\n6\n729040\n6\n200200\n", "output": "\nYES\nYES\nYES\nNO\nNO\nNO\n"}, {"type": "stdin_stdout", "input": "1\n8\n00202000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1\n5\n20502\n", "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\nThe brave Knight came to the Kin...
[{"type": "stdin_stdout", "input": "15\n11 22 13 24 15 26 17 28 19 30 21 2 23 4 25 6 27 8 29 10 1 12 3 14 5 16 7 18 9 20\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "9\n16 5 18 7 2 9 4 11 6 13 8 15 10 17 12 1 14 3\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "4\n1 2 3 4 5 6 7 8\n", "output": "\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 came up with a new prog...
[{"type": "stdin_stdout", "input": "4\n6\na := h\nb := aha\nc = a + b\nc = c + c\ne = c + c\nd = a + c\n15\nx := haha\nx = x + x\nx = x + x\nx = x + x\nx = x + x\nx = x + x\nx = x + x\nx = x + x\nx = x + x\nx = x + x\nx = x + x\nx = x + x\nx = x + x\nx = x + x\nx = x + x\n1\nhaha := hah\n5\nhaahh := aaaha\nahhhh = haah...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSome dwarves that are finishing ...
[{"type": "stdin_stdout", "input": "aaaabcccca\naaaadccccb\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "aaaabcccca\naaaadccdcb\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "accccbaaaa\naaaadccdcb\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "rtfabanpc\natfabrnpc\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\nJohn Doe has an n × m table. Joh...
[{"type": "stdin_stdout", "input": "100 1000000000000000000 10000\n", "output": " 1\n"}, {"type": "stdin_stdout", "input": "1 1000000000000000000 0\n", "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\nThe Little Elephant has an integ...
[{"type": "stdin_stdout", "input": "11100010010010000110101101101100111111001010001101101001001111010110010111001011010000001100110101000101111000001111101111110010000010101110011110101101010110001100011101111011100010011101100111110010111111100110101000000111101000000000110100100101111101000110101010101101001110001110...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCapitalization is writing a word...
[{"type": "stdin_stdout", "input": "lZqBqKeGvNdSeYuWxRiVnFtYbKuJwQtUcKnVtQhAlOeUzMaAuTaEnDdPfDcNyHgEoBmYjZyFePeJrRiKyAzFnBfAuGiUyLrIeLrNhBeBdVcEeKgCcBrQzDsPwGcNnZvTsEaYmFfMeOmMdNuZbUtDoQoNcGwDqEkEjIdQaPwAxJbXeNxOgKgXoEbZiIsVkRrNpNyAkLeHkNfEpLuQvEcMbIoGaDzXbEtNsLgGfOkZaFiUsOvEjVeCaMcZqMzKeAdXxJsVeCrZaFpJtZxInQxFaSmGgSsV...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 a serious bug has been ...
[{"type": "stdin_stdout", "input": "10 2\n10 2\n9 3\n9 4\n7 2\n4 6\n10 1\n9 2\n3 10\n7 1\n5 1\n", "output": "43\n"}, {"type": "stdin_stdout", "input": "10 3\n6 3\n6 10\n2 5\n5 7\n6 2\n9 2\n8 1\n10 5\n5 10\n7 6\n", "output": "34\n"}, {"type": "stdin_stdout", "input": "10 4\n10 2\n9 3\n9 4\n7 2\n4 6\n10 1\n9 2\n3 10\n7 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\nDZY has a hash table with p buck...
[{"type": "stdin_stdout", "input": "101 15\n139988797\n524419455\n1205904463\n153341038\n146759898\n171753194\n163710849\n42060733\n1382862835\n979451110\n1200809750\n37821717\n446728232\n850870259\n221398500\n", "output": "12\n"}, {"type": "stdin_stdout", "input": "101 15\n139988797\n524419455\n1205904463\n153341038\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 X and Little Z are good f...
[{"type": "stdin_stdout", "input": "13 42 292 733\n304 308\n362 365\n396 397\n686 688\n719 722\n815 816\n901 902\n904 905\n921 924\n929 933\n953 954\n977 980\n982 985\n28 30\n36 37\n108 112\n123 127\n134 135\n151 153\n160 162\n203 205\n208 212\n240 243\n261 264\n271 274\n294 297\n356 358\n383 385\n408 412\n415 418\n435...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHiking club \"Up the hill\" just...
[{"type": "stdin_stdout", "input": "700\n399\n", "output": "400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Johnny has recently learn...
[{"type": "stdin_stdout", "input": "4000\n", "output": "341934157\n"}, {"type": "stdin_stdout", "input": "3000\n", "output": "949793998\n"}, {"type": "stdin_stdout", "input": "3555\n", "output": "810675957\n"}, {"type": "stdin_stdout", "input": "2999\n", "output": "634360769\n"}, {"type": "stdin_stdout", "input": "3789...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 team of furry rescue rangers w...
[{"type": "stdin_stdout", "input": "-10000 10000 10000 -10000\n1000 100\n-890 455\n-891 454\n", "output": "17904214.8944449873\n"}, {"type": "stdin_stdout", "input": "-10000 -10000 10000 10000\n1000 1000\n-454 -891\n-454 -891\n", "output": "17933348.203209"}, {"type": "stdin_stdout", "input": "-10000 -6484 10000 10000\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given the string s of le...
[{"type": "stdin_stdout", "input": "100 1 1\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n", "output": "100\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\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\nGrandma Laura came to the market...
[{"type": "stdin_stdout", "input": "40 562\nhalfplus\nhalfplus\nhalfplus\nhalfplus\nhalfplus\nhalfplus\nhalfplus\nhalfplus\nhalf\nhalf\nhalf\nhalfplus\nhalf\nhalf\nhalfplus\nhalf\nhalfplus\nhalf\nhalfplus\nhalf\nhalfplus\nhalf\nhalfplus\nhalfplus\nhalfplus\nhalfplus\nhalfplus\nhalf\nhalf\nhalfplus\nhalf\nhalfplus\nhalf...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given n points on a plan...
[{"type": "stdin_stdout", "input": "20\n0 17\n1 8\n1 9\n2 5\n2 11\n3 0\n5 10\n5 13\n6 7\n7 3\n12 13\n13 7\n14 16\n15 10\n15 18\n17 2\n17 12\n18 14\n19 18\n20 17\n", "output": "18\n"}, {"type": "stdin_stdout", "input": "20\n0 17\n1 8\n1 9\n2 5\n2 20\n3 0\n5 10\n5 13\n6 7\n7 3\n12 13\n13 7\n14 16\n15 10\n15 18\n17 2\n17 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMasha wants to open her own bake...
[{"type": "stdin_stdout", "input": "8 57 3\n1 3 15\n2 3 1\n1 7 21\n1 2 11\n2 1 16\n1 6 4\n1 3 2\n3 7 17\n5 8 3\n1 3 18\n1 4 3\n1 2 1\n2 8 14\n1 4 17\n4 5 21\n2 3 6\n3 5 11\n2 8 11\n3 4 1\n1 3 9\n1 4 3\n2 3 12\n1 5 9\n2 3 15\n1 2 14\n1 2 10\n1 4 19\n5 7 7\n5 8 20\n5 8 1\n1 4 3\n4 5 8\n5 7 1\n1 2 14\n4 5 9\n6 7 2\n2 6 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 is a square box 6 × 6 in s...
[{"type": "stdin_stdout", "input": "RSTYWU\nLMNXQO\nFGHVKI\nEABP9C\n345J86\nZD7210\n", "output": "2782\nR6\nU5\nR6\nD5\nR6\nU5\nR6\nD5\nR6\nU5\nR6\nR6\nD5\nR6\nU4\nR6\nD4\nR6\nU4\nR6\nD4\nR6\nU4\nR6\nR6\nD4\nR6\nU3\nR6\nD3\nR6\nU3\nR6\nD3\nR6\nU3\nR6\nR6\nD3\nR6\nU2\nR6\nD2\nR6\nU2\nR6\nD2\nR6\nU2\nR6\nR6\nD2\nR6\nU1\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 again tries to play some co...
[{"type": "stdin_stdout", "input": "100 72\n8 8 7 9 6 1 4 5 3 7 5 10 5 4 1 3 4 1 3 1 6 6 4 5 4 5 6 1 10 7 9 1 6 10 6 6 9 3 3 4 5 9 4 9 8 1 5 9 3 7 1 8 5 2 1 1 7 7 7 6 6 4 2 9 10 2 8 3 1 1 4 8 5 9 7 10 9 4 2 3 7 7 6 7 8 5 1 3 8 5 1 8 9 10 3 7 1 8 10 5\n", "output": "4549\n"}, {"type": "stdin_stdout", "input": "100 72\n8...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCalculate the minimum number of ...
[{"type": "stdin_stdout", "input": "smaxpqplaqqbxuqxalqmbmmgubbpspxhawbxsuqhhegpmmpebqmqpbbeplwaepxmsahuepuhuhwxeqmmlgqubuaxehwuwasgxpqmugbmuawuhwqlswllssueglbxepbmwgs\n1\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "smaxpqplaqqbxuqxalqmbmmgubbpspxhawbxsuqhhegpmmpebqmqpbbeplwaepxmsahuepuhuhwxeqmmlgqubuaxehwu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIvan has an array consisting of ...
[{"type": "stdin_stdout", "input": "50\n48 37 47 50 46 43 42 46 36 40 45 41 40 50 35 49 37 42 44 45 49 44 31 47 45 49 48 41 45 45 48 20 34 43 43 41 47 50 41 48 38 48 43 48 46 48 32 37 47 45\n", "output": "31\n1 2 3 4 5 6 7 8 36 9 10 11 40 12 35 13 14 42 15 16 17 44 31 18 19 49 21 22 23 24 25 20 34 26 27 28 29 50 41 30 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya the programmer lives in th...
[{"type": "stdin_stdout", "input": "999999 1000000\n", "output": "Equal\n"}, {"type": "stdin_stdout", "input": "1000000 999993\n", "output": "Masha\n"}, {"type": "stdin_stdout", "input": "999997 1000000\n", "output": "Dasha\n"}, {"type": "stdin_stdout", "input": "459973 1000000\n", "output": "Dasha\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\nThe following problem is well-kn...
[{"type": "stdin_stdout", "input": "100000000\n100000000\n", "output": "100000000\n"}, {"type": "stdin_stdout", "input": "100000000\n100001000\n", "output": "100001000\n"}, {"type": "stdin_stdout", "input": "100000000\n110001000\n", "output": "110001000\n"}, {"type": "stdin_stdout", "input": "99999999\n100000000\n", "o...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFafa owns a company that works o...
[{"type": "stdin_stdout", "input": "127925\n", "output": "23\n"}, {"type": "stdin_stdout", "input": "83160\n", "output": "127"}, {"type": "stdin_stdout", "input": "100000\n", "output": "35"}, {"type": "stdin_stdout", "input": "110309\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "19764\n", "output": "29\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\nAkshara is a Maths teacher at Dy...
[{"type": "stdin_stdout", "input": "20\n3 2\n2 4 2\n100 4653\n96 86 92 95 97 88 99 89 98 97 96 87 91 90 89 91 95 94 98 86 93 85 99 96 85 90 99 98 100 96 90 99 87 89 85 96 89 96 88 89 98 96 95 86 85 92 94 94 87 89 97 96 93 85 156 99 97 93 94 99 97 86 91 91 90 98 96 92 137 92 91 99 90 91 100 93 99 91 92 92 104 88 98 90 9...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAn altar enshrines N stones arra...
[{"type": "stdin_stdout", "input": "8\nRRWRWWRW", "output": "1\n"}, {"type": "stdin_stdout", "input": "8\nRRWWWRRW", "output": "2\n"}, {"type": "stdin_stdout", "input": "8\nWRWWWRRR", "output": "3\n"}, {"type": "stdin_stdout", "input": "8\nWWWWRRRR", "output": "4\n"}, {"type": "stdin_stdout", "input": "8\nRRWRVWRW", "o...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have a tree with N vertices n...
[{"type": "stdin_stdout", "input": "8\n1 3\n2 3\n3 4\n3 5\n3 6\n6 7\n6 8", "output": "240\n240\n1680\n240\n240\n1008\n144\n144\n"}, {"type": "stdin_stdout", "input": "8\n1 3\n2 3\n5 4\n3 5\n3 6\n3 7\n3 8", "output": "360\n360\n2520\n120\n840\n360\n360\n360\n"}, {"type": "stdin_stdout", "input": "8\n1 2\n2 3\n2 4\n3 5\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\nGiven are a positive integer N a...
[{"type": "stdin_stdout", "input": "6\ncbacba", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "6\nabcabc", "output": "Yes"}, {"type": "stdin_stdout", "input": "6\nacbadc", "output": "No\n"}, {"type": "stdin_stdout", "input": "6\nabcaac", "output": "No\n"}, {"type": "stdin_stdout", "input": "6\ncdabca", "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\nDetermine if an N-sided polygon ...
[{"type": "stdin_stdout", "input": "10\n1 0 10 10 16 12 34 110 11 3", "output": "No\n"}, {"type": "stdin_stdout", "input": "10\n1 0 10 10 16 22 34 110 11 3", "output": "No\n"}, {"type": "stdin_stdout", "input": "10\n1 0 10 10 16 17 34 110 11 3", "output": "No\n"}, {"type": "stdin_stdout", "input": "10\n1 0 10 10 8 12 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 number 105 is quite special ...
[{"type": "stdin_stdout", "input": "-108", "output": "0\n"}, {"type": "stdin_stdout", "input": "-153", "output": "0\n"}, {"type": "stdin_stdout", "input": "122", "output": "1\n"}, {"type": "stdin_stdout", "input": "138", "output": "2\n"}, {"type": "stdin_stdout", "input": "197", "output": "5\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\nInput Format\n\n\nN K\na_1 a_2 a...
[{"type": "stdin_stdout", "input": "5 5\n11683 3774 3598 4173 3424", "output": "31773\n"}, {"type": "stdin_stdout", "input": "5 4\n11683 3774 3598 4173 3424", "output": "23510\n"}, {"type": "stdin_stdout", "input": "5 5\n3949 3208 13644 3469 3424", "output": "21140\n"}, {"type": "stdin_stdout", "input": "5 5\n4931 3208...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPrime numbers are widely applied...
[{"type": "stdin_stdout", "input": "12\n110\n200\n300\n0", "output": "5 7\n107 109\n197 199\n281 283\n"}, {"type": "stdin_stdout", "input": "12\n110\n200\n227\n0", "output": "5 7\n107 109\n197 199\n197 199\n"}, {"type": "stdin_stdout", "input": "12\n110\n200\n329\n0", "output": "5 7\n107 109\n197 199\n311 313\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\nShe was worried. The grades are ...
[{"type": "stdin_stdout", "input": "(B&B&f)|(~d&~i&i)|(~v&i&~V)|(&g&~e&o)|(~f&d&~v)|(d&~i&o)|(g&i&~B)|(~i&f&d)|(e&~i~~V)|(~v&f&~d)\n(S&X&~W)\n#", "output": "yes\nyes\n"}, {"type": "stdin_stdout", "input": "(B&B&f)|(~d&~i&i)|(~v&i&~V)|(&g&~e&o)|(~f&d&~v)|(d&~i&o)|(g&i&~B)|(~i&f&d)|(e&~i~~V)|(~v&f&~d)\n(T&X&~W)\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\nExample\n\nInput\n\n3 3 1 2 4\n1...
[{"type": "stdin_stdout", "input": "4 1 2 1 2\n1 2\n2 3\n11 0", "output": "IMPOSSIBLE\n"}, {"type": "stdin_stdout", "input": "8 1 2 1 2\n1 2\n2 3\n11 0", "output": "IMPOSSIBLE\n"}, {"type": "stdin_stdout", "input": "3 3 2 2 4\n1 2\n2 3\n3 1", "output": "IMPOSSIBLE\n"}, {"type": "stdin_stdout", "input": "3 3 2 1 4\n1 2\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a frog living in a big ...
[{"type": "stdin_stdout", "input": "10 10\n.o....o...\no.oo......\n..oo..oo..\n..o.......\n..oo..oo..\n.o.o...o..\no..U.o....\noo......oo\noo........\noo..oo....", "output": "RDLLLURUUURDDLLUURRDDLULLDDRR\n"}, {"type": "stdin_stdout", "input": "10 10\n.o....o...\no.oo......\n..oo..oo..\n..o.......\n..oo..oo..\n..o...o....
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn 21XX, an annual programming c...
[{"type": "stdin_stdout", "input": "[[r-i]-[m-e]]\nd -1\no 0\ng -1\nl 6", "output": "No\n"}, {"type": "stdin_stdout", "input": "[[m-y]-[a-o]]\nn 0\na 1\ny 2\nm 0", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "[[r-i]-[m-e]]\nd -1\nr 1\ng 1\nm 3", "output": "No\n"}, {"type": "stdin_stdout", "input": "[[r-i]-[m-...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 an i...
[{"type": "stdin_stdout", "input": "71983", "output": "19:59:43\n"}, {"type": "stdin_stdout", "input": "-1025", "output": "-1:42:55\n"}, {"type": "stdin_stdout", "input": "-144", "output": "-1:57:36\n"}, {"type": "stdin_stdout", "input": "-274", "output": "-1:55:26\n"}, {"type": "stdin_stdout", "input": "-399", "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\nDon't you tell me what you think...
[{"type": "stdin_stdout", "input": "20 10\n750 560 811 641 215 299 882 721 925 524 553 644 974 942 120 823 229 249 594 60 375 696 441 153 303 944 360 372 540 25 192 310 422 606 172 605 4 795 740 663\n39 30\n15 8\n6 38\n14 35\n27 7\n13 28\n21 12\n20 3\n23 22\n16 32\n1\n13 14 7 13 3 38 39 8 22 12 23 21 28 27 32 6 35 15 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\nThis is an interactive problem\n...
[{"type": "stdin_stdout", "input": "15\n111000110100010\n110101010100100\n001001011000100\n111011111001011\n011101111010100\n011011000011100\n010011100000010\n100101111100011\n001101111111100\n000101101101111\n100001101110000\n010101110110101\n110110011011011\n100010110110110\n111011101010000\n", "output": "? 1 1 1 3\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis is an easier version of the...
[{"type": "stdin_stdout", "input": "500\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 two integers n and...
[{"type": "stdin_stdout", "input": "1000 10\n", "output": "414070642\n"}, {"type": "stdin_stdout", "input": "1000 2\n", "output": "917124963\n"}, {"type": "stdin_stdout", "input": "379 10\n", "output": "181813681\n"}, {"type": "stdin_stdout", "input": "723 9\n", "output": "157557417\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\n\n\nInput\n\nThe input consists ...
[{"type": "stdin_stdout", "input": "UBSCRAMNLE\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "ALAKLINITY\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "SOLUSIONS\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "SM@RTPHONE\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "UBSCRBMN...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "87 83\n40 6 7 50 16 65 47 90 94 65 79 29 41 76 80 13 87 37 92 71 54 53 93 79 14 53 71 78 50 50 74 40 30 92 66 86 94 60 37 65 82 14 61 48 68 71 91 99 74 88 89 34 57 74 25 2 79 72 92 37 61 16 32 85 29 74 6 69 50 74 76 48 31 42 40 95 29 27 28 31 38 60 52 45 14 78 59\n", "output": "75\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\nEveryone knows that agents in Va...
[{"type": "stdin_stdout", "input": "1\n33\n200000000000000000000000000000022\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1\n33\n108463091323247016906011241806730\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1\n12\n200000000000000000000000000000022\n", "output": "2\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 got a job as a marketer in a...
[{"type": "stdin_stdout", "input": "10\n335544320 671088640\n335544322 671088639\n335544321 671088639\n335544325 671088637\n335544319 671088640\n335544319 671088641\n335544319 671088639\n335544318 671088639\n352759476 671088637\n335544319 671088643\n", "output": "NO\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nYES\nNO\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\nIn recent years John has very su...
[{"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000 1000000000000000000\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000 1000010000000000000 1000000000000000000 1000000 1000000000000000000\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\nPolycarp has n friends, the i-th...
[{"type": "stdin_stdout", "input": "1\n52\n0 1 1 1 1 -1 0 1 2 1 2 1 1 1 1 1 1 1 0 1 3 0 2 0 1 0 1 4 -1 2 1 1 -1 3 2 1 1 2 0 -1 2 1 2 0 1 2 2 1 1 1 1 0\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "1\n52\n0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 1 0 1 2 -1 2 0 0 -1 3 2 1 1 1 0 1 2 1 2 0 1 2 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\nThe Smart Beaver from ABBYY came...
[{"type": "stdin_stdout", "input": "2000\nJAPAN FEBRUARY MONEY SUPPLY RISES 8.8 PCT\nTOKYO, March 17 - Japan's broadly defined money supply\naverage of M-2 plus certificate of deposits (CDs) rose a\npreliminary 8.8 pct in February from a year earlier, compared\nwith an 8.6 pct rise ni January, the Bank of Japan said.\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne day Vasya was going home whe...
[{"type": "stdin_stdout", "input": "-827584 -680412 -103147\n897186 313672 388429\n892050 717946 505625 200144 311983 606037\n", "output": "1709658\n"}, {"type": "stdin_stdout", "input": "-827584 -680412 -103147\n897186 313672 388429\n892050 717946 505625 278931 311983 606037\n", "output": "1709658\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\nMomiji has got a rooted tree, co...
[{"type": "stdin_stdout", "input": "10\n1 2\n2 3\n3 4\n1 5\n2 6\n6 7\n7 8\n6 9\n9 10\n", "output": "3.8166666666666664\n"}, {"type": "stdin_stdout", "input": "10\n1 2\n2 3\n3 4\n1 5\n2 6\n8 7\n4 8\n6 9\n9 10\n", "output": "3.7333333333333334\n"}, {"type": "stdin_stdout", "input": "10\n1 2\n2 3\n3 4\n1 5\n3 6\n6 7\n7 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\nYou are given a rectangle grid. ...
[{"type": "stdin_stdout", "input": "1000000000 1000000000 500000000 500000000 500000000 500000001\n", "output": "250000000 249999999 750000000 750000000\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000 286536427 579261823 230782719 575570138\n", "output": "171145067 291476754 401927786 867046892\n"}, {"typ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 assume that \n\n * v(n) i...
[{"type": "stdin_stdout", "input": "6\n999\n1095\n821\n635\n63\n480\n", "output": "1003961/2011946\n1196833/2398042\n674039/1351366\n403199/808942\n3959/8174\n232303/466546\n"}, {"type": "stdin_stdout", "input": "6\n999\n588\n821\n635\n63\n480\n", "output": "1003961/2011946\n346909/696182\n674039/1351366\n403199/808942...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 a recent research Berland...
[{"type": "stdin_stdout", "input": "183\n", "output": "8372\n1 92\n1 93\n1 94\n1 95\n1 96\n1 97\n1 98\n1 99\n1 100\n1 101\n1 102\n1 103\n1 104\n1 105\n1 106\n1 107\n1 108\n1 109\n1 110\n1 111\n1 112\n1 113\n1 114\n1 115\n1 116\n1 117\n1 118\n1 119\n1 120\n1 121\n1 122\n1 123\n1 124\n1 125\n1 126\n1 127\n1 128\n1 129\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\nPolycarpus likes giving presents...
[{"type": "stdin_stdout", "input": "7 1\n1 7\n", "output": " 0\n 7 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\nAn army of n droids is lined up ...
[{"type": "stdin_stdout", "input": "49 2 1971\n794 866\n401 575\n341 83\n103 208\n352 134\n260 878\n497 931\n630 570\n885 464\n23 663\n60 1461\n416 870\n955 405\n392 961\n530 258\n73 404\n736 923\n44 436\n594 314\n904 138\n980 163\n76 720\n879 809\n81 838\n263 599\n218 139\n659 493\n1044 754\n679 302\n490 7\n204 530\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\nThere is an infinite sequence co...
[{"type": "stdin_stdout", "input": "30\n1 200000\n2 199999\n3 199998\n4 199997\n5 199996\n200001 399996\n200002 399997\n200003 399998\n200004 399999\n200005 400000\n400001 599998\n400002 599999\n400003 600000\n400004 599996\n400005 599995\n600001 800000\n600002 362647\n600003 799998\n600004 799997\n600005 799996\n60000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Lesha loves listening to ...
[{"type": "stdin_stdout", "input": "100000 1 10000\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "100000 99999 3\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "100000 99999 2\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "100000 99999 4\n", "output": "1\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\nBerOilGasDiamondBank has branche...
[{"type": "stdin_stdout", "input": "58\nesgdfmf\nxfkluadj\nqhvh\njwhuyhm\nmgi\nysgc\nvhhenku\npb\ntr\nu\njyrpjnpd\nkluadjo\nopb\ncopb\ngcyhceo\nr\ndjo\nxfklu\neo\nadjo\nfkluadjo\nybe\nwljwh\nqhvhh\nrhgotp\nyhceo\nuyhm\nvdd\nyhm\nysgcyhc\nvddrhg\nril\nwljwhu\nx\nqh\nhceo\ntfcopb\nmgitfc\nvddrh\nmgitfco\nxf\nmgitf\ncyoyb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nEach month Blake gets the report...
[{"type": "stdin_stdout", "input": "100 30\n65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 74 57 115 16 55 102 79 97 21 80 41 56 49 103 61 66 1 36 44 43 82 37 38 106 27 114 51 112 55 87 41 69 31 86 58 27 46 99 18 105 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAuthor has gone out of the stori...
[{"type": "stdin_stdout", "input": "7\n? 1\n+ 941492387\n+ 72235422\n+ 449924898\n+ 783332532\n- 941492387\n- 72235422\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "14\n+ 4\n+ 4\n+ 4\n+ 4\n? 3\n- 4\n- 4\n- 4\n? 3\n+ 5\n? 3\n- 4\n+ 4\n? 3\n", "output": "7\n7\n7\n7\n"}, {"type": "stdin_stdout", "input": "14\n+...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA stowaway and a controller play...
[{"type": "stdin_stdout", "input": "50 42 13\nto head\n00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001\n", "output": "Controller 61\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 an experienced Codeforce...
[{"type": "stdin_stdout", "input": "5\n99999997 999999998 999999998 999999999\n99999996 999999997 999999997 999999999\n99999997 999999998 999999998 999999999\n99999996 999999997 999999997 999999999\n99999997 999999998 999999998 999999999\n", "output": "899999999100000001\n449999999550000002\n899999999100000001\n4499999...
code_stdio