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\nInternational Women's Day is com...
[{"type": "stdin_stdout", "input": "8 2\n1 2 2 3 2 4 6 10\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "7 2\n1 2 2 3 2 4 10\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "7 3\n1 2 2 3 2 4 5\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "3 1\n1 1 1\n", "output": "2\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string S of leng...
[{"type": "stdin_stdout", "input": "50 27\nACBCABCCCAACACCBBBACCBCBBBCCBAAAABAACACAAACCACCCCA\n", "output": "ACBCABCCCAACACCBBBACCBCBBBcCBAAAABAACACAAACCACCCCA\n"}, {"type": "stdin_stdout", "input": "50 50\nCABABCBBCBABCAACBCBBAAAACBCBCBBABBABBBCCBAACCAACAB\n", "output": "CABABCBBCBABCAACBCBBAAAACBCBCBBABBABBBCCBAACCAA...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 K 500-yen coins. (...
[{"type": "stdin_stdout", "input": "100 100000\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "84 42001\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "13 6498\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "4 2000\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "2 900\n", "outp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSnuke has a fair N-sided die tha...
[{"type": "stdin_stdout", "input": "10000 100000\n", "output": "0.036463721466\n"}, {"type": "stdin_stdout", "input": "3904 16384\n", "output": "0.081316166237\n"}, {"type": "stdin_stdout", "input": "100000 5\n", "output": "0.999973749998\n"}, {"type": "stdin_stdout", "input": "97392 33\n", "output": "0.999781007423\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 is a string S representing...
[{"type": "stdin_stdout", "input": "SAT\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "SUN\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "FRI\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "MON\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "THU\n", "output": "3\n"}, {"type": "stdi...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe development of algae in a po...
[{"type": "stdin_stdout", "input": "5 1 200\n", "output": "999\n4994\n24969\n124844\n624219\n3121094\n15605469\n78027344\n390136719\n1950683594\n"}, {"type": "stdin_stdout", "input": "4 49 188\n", "output": "703\n2763\n11003\n43963\n175803\n703163\n2812603\n11250363\n45001403\n180005563\n"}, {"type": "stdin_stdout", "i...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an array $d_1, d_2...
[{"type": "stdin_stdout", "input": "1\n1000000000\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\n1 3 1 1 4\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "5\n1 3 2 1 4\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "5\n1 3 5 4 5\n", "output": "9\n"}, {"type": "stdin_stdout", "input": "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\nYou are given three positive (i....
[{"type": "stdin_stdout", "input": "5\n3 2 3\n100 100 100\n50 49 49\n10 30 20\n1 1000000000 1000000000\n", "output": "YES\n2 2 3\nYES\n100 100 100\nNO\nNO\nYES\n1 1 1000000000\n"}, {"type": "stdin_stdout", "input": "1\n127869 127869 127869\n", "output": "YES\n127869 127869 127869\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\nRecently, Norge found a string $...
[{"type": "stdin_stdout", "input": "200 13\nvgfjhgkgwkftaeqejmbgildembgxdbskxfndwmcckjfkbeekxkgakmcjhclqsecpnkaigcxxhfghgegfadjktckftdhtifriemfifakygoesjfginnddjjklwiwlbjsgftwhtjdxmcadpvhaeddxwnmguwhetwbmffbmvdvuhecgjckddrbikgwkrfwfhdhqolidgkfm\na b c d e f g h i j k l m\n", "output": "578\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\nRecall that the sequence $b$ is ...
[{"type": "stdin_stdout", "input": "10\n10\n-1 5 6 2 -8 -7 -6 5 -3 -1\n10\n1 2 3 4 5 6 7 8 9 10\n1\n6\n1\n-7\n11\n5 -4 1 2 3 -5 -7 -10 -2 1 12\n4\n-4 -5 -6 1\n7\n1 2 6 3 2 -6 -2\n5\n-1 -5 4 -2 -9\n1\n9\n3\n1 -1 1\n", "output": "3\n10\n6\n-7\n14\n-3\n4\n1\n9\n1\n"}, {"type": "stdin_stdout", "input": "4\n5\n1 2 3 -1 -2\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an undirected unwe...
[{"type": "stdin_stdout", "input": "8 9\n1 2\n2 3\n2 5\n1 6\n3 4\n6 5\n4 5\n2 7\n5 8\n", "output": "4 3\n7 2\n5 8\n5 2\n6 1\n2 3\n1 2\n"}, {"type": "stdin_stdout", "input": "5 6\n1 5\n2 5\n3 5\n4 5\n2 3\n1 2\n", "output": "5 3\n1 5\n4 5\n5 2\n"}, {"type": "stdin_stdout", "input": "5 6\n2 1\n2 3\n2 4\n2 5\n3 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\nYou are given a board of size $n...
[{"type": "stdin_stdout", "input": "3\n5\n3005\n3005\n", "output": "40\n9045074040\n9045074040\n"}, {"type": "stdin_stdout", "input": "3\n1\n5\n499993\n", "output": "0\n40\n41664916690999888\n"}, {"type": "stdin_stdout", "input": "1\n499999\n", "output": "41666416667000000\n"}, {"type": "stdin_stdout", "input": "1\n214...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 one integer number...
[{"type": "stdin_stdout", "input": "21\n719\n5039\n39916801\n479001599\n28657\n514229\n433494437\n66047\n263167\n16785407\n999999757\n999999761\n999999797\n999999883\n999999893\n999999929\n999999937\n991026973\n985062919\n979134757\n971230541\n", "output": "NO\nNO\nNO\nNO\nNO\nNO\nNO\nNO\nNO\nNO\nNO\nNO\nNO\nNO\nNO\nNO...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNikolay got a string $s$ of even...
[{"type": "stdin_stdout", "input": "8\nbbbabbba\n", "output": "2\nabbaabba\n"}, {"type": "stdin_stdout", "input": "8\nbbabbbaa\n", "output": "3\nabababba\n"}, {"type": "stdin_stdout", "input": "6\nababab\n", "output": "0\nababab\n"}, {"type": "stdin_stdout", "input": "6\nbbbbba\n", "output": "2\nababba\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\nMaksim walks on a Cartesian plan...
[{"type": "stdin_stdout", "input": "39\n27 47\n30 9\n18 28\n49 16\n10 12\n25 13\n44 11\n13 9\n3 8\n30 2\n8 30\n38 32\n7 29\n38 43\n27 37\n6 13\n21 25\n31 18\n17 26\n51 52\n27 40\n10 43\n50 27\n41 41\n2 11\n38 45\n37 43\n20 52\n36 11\n43 46\n4 39\n22 32\n42 11\n8 37\n9 17\n38 8\n41 1\n24 50\n47 7\n", "output": "861\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\nTakahashi is solving quizzes. He...
[{"type": "stdin_stdout", "input": "3\n1\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1\n2\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "1\n3\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "3\n2\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "2\n1\n", "output": "3\n"}, {"type": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven is a positive integer L.\n...
[{"type": "stdin_stdout", "input": "1000\n", "output": "37037037.037037037313\n"}, {"type": "stdin_stdout", "input": "999\n", "output": "36926037.000000000000\n"}, {"type": "stdin_stdout", "input": "430\n", "output": "2944703.703703703824\n"}, {"type": "stdin_stdout", "input": "392\n", "output": "2230973.629629629664\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\nIn 2020, AtCoder Inc. with an an...
[{"type": "stdin_stdout", "input": "1\n", "output": "Hello World\n"}, {"type": "stdin_stdout", "input": "2\n8\n5\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "2\n9\n9\n", "output": "18\n"}, {"type": "stdin_stdout", "input": "2\n5\n6\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "2\n3\n5\n", "outp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven are 1-digit positive integ...
[{"type": "stdin_stdout", "input": "9 1\n", "output": "111111111\n"}, {"type": "stdin_stdout", "input": "6 8\n", "output": "66666666\n"}, {"type": "stdin_stdout", "input": "7 7\n", "output": "7777777\n"}, {"type": "stdin_stdout", "input": "5 4\n", "output": "44444\n"}, {"type": "stdin_stdout", "input": "4 3\n", "output...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven is a lowercase English let...
[{"type": "stdin_stdout", "input": "a\n", "output": "b\n"}, {"type": "stdin_stdout", "input": "y\n", "output": "z\n"}, {"type": "stdin_stdout", "input": "c\n", "output": "d\n"}, {"type": "stdin_stdout", "input": "p\n", "output": "q\n"}, {"type": "stdin_stdout", "input": "d\n", "output": "e\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\nGiven are two strings S and T co...
[{"type": "stdin_stdout", "input": "oekdkfjdjgjknbfkwnfnhaoekdkfjdjgjknbfkwnfnhahjekkengkfoekdkfjdjgjknbfkwnfnhaoekdkfjdjgjknbfkwnfnhahj yowkymbmhkkgjjeokdlakbndkkworqotkfnblgpnkkrogjrfnvmbjisnbkzvmbnrrrigeoibgpefjobvmovpqosqoqrgrkengrlk\n", "output": "yowkymbmhkkgjjeokdlakbndkkworqotkfnblgpnkkrogjrfnvmbjisnbkzvmbnrrri...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 an array $a$ consis...
[{"type": "stdin_stdout", "input": "2\n1000000 1000000\n", "output": "1000000\n"}, {"type": "stdin_stdout", "input": "6\n5 1 2 4 6 3\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\n1 5 7 8 2\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\n2 1 1 1 1\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\nThere are $n$ monsters standing ...
[{"type": "stdin_stdout", "input": "6 2 3 3\n7 10 50 12 1 8\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "7 4 2 1\n1 3 5 4 2 7 6\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "2 1 100 2\n1 101\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1 1 100 99\n100\n", "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\nYou are given an array consistin...
[{"type": "stdin_stdout", "input": "100 25\n6745 2075 7499 7517 1776 5164 2335 2745 4465 1457 7565 2232 2486 9025 8059 9646 8017 7662 9690 3352 2306 366 7422 1073 7169 8966 4506 8225 5614 8628 2908 7452 9625 9332 7097 353 1043 8118 5794 4486 626 971 6731 6618 887 6354 4814 7307 7681 6160 9351 2579 411 3436 5570 2812 27...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe only difference between easy...
[{"type": "stdin_stdout", "input": "78 36\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0\n1 52\n2 6\n9 43\n10 52\n4 63\n9 35\n10 67\n9 17\n3 43\n4 38\n1 27\n9 44\n6 74\n7 3\n8 18\n1 52\n1 68\n5 51\n5 2\n7 50\n1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are $n$ students at your u...
[{"type": "stdin_stdout", "input": "10\n716243820 716243820 716243820 716243820 716243820 716243820 716243820 716243820 716243820 716243820\n", "output": "0 1\n1 1 1 1 1 1 1 1 1 1 \n"}, {"type": "stdin_stdout", "input": "10\n1 2 5 129 185 581 1041 1909 1580 8150\n", "output": "7486 3\n3 3 3 2 2 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\nA positive (strictly greater tha...
[{"type": "stdin_stdout", "input": "5\n5009\n7\n9876\n10000\n10\n", "output": "2\n9 5000 \n1\n7 \n4\n6 70 800 9000 \n1\n10000 \n1\n10 \n"}, {"type": "stdin_stdout", "input": "7\n1\n1\n1\n1\n1\n1\n1\n", "output": "1\n1 \n1\n1 \n1\n1 \n1\n1 \n1\n1 \n1\n1 \n1\n1 \n"}, {"type": "stdin_stdout", "input": "2\n9999\n52\n", "ou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe only difference between easy...
[{"type": "stdin_stdout", "input": "20\n10\n3 8 1 4 9 6 10 2 7 5\n10\n10 4 8 6 5 3 1 2 9 7\n1\n1\n2\n2 1\n10\n2 5 3 6 9 7 4 10 8 1\n10\n1 7 4 6 9 10 8 2 3 5\n8\n3 8 1 7 6 4 2 5\n8\n7 4 5 2 8 1 6 3\n5\n1 2 4 3 5\n6\n4 2 5 6 3 1\n5\n5 3 2 4 1\n5\n4 3 5 1 2\n7\n6 5 1 7 4 2 3\n6\n6 2 4 1 5 3\n3\n3 1 2\n4\n1 3 4 2\n3\n3 1 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are both a shop keeper and a...
[{"type": "stdin_stdout", "input": "3\n5\n1 2 3 4 5\n3\n1 2 3\n2\n777 778\n", "output": "3\n2\n778\n"}, {"type": "stdin_stdout", "input": "3\n5\n1 2 3 4 5\n3\n1 2 2\n4\n1 1 1 1\n", "output": "3\n2\n1\n"}, {"type": "stdin_stdout", "input": "1\n1\n2441139\n", "output": "2441139\n"}, {"type": "stdin_stdout", "input": "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\nIn BerSoft $n$ programmers work,...
[{"type": "stdin_stdout", "input": "10 35\n322022227 751269818 629795150 369443545 344607287 250044294 476897672 184054549 986884572 917181121\n6 3\n7 3\n1 9\n7 9\n10 7\n3 4\n8 6\n7 4\n6 10\n7 2\n3 5\n6 9\n3 10\n8 7\n6 5\n8 1\n8 5\n1 7\n8 10\n8 2\n1 5\n10 4\n6 7\n4 6\n2 6\n5 4\n9 10\n9 2\n4 8\n5 9\n4 1\n3 2\n2 1\n4 2\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\nAuthors have come up with the st...
[{"type": "stdin_stdout", "input": "6 5\n5 6 1 2 3 4\n6 5 1 2 3 4\n", "output": "YES\nbcdeaa\n"}, {"type": "stdin_stdout", "input": "5 2\n5 2 4 3 1\n5 4 3 1 2\n", "output": "YES\nbbbba\n"}, {"type": "stdin_stdout", "input": "5 4\n1 3 2 4 5\n2 3 5 1 4\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "3 2\n1 2 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\nRecently Vasya decided to improv...
[{"type": "stdin_stdout", "input": "5\n13 16 20 18 11\n", "output": "138\n3 4 2 1 5 \n"}, {"type": "stdin_stdout", "input": "6\n5 4 5 4 4 5\n", "output": "69\n6 1 3 5 2 4 \n"}, {"type": "stdin_stdout", "input": "4\n10 10 10 10\n", "output": "64\n2 1 4 3 \n"}, {"type": "stdin_stdout", "input": "3\n20 10 20\n", "output":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a sequence of posi...
[{"type": "stdin_stdout", "input": "8\n2 7 1 8 2 8 1 8\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "6\n1 2 2 3 3 3\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1\n1000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n2 4 1 4 2\n", "output": "2\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\nWe have five variables x_1, x_2,...
[{"type": "stdin_stdout", "input": "0 2 3 4 5\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "1 2 0 4 5\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "1 0 3 4 5\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "1 2 3 0 5\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "1 2 3 4 0\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\nWe have a sequence of length N, ...
[{"type": "stdin_stdout", "input": "6\n2 7 1 8 2 8\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "3\n1 10 100\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "4\n1 2 3 4\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "3\n1 4 1\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "2\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe ask you to select some number...
[{"type": "stdin_stdout", "input": "1 100 97\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "40 98 58\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "77 42 36\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "7 5 1\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "2 2 1\n", "outpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a farm whose length and...
[{"type": "stdin_stdout", "input": "100 100\n", "output": "9801\n"}, {"type": "stdin_stdout", "input": "91 61\n", "output": "5400\n"}, {"type": "stdin_stdout", "input": "22 15\n", "output": "294\n"}, {"type": "stdin_stdout", "input": "5 7\n", "output": "24\n"}, {"type": "stdin_stdout", "input": "2 2\n", "output": "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\nWe have a long seat of width X c...
[{"type": "stdin_stdout", "input": "64146 123 456\n", "output": "110\n"}, {"type": "stdin_stdout", "input": "64145 123 456\n", "output": "109\n"}, {"type": "stdin_stdout", "input": "100000 1 1\n", "output": "49999\n"}, {"type": "stdin_stdout", "input": "13 3 1\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "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\nOn a two-dimensional plane, ther...
[{"type": "stdin_stdout", "input": "5\n0 0\n7 3\n2 2\n4 8\n1 6\n8 5\n6 9\n5 4\n9 1\n3 7\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "5\n0 0\n1 1\n5 5\n6 6\n7 7\n2 2\n3 3\n4 4\n8 8\n9 9\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "3\n2 0\n3 1\n1 3\n4 2\n0 4\n5 5\n", "output": "2\n"}, {"type": "st...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn a public bath, there is a sho...
[{"type": "stdin_stdout", "input": "4 1000000000\n0 1000 1000000 1000000000\n", "output": "2000000000\n"}, {"type": "stdin_stdout", "input": "9 10\n0 3 5 7 100 110 200 300 311\n", "output": "67\n"}, {"type": "stdin_stdout", "input": "2 4\n0 3\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "2 4\n0 5\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 Elephant from the Zoo o...
[{"type": "stdin_stdout", "input": "4\n47\n74\n477\n4747477", "output": "2\n2\n3\n23\n"}, {"type": "stdin_stdout", "input": "4\n47\n47\n477\n4747477", "output": "2\n2\n3\n23\n"}, {"type": "stdin_stdout", "input": "4\n44\n74\n477\n4747477", "output": "3\n2\n3\n23\n"}, {"type": "stdin_stdout", "input": "4\n47\n44\n477\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\nThere are n persons who initiall...
[{"type": "stdin_stdout", "input": "16 20 2\n10 4\n5 3\n10 5\n12 7\n7 6\n9 12\n9 6\n1 10\n11 16\n11 1\n16 3\n10 2\n14 4\n15 14\n4 13\n13 15\n1 8\n7 15\n1 7\n8 15\n", "output": "0\n0\n0\n0\n0\n0\n4\n4\n4\n4\n10\n10\n10\n10\n10\n14\n14\n14\n14\n15\n"}, {"type": "stdin_stdout", "input": "16 20 2\n10 4\n5 3\n10 5\n12 7\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\nLet's call a string a phone numb...
[{"type": "stdin_stdout", "input": "100\n10073026040057460848727605087211482331696312132261702754626166388448133087167204984955299978572844873\n", "output": "9\n"}, {"type": "stdin_stdout", "input": "100\n12214470388509637187316171407185732399094381485438987303313809772379863936872280956215437122989955784\n", "output":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given q queries in the f...
[{"type": "stdin_stdout", "input": "30\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 100000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNote that this is the first prob...
[{"type": "stdin_stdout", "input": "60\n26 6\n59 30\n31 12\n31 3\n38 23\n59 29\n53 9\n38 56\n53 54\n29 21\n17 55\n59 38\n26 16\n24 59\n24 25\n17 35\n24 41\n30 15\n31 27\n8 44\n26 5\n26 48\n8 32\n53 17\n3 34\n3 51\n30 28\n47 10\n53 60\n36 42\n24 53\n59 22\n53 40\n26 52\n36 4\n59 8\n29 37\n36 20\n17 47\n53 18\n3 50\n30 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\nAn array of integers p_{1},p_{2}...
[{"type": "stdin_stdout", "input": "100\n0 0 57 121 57 0 19 251 19 301 19 160 57 578 664 57 19 50 0 621 91 5 263 34 5 96 713 649 22 22 22 5 108 198 1412 1147 84 1326 1777 0 1780 132 2000 479 1314 525 68 690 1689 1431 1288 54 1514 1593 1037 1655 807 465 1674 1747 1982 423 837 139 1249 1997 1635 1309 661 334 3307 2691 21...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis is the easier version of th...
[{"type": "stdin_stdout", "input": "5\n3 1 4 1 2\n15\n5 5\n5 4\n5 3\n5 2\n5 1\n4 4\n4 3\n4 2\n4 1\n3 3\n3 2\n3 1\n2 2\n2 1\n1 1\n", "output": "2\n1\n4\n1\n3\n2\n4\n1\n3\n2\n4\n3\n4\n3\n4\n"}, {"type": "stdin_stdout", "input": "5\n3 1 4 2 2\n15\n5 5\n5 4\n5 3\n5 2\n5 1\n4 4\n4 3\n4 2\n4 1\n3 3\n3 2\n3 1\n2 2\n2 1\n1 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\nThere are n lamps on a line, num...
[{"type": "stdin_stdout", "input": "19 5\n1001001001100000110\n2\n2 3\n2\n5 6\n2\n8 9\n5\n12 13 14 15 16\n1\n19\n", "output": "0\n1\n1\n1\n2\n2\n2\n3\n3\n3\n3\n4\n4\n4\n4\n4\n4\n4\n5\n"}, {"type": "stdin_stdout", "input": "8 6\n00110011\n3\n1 3 8\n5\n1 2 5 6 7\n2\n6 8\n2\n3 5\n2\n4 7\n1\n2\n", "output": "1\n1\n1\n1\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 are n points on a coordina...
[{"type": "stdin_stdout", "input": "5\n2 1 4 3 5\n2 2 2 3 4\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "5\n2 1 4 3 5\n0 2 2 3 4\n", "output": "18\n"}, {"type": "stdin_stdout", "input": "3\n1 3 2\n-100 2 10\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "3\n1 3 2\n-100 2 3\n", "output": "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\nYou are given a complete directe...
[{"type": "stdin_stdout", "input": "1\n132 8 1257\n", "output": "5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 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\nVasilisa the Wise from the Kingd...
[{"type": "stdin_stdout", "input": "16 14\n15 15\n17 13\n", "output": "9 7\n6 8\n"}, {"type": "stdin_stdout", "input": "12 14\n11 15\n9 17\n", "output": "3 9\n8 6\n"}, {"type": "stdin_stdout", "input": "12 12\n14 10\n16 8\n", "output": "9 3\n5 7\n"}, {"type": "stdin_stdout", "input": "11 11\n17 5\n12 10\n", "output": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou may know that Euclid was a m...
[{"type": "stdin_stdout", "input": "50 500000\n2 57 94\n2 1 10\n2 97 98\n2 15 86\n2 66 84\n2 40 100\n2 8 27\n2 14 43\n2 55 75\n2 25 90\n2 22 69\n2 9 12\n2 32 34\n2 24 48\n2 54 88\n2 13 50\n2 30 56\n2 38 77\n2 4 70\n2 39 92\n2 23 72\n2 17 36\n2 20 29\n2 6 51\n2 11 87\n2 21 68\n2 59 80\n2 52 61\n2 26 42\n2 2 37\n2 45 62\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 was dismantling his att...
[{"type": "stdin_stdout", "input": "3\n3 3\n0 -5 4\n1 5 4\n2 2\n-4 0\n1 2\n2 2\n0 0\n1 2\n", "output": "-1 -1 -1\n-1 -1\n-1 -1\n"}, {"type": "stdin_stdout", "input": "3\n3 3\n1 -3 4\n1 5 2\n2 2\n-2 0\n1 2\n2 2\n0 1\n1 2\n", "output": "\n0 6 2 \n-1 -1 \n1 3 \n"}, {"type": "stdin_stdout", "input": "3\n3 3\n0 -3 4\n1 5 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 an integer n. You ...
[{"type": "stdin_stdout", "input": "5\n178 170\n26 25\n64 84\n19 12\n20 136\n", "output": "764520\n12\n1015\n6\n32483\n"}, {"type": "stdin_stdout", "input": "5\n178 170\n26 25\n64 84\n19 12\n38 136\n", "output": "764520\n12\n1015\n6\n46148\n"}, {"type": "stdin_stdout", "input": "5\n178 170\n26 25\n64 84\n19 6\n20 136\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis is the easy version of the ...
[{"type": "stdin_stdout", "input": "100\n45 21 34 56 15 0 46 59 40 39 78 83 29 77 19 30 60 39 90 64 11 47 10 47 35 79 30 13 21 31 26 68 0 67 52 43 29 94 100 76 16 61 74 34 62 63 4 41 78 31 77 21 90 2 43 70 53 15 53 29 47 87 33 20 23 30 55 57 13 25 19 89 10 17 92 24 47 6 4 91 52 9 11 25 81 14 82 75 46 49 66 62 28 84 88 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 equation: \n\nA...
[{"type": "stdin_stdout", "input": "-50000 110001 -1028\n", "output": "2\n0.009385408263686695\n2.1906345917363135\n"}, {"type": "stdin_stdout", "input": "50000 110001 10338\n", "output": "2\n-2.1016396721343673\n-0.09838032786563272\n"}, {"type": "stdin_stdout", "input": "-50000 100001 -50000\n", "output": "2\n0.99553...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 recently found Ancient Prophes...
[{"type": "stdin_stdout", "input": "12-12-201312-12-201312-12-201313--12-201313--12-201313--12-201313--12-201313--12-201313--12-201313--12-201313--12-2013\n", "output": "12-12-2013\n"}, {"type": "stdin_stdout", "input": "12-12-211312-12-201312-12-201313--12-201313--02-201313--12-201313--12-201313--12-201313--12-201313-...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 cows playing poker a...
[{"type": "stdin_stdout", "input": "100\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n", "output": "100"}, {"type": "stdin_stdout", "input": "10\nAAAAAAAAAA\n", "output": "10"}, {"type": "stdin_stdout", "input": "8\nIFFFIAAI\n", "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\nVasily the Programmer loves roma...
[{"type": "stdin_stdout", "input": "1000 1000\n", "output": "1001\n"}, {"type": "stdin_stdout", "input": "1000 3\n", "output": "1499\n"}, {"type": "stdin_stdout", "input": "1000 2\n", "output": "1999\n"}, {"type": "stdin_stdout", "input": "1000 4\n", "output": "1333\n"}, {"type": "stdin_stdout", "input": "777 17\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\nPetya studies positional notatio...
[{"type": "stdin_stdout", "input": "10\n", "output": "1 2 3 4 5 6 7 8 9 \n2 4 6 8 10 12 14 16 18 \n3 6 9 12 15 18 21 24 27 \n4 8 12 16 20 24 28 32 36 \n5 10 15 20 25 30 35 40 45 \n6 12 18 24 30 36 42 48 54 \n7 14 21 28 35 42 49 56 63 \n8 16 24 32 40 48 56 64 72 \n9 18 27 36 45 54 63 72 81 \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\nTo celebrate the opening of the ...
[{"type": "stdin_stdout", "input": "10000 5000 5000 5000\n", "output": "6253751\n"}, {"type": "stdin_stdout", "input": "10000 4534 2345 4231\n", "output": "2069003\n"}, {"type": "stdin_stdout", "input": "8765 2432 2789 4993\n", "output": "1697715\n"}, {"type": "stdin_stdout", "input": "8987 4000 2534 4534\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 and B are preparing themselves...
[{"type": "stdin_stdout", "input": "10\n460626451 802090732 277246428 661369649 388684428 784303821 376287098 656422756 9301599 25720377\n277246428 388684428 661369649 460626451 656422756 802090732 9301599 784303821 376287098\n376287098 802090732 388684428 9301599 656422756 784303821 460626451 277246428\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\nLittle Susie listens to fairy ta...
[{"type": "stdin_stdout", "input": "67\n1 1\n3 8\n4 10\n7 8\n9 2\n10 1\n11 5\n12 8\n13 4\n16 6\n18 3\n19 3\n22 5\n24 6\n27 5\n28 3\n29 3\n30 5\n32 5\n33 10\n34 7\n35 8\n36 5\n41 3\n42 2\n43 5\n46 4\n48 4\n49 9\n52 4\n53 9\n55 1\n56 4\n59 7\n68 7\n69 4\n71 9\n72 10\n74 5\n76 4\n77 9\n80 7\n81 9\n82 5\n83 5\n84 9\n85 7\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\nEvery day Ruslan tried to count ...
[{"type": "stdin_stdout", "input": "50\n48 45 42\n32 45 8\n15 41 47\n32 29 38\n7 16 48\n19 9 21\n18 40 5\n39 40 7\n37 0 6\n42 15 37\n9 33 37\n40 41 33\n25 43 2\n23 21 38\n30 20 32\n28 15 5\n47 9 19\n47 22 26\n26 9 18\n24 23 24\n11 29 5\n38 44 9\n49 22 42\n1 15 32\n18 25 21\n8 48 39\n48 7 26\n3 30 26\n34 21 47\n34 14 4\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya wants to turn on Christmas...
[{"type": "stdin_stdout", "input": "1 100\n100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 rebus of form ? ...
[{"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\nNick has n bottles of soda left ...
[{"type": "stdin_stdout", "input": "90\n4 2 21 69 53 39 2 2 8 58 7 5 2 82 7 9 13 10 2 44 1 7 2 1 50 42 36 17 14 46 19 1 50 20 51 46 9 59 73 61 76 4 19 22 1 43 53 2 5 5 32 7 5 42 30 14 32 6 6 15 20 24 13 8 5 19 9 9 7 20 7 2 55 36 5 33 64 20 22 22 9 30 67 38 68 2 13 19 2 9\n48 4 39 85 69 70 11 42 65 77 61 6 60 84 67 15 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\nOur beloved detective, Sherlock ...
[{"type": "stdin_stdout", "input": "bwyplnjn zkms\n26\nzkms nzmcsytxh\nnzmcsytxh yujsb\nbwyplnjn gtbzhudpb\ngtbzhudpb hpk\nyujsb xvy\nhpk wrwnfokml\nwrwnfokml ndouuikw\nndouuikw ucgrja\nucgrja tgfmpldz\nxvy nycrfphn\nnycrfphn quvs\nquvs htdy\nhtdy k\ntgfmpldz xtdpkxm\nxtdpkxm suwqxs\nk fv\nsuwqxs qckllwy\nqckllwy diun\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 little time left before...
[{"type": "stdin_stdout", "input": "47 43\nerase 1\nalloc 95\nalloc 53\nerase 2\ndefragment\nalloc 100\nerase 4\nerase 2\nerase -849472053\ndefragment\nerase -638355221\nalloc 90\nerase 3\nerase 2\ndefragment\nalloc 17\nerase 5\ndefragment\nerase 6\ndefragment\nerase 3\ndefragment\ndefragment\nalloc 99\nalloc 69\nalloc...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 time ago Mister B detected ...
[{"type": "stdin_stdout", "input": "108\n1 102 33 99 6 83 4 20 61 100 76 71 44 9 24 87 57 2 81 82 90 85 12 30 66 53 47 36 43 29 31 64 96 84 77 23 93 78 58 68 42 55 13 70 62 19 92 14 10 65 63 75 91 48 11 105 37 50 32 94 18 26 52 89 104 106 86 97 80 95 17 72 40 22 79 103 25 101 35 51 15 98 67 5 34 69 54 27 45 88 56 16 46...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIgor is a post-graduate student ...
[{"type": "stdin_stdout", "input": "11\n1 1 1 1 1 1 1 1 1 1 1\n1 1000000001 1000000001 1000000001 1000000001 1000000001 1000000001 1000000001 1000000001 1000000001 1000000001\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\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\nAs technologies develop, manufac...
[{"type": "stdin_stdout", "input": "bn\n100\ndf\nyb\nze\nml\nyr\nof\nnw\nfm\ndw\nlv\nzr\nhu\nzt\nlw\nld\nmo\nxz\ntp\nmr\nou\nme\npx\nvp\nes\nxi\nnr\nbx\nqc\ngm\njs\nkn\ntw\nrq\nkz\nuc\nvc\nqr\nab\nna\nro\nya\nqy\ngu\nvk\nqk\ngs\nyq\nop\nhw\nrj\neo\nlz\nbh\nkr\nkb\nma\nrd\nz`\nuf\nhq\nmc\nmn\nti\nwn\nsh\nax\nsi\nnd\ntz\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecenlty Luba got a credit card ...
[{"type": "stdin_stdout", "input": "20 23036\n-1 1 -1 -1 -1 -1 1 -1 -1 0 0 1 1 0 -1 1 0 1 -1 -1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "20 23036\n-1 1 -1 -1 -1 -1 1 -1 -2 0 0 1 1 0 -1 1 0 1 -1 -1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "20 23036\n-1 1 -1 -1 -1 -1 1 -1 -2 0 0 1 1 0 -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\nLuba thinks about watering her g...
[{"type": "stdin_stdout", "input": "100 100\n2 46 24 18 86 90 31 38 84 49 58 28 15 80 14 24 87 56 62 87 41 87 55 71 87 32 41 56 91 32 24 75 43 42 35 30 72 53 31 26 54 61 87 85 36 75 44 31 7 38 77 57 61 54 70 77 45 96 39 57 11 8 91 42 52 15 42 30 92 41 27 26 34 27 3 80 32 86 26 97 63 91 30 75 14 7 19 23 45 11 8 43 44 73...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 and your friend are particip...
[{"type": "stdin_stdout", "input": "10\n3934 38497 42729 45023 51842 68393 77476 82414 91465 98055\n", "output": "98054\n"}, {"type": "stdin_stdout", "input": "6\n2 3 500000 999997 999998 999999\n", "output": "499999\n"}, {"type": "stdin_stdout", "input": "4\n999996 999997 999998 999999\n", "output": "4\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 a tree (a graph wi...
[{"type": "stdin_stdout", "input": "121\n110 31 57 33 45 33 33 33 91 102 79 33 61 72 107 101 117 10 118 33 33 64 24 94 117 76 33 23 33 49 5 52 95 78 33 39 33 92 17 33 25 33 56 33 3 88 33 108 62 15 28 111 67 33 33 11 96 33 36 70 46 98 80 104 33 19 60 33 112 51 33 2 33 33 121 59 33 41 50 81 105 33 115 34 33 18 84 32 33 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\nAdilbek's house is located on a ...
[{"type": "stdin_stdout", "input": "20 16 16\n1 2 3 4 5 6 8 9 10 11 13 14 15 16 18 19\n2 1 1 1 1 1 3 3 2 2 1 3 3 3 3 2\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "20 16 16\n1 2 3 4 5 6 8 9 10 11 13 14 15 16 18 19\n2 1 1 1 1 1 3 1 2 2 1 3 3 3 3 2\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "11 4...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs you know Appu created aversio...
[{"type": "stdin_stdout", "input": "50\n558017747 707412184 571476824 27885972 347137128 534455142 266330082 293791105 475845546 506551897 225052521 672800684 64370521 756181857 592652322 228887401 599530996 111233973 330484393 490574767 309080152 39589626 763859303 515779418 857884239 413041773 131315151 512215539 928...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 previous problem Chandu b...
[{"type": "stdin_stdout", "input": "4\n439 79\n991800654 985952720 985538124 983840231 983710443 982377023 981242112 980217433 978715835 975066351 971156452 970695839 967865836 966899150 964806897 962947103 961994537 961659306 950186818 949581998 947844082 945819757 943009670 939958230 934022730 933536137 933069759 930...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGolu is given a task of clearing...
[{"type": "stdin_stdout", "input": "4 6\n1 -1 -1 0 -1 1 \n0 0 1 1 1 0 \n0 -1 1 1 2 2 \n1 0 -1 2 2 1", "output": "0\n"}, {"type": "stdin_stdout", "input": "4 6\n1 0 -1 0 -1 1 \n0 0 1 1 1 0 \n1 -1 1 1 2 2 \n0 0 -1 2 2 1", "output": "0\n"}, {"type": "stdin_stdout", "input": "4 6\n2 0 -1 0 -1 1 \n0 0 1 1 1 0 \n1 -1 1 1 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\nA certain business maintains a l...
[{"type": "stdin_stdout", "input": "4\n10\nAlan\naLan\nalAn\nalaN\nALan\nAlAn\nAlaN\naLAn\naLaN\nalAN\n4\nabcdefghijklmnop T\nabccefghijklmnop T\nt tt ttt tttt\nTTTT TTT TT T\n4\nKenny G\nKenny Gee\nA DeForest Hoar\nC A R Hoare\n3\nk a\nm b\nk a", "output": "alAN \naLaN \naLAn \nAlaN \nAlAn \nALan \nalaN \nalAn \naLan ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRoy is going through the dark ti...
[{"type": "stdin_stdout", "input": "4\nSESSEEEECCBDESCCCC\nCCCCCCSSSEEESCCBSS\nSCCCCCCCSSEEESSSSS\nEESSSSCCCCCCSSEEEESAMPLE", "output": "7 10\n"}, {"type": "stdin_stdout", "input": "4\nSESSEEEECCBDESCCCC\nCCCCCCSSSEEESCCASS\nSCCCCCCCSSEEESSSSS\nEESSSSCCCCCCSSEEEESAMPLE", "output": "7 10\n"}, {"type": "stdin_stdout", "i...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn this problem, we only conside...
[{"type": "stdin_stdout", "input": "8", "output": "aaaaaaaa\naaaaaaab\naaaaaaba\naaaaaabb\naaaaaabc\naaaaabaa\naaaaabab\naaaaabac\naaaaabba\naaaaabbb\naaaaabbc\naaaaabca\naaaaabcb\naaaaabcc\naaaaabcd\naaaabaaa\naaaabaab\naaaabaac\naaaababa\naaaababb\naaaababc\naaaabaca\naaaabacb\naaaabacc\naaaabacd\naaaabbaa\naaaabbab\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHaving learned the multiplicatio...
[{"type": "stdin_stdout", "input": "33 106", "output": "-1\n"}, {"type": "stdin_stdout", "input": "12 29", "output": "-1\n"}, {"type": "stdin_stdout", "input": "19 29", "output": "-1\n"}, {"type": "stdin_stdout", "input": "19 57", "output": "-1\n"}, {"type": "stdin_stdout", "input": "37 57", "output": "-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\nAtCoDeer the deer found two posi...
[{"type": "stdin_stdout", "input": "-1 -2", "output": "Even\n"}, {"type": "stdin_stdout", "input": "-2 -2", "output": "Even\n"}, {"type": "stdin_stdout", "input": "-2 -1", "output": "Even\n"}, {"type": "stdin_stdout", "input": "-4 -1", "output": "Even\n"}, {"type": "stdin_stdout", "input": "-6 -1", "output": "Even\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\nThere are N students and M check...
[{"type": "stdin_stdout", "input": "5 5\n-100000000 -100000000\n-100000000 010000000\n100000000 -100000000\n100000000 100000000\n0 0\n-1 -1\n100000000 100001000\n100000000 -100000000\n-100000000 100000000\n-100000000 -11926256", "output": "5\n5\n3\n2\n1\n"}, {"type": "stdin_stdout", "input": "5 5\n-100000000 -100000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 students of AtCoder Kinderga...
[{"type": "stdin_stdout", "input": "30 30 000", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "106 25 31", "output": "No\n"}, {"type": "stdin_stdout", "input": "30 47 100", "output": "No\n"}, {"type": "stdin_stdout", "input": "30 26 100", "output": "No\n"}, {"type": "stdin_stdout", "input": "30 16 100", "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\n4 different points on the plane ...
[{"type": "stdin_stdout", "input": "1.0,0.0,0.1,0.1,0.0,0.1,0.0,0.0\n0.3,0.1,0.1,1.1,0.0,0.3,0.0,0.0", "output": "YES\nYES\n"}, {"type": "stdin_stdout", "input": "0.0,0.0,1.0,0.0,1.0,1.0,0.0,0.1\n0.3,0.1,0.1,1.1,0.0,0.3,0.0,0.0", "output": "YES\nYES\n"}, {"type": "stdin_stdout", "input": "0.0,0.0,1.0,0.0,1.0,1.0,0.0,0....
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSorting algorithms for sorting d...
[{"type": "stdin_stdout", "input": "5\n5\n1\n2\n-1\n0\n4\n1\n6\n2\n4\n4\n22\n3\n4\n1\n-1\n0", "output": "8\n2\n5\n0\n"}, {"type": "stdin_stdout", "input": "5\n10\n1\n4\n-1\n0\n8\n0\n3\n9\n7\n5\n22\n3\n4\n1\n-1\n0", "output": "8\n11\n0\n"}, {"type": "stdin_stdout", "input": "5\n5\n1\n2\n-1\n0\n8\n1\n6\n2\n4\n5\n22\n3\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\nPCK, which recycles Aizu's preci...
[{"type": "stdin_stdout", "input": "3\n12 1\n-3 5\n16 1", "output": "2 0\n13 0\n17 0\n"}, {"type": "stdin_stdout", "input": "3\n12 1\n-3 5\n16 2", "output": "2 0\n13 0\n18 0\n"}, {"type": "stdin_stdout", "input": "3\n12 1\n-3 5\n16 0", "output": "2 0\n13 0\n16 0\n"}, {"type": "stdin_stdout", "input": "3\n12 0\n-3 5\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\nYou are the God of Wind.\n\nBy m...
[{"type": "stdin_stdout", "input": "1\n0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0\n7\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n1 0 0 0 0 0 1 0 0 0 0 1 1 0 0 1\n0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1\n0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0\n0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0\n1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1\n0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0\n7\n0 0 0 0 0 0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nShort Phrase\n\nA Short Phrase (...
[{"type": "stdin_stdout", "input": "9\ndo\nhte\nbest\nand\nenjoy\ntoday\nat\nacm\nicpc\n14\noh\nyes\nby\nfar\nit\nis\nwow\nso\nbad\nto\nme\nyou\nknow\nhey\n15\nabcde\nfghijkl\nmnopq\nrstuvwx\nyzz\nabcde\nfghijkl\nmnopq\nrstuvwx\nyz\nabcde\nfghijkl\nmnopq\nrstuvwx\nyz\n0", "output": "1\n2\n6\n"}, {"type": "stdin_stdout"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nI have n tickets for a train wit...
[{"type": "stdin_stdout", "input": "6 279 2 5 26 14", "output": "117\n"}, {"type": "stdin_stdout", "input": "17 256 2 3 10 9", "output": "67\n"}, {"type": "stdin_stdout", "input": "6 323 2 12 8 9", "output": "182\n"}, {"type": "stdin_stdout", "input": "6 279 2 5 46 14", "output": "57\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\nTaro is an elementary school stu...
[{"type": "stdin_stdout", "input": "2\n999999\n1000100", "output": "12\n2\n"}, {"type": "stdin_stdout", "input": "2\n999999\n1010100", "output": "12\n3\n"}, {"type": "stdin_stdout", "input": "2\n999999\n1010110", "output": "12\n5\n"}, {"type": "stdin_stdout", "input": "2\n999999\n1101100", "output": "12\n4\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\nStep up and down\n\nKazuki, comm...
[{"type": "stdin_stdout", "input": "4\nlu ru ld rd\n4\nlu ld lu ru\n1\nlu\n10\nru lu ld rd ru rd ru lu rd ld\n0", "output": "2\n1\n0\n4"}, {"type": "stdin_stdout", "input": "4\nlu ru ld rd\n4\nlu ld lu ru\n0\nlu\n10\nur lu ld rd ru rd ru lu rd ld\n-1", "output": "2\n1\n"}, {"type": "stdin_stdout", "input": "4\nlu ru ld...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 is going to play a card gam...
[{"type": "stdin_stdout", "input": "47\nS 10\nS 11\nS 12\nS 13\nH 1\nH 2\nS 6\nS 7\nS 8\nS 9\nH 6\nH 8\nH 9\nH 10\nH 11\nH 4\nH 7\nS 2\nS 3\nS 4\nS 5\nH 12\nH 13\nC 1\nC 2\nD 1\nD 2\nD 3\nD 4\nD 5\nD 6\nD 7\nC 3\nC 4\nC 5\nC 6\nC 7\nC 8\nC 9\nC 10\nC 11\nC 13\nD 9\nD 10\nD 11\nD 12\nD 13", "output": "S 1\nH 3\nH 5\nC 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\nAt a geometry lesson Gerald was ...
[{"type": "stdin_stdout", "input": "-95534030 -14392539\n-89751090 79655267\n-77491839 40745315\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "92141071 -48275413\n-47968469 -13277723\n-15839680 51548907\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-79956125 -88524398\n10949698 32312326\n-7602470...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAwruk is taking part in election...
[{"type": "stdin_stdout", "input": "100\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a binary matrix A ...
[{"type": "stdin_stdout", "input": "16\nFFC0\nFFC0\nFFC0\nFFC0\nFFC0\nFFD0\nFFC0\nFFC0\nFFC0\nFFC0\nFFC0\nFFC0\nFFC0\nFFC0\nFFC0\nFFC0\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "16\nFFC0\nFFC0\nFFC0\nFFC0\nFFC0\nFFD0\nFFC0\nFFC0\nFFC0\nFFC0\n0CFF\nFFC0\nFFC0\nFFC0\nFFC0\nFFC0\n", "output": "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\nAt the big break Nastya came to ...
[{"type": "stdin_stdout", "input": "20 47\n4 6 11 15 9 17 3 1 19 14 12 8 2 5 7 20 16 18 13 10\n18 10\n6 3\n15 17\n18 7\n4 5\n19 10\n6 7\n11 3\n1 10\n17 3\n6 14\n7 10\n19 5\n12 10\n1 8\n6 11\n18 5\n6 8\n12 12\n1 5\n20 11\n16 8\n3 10\n20 19\n17 8\n19 10\n2 5\n19 8\n6 9\n16 3\n16 10\n19 7\n17 16\n10 13\n8 9\n12 5\n17 10\n...
code_stdio