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\nPROBLEM SPECIFICATION:\nYou are ...
[{"type": "stdin_stdout", "input": "100\n1681692778 887 84\n424238336 7794 16\n596516650 493 87\n1350490028 2363 22\n2044897764 60 91\n1636794921 541 26\n35005212 5737 73\n1726956430 2568 69\n333046344 1531 104\n468703136 4068 24\n1315634023 9803 51\n1532562280 3070 59\n628175012 8457 94\n1653377374 6230 43\n608413785 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Gudi escapes the room and mov...
[{"type": "stdin_stdout", "input": "10\n20\nqeevevbtaewcbtrqtyvbauyrauactw\nbutqrcbeebtayaqyuauvwwuaebavqe\nwuvtbbvqaqwuacqbvbwuyureeyayyt\ncavtwevvytcerrerurycqrwbrbebqv\nbcbvqwqatrvbyctbarqacbwtttqbcc\netcyrubybuwrtbuqubtcybbqwyuuwt\nweeqatybwyettcqarcwcvwyqwrwwwt\nectucwtratbwwacbwaqrawarywtuey\ntecyuywvrructbytttbe...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTak performed the following acti...
[{"type": "stdin_stdout", "input": "6\n1 0\n2 2\n3 3\n4 4\n5 5\n10 10", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "6\n1 0\n2 2\n3 3\n4 4\n5 0\n10 10", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "6\n-4 1\n1 3\n-1 1\n4 12\n2 0\n0 2", "output": "No\n"}, {"type": "stdin_stdout", "input": "6\n-4 1\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\nWe have a grid with N rows and M...
[{"type": "stdin_stdout", "input": "3 4\n2 4 7 10\n1 5 8 11\n3 6 12 12", "output": "10 4 7 2 \n8 11 1 5 \n3 6 12 12 \n3 4 1 2 \n8 6 7 5 \n10 11 12 12 \n"}, {"type": "stdin_stdout", "input": "3 4\n1 4 7 10\n1 5 8 11\n3 6 12 12", "output": "10 4 7 1 \n8 11 1 5 \n3 6 12 12 \n3 4 1 1 \n8 6 7 5 \n10 11 12 12 \n"}, {"type": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given three integers A, ...
[{"type": "stdin_stdout", "input": "-1 -1 -1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-2 -1 -1", "output": "No\n"}, {"type": "stdin_stdout", "input": "-2 -1 -2", "output": "No\n"}, {"type": "stdin_stdout", "input": "-3 10 -1", "output": "No\n"}, {"type": "stdin_stdout", "input": "-3 1 -11", "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\nAmidakuji is a traditional metho...
[{"type": "stdin_stdout", "input": "16 8 5", "output": "698231265\n"}, {"type": "stdin_stdout", "input": "15 8 3", "output": "978283490\n"}, {"type": "stdin_stdout", "input": "16 8 7", "output": "876814452\n"}, {"type": "stdin_stdout", "input": "16 9 3", "output": "996082491\n"}, {"type": "stdin_stdout", "input": "15 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\nAkaki, a patissier, can make N k...
[{"type": "stdin_stdout", "input": "5 3000\n150\n130\n150\n130\n100", "output": "28\n"}, {"type": "stdin_stdout", "input": "5 3000\n236\n130\n150\n130\n100", "output": "27\n"}, {"type": "stdin_stdout", "input": "5 3000\n150\n173\n150\n212\n101", "output": "26\n"}, {"type": "stdin_stdout", "input": "5 3000\n150\n130\n15...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAtCoDeer has three cards, one re...
[{"type": "stdin_stdout", "input": "7 3 2", "output": "YES\n"}, {"type": "stdin_stdout", "input": "7 6 0", "output": "YES\n"}, {"type": "stdin_stdout", "input": "2 6 0", "output": "YES\n"}, {"type": "stdin_stdout", "input": "9 6 0", "output": "YES\n"}, {"type": "stdin_stdout", "input": "0 6 0", "output": "YES\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\nThere are N people, conveniently...
[{"type": "stdin_stdout", "input": "7\n-10 4 1 -2 3 -2 1", "output": "0\n"}, {"type": "stdin_stdout", "input": "7\n-10 4 1 -2 3 -2 0", "output": "0\n"}, {"type": "stdin_stdout", "input": "7\n-20 4 1 -2 3 -2 0", "output": "0\n"}, {"type": "stdin_stdout", "input": "7\n-16 4 1 -2 3 -3 0", "output": "0\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\nFor integers b (b \\geq 2) and n...
[{"type": "stdin_stdout", "input": "31415926535\n13", "output": "15707963262\n"}, {"type": "stdin_stdout", "input": "31415926535\n2", "output": "31415926534\n"}, {"type": "stdin_stdout", "input": "31415926535\n4", "output": "31415926532\n"}, {"type": "stdin_stdout", "input": "31415926535\n3", "output": "15707963267\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 smelt fishing tournament was h...
[{"type": "stdin_stdout", "input": "3 5\n1 14\n2 5\n1 3\n3 4\n2 11", "output": "1 14\n1 14\n1 17\n1 17\n1 17\n"}, {"type": "stdin_stdout", "input": "3 5\n1 4\n2 10\n1 5\n3 4\n3 11", "output": "1 4\n2 10\n2 10\n2 10\n3 15\n"}, {"type": "stdin_stdout", "input": "3 5\n1 4\n2 19\n1 5\n3 4\n3 11", "output": "1 4\n2 19\n2 19...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn Aizuwakamatsu Village, which ...
[{"type": "stdin_stdout", "input": "3\n125 -1 15\n108 12 25\n149 10 50\n3\n32 -1 10\n70 10 41\n22 67 84\n0", "output": "NG\nOK\n"}, {"type": "stdin_stdout", "input": "3\n125 -1 15\n108 8 25\n246 10 42\n3\n32 -1 10\n70 10 41\n22 67 129\n0", "output": "NG\nOK\n"}, {"type": "stdin_stdout", "input": "3\n125 -1 15\n108 7 25...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlice is spending his time on an...
[{"type": "stdin_stdout", "input": "126 1", "output": "319908070\n"}, {"type": "stdin_stdout", "input": "143 1", "output": "990388601\n"}, {"type": "stdin_stdout", "input": "37 12", "output": "452771840\n"}, {"type": "stdin_stdout", "input": "143 2", "output": "798128291\n"}, {"type": "stdin_stdout", "input": "108 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\nPablo Squarson is a well-known c...
[{"type": "stdin_stdout", "input": "1\n5\n0 0\n0 -1\n0 2\n0 3\n12\n0 0\n0 0\n2 0\n3 0\n4 1\n5 1\n6 2\n3 2\n8 2\n9 3\n10 3\n10\n0 2\n1 3\n2 2\n3 2\n2 1\n5 1\n6 1\n7 1\n3 0\n0", "output": "1 1\n3 2\n4 5\n4 5\n"}, {"type": "stdin_stdout", "input": "1\n5\n0 -1\n0 1\n0 2\n0 3\n12\n0 0\n1 0\n2 0\n3 1\n4 1\n5 1\n6 2\n7 1\n8 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\n\"Balloons should be captured ef...
[{"type": "stdin_stdout", "input": "2\n10 100\n100 270\n2\n12 100\n100 280\n3\n100 150\n10 360\n40 450\n3\n100 150\n17 360\n40 440\n2\n100 10\n50 200\n2\n100 100\n50 110\n1\n15 10\n4\n1 10\n2 20\n3 100\n90 200\n0", "output": "OK 220\nOK 200\nOK 260\nOK 246\nNG 1\nNG 2\nNG 1\nOK 188\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\nTaro had his own personal comput...
[{"type": "stdin_stdout", "input": "KUSATSU\nLSATSU", "output": "No\n"}, {"type": "stdin_stdout", "input": "RUPCUAOC\n__PC", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "KUSATSU\nLSATRU", "output": "No\n"}, {"type": "stdin_stdout", "input": "RUPCUAOC\n__OC", "output": "Yes\n"}, {"type": "stdin_stdout", "input...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a tree T that cons...
[{"type": "stdin_stdout", "input": "6 3\n1\n1\n-1\n2\n3\nQ 5\nM 4\nQ 5\n0 0", "output": "2\n"}, {"type": "stdin_stdout", "input": "6 3\n1\n1\n2\n3\n2\nQ 5\nM 12\nQ 5\n0 0", "output": "2\n"}, {"type": "stdin_stdout", "input": "6 3\n-1\n1\n0\n3\n0\nQ 5\nL 4\nQ 5\n0 0", "output": "2\n"}, {"type": "stdin_stdout", "input": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nInternational Carpenters Profess...
[{"type": "stdin_stdout", "input": "3\n-1 ( 10\n10 ) 5\n10 ) 5", "output": "No\nNo\nYes\n"}, {"type": "stdin_stdout", "input": "3\n-1 ( 0\n10 ) 4\n20 ( 4", "output": "Yes\nNo\nYes\n"}, {"type": "stdin_stdout", "input": "3\n-1 ) 10\n10 ( 12\n10 ( 7", "output": "No\nNo\nNo\n"}, {"type": "stdin_stdout", "input": "3\n-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\nProblem statement\n\nN-winged ra...
[{"type": "stdin_stdout", "input": "1 11\n0\n1", "output": "11\n"}, {"type": "stdin_stdout", "input": "1 15\n0\n1", "output": "15\n"}, {"type": "stdin_stdout", "input": "1 13\n0\n1", "output": "13\n"}, {"type": "stdin_stdout", "input": "1 11\n1\n1", "output": "10\n"}, {"type": "stdin_stdout", "input": "1 15\n1\n1", "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\nproblem\n\nGiven the sequence $ ...
[{"type": "stdin_stdout", "input": "4\n14 15 0 10", "output": "29\n"}, {"type": "stdin_stdout", "input": "4\n17 19 0 20", "output": "56\n"}, {"type": "stdin_stdout", "input": "4\n12 23 0 10", "output": "35\n"}, {"type": "stdin_stdout", "input": "4\n14 8 0 10", "output": "18\n"}, {"type": "stdin_stdout", "input": "4\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\nExtended Euclid Algorithm\n\n\n\...
[{"type": "stdin_stdout", "input": "810 11", "output": "-3 221\n"}, {"type": "stdin_stdout", "input": "277 5", "output": "-2 111\n"}, {"type": "stdin_stdout", "input": "195 10", "output": "1 -19\n"}, {"type": "stdin_stdout", "input": "174 10", "output": "-2 35\n"}, {"type": "stdin_stdout", "input": "41 52", "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\nVitya has just started learning ...
[{"type": "stdin_stdout", "input": "auuaoonntanonnuewannnnpuuinniwoonennyolonnnvienonpoujinndinunnenannmuveoiuuhikucuziuhunnnmunzancenen\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "auuaoonntanonnuewannnopuuinniwoonennyolonnnvienonpoujinndinunnenannmuveoiuuhikucuziuhunnnmunzancenen\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\nYou are given n points on the pl...
[{"type": "stdin_stdout", "input": "20\n-2967010 48581504\n-2967318 48581765\n-2967443 48581988\n-2967541 48582265\n-2967443 48582542\n-2967318 48582765\n-2967010 48583026\n-2966691 48583154\n-2966252 48583234\n-2965813 48583154\n-2965494 48583026\n-2965186 48582765\n-2965061 48582542\n-2964963 48582265\n-2965061 48581...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 permutation of size n is an ar...
[{"type": "stdin_stdout", "input": "69\n-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1\n", "output": " ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\n13 2 1 3 5 8 9 10 7 12 4 12\n", "output": "YES\n11\n1 2 3 4 5 7 8 9 10 12 13 \n1\n12 \n"}, {"type": "stdin_stdout", "input": "12\n12 8 1 3 7 5 9 6 8 10 11 2\n", "output": "YES\n11\n1 2 3 5 6 7 8 9 10 11 12 \n1\n8 \n"}, {"type": "stdin_stdout", "input": "12\n13 2 1 3 5 8 9 10 7 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\nPolycarp wants to train before a...
[{"type": "stdin_stdout", "input": "5\n200000 200000 200000 200000 200000\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "5\n200000 200000 200000 200000 329398\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "5\n330358 200000 200000 200000 200000\n", "output": "5\n"}, {"type": "stdin_stdout", "input": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Cybermen and the Daleks have...
[{"type": "stdin_stdout", "input": "10\n11 11\n11 12\n11 15\n11 17\n11 18\n11 19\n11 28\n11 33\n11 38\n11 40\n12 11\n15 46\n17 11\n17 46\n18 46\n19 11\n19 46\n20 11\n20 46\n24 46\n25 46\n26 11\n32 11\n32 46\n33 11\n34 46\n36 11\n39 11\n40 46\n43 11\n44 0\n46 14\n46 15\n46 17\n46 22\n46 26\n46 28\n46 32\n46 43\n46 45\n4...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor her birthday Alice received ...
[{"type": "stdin_stdout", "input": "3\n110\n011\n100\n100\n011\n100\n100\n", "output": "1\ncol 1\n"}, {"type": "stdin_stdout", "input": "3\n110\n010\n101\n100\n010\n101\n100\n", "output": "1\ncol 1\n"}, {"type": "stdin_stdout", "input": "3\n110\n010\n101\n110\n110\n101\n100\n", "output": "1\nrow 1\n"}, {"type": "stdin_...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a tree consisting ...
[{"type": "stdin_stdout", "input": "15\n10 34 69 39 82 49 57 22 50 25 82 37 33 62 69\n35 14 68 31 26 8 33 98 33 95 19 22 89 18 67\n80 24 10 5 26 85 69 21 29 38 89 24 78 68 88\n13 1\n6 12\n8 4\n11 9\n14 11\n15 5\n3 15\n1 10\n13 9\n7 12\n14 6\n3 2\n2 7\n4 5\n", "output": "620\n2 3 2 2 3 3 1 1 3 3 2 2 1 1 1 \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\nAn integer sequence is called be...
[{"type": "stdin_stdout", "input": "139 140 2362 2360\n", "output": "YES\n0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nToday, as a friendship gift, Bak...
[{"type": "stdin_stdout", "input": "5\n1073741823 1073741823 181085488 1073741823 1073741823\n", "output": "536870912\n"}, {"type": "stdin_stdout", "input": "5\n1073741823 29972487 1073741823 1073741823 1073741823\n", "output": "536870912\n"}, {"type": "stdin_stdout", "input": "5\n219338430 29972487 1073741823 10737418...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor the multiset of positive int...
[{"type": "stdin_stdout", "input": "10\n972 972 324 972 324 648 1944 243 324 474\n", "output": "162\n"}, {"type": "stdin_stdout", "input": "10\n540 648 1116 648 720 540 594 864 972 648\n", "output": "36\n"}, {"type": "stdin_stdout", "input": "10\n972 1224 324 972 324 507 1868 392 324 474\n", "output": "2\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\nA binary matrix is called good i...
[{"type": "stdin_stdout", "input": "2 58\n1100001110010010100001000000000110110001101001100010101110\n1110110010101111001110010001100010001010100011111110110100\n", "output": "27\n"}, {"type": "stdin_stdout", "input": "7 15\n000100001010010\n100111010110001\n101101111100100\n010000111111010\n111010010100001\n0000110011...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an array a consist...
[{"type": "stdin_stdout", "input": "3\n5\n1 2 3 1 2\n5\n4 4 4 3 2\n6\n1 4 3 5 1 1\n", "output": "-1 -1 1 1 1\n-1 -1 4 3 2\n-1 -1 -1 1 1 1\n"}, {"type": "stdin_stdout", "input": "3\n5\n1 2 3 4 2\n5\n4 1 1 4 2\n6\n1 4 3 5 1 1\n", "output": "-1 -1 2 2 1\n-1 -1 1 1 1\n-1 -1 -1 1 1 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\nHomer has two friends Alice and ...
[{"type": "stdin_stdout", "input": "5\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nazazazazazazazazazazazazazazazazazazazazazazazazaz\nzazazazazazazazazazazazazazazazazazazazazazazazaza\nzzazzazzazzazzazzazzazzazzazzazzazzazzazzazza\n", "output": "bzbzbzbzbzbz...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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, consis...
[{"type": "stdin_stdout", "input": "1\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n", "output": "ba\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\nPolycarpus analyzes a string cal...
[{"type": "stdin_stdout", "input": "156642200 503020953 296806626 871864091\n", "output": "234585497\n"}, {"type": "stdin_stdout", "input": "462616550 929253987 199885647 365920450\n", "output": "166034804\n"}, {"type": "stdin_stdout", "input": "166724572 472113234 358126054 528083792\n", "output": "125430608\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\nThe Little Elephant very much lo...
[{"type": "stdin_stdout", "input": "100000000000000000 1000000000000000000\n", "output": "90000000000000000\n"}, {"type": "stdin_stdout", "input": "645762257531682046 885295120956158518\n", "output": "23953286342447648\n"}, {"type": "stdin_stdout", "input": "819875140559301752 946247219812473271\n", "output": "12637207...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle Petya likes points a lot....
[{"type": "stdin_stdout", "input": "100 100\n-98 -97 -96 -93 -92 -91 -90 -87 -86 -84 -81 -80 -79 -78 -76 -75 -73 -71 -69 -67 -65 -64 -63 -62 -61 -54 -51 -50 -49 -48 -46 -45 -44 -37 -36 -33 -30 -28 -27 -16 -15 -13 -12 -10 -9 -7 -6 -5 -4 2 3 5 8 9 10 11 13 14 15 16 17 19 22 24 25 26 27 28 30 31 32 36 40 43 45 46 47 50 51...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 winner of the card game popu...
[{"type": "stdin_stdout", "input": "12\natrtthfpcvishmqbakprquvnejr 185\natrtthfpcvishmqbakprquvnejr -699\natrtthfpcvishmqbakprquvnejr -911\natrtthfpcvishmqbakprquvnejr -220\nfcgslzkicjrpbqaifgweyzreajjfdo 132\nfcgslzkicjrpbqaifgweyzreajjfdo -242\nm 177\nm -549\natrtthfpcvishmqbakprquvnejr -242\nm 38\natrtthfpcvishmqba...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 loves hamburgers very...
[{"type": "stdin_stdout", "input": "SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS\n100 100 100\n100 100 100\n1000000000000\n", "output": "100000001\n"}, {"type": "stdin_stdout", "input": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlexandra has a paper strip with...
[{"type": "stdin_stdout", "input": "2 0000000000 2\n-1000000000 1000000000\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2 0000100000 2\n-1000000000 1000000000\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2 0000000000 3\n-1000000000 1000000000\n", "output": "-1\n"}, {"type": "stdin_stdout", "in...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFox Ciel is participating in a p...
[{"type": "stdin_stdout", "input": "178\n5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 12 6 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\nGiant chess is quite common in G...
[{"type": "stdin_stdout", "input": "100 10 30\n40 4\n15 3\n75 3\n88 10\n32 1\n16 5\n81 8\n45 2\n72 8\n11 6\n86 4\n50 2\n9 4\n11 1\n20 3\n47 3\n2 4\n68 3\n90 5\n85 2\n88 1\n88 5\n86 3\n70 9\n49 3\n34 4\n5 7\n77 5\n50 1\n87 5\n", "output": "402737011\n"}, {"type": "stdin_stdout", "input": "100000 100000 4\n50001 50001\n5...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecently, Duff has been practici...
[{"type": "stdin_stdout", "input": "100\n196 1681 196 0 61 93 196 196 196 196 196 0 0 96 18 1576 0 93 666463 18 93 0 1278 8939 93 196 196 1278 3 0 67416 869956 10 56489 196 745 39 783 317 8939 196 81 69634 4552 39 3 14 20 25 8 10 4 7302 0 12860 20 1140 15990 7302 0 19579 4142 11 1354 149297 93 311 2338 0 79475 10 75252...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn the school computer room ther...
[{"type": "stdin_stdout", "input": "10\n19999 19999 20000 20000 29860 20000 12103 20000 19999 17191\n", "output": "10536\n"}, {"type": "stdin_stdout", "input": "10\n19999 19999 20000 39539 29860 20000 12103 20000 19999 17191\n", "output": "25661\n"}, {"type": "stdin_stdout", "input": "10\n11328 19999 20000 39539 29860 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 city administration of IT Ci...
[{"type": "stdin_stdout", "input": "10000 671249297\n", "output": "16096020.300745647400617599487304687500"}, {"type": "stdin_stdout", "input": "10001 671249297\n", "output": "16097629.902775721624493598937988281250"}, {"type": "stdin_stdout", "input": "11001 671249297\n", "output": "17707231.93285028636455535888671875...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 only line of th...
[{"type": "stdin_stdout", "input": "A232726\n", "output": "23\n"}, {"type": "stdin_stdout", "input": "A223635\n", "output": "22\n"}, {"type": "stdin_stdout", "input": "A221033\n", "output": "21\n"}, {"type": "stdin_stdout", "input": "A222222\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "A101010\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\nA little bear Limak plays a game...
[{"type": "stdin_stdout", "input": "100 100 100 100 100\n", "output": "200\n"}, {"type": "stdin_stdout", "input": "100 100 100 100 000\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100 100 100 000 000\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "98 99 100 99 100\n", "output": "296\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\nThe crowdedness of the discotheq...
[{"type": "stdin_stdout", "input": "20\n-961747 0 961747\n-957138 0 957138\n-921232 0 921232\n-887450 0 887450\n-859109 0 859109\n-686787 0 686787\n-664613 0 664613\n-625553 0 625553\n-464803 0 464803\n-422784 0 422784\n-49107 0 49107\n-37424 0 37424\n134718 0 134718\n178903 0 178903\n304415 0 304415\n335362 0 335362\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 quite ordinary day Valera we...
[{"type": "stdin_stdout", "input": "1000000000 2000000000 2\n", "output": "500000001\n"}, {"type": "stdin_stdout", "input": "200000000 2000000000 1800000011\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1500000000 2000000000 11\n", "output": "10389612\n"}, {"type": "stdin_stdout", "input": "1100000000 200000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 program you want...
[{"type": "stdin_stdout", "input": "10 39\n1 0 1 1 1 1 1 1 1 1\n0 1\n0 2\n0 3\n0 5\n0 6\n0 7\n0 8\n0 9\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n1 9\n2 3\n2 4\n2 5\n2 6\n2 7\n2 8\n2 9\n3 4\n3 5\n3 7\n3 8\n3 9\n4 5\n4 6\n5 6\n5 7\n5 8\n5 9\n6 7\n6 8\n7 8\n7 9\n8 9\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "10 39...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 last stage of Football World...
[{"type": "stdin_stdout", "input": "256 107 129\n", "output": "Final!\n"}, {"type": "stdin_stdout", "input": "256 107 240\n", "output": "Final!\n"}, {"type": "stdin_stdout", "input": "256 128 129\n", "output": "Final!"}, {"type": "stdin_stdout", "input": "256 128 256\n", "output": "Final!"}, {"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 Statement \nUnseen gang ...
[{"type": "stdin_stdout", "input": "cetnalpevbhU bpma @tllahd noitadol CY/JTehtnh\n1\n\nDLQMAR", "output": "c\ne\nt\nn\na\nl\np\ne\nv\nb\nh\nU\n \nb\np\nm\na\n \n@\nt\nl\nl\na\nh\nd\n \nn\no\ni\nt\na\nd\no\nl\n \nC\nY\n/\nJ\nT\ne\nh\nt\nn\nh\n"}, {"type": "stdin_stdout", "input": "cetnalpevbhU bpma @tllahd noitadol JY/...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi has N days of summer v...
[{"type": "stdin_stdout", "input": "328 15\n16 23 1 34 5 24 79 3 19 8 7 0 -1 70 -1", "output": "41\n"}, {"type": "stdin_stdout", "input": "328 15\n16 23 0 34 5 24 79 3 19 8 7 0 -1 70 -1", "output": "42\n"}, {"type": "stdin_stdout", "input": "253 15\n8 23 12 34 5 16 79 3 23 8 46 0 0 70 1", "output": "-1\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\nGiven are three integers A_1, A_...
[{"type": "stdin_stdout", "input": "115 -5 1", "output": "bust\n"}, {"type": "stdin_stdout", "input": "-2 -10 -1", "output": "win\n"}, {"type": "stdin_stdout", "input": "-4 -10 -1", "output": "win\n"}, {"type": "stdin_stdout", "input": "-4 -13 -1", "output": "win\n"}, {"type": "stdin_stdout", "input": "-4 -13 -2", "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\nThere are N islands and M bridge...
[{"type": "stdin_stdout", "input": "15 5\n3 3\n1 1\n5 2\n3 6\n4 5", "output": "101\n101\n103\n104\n105\n"}, {"type": "stdin_stdout", "input": "16 5\n2 4\n4 2\n0 2\n2 4\n4 3", "output": "114\n114\n117\n119\n120\n"}, {"type": "stdin_stdout", "input": "12 5\n1 3\n2 -1\n5 6\n3 5\n7 1", "output": "61\n62\n64\n65\n66\n"}, {"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSnuke has decided to use a robot...
[{"type": "stdin_stdout", "input": "16 10\n1 12 12 27 52 132 731 18298 395504 534840 1276551 903860 9384806 19108104 82684732 535447408", "output": "3248775590\n"}, {"type": "stdin_stdout", "input": "16 10\n0 12 12 27 52 132 731 18298 395504 534840 1276551 903860 9384806 19108104 82684732 535447408", "output": "3248775...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi has N blue cards and M...
[{"type": "stdin_stdout", "input": "1\nvoldemort\n10\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nuoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nvoldemort", "output": "0\n"}, {"type": "stdin_stdout", "input": "1\nvoldemort\n10\nvoldemort\nvoldemort\nvoldemort\nvoldemort\nuoldemort\nvoldemort\nvoldemort\nvoleemo...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKode Festival is an anual contes...
[{"type": "stdin_stdout", "input": "3\n2\n1\n-3\n4\n-1\n25\n110\n1014", "output": "872\n"}, {"type": "stdin_stdout", "input": "3\n2\n1\n-3\n4\n-1\n25\n111\n1014", "output": "871\n"}, {"type": "stdin_stdout", "input": "3\n2\n1\n-3\n4\n-2\n25\n111\n1014", "output": "870\n"}, {"type": "stdin_stdout", "input": "3\n2\n1\n-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\n<image>\n\n\nAt the request of a...
[{"type": "stdin_stdout", "input": "2006\n1101", "output": "**** \n *\n=====\n * *\n**** \n* ***\n*****\n*****\n\n*****\n \n=====\n ** *\n* * \n*****\n*****\n*****\n"}, {"type": "stdin_stdout", "input": "2006\n0101", "output": "**** \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\nAka Beko, trying to escape from ...
[{"type": "stdin_stdout", "input": "0100\n0101\n10100\n10000\n0101011\n1011\n011111\n#", "output": "Yes\nNo\nYes\nNo\nYes\nYes\nYes\n"}, {"type": "stdin_stdout", "input": "0100\n0100\n10100\n10000\n0101011\n1001\n011111\n#", "output": "Yes\nYes\nYes\nNo\nYes\nNo\nYes\n"}, {"type": "stdin_stdout", "input": "0100\n0100\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\nproblem\n\nAt IOI Confectionery,...
[{"type": "stdin_stdout", "input": "2 5\n0 1 1 1 0\n1 0 0 0 1\n3 6\n1 0 0 0 1 0\n1 1 1 0 1 0\n1 0 1 1 0 1\n0 0", "output": "10\n15\n"}, {"type": "stdin_stdout", "input": "2 5\n1 1 1 1 0\n0 0 0 0 1\n3 6\n1 0 0 0 0 1\n0 1 1 0 1 0\n1 0 1 1 0 1\n0 0", "output": "10\n16\n"}, {"type": "stdin_stdout", "input": "2 5\n1 1 1 1 0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nShe catched the thrown coin that...
[{"type": "stdin_stdout", "input": "10.328181706040372\n1.2129508820938308 0.8573113359511872 1.4723271231711133 0.8719653577025106\n2.7936576829562947\n1.6284720172281655 0.042076349022347914 1.0082063051036116 0.8077902409181328\n0", "output": "impossible\nimpossible\n"}, {"type": "stdin_stdout", "input": "11.3176862...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 mobile phone company ACMICPC (...
[{"type": "stdin_stdout", "input": "3\n4.0 4.919471432458173 3.0\n5.0 6.0 3.0\n5.5 5.905781212152949 1.4338480515274736\n2\n3.425881146117804 3.0 3.9422533178461854\n2.0201718577591117 2.4837552710328548 2.0844959491534008\n0", "output": "1 47.40\n2 62.17\n"}, {"type": "stdin_stdout", "input": "3\n4.0 4.919471432458173...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 straight tunnel without branch...
[{"type": "stdin_stdout", "input": "3 11\nR 1\nL 2\nL 5\n1 20\nR 1\n2 10\nR 5\nL 7\n2 10\nR 2\nL 8\n2 99\nR 1\nL 98\n4 10\nL 1\nR 4\nL 8\nR 9\n6 10\nR 2\nR 3\nL 4\nR 6\nL 7\nL 8\n0 0", "output": "10 3\n19 1\n7 1\n8 1\n98 2\n8 2\n8 3\n"}, {"type": "stdin_stdout", "input": "3 11\nR 1\nL 2\nL 5\n1 10\nR 1\n2 10\nR 5\nL 7\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem\n\nGiven a natural numbe...
[{"type": "stdin_stdout", "input": "011", "output": "1024\n"}, {"type": "stdin_stdout", "input": "011", "output": "1024\n"}, {"type": "stdin_stdout", "input": "11", "output": "1024\n"}, {"type": "stdin_stdout", "input": "11", "output": "1024\n"}, {"type": "stdin_stdout", "input": "010", "output": "48\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 N non-overlapping ...
[{"type": "stdin_stdout", "input": "4\n3.307280934588015 0.7642036899017219 2.9975443060138307\n3.0890161534289398 0.6780678528661457 4.906860770397891\n3.468973691756493 5.995537907012198 0.06334557687080211\n2.4219246439893203 3.2220571965352227 5.068471740319732\n0", "output": "-4.485038669176\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\nproblem\n\nAOR Co., Ltd. (Associ...
[{"type": "stdin_stdout", "input": "3 1\n-1 24\n1 0", "output": "-1\n"}, {"type": "stdin_stdout", "input": "3 1\n-2 24\n1 0", "output": "-1\n"}, {"type": "stdin_stdout", "input": "3 1\n-4 24\n1 0", "output": "-1\n"}, {"type": "stdin_stdout", "input": "3 -2\n11 4\n2 8", "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\nThe Little Elephant loves lucky ...
[{"type": "stdin_stdout", "input": "4\n4\n14\n707\n479\n7\n8\n1675475\n9756417", "output": "4\n77\n\n777744\n"}, {"type": "stdin_stdout", "input": "4\n4\n7\n707\n479\n7\n8\n1675475\n9756417", "output": "7\n77\n\n777744\n"}, {"type": "stdin_stdout", "input": "4\n0\n7\n435\n479\n7\n8\n1675475\n9756417", "output": "7\n74\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPavel made a photo of his favour...
[{"type": "stdin_stdout", "input": "2\n282238675 111160538 526707498 169652181\n", "output": "14299383119546189\n"}, {"type": "stdin_stdout", "input": "2\n229872385 40870434 715428884 160550871\n", "output": "46761413035493300\n"}, {"type": "stdin_stdout", "input": "2\n186213023 111160538 526707498 169652181\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 have n coins, each of the sa...
[{"type": "stdin_stdout", "input": "1000000000\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "723061816\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "517188853\n", "output": "29\n"}, {"type": "stdin_stdout", "input": "237913214\n", "output": "28\n"}, {"type": "stdin_stdout", "input": "536870911\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\nDark Assembly is a governing bod...
[{"type": "stdin_stdout", "input": "8 1 8109\n1944 40\n9732 40\n9214 80\n1770 40\n7837 50\n7430 100\n1753 30\n3991 60\n", "output": "0.6441514424\n"}, {"type": "stdin_stdout", "input": "8 3 6395\n8159 90\n4143 50\n6954 50\n5011 20\n9872 10\n7689 90\n8811 70\n2058 10\n", "output": "0.5175644027\n"}, {"type": "stdin_stdo...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOn his free time, Chouti likes d...
[{"type": "stdin_stdout", "input": "1411 1081 1082\n", "output": "238077838\n"}, {"type": "stdin_stdout", "input": "2000 1234 1800\n", "output": "550745740\n"}, {"type": "stdin_stdout", "input": "1841 1185 1765\n", "output": "773828348\n"}, {"type": "stdin_stdout", "input": "2000 2000 1999\n", "output": "694730459\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\nNN is an experienced internet us...
[{"type": "stdin_stdout", "input": "249 35\n", "output": "0.44721996534695957\n"}, {"type": "stdin_stdout", "input": "87 010\n", "output": "0.37454615226200993\n"}, {"type": "stdin_stdout", "input": "101 100\n", "output": "3.2098109040106433\n"}, {"type": "stdin_stdout", "input": "263 35\n", "output": "0.42312695404372...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 a simplified version of ...
[{"type": "stdin_stdout", "input": "5000 1\n4008 1126\n", "output": "6125 6124 6123 6122 6121 6120 6119 6118 6117 6116 6115 6114 6113 6112 6111 6110 6109 6108 6107 6106 6105 6104 6103 6102 6101 6100 6099 6098 6097 6096 6095 6094 6093 6092 6091 6090 6089 6088 6087 6086 6085 6084 6083 6082 6081 6080 6079 6078 6077 6076 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\nLet's define a number ebne (even...
[{"type": "stdin_stdout", "input": "36\n6\n165310\n6\n177978\n6\n211759\n6\n212643\n6\n229540\n6\n250029\n6\n211519\n6\n256097\n6\n163478\n5\n91505\n5\n79280\n6\n260629\n6\n128051\n6\n121972\n6\n261633\n6\n172044\n6\n119055\n6\n208323\n6\n149942\n6\n161236\n6\n177150\n6\n233766\n5\n97949\n6\n230107\n6\n175822\n6\n21354...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKate has a set S of n integers \...
[{"type": "stdin_stdout", "input": "21031\n", "output": "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given three integers x, ...
[{"type": "stdin_stdout", "input": "7\n7 5 12345\n5 0 4\n10 5 15\n17 8 54321\n499999993 9 1000000000\n10 5 187\n2 0 999999999\n", "output": "12339\n0\n15\n54306\n999999995\n185\n999999998\n"}, {"type": "stdin_stdout", "input": "7\n7 5 12345\n5 0 4\n10 5 15\n17 8 54321\n499999993 5 1000000000\n10 5 187\n2 0 999999999\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\nLet's call a list of positive in...
[{"type": "stdin_stdout", "input": "100\n881 479 355 759 257 497 690 598 275 446 439 787 257 326 436 713 322 5 253 781 434 307 164 154 241 381 38 942 680 906 240 11 431 478 628 1203 346 74 493 964 455 746 950 41 585 549 892 687 264 41 487 676 63 453 861 980 477 901 80 907 285 506 619 748 773 743 56 925 651 685 845 313 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis is the hard version of the ...
[{"type": "stdin_stdout", "input": "5\n2 0\n1 2\n2 1\n1 2\n1 2\n2 1\n2 1\n1 2\n3 9\n1 2 3\n1 2\n1 3\n2 3\n1 2\n1 3\n2 3\n1 2\n1 3\n2 3\n3 0\n3 2 1\n", "output": "2\n2\n2\n2\n2\n3\n4\n4\n3\n3\n3\n3\n4\n4\n3\n3\n"}, {"type": "stdin_stdout", "input": "5\n2 0\n1 2\n2 1\n1 2\n1 2\n2 1\n2 1\n1 2\n3 9\n1 2 3\n1 2\n1 3\n2 3\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 an undirected grap...
[{"type": "stdin_stdout", "input": "3\n5 9 4\n1 2\n1 3\n1 4\n1 5\n2 3\n2 4\n2 5\n3 4\n3 5\n10 15 3\n1 2\n2 3\n3 4\n4 5\n5 1\n1 7\n2 8\n3 9\n4 10\n5 6\n7 10\n10 8\n8 6\n6 9\n9 7\n4 5 4\n1 2\n2 3\n3 4\n4 1\n1 3\n", "output": "2\n4 1 2 3 \n1 10\n1 2 3 4 5 6 7 8 9 10 \n-1\n"}, {"type": "stdin_stdout", "input": "3\n5 9 4\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\nAthenaeus has just finished crea...
[{"type": "stdin_stdout", "input": "5\n6\n1 2 2 2 5 11\n2\n2 4\n6\n1 1 3 4 4 10\n1\n1\n6\n1 1 1 2 2 2\n", "output": "5\n2\n6\n1\n3\n"}, {"type": "stdin_stdout", "input": "5\n6\n1 2 2 4 6 11\n2\n1 4\n6\n1 1 1 4 4 10\n1\n1\n6\n1 1 2 2 2 2\n", "output": "6\n2\n5\n1\n3\n"}, {"type": "stdin_stdout", "input": "5\n6\n1 2 2 2 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a positive integer...
[{"type": "stdin_stdout", "input": "8\n420587971613\n681238648792\n817378345476\n509923060101\n202232821384\n387799635832\n215157629382\n698361920355\n", "output": "NO\nYES\nYES\nYES\nYES\nYES\nNO\nNO\n"}, {"type": "stdin_stdout", "input": "8\n187759228040\n681238648792\n817378345476\n509923060101\n202232821384\n387799...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp is wondering about buyi...
[{"type": "stdin_stdout", "input": "3\n4 15\n1 3 10 11\n1 2 7\n4 100\n1 5 10 50\n3 14 12\n2 1000000000\n1 1\n1\n", "output": "\n6\n13\n1000000000\n"}, {"type": "stdin_stdout", "input": "3\n4 15\n1 3 20 11\n1 2 13\n4 100\n2 5 10 50\n3 26 12\n2 1000000000\n1 1\n1\n", "output": "5\n14\n1000000000\n"}, {"type": "stdin_stdo...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne must train much to do well o...
[{"type": "stdin_stdout", "input": "86 81 36\n84 44 92 12 39 24 70 73 17 43 50 59 9 89 87 67 80 35 7 49 6 23 1 19 2 70 40 84 4 28 18 60 13 97 3 76 69 5 13 26 55 27 21 62 17 3 6 40 55 69 16 56 13 55 20 72 35 13 38 24 14 73 73 92 75 46 92 39 22 86 0 70 12 95 48 40 37 69 4 83 42 9 4 63 66 56\n16 5 2 16 -1 21 11 -1 1 48 -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 cities numbered from...
[{"type": "stdin_stdout", "input": "5\n0 954 1255 266 751\n954 0 1677 688 1173\n1255 1677 0 989 504\n266 688 989 0 485\n751 1173 504 485 0\n5\n5 2 1509\n3 4 692\n3 5 756\n3 1 151\n2 5 262\n", "output": "8742 7851 7851 6398 5111 "}, {"type": "stdin_stdout", "input": "5\n0 954 1255 266 751\n954 0 1677 688 1173\n1255 1677...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya has n items lying in a lin...
[{"type": "stdin_stdout", "input": "2 100 100 10000 10000\n100 100\n", "output": "20000\n"}, {"type": "stdin_stdout", "input": "2 100 100 00000 10000\n100 100\n", "output": "20000\n"}, {"type": "stdin_stdout", "input": "2 100 100 00001 10000\n000 100\n", "output": "10000\n"}, {"type": "stdin_stdout", "input": "2 100 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\nTwo semifinals have just been in...
[{"type": "stdin_stdout", "input": "8\n100 101\n200 201\n300 301\n310 400\n320 500\n330 600\n340 700\n350 800\n", "output": "11111000\n11110000\n"}, {"type": "stdin_stdout", "input": "8\n100 101\n200 201\n300 157\n310 400\n320 500\n330 600\n340 700\n350 800\n", "output": "11111000\n11110000\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 can find anything whatsoever...
[{"type": "stdin_stdout", "input": "0 0 0\n0 1 0\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1 1 0\n0 1 0\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1 0 0\n0 0 0\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1 1 1\n0 1 1\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\nJzzhu has picked n apples from h...
[{"type": "stdin_stdout", "input": "15686\n", "output": "7422\n3 6\n9 12\n15 18\n21 24\n27 30\n33 36\n39 42\n45 48\n51 54\n57 60\n63 66\n69 72\n75 78\n81 84\n87 90\n93 96\n99 102\n105 108\n111 114\n117 120\n123 126\n129 132\n135 138\n141 144\n147 150\n153 156\n159 162\n165 168\n171 174\n177 180\n183 186\n189 192\n195 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya is studying in the last cl...
[{"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000 1000000000000000000\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1001000000000000000 1000000000000000000 1000000000000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1001000000000000000 1000000000000000000 1000000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIlya got tired of sports program...
[{"type": "stdin_stdout", "input": "2000 1.00 2000\n", "output": "2000.000000000000\n"}, {"type": "stdin_stdout", "input": "2000 0.99 2000\n", "output": "1980.000000000000\n"}, {"type": "stdin_stdout", "input": "2000 0.61 2000\n", "output": "1220.000000000000\n"}, {"type": "stdin_stdout", "input": "1000 0.90 1733\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\nAri the monster is not an ordina...
[{"type": "stdin_stdout", "input": "63 20\n35 26\n54 5\n32 56\n56 53\n59 46\n37 31\n46 8\n4 1\n2 47\n59 42\n55 11\n62 6\n30 7\n60 24\n41 36\n34 22\n24 34\n21 2\n12 52\n8 44\n60 21\n24 30\n48 35\n48 25\n32 57\n20 37\n11 54\n11 62\n42 58\n31 43\n12 23\n55 48\n51 55\n41 27\n25 33\n21 18\n42 12\n4 15\n51 60\n62 39\n46 41\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's the year 4527 and the tanks...
[{"type": "stdin_stdout", "input": "6\n1000000000000000000000000000000000000 11965651543 1000000000000000000000000000000000000 1000000000000000000000000000000000000 1000000000000000000000000000000000000 1000000000000000000000000000000000000\n", "output": "1196565154300000000000000000000000000000000000000000000000000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an undirected grap...
[{"type": "stdin_stdout", "input": "11 7\n1 2 B\n1 3 R\n3 2 R\n4 5 R\n6 7 R\n8 9 R\n10 11 R\n", "output": "5\n3 4 6 8 10 \n"}, {"type": "stdin_stdout", "input": "6 6\n1 2 R\n1 3 R\n2 3 R\n4 5 B\n5 6 B\n5 6 B\n", "output": "1\n5\n"}, {"type": "stdin_stdout", "input": "6 6\n1 2 R\n1 3 R\n2 6 R\n4 5 B\n5 6 B\n5 6 B\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\nFor each string s consisting of ...
[{"type": "stdin_stdout", "input": "999961560 999983920 999983921 999961560\n", "output": "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWell, the series which Stepan wa...
[{"type": "stdin_stdout", "input": "100 100\n????????????????????????????????????????????????????????????????????????????????????????????????????\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "100 000\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\nHideo Kojima has just quit his j...
[{"type": "stdin_stdout", "input": "100\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100\n1 1 1 1 1 1 1 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIt's another Start[c]up finals, ...
[{"type": "stdin_stdout", "input": "25 6\n1 10 5\n1 8 4\n1 8 2\n4 8 9\n3 2 8\n1 9 5\n2 10 10\n3 9 6\n3 5 4\n2 7 8\n2 3 2\n2 6 8\n3 7 8\n4 3 7\n1 8 1\n3 6 4\n3 2 8\n2 2 1\n4 8 8\n4 15 4\n3 10 2\n3 6 6\n2 2 5\n1 6 2\n4 1 5\n", "output": "477\n"}, {"type": "stdin_stdout", "input": "25 6\n1 10 5\n1 8 4\n1 8 2\n4 8 9\n3 2 8...
code_stdio