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\nNandu is stuck in a maze consist...
[{"type": "stdin_stdout", "input": "55 6\n0001100110100100011011001111011111100010010110100100001\n37 46\n48 24\n43 45\n41 33\n2 34\n11 5", "output": "No\nYes\nNo\nNo\nNo\nNo\n"}, {"type": "stdin_stdout", "input": "55 6\n0001100110100100011011001111011111100010010110100100001\n37 46\n48 24\n43 45\n37 33\n2 34\n11 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\nShantam is very rich , even ric...
[{"type": "stdin_stdout", "input": "2\n1 3\n1 1 -1 1 2 1\n7 2\n2 3 2 -1 1 5\n\nSAMPLE", "output": "1 1000000\n2 13\n"}, {"type": "stdin_stdout", "input": "2\n1 3\n1 1 -1 1 2 1\n7 1\n2 3 2 -1 1 5\n\nSAMPLE", "output": "1 1000000\n2 2\n"}, {"type": "stdin_stdout", "input": "2\n1 3\n1 1 -1 1 2 1\n7 1\n2 5 4 -1 1 5\n\nELPM...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 was a teacher and his clas...
[{"type": "stdin_stdout", "input": "3\n8\nBGBBGGBGBGGBBBGG\n5\nGGGGGBBBBB\n7\nGGBBBGBGBGGBGB", "output": "3\n2\n3\n"}, {"type": "stdin_stdout", "input": "3\n8\nBGBBGGBBBGGBGBGG\n5\nGGGGGBBBBB\n7\nGGBBBGBGBGGBGB", "output": "4\n2\n3\n"}, {"type": "stdin_stdout", "input": "3\n8\nBGBBGGBGBGGBBBGG\n5\nGGGGGBBBBB\n7\nGBGBBG...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 N voting papers. The i-t...
[{"type": "stdin_stdout", "input": "8\nfubfalo\nbuefalo\nbuffamo\nolaffub\nouafflb\nomaffub\nbuffalo\nbuofalf", "output": "buefalo\nbuffalo\nbuffamo\nbuofalf\nfubfalo\nolaffub\nomaffub\nouafflb\n"}, {"type": "stdin_stdout", "input": "8\nfubfalo\nbuefola\nbuffamo\nolaffub\nouafflb\nomaffub\nbuffalo\nbuofalf", "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\nTakahashi has a tower which is d...
[{"type": "stdin_stdout", "input": "121980 33447 90629 11295524182", "output": "643972230\n"}, {"type": "stdin_stdout", "input": "111605 33447 77758 2284871002", "output": "762328834\n"}, {"type": "stdin_stdout", "input": "111605 33447 14069 2284871002", "output": "815838636\n"}, {"type": "stdin_stdout", "input": "4247...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTic-tac-toe is a game in which y...
[{"type": "stdin_stdout", "input": "ooosxssxs\nxooswsosx\nooxxxooxo", "output": "o\nd\nd\n"}, {"type": "stdin_stdout", "input": "oopsxssxs\nxooswsosx\noxooxxxoo", "output": "d\nd\nd\n"}, {"type": "stdin_stdout", "input": "oopsxrsxs\nxsoswsoox\nooooxxxox", "output": "d\nd\no\n"}, {"type": "stdin_stdout", "input": "xprmn...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nArtist Shinagawa was asked to ex...
[{"type": "stdin_stdout", "input": "3\nCyan Yellow Red Magenta Green Blue\nCyan Yellow Red Magenta Green Blue\nRed Yellow Magenta Blue Green Cyan\n4\nRed Mahenta Blue Green Yellow Cyan\nRed Yellow Magenta Blue Green Cyan\nMagenta Green Red Cyan Yellow Blue\nCyan Green Yellow Blue Magenta Red\n0", "output": "1\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\nAlice and Brown are brothers in ...
[{"type": "stdin_stdout", "input": "1001 20263", "output": "10632\n"}, {"type": "stdin_stdout", "input": "1011 20263", "output": "10637\n"}, {"type": "stdin_stdout", "input": "0010 12073", "output": "6041\n"}, {"type": "stdin_stdout", "input": "0000 12073", "output": "6036\n"}, {"type": "stdin_stdout", "input": "0001 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn the Kingdom of IOI, the wind ...
[{"type": "stdin_stdout", "input": "3 5 2 2\n0\n4\n2\n10\n2 0 1\n1 1 -3\n2 1 5\n1 2 -1\n1 2 5", "output": "-20\n-20\n-20\n-20\n-20\n"}, {"type": "stdin_stdout", "input": "3 5 2 2\n0\n4\n2\n11\n2 0 1\n1 1 -3\n2 1 7\n1 2 -1\n1 2 5", "output": "-22\n-22\n-22\n-22\n-22\n"}, {"type": "stdin_stdout", "input": "3 5 1 2\n0\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\nA fraction whose numerator is 1 ...
[{"type": "stdin_stdout", "input": "2 3 120 3\n2 3 300 3\n2 3 299 3\n2 3 12 3\n2 3 12000 7\n54 1343 12000 7\n2 3 300 1\n2 1 200 5\n2 4 54 2\n0 0 0 0", "output": "4\n7\n6\n2\n42\n0\n0\n9\n3\n"}, {"type": "stdin_stdout", "input": "2 3 120 3\n2 3 300 3\n2 3 299 3\n2 3 12 3\n2 3 12000 7\n54 795 12000 7\n2 4 300 1\n2 1 200 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nReordering the Documents\n\nSusa...
[{"type": "stdin_stdout", "input": "2 1\n0 1 -1 1 -1 -1", "output": "2\n"}, {"type": "stdin_stdout", "input": "6 3\n0 10 7 2 -1 2", "output": "0\n"}, {"type": "stdin_stdout", "input": "6 6\n0 10 7 2 -1 2", "output": "0\n"}, {"type": "stdin_stdout", "input": "6 6\n0 10 7 3 -1 2", "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\nExpression Mining\n\nConsider an...
[{"type": "stdin_stdout", "input": "3\n(3+2)*3+1\n1\n1*1*1+1+1*1\n1307\n1*(2*3*4)+5+((5+7*8))*(9)\n0", "output": "2\n10\n0\n"}, {"type": "stdin_stdout", "input": "3\n(1+2)*4+3\n1\n1*1*1+1*1*1\n1108\n1*(2*3*4)+5+((6+7*8))*(9)\n0", "output": "3\n12\n0\n"}, {"type": "stdin_stdout", "input": "3\n(1+2)*3+3\n1\n1*1*1+1+1*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\nTraining is indispensable for ac...
[{"type": "stdin_stdout", "input": "2\n1 3\n1 1\nRRRR\nRRGR\nRBRR\nRRRR", "output": "10\n"}, {"type": "stdin_stdout", "input": "2\n2 0\n1 1\nRRRR\nRRGR\nRBRR\nRRRR", "output": "16\n"}, {"type": "stdin_stdout", "input": "2\n2 0\n2 1\nRRRR\nRRGR\nRBRR\nRRRR", "output": "10\n"}, {"type": "stdin_stdout", "input": "2\n2 -1\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn the International City of Pip...
[{"type": "stdin_stdout", "input": "4 1\n0 4 2 4\n0 2 1 2\n0 -1 2 0\n-1 0 1 0\n3 0 2 4\n0 -1\n1 1\n2 2\n1 4\n2 1", "output": "5.2360679775\n"}, {"type": "stdin_stdout", "input": "4 1\n0 4 2 8\n0 2 1 2\n0 -1 2 0\n-1 0 1 0\n3 0 2 4\n0 -1\n1 1\n2 2\n1 4\n2 1", "output": "9.7082039325\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\nIn the Jambo Amusement Garden (J...
[{"type": "stdin_stdout", "input": "4\nred 3444\nred 3018\nred 3098\nred 3319\n4\nred\nred\nred\nred", "output": "Yes"}, {"type": "stdin_stdout", "input": "4\nred 3444\nred 3018\nred 3098\nred 3319\n4\nred\nred\nrec\nred", "output": "No\n"}, {"type": "stdin_stdout", "input": "4\nred 3444\nder 3018\nred 3098\nred 3319\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\nPriority queue is a container of...
[{"type": "stdin_stdout", "input": "2 10\n0 0 3\n0 0 17\n0 0 2\n1 0\n1 0\n1 0\n0 0 4\n1 0\n0 0 8\n1 0", "output": "17\n17\n17\n17\n17\n"}, {"type": "stdin_stdout", "input": "3 10\n0 0 3\n0 0 16\n0 0 0\n1 0\n2 1\n1 1\n0 0 4\n1 0\n0 1 10\n1 1", "output": "16\n16\n10\n"}, {"type": "stdin_stdout", "input": "2 10\n0 1 3\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\nIn Summer Informatics School, if...
[{"type": "stdin_stdout", "input": "100\n73 81 39 85 48 49 37 20 66 41 79 32 54 71 31 50 48 29 10 85 81 20 20 20 48 54 70 40 71 31 49 77 50 33 12 87 19 12 54 39 87 10 20 39 81 18 70 53 86 7 33 37 62 9 77 54 50 30 70 81 66 12 41 12 20 23 87 73 91 75 94 49 18 71 81 32 79 85 30 94 48 10 41 62 73 90 40 70 90 91 33 100 79 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\nZibi is a competitive programmin...
[{"type": "stdin_stdout", "input": "40 39\n0 -2\n-2 3\n3 3\n3 -2\n-1 1\n2 0\n-3 2\n-2 1\n0 -3\n-1 -3\n1 -1\n-3 -1\n2 2\n0 2\n1 -3\n-2 -1\n1 2\n-1 -2\n-1 0\n3 2\n1 3\n-3 1\n-2 -3\n-3 -1\n3 0\n-1 3\n3 1\n-2 2\n0 3\n3 -1\n2 -3\n1 1\n-1 -1\n0 1\n-3 0\n1 0\n-3 3\n-3 -3\n2 2\n-1 2\n1 29\n29 2\n29 3\n29 4\n5 29\n29 6\n7 29\n8...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have got a shelf and want to...
[{"type": "stdin_stdout", "input": "10\nL 100\nR 100000\nR 123\nL 101\n? 123\nL 10\nR 115\n? 100\nR 110\n? 115\n", "output": "0\n2\n1\n"}, {"type": "stdin_stdout", "input": "10\nL 100\nR 101000\nR 123\nL 101\n? 123\nL 10\nR 115\n? 100\nR 110\n? 115\n", "output": "0\n2\n1\n"}, {"type": "stdin_stdout", "input": "10\nL 10...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two segments [l_1;...
[{"type": "stdin_stdout", "input": "5\n1 2 1 2\n2 6 3 4\n2 4 1 3\n1 2 1 3\n1 4 5 14\n", "output": "1 2\n2 3\n2 1\n1 3\n1 5\n"}, {"type": "stdin_stdout", "input": "5\n1 2 1 2\n1 6 3 4\n2 4 1 3\n1 2 1 3\n1 4 5 14\n", "output": "1 2\n1 3\n2 1\n1 3\n1 5\n"}, {"type": "stdin_stdout", "input": "5\n1 2 1 2\n1 6 5 4\n2 4 1 3\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecall that string a is a subseq...
[{"type": "stdin_stdout", "input": "ovvvvovovvvvovoovovovovvvvvvvoovoovvovvoooooovo\n", "output": "463\n"}, {"type": "stdin_stdout", "input": "vvovooovovvovoovoovvvvovovvvov\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "vovvvovovvvvoovoovovvovooovovv\n", "output": "100\n"}, {"type": "stdin_stdout", "input"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe only difference between easy...
[{"type": "stdin_stdout", "input": "50 50\n199987 199984 199987 199977 199996 199923 199984 199995 199991 200000 199998 199990 199983 199981 199973 199989 199981 199993 199959 199994 199973 199962 199998 199970 199999 199981 199996 199996 199985 199980 199959 199990 199982 199987 199992 199997 199985 199976 199947 1999...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlice is playing a game with her...
[{"type": "stdin_stdout", "input": "8000 100\n7990 4432 5901 5019 423 1200 7760 5752 7422 4337 4802 2570 7354 4912 2185 2344 6538 2783 1473 5311 3987 4739 7159 1677 3438 502 2800 1318 5223 4518 4448 6451 3455 5012 1588 814 4971 5847 3849 6248 6420 3607 2610 6852 1045 3730 757 6905 5248 3738 2382 7251 1305 7380 2476 734...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKarlsson has recently discovered...
[{"type": "stdin_stdout", "input": "4\n6\n1 1 1 1 2 1 2 1 2 1 1 1\n2\n2 2 1 2\n3\n1 1 1 1 1 1\n2\n2 1 2 1\n", "output": "12\n2\n6\n0\n"}, {"type": "stdin_stdout", "input": "4\n6\n2 2 2 1 2 2 2 1 2 2 1 2\n2\n2 2 1 2\n3\n1 1 1 1 2 1\n2\n2 1 1 1\n", "output": "10\n2\n4\n2\n"}, {"type": "stdin_stdout", "input": "4\n6\n1 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 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\nIf the girl doesn't go to Denis,...
[{"type": "stdin_stdout", "input": "30 8\n0 1 13 12 23 24 26 30\n40 7\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "30 8\n0 1 9 12 23 24 26 30\n40 7\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "30 8\n0 1 9 12 23 24 26 30\n27 7\n", "output": "41\n"}, {"type": "stdin_stdout", "input": "30 8\n0 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 last contest held on Johnny'...
[{"type": "stdin_stdout", "input": "3\n576460752303423484\n576460752303423484\n576460752303423485\n", "output": "1152921504606846911\n1152921504606846911\n1152921504606846912\n"}, {"type": "stdin_stdout", "input": "3\n576460752303423484\n576460752303423484\n361364603326849558\n", "output": "1152921504606846911\n1152921...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMr. Chanek The Ninja is one day ...
[{"type": "stdin_stdout", "input": "20 17 998\n1000 1000 295133\n1 1000 322998\n31 1 412809\n1 457 347941\n1000 579 600207\n1 708 315587\n1 159 302269\n1000 447 1582128\n247 1 591835\n933 1 16036\n140 1 305582\n1 1 147502\n1000 1 631288\n216 1000 145614\n402 1000 875933\n594 1000 874200\n1000 963 839096\n1 865 156116\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 rectangular grid...
[{"type": "stdin_stdout", "input": "2\n2 2\n-1 1\n1 1\n3 4\n-1 -1 -2 -10\n0 -2 -5 -6\n-1 -3 -4 -5\n", "output": "2\n40\n"}, {"type": "stdin_stdout", "input": "2\n2 2\n-1 1\n1 1\n3 4\n-1 -1 -2 -3\n-1 -2 -3 -4\n-2 -1 -8 -5\n", "output": "2\n33\n"}, {"type": "stdin_stdout", "input": "2\n2 2\n-1 1\n1 1\n3 4\n-1 -1 -2 -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\nFor the New Year, Polycarp decid...
[{"type": "stdin_stdout", "input": "16\n8192 8192 67108864\n8192 8192 67108865\n8192 8192 70000000\n8192 8192 67108863\n1 1 1\n13 13 1\n1000 1000 100\n100 15 16\n157 185 95\n1992 1895 12\n1888 4984 164\n1564 8917 15\n150 15 2\n1500 10 40\n1 10000 1000\n1 10000 10000\n", "output": "YES\nNO\nNO\nYES\nYES\nYES\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\nGaurang has grown up in a mystic...
[{"type": "stdin_stdout", "input": "37\n30 16\n22 37\n37 43\n25 31\n12 12\n15 30\n42 11\n29 28\n26 32\n12 32\n18 12\n11 48\n24 25\n15 40\n40 38\n17 12\n22 27\n35 32\n11 29\n35 24\n42 35\n21 14\n25 11\n16 14\n28 31\n49 45\n48 24\n28 20\n21 19\n43 49\n42 24\n14 21\n23 19\n19 16\n32 35\n28 10\n14 22\n", "output": "5006921...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 positive integer n ...
[{"type": "stdin_stdout", "input": "6\n1\n2\n3\n4\n5\n100\n", "output": "\n1\n2\n3\n4\n5\n18\n"}, {"type": "stdin_stdout", "input": "6\n2\n2\n3\n8\n10\n100\n", "output": "2\n2\n3\n8\n9\n18\n"}, {"type": "stdin_stdout", "input": "6\n2\n2\n3\n4\n10\n100\n", "output": "2\n2\n3\n4\n9\n18\n"}, {"type": "stdin_stdout", "inpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a directed graph G...
[{"type": "stdin_stdout", "input": "1\n\n000110 0\n", "output": "1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\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\nThe problem describes the proper...
[{"type": "stdin_stdout", "input": "\"RUn.exe O\" \"\" \" 2ne, \" two! . \" \"\n", "output": "<RUn.exe O>\n<>\n< 2ne, >\n<two!>\n<.>\n< >\n"}, {"type": "stdin_stdout", "input": "\"RUn.exe O\" \"\" \" 2ne, \" two! . \" \"\n", "output": "<RUn.exe O>\n<>\n< 2ne, >\n<two!>\n<.>\n< >\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\nLittle boy Petya loves stairs ve...
[{"type": "stdin_stdout", "input": "500 50\n72 474 467 241 442 437 336 234 410 120 438 164 405 177 142 114 27 20 445 235 46 176 88 488 242 391 28 414 145 92 206 334 152 343 367 254 100 243 155 348 148 450 461 483 97 34 471 69 416 362\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "50 40\n14 27 19 30 31 20 28 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOur bear's forest has a checkere...
[{"type": "stdin_stdout", "input": "1000000000 1000000000 1000000000 100 -100 1000000000000000000\n", "output": "969796608 969796608\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000 1000000001 100 -100 1000000000000000000\n", "output": "599261184 599261185\n"}, {"type": "stdin_stdout", "input": "546978166 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFedya studies in a gymnasium. Fe...
[{"type": "stdin_stdout", "input": "124356983594583453458888889\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1134974\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1236642\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1068905\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1528...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVanya has a table consisting of ...
[{"type": "stdin_stdout", "input": "5\n4 11 20 20\n6 11 20 16\n5 1 33 15\n11 3 18 21\n3 2 14 21\n", "output": "1087\n"}, {"type": "stdin_stdout", "input": "5\n4 11 20 22\n6 11 20 16\n5 1 34 15\n11 3 18 21\n3 1 14 11\n", "output": "1028\n"}, {"type": "stdin_stdout", "input": "5\n4 11 20 38\n6 11 20 16\n5 2 19 15\n11 3 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 a lover of bacteria. You...
[{"type": "stdin_stdout", "input": "1000000000\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "1000100000\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "1034416188\n", "output": "18\n"}, {"type": "stdin_stdout", "input": "1000100100\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "34300081...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nEveryone knows that long ago on ...
[{"type": "stdin_stdout", "input": "10\n8097 8097 8097 14160 8097 8097 8097 8097 8097 8097\n", "output": "45\n"}, {"type": "stdin_stdout", "input": "10\n8097 8097 8097 14160 8097 8097 8097 8097 8097 4894\n", "output": "38\n"}, {"type": "stdin_stdout", "input": "10\n8097 8097 8097 14160 8097 8097 8097 8097 9062 4894\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\nRecently Polycarp started to dev...
[{"type": "stdin_stdout", "input": "92 51 18\n(()(((()())(()())())())(()())()()()())((()()())(())(())(()((())()())())(())())((())()())()()\nLRLRLLLLRRRLLRRLDLRLRRLRDLDLDLDDRRLRRRLLRDRLDDRLRRD\n", "output": "(()()()()())((()()())(())(())(()((())()())())(())())((())()())()()\n"}, {"type": "stdin_stdout", "input": "86 11 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBarney lives in country USC (Uni...
[{"type": "stdin_stdout", "input": "85\n1 1 2 2 4 6 1 3 6 3 3 11 9 14 12 5 8 11 16 19 12 17 2 19 1 24 6 2 6 6 24 3 20 1 1 1 17 8 4 25 31 32 39 12 35 23 31 26 46 9 37 7 5 23 41 41 39 9 11 54 36 54 28 15 25 58 56 18 23 70 68 18 3 48 57 70 15 65 22 35 25 13 49 34\n", "output": "1.00000000 28.50000000 27.00000000 38.000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHarry Water, Ronaldo, Her-my-oh-...
[{"type": "stdin_stdout", "input": "2\n10\n10\n", "output": "200\n"}, {"type": "stdin_stdout", "input": "2\n19\n10\n", "output": "380\n"}, {"type": "stdin_stdout", "input": "2\n4\n18\n", "output": "144\n"}, {"type": "stdin_stdout", "input": "2\n6\n18\n", "output": "216\n"}, {"type": "stdin_stdout", "input": "2\n6\n23\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\nDasha logged into the system and...
[{"type": "stdin_stdout", "input": "30 100 200\n102 108 122 116 107 145 195 145 119 110 187 196 140 174 104 190 193 181 118 127 157 111 139 175 173 191 181 105 142 166\n30 26 20 23 27 15 2 14 21 25 6 1 17 10 29 5 3 7 22 19 13 24 18 9 11 4 8 28 16 12\n", "output": "100 100 100 100 100 101 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 developing a new feature...
[{"type": "stdin_stdout", "input": "10 54 100 27 1 33 27 80 49 27 6\n", "output": "1 6 27 27 27 33 49 54 80 100 "}, {"type": "stdin_stdout", "input": "10 54 100 28 1 33 27 80 49 27 6\n", "output": "1 6 27 27 28 33 49 54 80 100\n"}, {"type": "stdin_stdout", "input": "10 54 100 27 1 33 27 80 49 21 6\n", "output": "1 6 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\nYou are given a multiset of n in...
[{"type": "stdin_stdout", "input": "108 29 72\n738 192 711 235 288 288 679 36 785 233 706 71 216 144 216 1419 338 583 495 648 144 432 72 720 541 288 158 328 154 393 10 533 867 176 707 216 314 397 440 142 326 458 568 701 745 144 61 634 520 720 744 144 409 127 526 476 101 469 72 432 738 432 235 641 695 276 144 144 231 55...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 whole world got obsessed wit...
[{"type": "stdin_stdout", "input": "RLRRRRRDRRDRRRRDLRRRRRRRDLRLDDLRRRRLDLDRDRRRRDRDRDRDLRRURRLRRRRDRRRRRRRRLDDRLRRDRRRRRRRDRDRLDRDDDRDR\n", "output": "BUG\n"}, {"type": "stdin_stdout", "input": "DDDDDDDDDDDDDDDDDDDDDDDDDLLLLLLLLLLLLLLLLLLLLLLLLRRRRRRRRRRRRRRRRRRRRRRRRRRRUUUUUUUUUUUUUUUUUUUUUUUU\n", "output": "BUG\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\nImp likes his plush toy a lot.\n...
[{"type": "stdin_stdout", "input": "1000000000 999999999\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "1079372212 582938127\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1000001000 1000000000\n", "output": "No\n"},...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne day Igor K. stopped programm...
[{"type": "stdin_stdout", "input": "10\n1 2\n1 3\n1 4\n1 5\n2 3\n2 4\n2 5\n3 4\n3 5\n4 5\n", "output": "WIN\n"}, {"type": "stdin_stdout", "input": "9\n3 5\n3 2\n1 5\n4 3\n5 4\n1 4\n1 3\n4 2\n5 2\n", "output": "WIN\n"}, {"type": "stdin_stdout", "input": "9\n3 5\n2 5\n5 1\n4 5\n1 3\n3 2\n1 4\n4 3\n4 2\n", "output": "WIN\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLimak is an old brown bear.\nHe ...
[{"type": "stdin_stdout", "input": "15\n163004418 141715548 168024392 150391828 194860227 992288235 933539839 120817690 26026774 465544095 363334937 708292303 29566466 171450602 452807812", "output": "987375170\n"}, {"type": "stdin_stdout", "input": "15\n163004418 74928250 168024392 150391828 194860227 992288235 933539...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMa5termind and Subway are bored ...
[{"type": "stdin_stdout", "input": "a2b3c2a1\n4\n11\n18\n1\n13\n\nMLFP@S", "output": "-1\n-1\na\n-1\n"}, {"type": "stdin_stdout", "input": "b2b3c2a1\n4\n2\n11\n2\n10\n\nPAMSLE", "output": "b\n-1\nb\n-1\n"}, {"type": "stdin_stdout", "input": "a2b3c2a1\n4\n11\n18\n1\n8\n\nMLFP@S", "output": "-1\n-1\na\nc\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\nThere is a mysterious temple in ...
[{"type": "stdin_stdout", "input": "3\n5\n4 3 4 10 1\n4\n1 2 3 4\n2\n2 2\n\nSAMPKE", "output": "YES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "3\n5\n4 3 4 10 1\n4\n1 0 3 4\n2\n2 2\n\nSAMPKE", "output": "YES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "3\n5\n3 5 8 5 1\n4\n1 3 2 4\n2\n1 1\n\nSAMPLE", "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\nAs predicted by the great Gods, ...
[{"type": "stdin_stdout", "input": "2\n12\n17\n\nT@MONE", "output": "208012\n129644790\n"}, {"type": "stdin_stdout", "input": "2\n8\n21\n\nMPEALS", "output": "1430\n24466267020\n"}, {"type": "stdin_stdout", "input": "2\n24\n3\n\nELAMPS", "output": "1289904147324\n5\n"}, {"type": "stdin_stdout", "input": "2\n8\n17\n\nEN...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFennec is fighting with N monste...
[{"type": "stdin_stdout", "input": "3 0\n1000000000 1000000000 1010000000", "output": "3010000000\n"}, {"type": "stdin_stdout", "input": "3 0\n1000000000 1000000000 1110000000", "output": "3110000000\n"}, {"type": "stdin_stdout", "input": "3 0\n1100000000 1000000000 1110000000", "output": "3210000000\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 will be given a string S of ...
[{"type": "stdin_stdout", "input": "CSS\nBSR", "output": "1\n"}, {"type": "stdin_stdout", "input": "SRR\nSSR", "output": "2\n"}, {"type": "stdin_stdout", "input": "SSR\nRTS", "output": "0\n"}, {"type": "stdin_stdout", "input": "STR\nSTR", "output": "3\n"}, {"type": "stdin_stdout", "input": "RSR\nSSS", "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\nNote the unusual memory limit.\n...
[{"type": "stdin_stdout", "input": "10 12\n####..$\n....#.\n.#....\n....#.\n.####.#\n....\"#", "output": "5\n"}, {"type": "stdin_stdout", "input": "14 14\n.###$.$\n.#...-\n/...#.\n...-#.\n.####.#\n....##", "output": "5\n"}, {"type": "stdin_stdout", "input": "14 14\n.###$.$\n.#...-\n/...#.\n...-#.\n#.####.\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\nIn your garden, there is a long ...
[{"type": "stdin_stdout", "input": "1 1000000000\n1000000000000000000 1000000000", "output": "1999999999000000000"}, {"type": "stdin_stdout", "input": "3 17\n22 15\n10 10\n17 10", "output": "70\n"}, {"type": "stdin_stdout", "input": "3 17\n22 19\n10 10\n17 10", "output": "77\n"}, {"type": "stdin_stdout", "input": "3 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\nThere is a set consisting of N d...
[{"type": "stdin_stdout", "input": "8 2 9\n3\n4\n5\n13\n15\n22\n26\n32", "output": "13"}, {"type": "stdin_stdout", "input": "8 2 9\n3\n0\n5\n7\n15\n22\n26\n32", "output": "16"}, {"type": "stdin_stdout", "input": "8 2 9\n3\n0\n5\n7\n11\n22\n26\n32", "output": "10"}, {"type": "stdin_stdout", "input": "8 2 9\n3\n4\n5\n7\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\nSigma and Sugim are playing a ga...
[{"type": "stdin_stdout", "input": "5 1 2\n1 2\n1 3\n1 4\n4 6\n2 1\n1 3\n1 5\n5 4", "output": "-1\n"}, {"type": "stdin_stdout", "input": "5 1 2\n1 2\n1 3\n1 4\n6 5\n2 1\n1 3\n1 5\n5 4", "output": "6\n"}, {"type": "stdin_stdout", "input": "5 1 2\n1 2\n1 3\n1 4\n4 5\n2 1\n1 3\n1 5\n5 4", "output": "6"}, {"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\nThe huge maze The Squares has be...
[{"type": "stdin_stdout", "input": "10 3\n##########\n#E.......X\n##########\n4 4\n####\n#N.#\n#..X\n####\n5 5\n#####\n#N..#\n###.X\n#S..#\n#####\n6 6\n######\n#..#X#\n#.EE.#\n####N#\n#....#\n######\n8 8\n##X#####\n#....E.#\n#####.##\n#.#...##\n#.W.#..#\n#-#.N#.X\n#X##.#.#\n########\n0 0", "output": "8\nNA\n9\n16\n23\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\nDr. Grey is a data analyst, who ...
[{"type": "stdin_stdout", "input": "3 45\n110\n1\n100\n3 31\n100\n100\n34\n10 10\n0\n2\n3\n8\n5\n16\n21\n1\n56\n16\n0 0", "output": "0.51\n0.343333333333\n1.37666666667\n"}, {"type": "stdin_stdout", "input": "3 45\n110\n1\n100\n3 31\n100\n100\n34\n10 13\n0\n2\n3\n8\n5\n16\n21\n1\n56\n32\n0 0", "output": "0.51\n0.343333...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 story of 20XX. The n...
[{"type": "stdin_stdout", "input": "6\n1 1\n.\n3 3\n...\n.W.\n...\n10 10\n..........\n.DDDDCCC..\n.DDDDCCC..\n.DDDDCCC..\nADDDDCCC..\nAAA..CCC..\n..CBBBBAAA\nAAABBBB...\n..BBBBB...\n..........\n10 10\n..........\n.DDDDDD...\n.DDDDCCC..\n.DDDDCCC..\nADDDDCCC..\nAAA.-CCC..\nAAABBBBC..\nAAABBBB...\n..BBBBB...\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 recording a result of a ...
[{"type": "stdin_stdout", "input": "16 4\n2.9498357179035515 3.940737376487606 2.8105250026221755 0.5153809858809549\n0.8717542191150367 2.4349144722266685 0.6044093106720025 1.0790706578914466\n1.8516458934245779 0.5815158140795751 2.050694060753176 1.2838449227433606", "output": "50.234435262\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\nSunuke-kun's dictionary contains...
[{"type": "stdin_stdout", "input": "2\n?rum??mer\nc??a??mp", "output": "715167440\n"}, {"type": "stdin_stdout", "input": "2\n?sum??mer\nc??a??mp", "output": "703286064"}, {"type": "stdin_stdout", "input": "2\n?rum??mer\nc@?a??mp", "output": "0\n"}, {"type": "stdin_stdout", "input": "2\n?rum??mer\ncA?a??mp", "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\nExample\n\nInput\n\n4\nDurett 7\...
[{"type": "stdin_stdout", "input": "4\nDurett 10\nGayles 4\nF`cenda 10\nyrethguaD 0\n1\n+ Mccourtney 1", "output": "Mccourtney is not working now.\nF`cenda is working hard now.\n"}, {"type": "stdin_stdout", "input": "4\nDurett 10\nGaxles 4\nFacenda 10\nyrethguaD 0\n1\n+ yentruoccM 2", "output": "yentruoccM is not worki...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n<image>\n\n\nAs shown in the fig...
[{"type": "stdin_stdout", "input": "4\n-2 1\n9 2\n3 5\n0 1\n2\n1 1 1 9\n-1 15 -1 0", "output": "0.257575758\n15.545454545\n"}, {"type": "stdin_stdout", "input": "4\n-1 1\n9 1\n2 5\n0 3\n2\n1 1 1 9\n0 15 -1 0", "output": "3.500000000\n20.994871795\n"}, {"type": "stdin_stdout", "input": "4\n-1 1\n9 1\n2 5\n0 3\n2\n1 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\nTug of war is a sport that direc...
[{"type": "stdin_stdout", "input": "3\n-1 2\n0 -2\n-1 4", "output": "100000000000006\n0\n100000000000006\n"}, {"type": "stdin_stdout", "input": "3\n-1 1\n0 -2\n-14 4", "output": "100000000000006\n0\n23645636961410\n"}, {"type": "stdin_stdout", "input": "3\n-2 1\n0 -6\n-3 6", "output": "100000000000006\n0\n3173970899639...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 star is a figure of the follow...
[{"type": "stdin_stdout", "input": "100 3\n.*.\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n**...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn order to make the \"Sea Battl...
[{"type": "stdin_stdout", "input": "100000000 100000000 100000000 100000000\n", "output": "600000004\n"}, {"type": "stdin_stdout", "input": "100000000 100000000 99999999 100000000\n", "output": "600000004\n"}, {"type": "stdin_stdout", "input": "100000000 100001000 99999999 100000000\n", "output": "600002004\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\nNazar, a student of the scientif...
[{"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000\n", "output": "975735772\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 1000000000010000000\n", "output": "636734266\n"}, {"type": "stdin_stdout", "input": "100879890062904086 919413561635743169\n", "output": "824441806\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\nPetya loves lucky numbers. Every...
[{"type": "stdin_stdout", "input": "00000000000000000000000000000000000000000000000000\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "110996812575168252737244204200508745829735318381381\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "122094830270541438292052920866473330280784608392695\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\nRecently Polycarp noticed that s...
[{"type": "stdin_stdout", "input": "1\nammsdsdadasdsadssadassadsadasdsadsadr\n", "output": "adrs\n"}, {"type": "stdin_stdout", "input": "1\nammsdsdaeasdsadssadassadsadasdsadsads\n", "output": "ades\n"}, {"type": "stdin_stdout", "input": "1\nmlsjmksjfksjfkrjjksfnfksjfsksjdf\n", "output": "dfjklmnrs\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\nVasya had three strings a, b and...
[{"type": "stdin_stdout", "input": "100 200\nboyjrjoeozwqgxexhcuioymcmnkvctbmnmsycolzhooftwndexqtwbttuwwfttaxymqsjiihgsdjasaxycgoznjiorzfiwabmhsg\nazrxzoqaombkfdlqocjgufzhtogekkfqqtkndjydeiulljvowvtvyszrlnvumwbflyyhlqrnthiqmguskrhzfktwcxdzidbyoqtn\nboyjrjoeozwqgxexhcuioymcmnkvctbmnmsycolzhooftwndexqtwbttuwwfttaxymqsjii...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKaavi, the mysterious fortune te...
[{"type": "stdin_stdout", "input": "babbaaababbbbabbaaaababbbaabababbaabbaababbaaabaabbabaabbaababababbaabaaabaaaaababbaabaaaaabaabbabaaababbbb\nbbaabbbbabbbbaaaaaababbbabaaabbbbabababbbaabbbbbabaababbaabaaabaabbababababaaaaabaabbabaaabaaaaaaaaaaaaabbb\n", "output": "284471294"}, {"type": "stdin_stdout", "input": "bbbb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOh, no!\n\nThe coronavirus has c...
[{"type": "stdin_stdout", "input": "3\n8707 7998 1614\n999941093851 131953876 8707\n", "output": "SMALL\n15155\nPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 directed graph o...
[{"type": "stdin_stdout", "input": "50 49\n1 3\n6 46\n47 25\n11 49\n47 10\n26 10\n12 38\n45 38\n24 39\n34 22\n36 3\n21 16\n43 44\n45 23\n2 31\n26 13\n28 42\n43 30\n12 27\n32 44\n24 25\n28 20\n15 19\n6 48\n41 7\n15 17\n8 9\n2 48\n33 5\n33 23\n4 19\n40 31\n11 9\n40 39\n35 27\n14 37\n32 50\n41 20\n21 13\n14 42\n18 30\n35 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMonocarp wants to draw four line...
[{"type": "stdin_stdout", "input": "4\n1 1 5 4\n4 16 10 4\n2 1 4 1\n100 21 54 111\n", "output": "4\n40\n2\n2100\n"}, {"type": "stdin_stdout", "input": "4\n0 5 2 4\n6 14 10 3\n2 0 5 1\n101 40 47 111\n", "output": "0\n30\n0\n4040\n"}, {"type": "stdin_stdout", "input": "4\n1 1 5 8\n4 16 10 4\n2 1 4 1\n100 21 54 111\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\nYou are given three integers a, ...
[{"type": "stdin_stdout", "input": "6565 1488 2427\n", "output": "Yes\n111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 computers in a row, ...
[{"type": "stdin_stdout", "input": "400 234567899\n", "output": "\n20914007\n"}, {"type": "stdin_stdout", "input": "350 999999733\n", "output": "255248393\n"}, {"type": "stdin_stdout", "input": "398 999999733\n", "output": "875462745\n"}, {"type": "stdin_stdout", "input": "399 999999733\n", "output": "530105147\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 sequence A, wher...
[{"type": "stdin_stdout", "input": "15\n+ 2101039\n-\n+ 4567886\n+ 113371486\n-\n+ 578943\n-\n-\n+ 62356680\n-\n+ 711111\n-\n+ 797735011\n-\n-\n", "output": "431927902\n"}, {"type": "stdin_stdout", "input": "15\n+ 2168539\n-\n+ 4567886\n+ 113371486\n-\n+ 578943\n-\n-\n+ 62356680\n-\n+ 711111\n-\n+ 797735011\n-\n-\n", "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe main server of Gomble compan...
[{"type": "stdin_stdout", "input": "14\n[12:07 p.m.]: mamaa\n[12:36 a.m.]: amaamppa\n[01:31 a.m.]: pmpp\n[05:47 a.m.]: paapappapaaampm\n[12:07 a.m.]: ppamammm\n[01:03 a.m.]: aapapmpampamamaaa\n[07:55 a.m.]: mpappmmapmpa\n[02:49 a.m.]: papmppppmpamppa\n[03:12 a.m.]: aaaaaaamam\n[04:40 a.m.]: paap\n[01:13 a.m.]: ap\n[03:...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSo, the Berland is at war with i...
[{"type": "stdin_stdout", "input": "1003 -5005 3399\n-10705 -1729 4365\n", "output": "2196.845285084989\n"}, {"type": "stdin_stdout", "input": "-9577 9051 5276\n-4315 -1295 3517\n", "output": "1407.1273140166404\n"}, {"type": "stdin_stdout", "input": "-9445 -9860 5513\n6291 -855 9034\n", "output": "1791.7043689042112\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\nGerald has been selling state se...
[{"type": "stdin_stdout", "input": "243\n", "output": " 1\n"}, {"type": "stdin_stdout", "input": "108\n", "output": " 2\n"}, {"type": "stdin_stdout", "input": "81\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\nHooray! Berl II, the king of Ber...
[{"type": "stdin_stdout", "input": "11 8\n3 5 5\n8 9 9\n4 6 6\n8 10 10\n5 7 7\n2 7 2\n10 11 11\n1 11 1\n", "output": "0 1 5 5 6 7 2 9 10 11 1 \n"}, {"type": "stdin_stdout", "input": "11 7\n7 8 8\n5 6 5\n1 3 3\n7 9 9\n5 10 10\n10 11 11\n1 11 4\n", "output": "3 3 4 0 10 5 8 9 10 11 4 \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\nVanya loves playing. He even has...
[{"type": "stdin_stdout", "input": "123 222\n44 -190 -188 -185 -55 17 190 176 157 176 -24 -113 -54 -61 -53 53 -77 68 -12 -114 -217 163 -122 37 -37 20 -108 17 -140 -210 218 19 -89 54 18 197 111 -150 -36 -131 -172 36 67 16 -202 72 169 -137 -34 -122 137 -72 196 -17 -104 180 -102 96 -69 -184 21 -15 217 -61 175 -221 62 173 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSummer is coming! It's time for ...
[{"type": "stdin_stdout", "input": "4 5\n87882 40786 3691 85313 46694\n28884 16067 3242 97367 78518\n4250 35501 9780 14435 19004\n64673 65438 56977 64495 27280\n", "output": "747898\n"}, {"type": "stdin_stdout", "input": "4 5\n2274 40786 3691 98933 46694\n28884 16067 3242 97367 73338\n8377 57682 9780 14435 19004\n64673...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 and Gena love playing tabl...
[{"type": "stdin_stdout", "input": "186\n2 1 2 1 1 1 1 1 2 1 1 2 2 2 1 1 2 2 1 1 1 2 1 1 2 2 1 1 1 2 2 1 1 1 1 1 2 1 1 1 2 1 2 1 1 2 1 1 1 2 2 2 2 2 2 2 1 2 1 2 1 1 2 1 2 2 1 1 1 1 1 2 2 1 2 2 1 2 2 1 1 1 2 2 1 1 2 2 1 2 2 1 2 2 2 2 2 1 1 1 1 2 1 1 2 2 2 2 2 2 1 1 1 1 1 2 1 1 2 2 1 2 2 1 1 1 1 1 2 2 1 1 2 2 1 2 2 2 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\nWhile Mike was walking in the su...
[{"type": "stdin_stdout", "input": "uqurdorwgtukbijpzhrpqoazllayzteqmeqhbgwvrgsiegiaaujtnxlzmihqyefraxpgywiauawpexgpazhqblryvremznotyklfiernvusugwlupadltrsbfvezbdbbyeetmwlkblwnidxchmwtzmrwdvlddwzbeswwpkizbqaghtrvalqickozbwfsqbcfjlbgttptlsqitjufjhsnjndvihtcdgsgntlqnzzeqcrmuxmrixmzreysejvrudqurnorhrlseammogstjseshstzxxtf...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLimak is an old brown bear. He o...
[{"type": "stdin_stdout", "input": "50\n840868705 387420489 387420489 795385082 634350497 206851546 536870912 536870912 414927754 306894916 387420489 536870912 387420489 149011306 373106005 536870912 700746206 387420489 777952883 847215247 176645254 576664386 387420489 230876513 536870912 536870912 536870912 387420489 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAfter making bad dives into swim...
[{"type": "stdin_stdout", "input": "4\n-474 -894\n-474 -833\n-446 -894\n-446 -833\n", "output": "1708\n"}, {"type": "stdin_stdout", "input": "4\n-796 -330\n-796 758\n171 -330\n171 758\n", "output": "1052096\n"}, {"type": "stdin_stdout", "input": "4\n-414 -891\n-414 896\n346 -891\n346 896\n", "output": "1358120\n"}, {"t...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 flowerbed has many flowers and...
[{"type": "stdin_stdout", "input": "10 -49 10 104 36\n30 114\n82 -379\n-49 25\n142 -38\n-5 138\n20 20\n5 -1\n45 -28\n-288 -6\n-2 45\n", "output": "168482\n"}, {"type": "stdin_stdout", "input": "10 -49 10 180 36\n30 114\n82 -379\n-49 25\n142 -38\n-5 138\n20 20\n5 -1\n45 -28\n-288 -6\n-2 45\n", "output": "168482\n"}, {"t...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 sportsman starts from point xs...
[{"type": "stdin_stdout", "input": "100 1000 1 5\n204 233 384 776 450 649 473 717 55 90 208 951 499 551 916 18 539 103 420 521 730 779 360 546 746 953 484 82 110 789 161 950 71 806 928 652 510 287 997 967 329 786 643 431 321 663 279 291 799 986 848 680 131 225 918 801 567 369 687 209 602 401 952 930 442 853 606 338 129...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 well known that the planet...
[{"type": "stdin_stdout", "input": "104 54\n683 252 125 813 874 835 651 424 826 139 397 323 143 153 326 941 536 435 317 854 353 222 851 591 420 415 190 872 178 311 612 635 174 505 153 81 559 815 805 414 378 62 75 929 208 942 254 670 329 671 127 494 504 618 292 699 203 959 218 788 285 602 83 104 41 562 272 806 4 582 780...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nZS the Coder has recently found ...
[{"type": "stdin_stdout", "input": "1000000000000000010 1000000000000000000\n", "output": "954414 954414\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000\n", "output": "906300 906300"}, {"type": "stdin_stdout", "input": "1002926547994558173 397746475431992189\n", "output": "145788 145788\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBob recently read about bitwise ...
[{"type": "stdin_stdout", "input": "17 15\na := 010000111111110\nb := 101100110000100\nc := 100101100100111\nd := 010110101110110\ne := 111111000010110\nf := 011001110111110\ng := 110011010100101\nh := 000001010010001\ni := 110000111001011\nj := 000010000010111\nk := 110110111110110\nl := 010000110000100\nm := 00011110...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 just invented a new...
[{"type": "stdin_stdout", "input": "89\n11111111101111111110111111111011111111101111111110111111111011111111101111111110111111111\n", "output": "999999999\n"}, {"type": "stdin_stdout", "input": "53\n10110111011110111110111111011111110111111110011111111\n", "output": "1234567808\n"}, {"type": "stdin_stdout", "input": "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\nIn the computer network of the B...
[{"type": "stdin_stdout", "input": "10\n2:7,4-2:5,8-1:3-1:6-1:2-2:10,9\n9:6,7,3,4,10,8,9,5,1\n9:2,1,7,6,9,4,8,10,5\n8:5,2,1,3,6,9,10,8-1:7\n1:8-8:9,10,2,6,3,1,7,4\n9:8,4,1,2,10,9,7,3,5\n9:1,3,6,2,9,10,5,8,4\n9:5,2,7,3,6,4,10,1,9\n9:3,7,6,8,10,5,1,2,4\n1:9-8:2,7,3,6,8,5,1,4\n", "output": "9\n1 2\n1 3\n1 4\n1 5\n1 6\n1 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\nWhat are you doing at the end of...
[{"type": "stdin_stdout", "input": "10\n100000 873326525630182716\n100000 620513733919162415\n100000 482953375281256917\n100000 485328193417229962\n100000 353549227094721271\n100000 367447590857326107\n100000 627193846053528323\n100000 243833127760837417\n100000 287297493528203749\n100000 70867563577617188\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\nAs we all know, Max is the best ...
[{"type": "stdin_stdout", "input": "100 1\n92 93 p\n", "output": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\nBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\nBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nStudents love to celebrate their...
[{"type": "stdin_stdout", "input": "50 1000 49\n", "output": "YES\n1 1000.00000000000000000000 2 20.40816326530612201395 \n2 979.59183673469385666976 3 40.81632653061224402791 \n3 959.18367346938771333953 4 61.22448979591836604186 \n4 938.77551020408168369613 5 81.63265306122448805581 \n5 918.36734693877554036590 6 102...
code_stdio