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\nOverlooking the captivating blen...
[{"type": "stdin_stdout", "input": "100\n????????????????????????????????????????????????????????????????????????????????????????????????????\n", "output": "Yes"}, {"type": "stdin_stdout", "input": "100\nC?M?M?M?YM??YMYC?MCYMYM??Y??YC?CYC???YM?YM??MYMY?CYCYMYC?YC?C?CYCMY??CMC?YMCMYCYCYMYM?CYM?M?MCMCMY?Y\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're given a row with n chairs...
[{"type": "stdin_stdout", "input": "459\n000111000101010000100001001010111110011011010001100101111010111011101110111101111101100101100011011001100110001001111001101000111001011100110100011111011111000010000110010011100110011011111110011100001101001111000100111011001000001011111100110100001001001100101011100001110110100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMehta is a forever alone and des...
[{"type": "stdin_stdout", "input": "5\n21\n22\n23\n24\n25\n\nELPMAS", "output": "10\n"}, {"type": "stdin_stdout", "input": "5\n21\n22\n27\n24\n25\n\nELPMAS", "output": "10\n"}, {"type": "stdin_stdout", "input": "5\n21\n22\n23\n24\n25\n\nSALPLE", "output": "10\n"}, {"type": "stdin_stdout", "input": "5\n42\n22\n27\n24\n2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an undirected grap...
[{"type": "stdin_stdout", "input": "4 7\n0 0 1\n-1 1 1\n-1 2 3\n1 0 1\n1 2 2\n-1 0 3\n-1 1 1", "output": "1\n0\n1\n1\n0\n1\n"}, {"type": "stdin_stdout", "input": "4 7\n0 0 1\n-1 2 1\n-1 2 3\n1 0 1\n1 2 2\n-1 0 3\n-1 1 1", "output": "0\n0\n1\n1\n0\n1\n"}, {"type": "stdin_stdout", "input": "9 7\n1 1 1\n-1 0 1\n-1 2 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\nThere are N observatories in AtC...
[{"type": "stdin_stdout", "input": "6 5\n8 6 18 1 4 1\n1 3\n4 0\n4 0\n4 6\n4 6", "output": "3\n"}, {"type": "stdin_stdout", "input": "6 5\n8 6 18 1 4 0\n1 3\n4 0\n4 0\n4 6\n4 6", "output": "4\n"}, {"type": "stdin_stdout", "input": "6 5\n13 6 9 1 2 1\n1 3\n1 1\n4 0\n3 3\n4 6", "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\nTakahashi has A cookies, and Aok...
[{"type": "stdin_stdout", "input": "498881727339 49011419508 0000000100000", "output": "498881627339 49011419508\n"}, {"type": "stdin_stdout", "input": "498881727339 49011419508 0000001100000", "output": "498880627339 49011419508\n"}, {"type": "stdin_stdout", "input": "498881727339 50858735181 0000001100000", "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 string S consisting o...
[{"type": "stdin_stdout", "input": "RLRLLRLRRRRLLLLL", "output": "1 1 2 1 0 1 1 0 0 0 4 5 0 0 0 0\n"}, {"type": "stdin_stdout", "input": "RRRLLRLLRRLRLLLL", "output": "0 0 3 2 0 2 1 0 0 1 2 3 2 0 0 0\n"}, {"type": "stdin_stdout", "input": "RRRLLRLLLRRLLRLL", "output": "0 0 3 2 0 2 2 0 0 0 2 2 0 2 1 0\n"}, {"type": "std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an integer N. Buil...
[{"type": "stdin_stdout", "input": "4", "output": "4\n1 2\n1 3\n2 4\n3 4\n"}, {"type": "stdin_stdout", "input": "4", "output": "4\n1 2\n1 3\n2 4\n3 4\n"}, {"type": "stdin_stdout", "input": "3", "output": "2\n1 3\n2 3"}, {"type": "stdin_stdout", "input": "000", "output": "0\n"}, {"type": "stdin_stdout", "input": "001", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPrint all the integers that sati...
[{"type": "stdin_stdout", "input": "0 32 110", "output": "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n"}, {"type": "stdin_stdout", "input": "8 35 011", "output": "8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n25\n26\n27\n28\n29\n30\n31\n32\n33\n3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have a deck consisting of N c...
[{"type": "stdin_stdout", "input": "1 1 1\n1010000000", "output": "1009999999\n"}, {"type": "stdin_stdout", "input": "1 1 1\n1010100000", "output": "1010099999\n"}, {"type": "stdin_stdout", "input": "3 100 100\n10 1001 000", "output": "1001\n"}, {"type": "stdin_stdout", "input": "1 1 1\n1000000000", "output": "99999999...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNuske has a grid with N rows and...
[{"type": "stdin_stdout", "input": "5 5 6\n11010\n01110\n10111\n11111\n01010\n1 1 5 5\n1 2 4 5\n2 3 3 5\n3 3 3 2\n3 1 3 5\n1 1 3 4", "output": "-2\n-2\n0\n0\n2\n1\n"}, {"type": "stdin_stdout", "input": "5 5 6\n11010\n01110\n10111\n11111\n01010\n1 1 5 5\n1 2 4 5\n3 3 3 5\n3 3 3 2\n3 1 3 5\n1 1 3 4", "output": "-2\n-2\n1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given nonnegative intege...
[{"type": "stdin_stdout", "input": "-1 1010010100000100000 4", "output": "252502525000025001\n"}, {"type": "stdin_stdout", "input": "-1 1010010110000100000 3", "output": "336670036666700001\n"}, {"type": "stdin_stdout", "input": "-1 1010010111000100000 3", "output": "336670037000033334\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\n12:17 (UTC): The sample input 1 ...
[{"type": "stdin_stdout", "input": "4 13\n4 1 2 1\n4 1 10 1", "output": "714238057\n"}, {"type": "stdin_stdout", "input": "4 30\n3 1 1 1\n4 2 10 1", "output": "605469785\n"}, {"type": "stdin_stdout", "input": "4 12\n3 1 2 1\n11 1 5 2", "output": "809171659\n"}, {"type": "stdin_stdout", "input": "4 13\n4 1 2 1\n4 1 12 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe problem of hiding a part of ...
[{"type": "stdin_stdout", "input": "123+5X6=X79\n12X+4X7=X79\nXX22+89=X2XX", "output": "NA\nNA\nNA\n"}, {"type": "stdin_stdout", "input": "127+5X6=X39\n12X+4X7=X79\nXX22+89=X2XX", "output": "NA\nNA\nNA\n"}, {"type": "stdin_stdout", "input": "127+5X6=X39\n12X+4X7=X79\nXX32+89=X2XX", "output": "NA\nNA\nNA\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\nTakeshi, who loves hot springs, ...
[{"type": "stdin_stdout", "input": "2 1\n1 2 5\n3 2\n1 2 5\n2 3 36\n6 9\n3 2 7\n1 2 14\n2 5 27\n2 6 10\n2 2 21\n4 2 20\n3 5 2\n4 5 12\n4 6 14\n0 0", "output": "5\n0\n0\n"}, {"type": "stdin_stdout", "input": "2 1\n1 2 5\n3 2\n1 2 5\n2 3 36\n6 9\n3 2 7\n1 2 14\n2 5 27\n2 6 10\n2 2 21\n4 2 20\n3 5 2\n4 5 12\n8 6 14\n0 0",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's solve the puzzle by progra...
[{"type": "stdin_stdout", "input": "3\n-3 1 1\n2 -4 1\n2 1 -1\n3\n-2 1 1\n1 0 -6\n1 -5 3\n4\n-8 11 -2 1\n2 -7 -2 2\n1 -1 1 2\n1 1 1 -1\n6\n2 0 3 -7 0 2\n1 -10 1 1 4 2\n2 10 5 2 -6 0\n2 4 -23 2 1 8\n3 3 -8 2 3 7\n-7 2 5 2 -3 -18\n6\n3 2 3 -7 1 2\n1 -10 1 0 3 2\n2 6 5 0 -6 1\n0 4 -23 2 2 5\n4 3 -2 2 3 5\n-7 2 4 1 -5 -12\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a chain consisting of m...
[{"type": "stdin_stdout", "input": "10\n802 0 10\n814 0 4\n820 1 4\n826 1 4\n832 3 5\n838 9 5\n845 7 3\n849 10 3\n853 14 4\n857 18 3\n3\n0 0 5\n8 0 5\n8 8 5\n3\n0 0 5\n7 3 6\n16 1 5\n9\n-1 3 5\n8 0 8\n19 2 11\n23 14 6\n23 21 6\n23 28 6\n19 40 8\n8 42 8\n0 39 5\n11\n0 0 5\n8 0 5\n18 8 10\n8 16 5\n0 16 5\n-1 24 5\n3 32 5...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe committee members of the Kit...
[{"type": "stdin_stdout", "input": "4\nA\nAMD\nCAT\nDOG\nZ XUW ZVX Z YZT.\n2\nZA\nAY\nZA.\n2\n@A\nBB\nCC.\n16\nA\nB\nC\nD\nE\nF\nG\nH\nI\nJ\nK\nL\nM\nN\nO\nONMLKJIHGFEDCBA\nA B C D E F G H I J K L M N O ABCDEFGHIJKLMNO.\n0", "output": "A DOG AMD A CAT.\nZA.\nBB.\nO N M L K J I H G F E D C B A ONMLKJIHGFEDCBA.\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\nBackground\n\nThe kindergarten a...
[{"type": "stdin_stdout", "input": "13 4\n? a ? ? z a ?\n1 1\n0 2\n2 4\n4 5\n2 6\n0 6", "output": "aaaazab110224\n"}, {"type": "stdin_stdout", "input": "13 2\n? a ? ? z ` ?\n1 1\n0 2\n2 4\n4 5\n2 6\n0 6", "output": "aaaaz`b110224\n"}, {"type": "stdin_stdout", "input": "13 2\n? a ? @ z ` ?\n1 1\n0 2\n2 4\n4 5\n2 6\n0 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\nMaki is a house cat. One day she...
[{"type": "stdin_stdout", "input": "3\n0 -1 100 001\n60 100 50\n100 110 10\n25 75 50\n4\n0 0 100 000\n50 50 50\n150 50 50\n50 150 50\n150 117 50\n0", "output": "0\n0\n"}, {"type": "stdin_stdout", "input": "3\n0 0 100 101\n60 100 50\n100 100 10\n80 80 50\n4\n0 0 100 100\n50 50 50\n150 50 50\n50 150 50\n150 150 50\n0", "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem Statement\n\nMr. Takatsu...
[{"type": "stdin_stdout", "input": "10 4\n4\n3\n1\n2", "output": "3\n"}, {"type": "stdin_stdout", "input": "12 4\n4\n1\n1\n2", "output": "3\n"}, {"type": "stdin_stdout", "input": "10 4\n4\n1\n1\n2", "output": "3\n"}, {"type": "stdin_stdout", "input": "10 4\n4\n3\n1\n3", "output": "3\n"}, {"type": "stdin_stdout", "input...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nB: Hokkaido University Hard\n\nN...
[{"type": "stdin_stdout", "input": "3 3\nB.B\nB..\n.BB", "output": "4\n"}, {"type": "stdin_stdout", "input": "2 3\nB.B\nB..\n.BB", "output": "3\n"}, {"type": "stdin_stdout", "input": "1 3\nB-B\n..B\n.BA", "output": "2\n"}, {"type": "stdin_stdout", "input": "1 1\nB-B\n..B\n.BA", "output": "0\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\nWrite a program which manipulate...
[{"type": "stdin_stdout", "input": "3 5\n0 1 0 1\n0 2 3 2\n0 3 3 3\n1 2\n1 3", "output": "2\n5\n"}, {"type": "stdin_stdout", "input": "3 5\n0 1 2 1\n0 2 3 2\n0 3 3 3\n1 2\n1 3", "output": "3\n5"}, {"type": "stdin_stdout", "input": "6 3\n1 2\n0 1 4 -1\n1 2", "output": "0\n-1\n"}, {"type": "stdin_stdout", "input": "-1 1\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya has got an undirected grap...
[{"type": "stdin_stdout", "input": "100000 3950493829\n", "output": "0 11111\n"}, {"type": "stdin_stdout", "input": "233159 100970714\n", "output": "0 218947\n"}, {"type": "stdin_stdout", "input": "107865 257541069\n", "output": "0 85169\n"}, {"type": "stdin_stdout", "input": "134480 71136624\n", "output": "0 122551\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\nLunar New Year is approaching, a...
[{"type": "stdin_stdout", "input": "26\n150393140 360409816 380562806 954731482 34457876 66727907 376298532 679315200 260466665 597680044 95770656 948689469 209020313 926343072 66801160 426280560 927872284 389224547 492602065 324416078 776983298 191080523 167234113 791882865 365749226 28861923\n755656155 336170357\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 is a robot staying at X=0 ...
[{"type": "stdin_stdout", "input": "100 1 1\n0 0 0 1 1 0 1 0 1 0 1 0 -1 1 0 0 1 1 0 1 2 0 1 1 1 1 1 1 1 0 1 1 1 0 -1 0 0 0 -1 0 1 0 0 1 1 0 1 0 0 1 0 1 1 0 0 1 0 0 0 1 1 1 1 1 0 0 1 0 0 1 0 0 0 0 1 0 0 0 1 1 0 1 1 0 1 1 1 0 1 1 -1 1 1 0 0 1 1 0 1 1\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "100 1 1\n0 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\nYou are given an array a consist...
[{"type": "stdin_stdout", "input": "2\n5\n3 1 10 4 1\n7\n1 0 1 1 1 2 2\n", "output": "2\n3\n"}, {"type": "stdin_stdout", "input": "2\n5\n3 1 10 5 1\n7\n1 0 1 1 1 2 2\n", "output": "2\n3\n"}, {"type": "stdin_stdout", "input": "2\n5\n3 1 10 5 1\n7\n1 0 1 1 1 2 4\n", "output": "2\n3\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\nOld timers of Summer Informatics...
[{"type": "stdin_stdout", "input": "20 4\n1\n1\n1\n1\n1\n2\n2\n2\n2\n2\n3\n3\n3\n3\n3\n4\n4\n4\n4\n4\n", "output": "18\n"}, {"type": "stdin_stdout", "input": "16 12\n1\n1\n1\n2\n2\n4\n3\n3\n3\n4\n4\n4\n5\n5\n6\n6\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "16 12\n1\n1\n1\n2\n2\n4\n3\n3\n3\n4\n4\n4\n5\n1\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a system of pipes....
[{"type": "stdin_stdout", "input": "6\n7\n2323216\n1615124\n1\n3\n4\n2\n13\n24\n2\n12\n34\n3\n536\n345\n2\n46\n101\n", "output": "YES\nYES\nYES\nNO\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "6\n7\n2323216\n1615124\n1\n5\n4\n2\n13\n24\n2\n12\n34\n3\n536\n345\n2\n46\n101\n", "output": "YES\nYES\nYES\nNO\nYES\nNO\n"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Central Company has an offic...
[{"type": "stdin_stdout", "input": "20\n384933 946658 407136 242739 -242739 -407136 -946658 -384933 384933 -384933 319281 407136 804861 -407136 415987 946658 -946658 -415987 -804861 -319281\n", "output": "3\n8 2 10 \n"}, {"type": "stdin_stdout", "input": "20\n384933 946658 407136 242739 -242739 -407136 -946658 -384933 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 map of Bertown can be repres...
[{"type": "stdin_stdout", "input": "20 50\n20 3\n5 16\n1 3\n10 11\n10 15\n15 9\n20 9\n14 6\n16 5\n13 4\n11 5\n3 20\n13 17\n11 8\n11 6\n12 14\n16 18\n17 13\n18 7\n3 1\n8 10\n17 15\n7 2\n9 13\n5 11\n6 1\n2 16\n8 18\n10 8\n4 13\n9 15\n14 12\n1 6\n9 20\n7 18\n6 14\n7 6\n18 16\n2 7\n3 11\n15 17\n3 12\n14 10\n4 14\n19 4\n11 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConsider the infinite sequence s...
[{"type": "stdin_stdout", "input": "9\n2\n2\n6\n4\n14\n11\n13\n8\n17\n", "output": "2\n2\n12\n4\n9\n11\n7\n10\n32\n"}, {"type": "stdin_stdout", "input": "9\n2\n2\n3\n4\n10\n12\n12\n8\n11\n", "output": "2\n2\n3\n4\n6\n13\n13\n10\n11\n"}, {"type": "stdin_stdout", "input": "9\n2\n2\n6\n4\n14\n17\n13\n8\n17\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\nToday Johnny wants to increase h...
[{"type": "stdin_stdout", "input": "25 50\n25 2\n6 17\n11 4\n3 18\n11 20\n6 7\n24 15\n1 8\n13 5\n12 25\n15 18\n14 21\n13 6\n5 10\n3 14\n1 2\n23 13\n12 20\n6 4\n8 9\n3 5\n10 7\n20 2\n20 18\n7 4\n8 25\n15 6\n24 14\n2 23\n2 13\n11 3\n16 21\n18 10\n22 1\n5 24\n6 18\n22 23\n4 13\n8 18\n5 20\n22 17\n20 7\n19 15\n10 12\n2 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 an array a_1, a_2,...
[{"type": "stdin_stdout", "input": "4\n1\n8\n6\n4 4 6 6 2 9\n4\n4 5 6 10\n5\n10 10 2 2 4\n", "output": "YES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "4\n1\n8\n6\n4 4 6 6 2 9\n4\n4 5 6 7\n5\n10 10 2 2 4\n", "output": "YES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "4\n1\n8\n6\n4 4 6 6 2 15\n4\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\nYou have a knapsack with the cap...
[{"type": "stdin_stdout", "input": "3\n1 3\n3\n6 2\n19 8 19 69 9 4\n7 12\n1 1 1 17 1 1 1\n", "output": "1\n1 \n-1\n6\n1 2 3 5 6 7 \n"}, {"type": "stdin_stdout", "input": "3\n1 3\n3\n6 2\n19 8 19 69 9 4\n7 12\n1 1 1 17 1 1 1\n", "output": "1\n1 \n-1\n6\n1 2 3 5 6 7 \n"}, {"type": "stdin_stdout", "input": "3\n1 3\n3\n6 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\nPetya organized a strange birthd...
[{"type": "stdin_stdout", "input": "6\n6 6\n2 3 1 5 6 6\n629717071 992393438 995305242 999968259 999970082 999971487\n6 6\n2 5 2 2 4 3\n756869732 979591024 993778447 1268827656 999873038 999943064\n6 6\n5 1 4 5 6 4\n733550952 979779220 979918868 983712198 991976436 995169050\n6 6\n4 2 2 3 2 4\n257971677 920812339 98100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 multiset S initi...
[{"type": "stdin_stdout", "input": "7\n5 1000000000\n4 2 3 0 1\n4 0\n5 2 0 1\n3 0\n100 0 1\n6 1234567\n1 2 3 4 5 0\n3 114514\n8 0 4\n1 1000000\n0\n1 10000000\n1\n", "output": "1000000005\n4\n3\n1234573\n4\n1000001\n1\n"}, {"type": "stdin_stdout", "input": "7\n5 1000000000\n4 2 3 0 1\n4 0\n5 2 0 1\n3 0\n100 0 2\n6 12345...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 an infinit...
[{"type": "stdin_stdout", "input": "10\n4 4 2 4\n2 2 1 3\n1 1 2 1\n12 1 5 4\n8 5 2 3\n4 3 3 3\n1 3 2 6\n5 2 3 1\n4 1 2 5\n7 1 5 1\n", "output": "2\n6 1\n8 10\n"}, {"type": "stdin_stdout", "input": "10\n4 4 2 4\n2 2 1 3\n1 1 2 1\n12 1 5 4\n4 5 2 3\n4 6 3 3\n1 3 2 6\n5 2 3 1\n4 1 2 5\n7 1 5 4\n", "output": "2\n1 7\n6 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\nLolek and Bolek are about to tra...
[{"type": "stdin_stdout", "input": "510 132\n50 76 77 69 94 30 47 65 14 62 18 121 26 35 49 17 105 93 47 16 78 3 7 74 7 37 30 36 30 83 121 113 7 58 86 10 65 57 34 102 55 44 43 47 106 44 115 75 109 70 47 45 16 57 62 55 20 88 74 40 45 84 41 1 9 53 65 25 67 31 115 2 63 51 123 70 65 65 18 14 75 14 103 26 117 105 36 104 81 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\nSereja has a sequence that consi...
[{"type": "stdin_stdout", "input": "42\n18468 6335 26501 20291 15725 11479 29359 26963 24465 5706 28146 23282 16828 9962 492 2996 11943 4828 5437 32392 14605 3903 154 293 12383 17422 18717 19719 19896 5448 21727 14772 11539 1870 19913 25668 26300 17036 9895 28704 23812 31323\n", "output": "226510822\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\nPaladin Manao caught the trail o...
[{"type": "stdin_stdout", "input": "50 2 5\n9 14\n46 34\n40 35\n44 30\n32 16\n1 38\n48 2\n17 14\n50 25\n6 1\n45 19\n21 15\n22 11\n15 33\n8 28\n2 32\n10 22\n37 3\n43 39\n25 16\n9 19\n16 3\n28 32\n20 45\n24 32\n4 18\n49 39\n13 45\n26 4\n11 33\n14 37\n42 19\n31 45\n38 3\n34 8\n18 29\n35 34\n29 16\n7 46\n19 28\n27 33\n30 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\nIahub wants to enhance his multi...
[{"type": "stdin_stdout", "input": "2 9 1\n836096 600367 472071 200387 79763\n863406 505282 233544 157810 152591\n", "output": "36\n2 1\n3 1\n4 1\n5 1\n6 1\n7 1\n8 1\n9 1\n3 2\n4 2\n5 2\n6 2\n7 2\n8 2\n9 2\n4 3\n5 3\n6 3\n7 3\n8 3\n9 3\n5 4\n6 4\n7 4\n8 4\n9 4\n6 5\n7 5\n8 5\n9 5\n7 6\n8 6\n9 6\n8 7\n9 7\n9 8\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\nLittle Chris is bored during his...
[{"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\nConsider a football tournament w...
[{"type": "stdin_stdout", "input": "30\n25 8\n25 4\n21 9\n25 1\n7 16\n23 21\n22 17\n27 29\n7 29\n20 3\n13 23\n7 13\n16 18\n25 14\n13 17\n28 15\n10 23\n25 18\n2 3\n23 13\n30 8\n13 15\n20 15\n11 29\n10 23\n5 16\n4 14\n4 30\n7 20\n11 1\n", "output": "29 29\n31 27\n29 29\n29 29\n30 28\n30 28\n29 29\n29 29\n29 29\n29 29\n31...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDreamoon likes to play with sets...
[{"type": "stdin_stdout", "input": "3081 11\n", "output": "203335\n11 22 33 55\n77 88 99 121\n143 154 165 187\n209 220 231 253\n275 286 297 319\n341 352 363 385\n407 418 429 451\n473 484 495 517\n539 550 561 583\n605 616 627 649\n671 682 693 715\n737 748 759 781\n803 814 825 847\n869 880 891 913\n935 946 957 979\n1001 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA new e-mail service \"Berlandes...
[{"type": "stdin_stdout", "input": "10\nzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzz...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPasha got a very beautiful strin...
[{"type": "stdin_stdout", "input": "xwcxggxvfqbdklewbxkjzibmufnaywuxsqvwakefxbbkfandvigasbhbatsxyqxicrosatfsfybedklsaztyyiuurfbrzmwumujy\n100\n14 43 30 13 8 19 33 7 16 14 15 35 5 18 44 1 35 1 18 7 50 47 9 49 28 29 39 37 27 17 19 12 5 24 37 42 37 23 35 31 10 26 5 38 40 34 42 47 2 40 43 32 16 25 14 45 35 38 46 48 49 27 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\nA tree of size n is an undirecte...
[{"type": "stdin_stdout", "input": "11\n7 3 5 2 10 1 9 6 8 4 11\n", "output": "YES\n11 1\n11 2\n11 3\n11 4\n11 5\n11 6\n11 7\n11 8\n11 9\n11 10\n"}, {"type": "stdin_stdout", "input": "8\n1 2 6 4 5 7 8 3\n", "output": "YES\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n"}, {"type": "stdin_stdout", "input": "6\n2 1 6 5 3 4\n", "out...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMarina loves Sasha. But she keep...
[{"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 99 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\nLittle Artem has invented a time...
[{"type": "stdin_stdout", "input": "10\n1 1 1000000000\n1 4 1000000000\n2 2 1000000000\n1 5 1000000000\n1 8 1000000000\n2 15 1000000000\n3 3 1000000000\n3 10 1000000000\n3 6 1000000000\n3 7 1000000000\n", "output": "0\n3\n2\n2\n"}, {"type": "stdin_stdout", "input": "20\n1 1 1\n1 2 2\n1 3 3\n1 4 4\n1 5 5\n2 4 5\n2 12 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\nRecently, on a programming lesso...
[{"type": "stdin_stdout", "input": "C:<span class=\"tex-span\">\\</span>folder1<span class=\"tex-span\">\\</span>folder2<span class=\"tex-span\">\\</span>folder3<span class=\"tex-span\">\\</span>file1.txt\nC:<span class=\"tex-span\">\\</span>folder1<span class=\"tex-span\">\\</span>folder2<span class=\"tex-span\">\\</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\nn hobbits are planning to spend ...
[{"type": "stdin_stdout", "input": "1000000000 1000000000 1000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "100000000 999834114 93836827\n", "output": "29998\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000010 1000000000\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "100000000 9998...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle Vasya likes very much to ...
[{"type": "stdin_stdout", "input": "10\n2 32 157\n2 86 157\n2 86 32\n2 154 157\n2 32 154\n2 86 154\n2 157 38\n2 32 38\n2 38 86\n2 38 154\n2 69 157\n2 69 32\n2 69 86\n2 69 154\n2 38 69\n2 172 157\n2 32 172\n2 86 172\n2 172 154\n2 172 38\n2 69 172\n2 157 110\n2 32 110\n2 86 110\n2 154 110\n2 110 38\n2 110 69\n2 172 110\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\nVasya has an array of integers o...
[{"type": "stdin_stdout", "input": "100\n45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 69 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIt is winter now, and Max decide...
[{"type": "stdin_stdout", "input": "1\n177 99\n1 4 7 10 11 13 14 15 16 17 19 21 22 24 25 26 27 28 32 34 35 38 39 40 42 45 46 52 54 55 57 58 59 60 62 64 65 67 70 71 74 77 78 79 80 81 83 84 88 92 93 94 95 100 101 102 104 106 107 108 109 110 112 113 114 115 116 118 122 123 124 125 127 128 129 130 134 135 137 138 139 140 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a sequence of n po...
[{"type": "stdin_stdout", "input": "100\n1 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 95 96 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAllen wants to enter a fan zone ...
[{"type": "stdin_stdout", "input": "30\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 10000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA square pyramid of balls consis...
[{"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\nXenny had N numbers and he loved...
[{"type": "stdin_stdout", "input": "1\n4 10\n-1 7 4 3 -1\n\nSAMQLE", "output": "0/1\n"}, {"type": "stdin_stdout", "input": "1\n5 12\n1 4 4 4 -1\n\nSAMPLE", "output": "0/1\n"}, {"type": "stdin_stdout", "input": "1\n5 12\n1 4 4 6 -1\n\nSAMPLE", "output": "0/1\n"}, {"type": "stdin_stdout", "input": "1\n5 12\n1 4 4 4 -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 rooted binary tree wit...
[{"type": "stdin_stdout", "input": "15\n123 119\n129 120\n132 112\n126 109\n118 103\n115 109\n102 100\n130 120\n105 105\n132 115\n104 102\n107 107\n127 116\n121 104\n121 115\n8\n8 234\n9 244\n10 226\n11 227\n12 240\n13 237\n14 206\n15 227", "output": "256\n255\n250\n247\n255\n259\n223\n253"}, {"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\nWe have A balls with the string ...
[{"type": "stdin_stdout", "input": "red blue\n11 -1\nred", "output": "10 -1\n"}, {"type": "stdin_stdout", "input": "red blue\n11 -2\nred", "output": "10 -2\n"}, {"type": "stdin_stdout", "input": "red bleu\n12 -1\nred", "output": "11 -1\n"}, {"type": "stdin_stdout", "input": "red bulf\n-2 -1\nred", "output": "-3 -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\nTakahashi is going to buy N item...
[{"type": "stdin_stdout", "input": "10 -1\n1000100000 1000100000 1110000000 1100000000 1000001000 1000000000 1000000000 1010010001 1000000001 1100000000", "output": "10320211002\n"}, {"type": "stdin_stdout", "input": "10 0\n1000100000 1000100000 1110000000 1100000000 1000001000 1000000000 1000000000 1010010000 10000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 come to a store that s...
[{"type": "stdin_stdout", "input": "13 2 1 3000", "output": "174001\n"}, {"type": "stdin_stdout", "input": "13 1 1 3000", "output": "347886\n"}, {"type": "stdin_stdout", "input": "13 2 1 3118", "output": "187920\n"}, {"type": "stdin_stdout", "input": "22 2 1 3118", "output": "111399\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 an integer sequenc...
[{"type": "stdin_stdout", "input": "16 0\n6\n2\n2\n-1\n4\n-1\n-1\n1\n1\n5 8\n13 14\n9 5\n8 3\n1 16", "output": "33\n"}, {"type": "stdin_stdout", "input": "9 0\n6\n2\n2\n-1\n4\n-1\n-1\n1\n1\n5 8\n13 14\n9 5\n8 3\n1 16", "output": "22\n"}, {"type": "stdin_stdout", "input": "9 5\n3\n2\n2\n1\n13\n11\n-1\n1\n1\n3 5\n15 9\n9...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 and Aoki love calculat...
[{"type": "stdin_stdout", "input": "10 10 14\n1100110011\n1011001101", "output": "100001000000000010001000\n100001000000000000100010\n"}, {"type": "stdin_stdout", "input": "10 10 14\n1110110011\n1011001101", "output": "100001000000000100001000\n100001000000000000100010\n"}, {"type": "stdin_stdout", "input": "10 10 14\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSnuke is giving cookies to his t...
[{"type": "stdin_stdout", "input": "-4 -10", "output": "Impossible\n"}, {"type": "stdin_stdout", "input": "-1 14", "output": "Impossible\n"}, {"type": "stdin_stdout", "input": "-2 28", "output": "Impossible\n"}, {"type": "stdin_stdout", "input": "-2 40", "output": "Impossible\n"}, {"type": "stdin_stdout", "input": "-1 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSmeke has decided to participate...
[{"type": "stdin_stdout", "input": "0000", "output": "ABC\n"}, {"type": "stdin_stdout", "input": "2936", "output": "ARC\n"}, {"type": "stdin_stdout", "input": "0100", "output": "ABC\n"}, {"type": "stdin_stdout", "input": "1432", "output": "ARC\n"}, {"type": "stdin_stdout", "input": "1100", "output": "ABC\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\nTaro Aizu's company has a boss w...
[{"type": "stdin_stdout", "input": "4 15000\n520\n41\n129\n500\n3 1047\n6\n20\n25\n3 359208\n5\n14\n17\n0 0", "output": "14983\n1039\n359207\n"}, {"type": "stdin_stdout", "input": "4 15000\n305\n260\n136\n500\n3 400\n10\n23\n30\n3 599838\n5\n1\n12\n0 0", "output": "14983\n397\n599831\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\nA plurality of trampolines are a...
[{"type": "stdin_stdout", "input": "4\n163\n51\n2\n32", "output": "yes\n"}, {"type": "stdin_stdout", "input": "4\n001\n103\n-1\n0", "output": "no\n"}, {"type": "stdin_stdout", "input": "4\n001\n136\n-1\n0", "output": "no\n"}, {"type": "stdin_stdout", "input": "4\n001\n155\n-1\n0", "output": "no\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\nThe Ohgas are a prestigious fami...
[{"type": "stdin_stdout", "input": "4\n1000000\n8\n2\n0 0.7358189007888192 3000\n1 0.17615020446016216 3825\n6620000\n7\n2\n0 0.6920348397011968 48227\n0 0.0740966796875 40942\n56271855\n4\n4\n0 0.19624457693261887 30754\n1 0.00634765625 26165\n0 1.6296802800223897 27575\n0 0.8924194187554844 10932\n6380784\n0\n4\n1 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\nHere is a very simple variation ...
[{"type": "stdin_stdout", "input": "10 1 0 0\n7 1 0 0\n13 0 0 0\n6 11 1 1\n2\n5\n7 1 0 6\n1\n1\n3\n4\n5\n6\n0 0 0 0", "output": "0.000000\n0.000000\n0.000000\n0.829031\n0.000000\n"}, {"type": "stdin_stdout", "input": "6 1 0 0\n7 1 0 0\n7 2 0 0\n12 3 1 1\n2\n5\n8 10 0 6\n1\n3\n4\n4\n5\n6\n0 0 0 0", "output": "0.166667\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\n<!--\n\nProblem C\n\n-->\n\nBala...
[{"type": "stdin_stdout", "input": "4 2\n9 2 7 21\n2 9\n6 2\n1 3 6 12 16 16\n2 9\n5 2\n7 3 6 12 11\n2 8\n7 5\n15 16 88 48 51 75 111\n36 54 57 148 102\n0 0", "output": "10\n-1\n-1\n2\n"}, {"type": "stdin_stdout", "input": "4 2\n9 2 7 11\n2 9\n6 2\n1 3 12 12 16 9\n2 9\n5 2\n7 3 6 12 11\n2 8\n7 5\n15 16 57 48 51 75 111\n3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMiki is a high school student. S...
[{"type": "stdin_stdout", "input": "15 -1 0\n3.507493431634293\n1.3168078857315408\n0.8923013066938583", "output": "-5115018.0145617081\n"}, {"type": "stdin_stdout", "input": "15 -1 0\n2.5963136238190727\n1.3168078857315408\n0.4906502505511706", "output": "1186.1864007578\n"}, {"type": "stdin_stdout", "input": "15 -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\nB: Periodic Sequence-\n\nproblem...
[{"type": "stdin_stdout", "input": "6\n-1 -14 10 -3 2 -1", "output": "1\n"}, {"type": "stdin_stdout", "input": "6\n-1 -14 18 -3 2 -1", "output": "1\n"}, {"type": "stdin_stdout", "input": "6\n-1 -14 18 -1 2 -1", "output": "1\n"}, {"type": "stdin_stdout", "input": "6\n-1 -10 18 -1 2 -1", "output": "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\nFor given two segments s1 and s2...
[{"type": "stdin_stdout", "input": "3\n-1 0 0 -1 2 1 4 -2\n1 -1 -1 0 4 2 6 -1\n0 -1 6 1 0 -2 5 0", "output": "0\n0\n0\n"}, {"type": "stdin_stdout", "input": "3\n-1 0 -1 -1 2 1 4 -2\n1 0 0 0 4 1 6 -1\n0 -1 12 1 1 -2 0 0", "output": "0\n0\n1\n"}, {"type": "stdin_stdout", "input": "3\n-1 0 0 -1 2 1 4 -2\n1 0 0 0 4 1 6 -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\nFor a given sequence of integers...
[{"type": "stdin_stdout", "input": "9\n1 4 1 4 2 1 3 5 6\n12\n2 9 1\n2 6 1\n3 7 5", "output": "2\n2\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "9\n1 4 1 4 4 -1 4 5 6\n8\n0 9 1\n1 12 1\n3 7 9", "output": "2\n1\n0\n0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "9\n6 4 0 4 4 -1 3 5 6\n8\n0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne of Arkady's friends works at...
[{"type": "stdin_stdout", "input": "01\nzbrronwaofovklkopelo\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "01\nzbrronwaofovklkopeln\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "01\nzbrrnnwaofovklkopeln\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "01\nzbrrnnwaofovklkopelo\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\nThe German University in Cairo (...
[{"type": "stdin_stdout", "input": "44 42\n4 37 166\n34 25 47\n28 19 367\n20 14 811\n8 3 878\n39 1 925\n35 9 206\n32 18 1008\n16 44 503\n5 20 426\n22 34 896\n44 43 471\n17 33 577\n40 22 317\n24 31 818\n37 11 292\n21 39 888\n6 8 983\n43 36 170\n11 21 662\n36 17 942\n18 7 356\n2 32 220\n12 5 774\n19 27 193\n13 40 63\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\nInaka has a disc, the circumfere...
[{"type": "stdin_stdout", "input": "30000 28\n10601 1119\n11119 20601\n9493 25771\n14351 4869\n13101 3619\n23101 13619\n29869 9351\n6119 15601\n3101 23619\n1851 22369\n11851 2369\n8619 18101\n19579 20882\n18619 28101\n16851 7369\n8101 28619\n24869 4351\n24351 14869\n27369 6851\n9869 19351\n5601 26119\n3976 21301\n21851...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nToad Pimple has an array of inte...
[{"type": "stdin_stdout", "input": "5 3\n1 3 -1 2 -1\n1 2\n2 5\n1 4\n", "output": "Shi\nShi\nShi\n"}, {"type": "stdin_stdout", "input": "5 3\n1 3 -1 2 -1\n1 2\n2 5\n1 5\n", "output": "Shi\nShi\nShi\n"}, {"type": "stdin_stdout", "input": "5 3\n1 3 -1 2 1\n1 3\n2 4\n1 4\n", "output": "Shi\nShi\nShi\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\nYou are given two strings of equ...
[{"type": "stdin_stdout", "input": "3\nxabb\naabx\ntechnocup\ntechnocup\na\nz\n", "output": "YES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "3\nxabb\naabx\nteohnccup\ntechnocup\na\nz\n", "output": "YES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "3\nxabb\naabx\ntdohnccup\ntechnocup\na\nz\n", "output": "YES\nYE...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 seats in the train's...
[{"type": "stdin_stdout", "input": "100 1000000000\n12 803 439 1031 435 300 497 520 718 573 782 523 328 88 275 159 128 389 920 869 503 80 490 289 22 889 353 799 29 131 1138 123 405 221 727 135 248 348 299 833 19 943 471 410 635 626 784 1205 213 724 550 437 860 536 718 173 406 832 520 748 512 29 466 982 574 848 11 693 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\nDaisy is a senior software engin...
[{"type": "stdin_stdout", "input": "16\n1 1 1\n1 1 0\n1 1 0\n1 1 0\n1 1 0\n1 0 1\n1 0 1\n1 0 1\n1 0 1\n0 1 1\n0 1 1\n0 1 1\n0 1 1\n1 1 1\n1 1 1\n1 1 1\n1 1 1\n0 0 0\n1 0 0\n0 1 0\n1 1 0\n0 0 0\n1 0 0\n0 0 1\n1 0 1\n0 0 0\n0 1 0\n0 0 1\n0 1 1\n1 0 0\n0 1 0\n0 0 1\n", "output": "Possible\n1 0 1 1 1 0 1 1 1 0 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\nPolycarp is a frequent user of t...
[{"type": "stdin_stdout", "input": "100 100\n82 51 81 14 37 17 78 92 64 15 8 86 89 8 87 77 66 10 15 12 100 25 92 47 21 78 20 63 13 49 41 36 41 79 16 87 87 69 1 76 80 60 100 49 70 59 72 8 38 71 15 97 71 14 76 90 81 4 59 46 39 28 92 3 28 22 53 99 59 52 74 43 92 43 42 23 44 9 82 47 7 48 12 12 3 55 37 71 46 22 84 52 98 41 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two positive integ...
[{"type": "stdin_stdout", "input": "6\n2 7\n4 12\n2 1000000000\n7 97\n1000000000 1000000000\n2 1\n", "output": "\n13\n\n15\n\n1999999999\n\n113\n\n1000000001\n\n1\n"}, {"type": "stdin_stdout", "input": "6\n2 7\n4 12\n4 1000000000\n7 97\n1000000000 1000000000\n2 1\n", "output": "\n13\n\n15\n\n1333333333\n\n113\n\n100000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA new agent called Killjoy inven...
[{"type": "stdin_stdout", "input": "7\n2 7\n7 1313\n2 14\n8 1211\n2 9\n12 121\n2 121\n121 312\n2 121\n136 121\n2 7\n1313 7\n2 8\n1211 8\n", "output": "1\n2\n2\n1\n1\n1\n1\n"}, {"type": "stdin_stdout", "input": "7\n2 7\n7 1313\n2 8\n8 1211\n2 9\n12 121\n2 121\n121 312\n2 121\n312 121\n2 7\n1313 7\n2 8\n1211 8\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\nChef Monocarp has just put n dis...
[{"type": "stdin_stdout", "input": "1\n200\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp has a favorite sequence...
[{"type": "stdin_stdout", "input": "6\n7\n1324 4 5 2 9 1 1\n4\n9 2 7 1\n11\n8 4 3 1 2 7 8 7 9 4 2\n1\n42\n2\n11 7\n8\n1 1 1 1 1 1 1 1\n", "output": "1324 1 4 1 5 9 2 \n9 1 2 7 \n8 2 4 4 3 9 1 7 2 8 7 \n42 \n11 7 \n1 1 1 1 1 1 1 1 \n"}, {"type": "stdin_stdout", "input": "6\n7\n1324 4 5 3 9 1 1\n4\n9 4 7 2\n11\n15 4 5 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\nSuppose you are living with two ...
[{"type": "stdin_stdout", "input": "7\n2 1\n2 2\n3 1\n3 2\n3 3\n5 5\n69 1337\n", "output": "\n1\n2\n1\n3\n2\n2\n65\n"}, {"type": "stdin_stdout", "input": "7\n2 1\n2 2\n3 1\n3 2\n3 3\n5 5\n69 1154\n", "output": "1\n2\n1\n3\n2\n2\n14\n"}, {"type": "stdin_stdout", "input": "7\n2 1\n2 2\n3 1\n3 2\n5 3\n5 5\n69 1154\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 Smart Beaver from ABBYY came...
[{"type": "stdin_stdout", "input": "7000\nTREASURY BALANCES AT FED FELL ON MARCH 27\nWASHINGTON, March 30 - Treasury balances at the Federal\nReserve fell on March 27 to 2.424 billion dlrs from 2.508\nbillion dlrs on the previous business day, the Treasury said in\nsti latest budget statement.\nBalances in tax and loan...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVictor and Peter are playing hid...
[{"type": "stdin_stdout", "input": "-7366 1446\n-7727 -1428\n-2680 -3822 -5191 -5553\n-7304 -6313 -9229 1377\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "-4752 -3262\n-4582 6436\n-8997 -6490 -4630 1426\n-9865 -6697 -2371 -5622\n", "output": "YES"}, {"type": "stdin_stdout", "input": "-4752 -3262\n-4582 643...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNearly each project of the F com...
[{"type": "stdin_stdout", "input": "110 5\n- 60\n- 58\n+ 25\n- 32\n+ 86\n", "output": "105\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26 27 28 29 30 31 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 59 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 game called \"I Wanna...
[{"type": "stdin_stdout", "input": "100\n75 83 69 73 30 76 37 48 14 41 42 21 35 15 50 61 86 85 46 3 31 13 78 10 2 44 80 95 56 82 38 75 77 4 99 9 84 53 12 11 36 74 39 72 43 89 57 28 54 1 51 66 27 22 93 59 68 88 91 29 7 20 63 8 52 23 64 58 100 79 65 49 96 71 33 45\n83 50 89 73 34 28 99 67 77 44 19 60 68 42 8 27 94 85 14 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSomeday, Drazil wanted to go on ...
[{"type": "stdin_stdout", "input": "-1000000000 -1000000000 2000000000\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-1000000000 1000000000 2000000000\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-1000000000 -1000000000 1000000000\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "-100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRikhail Mubinchik believes that ...
[{"type": "stdin_stdout", "input": "10000 239\n", "output": "1168638\n"}, {"type": "stdin_stdout", "input": "10000 1538\n", "output": "11620"}, {"type": "stdin_stdout", "input": "11275 615\n", "output": "263862"}, {"type": "stdin_stdout", "input": "10100 1538\n", "output": "11940"}, {"type": "stdin_stdout", "input": "1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA schoolboy named Vasya loves re...
[{"type": "stdin_stdout", "input": "168\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 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 1 0 1 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 0 1 0 1 0 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 an array a with n ...
[{"type": "stdin_stdout", "input": "10 5\n0 0 1 0 0 1 1 0 1 1\n", "output": "10\n1 1 1 1 1 1 1 1 1 1 "}, {"type": "stdin_stdout", "input": "10 2\n1 0 0 1 0 1 0 1 0 1\n", "output": "5\n1 0 0 1 1 1 1 1 0 1 "}, {"type": "stdin_stdout", "input": "10 3\n0 0 1 0 0 1 0 0 1 1\n", "output": "6\n0 0 1 0 1 1 1 1 1 1 "}, {"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\nSmall, but very brave, mouse Bra...
[{"type": "stdin_stdout", "input": "5 5\nW G B W G\nG B W G B\nB W G B W\nW G B W G\nG B W G B\n", "output": "#Black&White\n"}, {"type": "stdin_stdout", "input": "5 5\nW G B Y M\nG B Y M C\nB Y M C W\nY M C W G\nM C W G B\n", "output": "#Color\n"}, {"type": "stdin_stdout", "input": "5 5\nW G B Y M\nG B Y M C\nB Y M C W...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMike has n strings s1, s2, ..., ...
[{"type": "stdin_stdout", "input": "33\nnkgcmrfvxe\nvxenkgcmrf\nrfvxenkgcm\nvxenkgcmrf\nxenkgcmrfv\nenkgcmrfvx\nenkgcmrfvx\nnkgcmrfvxe\nkgcmrfvxen\ncmrfvxenkg\ncmrfvxenkg\nxenkgcmrfv\nrfvxenkgcm\nrfvxenkgcm\nnkgcmrfvxe\nxenkgcmrfv\nrfvxenkgcm\nxenkgcmrfv\nxenkgcmrfv\ngcmrfvxenk\nmrfvxenkgc\nfvxenkgcmr\nvxenkgcmrf\nenkg...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 bus moves along the coordinate...
[{"type": "stdin_stdout", "input": "1000000 1000000000 999999 10000\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "1000000 1000000 500000 10000\n", "output": "10000\n"}, {"type": "stdin_stdout", "input": "1000000 1100000 500000 10000\n", "output": "10000\n"}, {"type": "stdin_stdout", "input": "1000000 150000...
code_stdio