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\nAlice has just learnt about prim...
[{"type": "stdin_stdout", "input": "3\naabbb\nbabba\naabbccdd\n\nEAMOSL", "output": "YES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "3\nbbaba\nabcbc\nccbcbbaa\n\nSM>OLD", "output": "YES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "3\naabbb\nabbab\naabbccdd\n\nEAMOSL", "output": "YES\nYES\nNO\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\nAli baba did a trick on the fort...
[{"type": "stdin_stdout", "input": "4\n13\n13\n104\n45412902\n\nEMPLAR", "output": "11\n11\n81\n23716941\n"}, {"type": "stdin_stdout", "input": "4\n13\n25\n104\n45412902\n\nEMPLAR", "output": "11\n19\n81\n23716941\n"}, {"type": "stdin_stdout", "input": "4\n23\n13\n104\n45412902\n\nEMPLAR", "output": "15\n11\n81\n237169...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 sequence A composed o...
[{"type": "stdin_stdout", "input": "2\n1 2\n3\n1 100\n2 000\n100 1000", "output": "102\n100\n1000\n"}, {"type": "stdin_stdout", "input": "2\n1 2\n3\n1 100\n2 001\n100 1000", "output": "102\n101\n1001\n"}, {"type": "stdin_stdout", "input": "2\n1 2\n3\n1 100\n1 001\n100 1000", "output": "102\n102\n1002\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\nIf there is an integer not less ...
[{"type": "stdin_stdout", "input": "3 1\n1 7\n3 2\n0 28", "output": "700\n"}, {"type": "stdin_stdout", "input": "3 3\n1 14\n3 2\n1 7", "output": "-1\n"}, {"type": "stdin_stdout", "input": "3 3\n1 7\n3 4\n1 7", "output": "704\n"}, {"type": "stdin_stdout", "input": "3 3\n0 2\n3 2\n1 1", "output": "102\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\nWe have N switches with \"on\" a...
[{"type": "stdin_stdout", "input": "15 0\n0 6 1\n0 1\n0 -1\n2 1 -2", "output": "32768\n"}, {"type": "stdin_stdout", "input": "13 0\n0 7 1\n0 1\n0 -1\n2 1 -2", "output": "8192\n"}, {"type": "stdin_stdout", "input": "6 0\n-4 0 2\n-1 4\n1 0\n0 0 -2", "output": "64\n"}, {"type": "stdin_stdout", "input": "4 0\n0 2 2\n0 2\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\nLet S(n) denote the sum of the d...
[{"type": "stdin_stdout", "input": "263", "output": "1\n2\n3\n4\n5\n6\n7\n8\n9\n19\n29\n39\n49\n59\n69\n79\n89\n99\n199\n299\n399\n499\n599\n699\n799\n899\n999\n1099\n1199\n1299\n1399\n1499\n1599\n1699\n1799\n1899\n1999\n2999\n3999\n4999\n5999\n6999\n7999\n8999\n9999\n10999\n11999\n12999\n13999\n14999\n15999\n16999\n17...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe postal code in Atcoder Kingd...
[{"type": "stdin_stdout", "input": "3 4\n269-6650", "output": "Yes"}, {"type": "stdin_stdout", "input": "6 4\n269-6650", "output": "No\n"}, {"type": "stdin_stdout", "input": "6 8\n269-6650", "output": "No\n"}, {"type": "stdin_stdout", "input": "6 1\n269-6650", "output": "No\n"}, {"type": "stdin_stdout", "input": "6 2\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have a sequence of length N, ...
[{"type": "stdin_stdout", "input": "6\n4 7 0 -1 6 4", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "6\n2 7 2 12 2 8", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "6\n4 7 2 8 2 10", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "6\n2 7 2 8 2 8", "output": "Yes\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\nThere is a tree T with N vertice...
[{"type": "stdin_stdout", "input": "10\n2 4\n2 5\n8 3\n10 7\n1 7\n2 8\n9 10\n8 6\n10 8", "output": "220\n"}, {"type": "stdin_stdout", "input": "10\n1 4\n2 5\n1 3\n10 1\n1 6\n4 8\n9 8\n7 10\n10 2", "output": "122\n"}, {"type": "stdin_stdout", "input": "10\n2 4\n2 5\n2 3\n10 7\n1 6\n2 10\n9 5\n8 7\n10 6", "output": "194\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 balls placed in a ro...
[{"type": "stdin_stdout", "input": "-10 -2", "output": "1.1290058539e-05\n"}, {"type": "stdin_stdout", "input": "-3 -6", "output": "-0.00249895876718\n"}, {"type": "stdin_stdout", "input": "-3 -2", "output": "-0.0246913580247\n"}, {"type": "stdin_stdout", "input": "-5 9", "output": "3.43322753906e-05\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\nAssume that a, b, and n are all ...
[{"type": "stdin_stdout", "input": "2 3 2\n2 7 3\n13 3 5\n4 6 2", "output": "12\n15\n15\n12\n"}, {"type": "stdin_stdout", "input": "1 3 2\n2 7 3\n13 3 5\n4 6 2", "output": "6\n15\n15\n12\n"}, {"type": "stdin_stdout", "input": "2 3 2\n2 7 3\n13 3 5\n4 4 2", "output": "12\n15\n15\n0\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\nTsuruga Castle, a symbol of Aizu...
[{"type": "stdin_stdout", "input": "8\n106\n29\n127\n11\n41\n39\n2\n5\n4\n67\n81\n78\n65\n0", "output": "2\n1\n1\n1\n1\n0\n2\n0\n0\n0\n0\n0\n0\n4\n"}, {"type": "stdin_stdout", "input": "8\n001\n21\n127\n11\n41\n39\n2\n5\n4\n67\n81\n78\n65\n0", "output": "3\n1\n1\n1\n1\n0\n1\n0\n0\n0\n0\n0\n0\n4\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 educational program (AHK Edu...
[{"type": "stdin_stdout", "input": "-1 -2 1 11", "output": "no\n"}, {"type": "stdin_stdout", "input": "-1 -2 1 19", "output": "no\n"}, {"type": "stdin_stdout", "input": "-2 -2 1 1", "output": "yes\n"}, {"type": "stdin_stdout", "input": "-1 4 4 10", "output": "no\n"}, {"type": "stdin_stdout", "input": "-1 1 4 10", "outp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nproblem\n\nIn the area where Kaz...
[{"type": "stdin_stdout", "input": "3 5\n10\n25\n15\n50\n30\n15\n40\n30", "output": "1125"}, {"type": "stdin_stdout", "input": "3 5\n10\n25\n15\n50\n30\n15\n12\n30", "output": "855\n"}, {"type": "stdin_stdout", "input": "3 5\n10\n38\n18\n50\n30\n6\n40\n30", "output": "1068\n"}, {"type": "stdin_stdout", "input": "3 5\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\nIn the good old Hachioji railroa...
[{"type": "stdin_stdout", "input": "3 5\n0W 1W\n0W 2W\n0W 2E\n0E 1E\n1E 2E\naabbcdcee\n-\n-\n-\n-\nbbaadeecc\n3 3\n0E 1W\n1E 2W\n2E 0W\naabb\nbbcc\naa\nbbbb\ncc\naaaa\n3 4\n0E 1W\n0E 2E\n1E 2W\n2E 0W\nababab\n-\n-\naaabbb\n-\n-\n0 0", "output": "5\n2\n5\n"}, {"type": "stdin_stdout", "input": "3 5\n0W 1W\n0W 2W\n0W 2E\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\nShortest Common Non-Subsequence\...
[{"type": "stdin_stdout", "input": "0101\n1101001", "output": "0000\n"}, {"type": "stdin_stdout", "input": "0101\n1101000", "output": "0001\n"}, {"type": "stdin_stdout", "input": "0101\n0011001", "output": "1000\n"}, {"type": "stdin_stdout", "input": "0101\n0110001", "output": "0010\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\nA Garden with Ponds\n\nMr. Gardi...
[{"type": "stdin_stdout", "input": "3 3\n0 0 2\n0 1 2\n2 3 1\n3 5\n0 3 7 3 3\n4 1 0 2 3\n3 3 4 0 2\n7 7\n2 1 1 1 1 0 0\n1 0 0 0 1 0 0\n1 0 1 1 1 1 1\n1 0 0 0 2 0 1\n1 1 1 1 1 0 1\n0 0 2 1 0 1 1\n0 0 1 1 1 2 -1\n6 6\n1 1 1 1 2 2\n1 0 0 2 0 2\n1 0 -1 2 1 2\n3 3 3 15 13 9\n3 0 0 18 -1 9\n2 6 3 9 9 2\n0 0", "output": "0\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\nA convex polygon consisting of N...
[{"type": "stdin_stdout", "input": "4\n100 100\n0 100\n0 0\n100 0", "output": "50.00000 50.00000"}, {"type": "stdin_stdout", "input": "4\n111 100\n-2 110\n0 -2\n110 -1", "output": "NA\n"}, {"type": "stdin_stdout", "input": "4\n111 110\n-2 110\n0 -2\n110 -1", "output": "NA\n"}, {"type": "stdin_stdout", "input": "4\n111 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\nLet's consi...
[{"type": "stdin_stdout", "input": "00000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000111111111\n10000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111111\n010101010101010101010101...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nC: Namo .. Cut\n\nproblem\n\n-De...
[{"type": "stdin_stdout", "input": "3\n2 2\n1 3\n2 1\n2\n2 3", "output": "1\n1\n"}, {"type": "stdin_stdout", "input": "3\n1 2\n1 3\n2 3\n2\n2 3", "output": "2\n2\n"}, {"type": "stdin_stdout", "input": "3\n1 1\n1 3\n2 3\n2\n2 3", "output": "1\n1\n"}, {"type": "stdin_stdout", "input": "3\n2 1\n1 3\n2 3\n2\n2 3", "output"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem\n\nThe popular video pos...
[{"type": "stdin_stdout", "input": "110000", "output": "110000\n"}, {"type": "stdin_stdout", "input": "100010", "output": "100000\n"}, {"type": "stdin_stdout", "input": "121470", "output": "121000\n"}, {"type": "stdin_stdout", "input": "101101", "output": "101000\n"}, {"type": "stdin_stdout", "input": "113193", "output...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given $n$ integers $w_i ...
[{"type": "stdin_stdout", "input": "5\n0 91 14 2 11", "output": "120\n"}, {"type": "stdin_stdout", "input": "5\n0 91 14 3 11", "output": "122\n"}, {"type": "stdin_stdout", "input": "5\n1 25 13 2 11", "output": "55\n"}, {"type": "stdin_stdout", "input": "5\n0 91 9 2 11", "output": "106\n"}, {"type": "stdin_stdout", "inp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA state with $n$ flags of ON or ...
[{"type": "stdin_stdout", "input": "14\n1 1\n0 1\n1 4\n0 0\n0 0\n0 0\n0 2\n0 3\n4 0\n1\n5\n6\n4\n8", "output": "1\n0\n0\n0\n0\n0\n0\n1\n1\n0\n0\n18\n"}, {"type": "stdin_stdout", "input": "14\n2 1\n0 1\n1 4\n0 0\n0 0\n0 0\n0 2\n0 3\n4 0\n1\n5\n6\n4\n8", "output": "0\n0\n0\n0\n0\n0\n0\n0\n1\n0\n0\n16\n"}, {"type": "stdin...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a rectangular para...
[{"type": "stdin_stdout", "input": "10\n2 10 8\n5 5 2\n16 9 1\n2 7 4\n6 4 10\n1 1 8\n2 8 1\n10 6 1\n7 5 2\n9 5 4\n", "output": "24\n6\n15\n10\n39\n4\n7\n15\n8\n18\n"}, {"type": "stdin_stdout", "input": "10\n9 6 8\n6 5 2\n8 9 2\n2 7 9\n6 4 10\n1 1 8\n2 8 1\n10 11 3\n7 5 3\n9 5 6\n", "output": "41\n14\n21\n12\n39\n4\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\nWhen Masha came to math classes ...
[{"type": "stdin_stdout", "input": "100\n2 2 2 2 3 3 3 3 3 3 1 3 3 2 3 3 0 3 3 3 2 3 3 3 3 1 3 3 3 3 3 3 3 1 1 2 2 2 2 2 1 3 3 2 2 1 3 3 3 2 3 3 3 1 1 2 3 1 0 0 1 3 3 3 1 3 2 2 2 2 3 3 2 2 2 3 3 2 2 3 1 1 1 1 3 3 3 3 3 3 3 3 3 3 3 2 3 3 3\n0 0 0 2 2 1 0 0 0 0 0 0 2 2 2 0 0 0 3 2 2 2 2 2 1 1 1 3 3 1 0 2 1 1 0 0 2 2 2 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\nInitially Ildar has an empty arr...
[{"type": "stdin_stdout", "input": "3\n0 1 1000000000\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "3\n1 1 1000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\n1 0 1000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\n1 0 0000000000\n", "output": "1\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an integer number ...
[{"type": "stdin_stdout", "input": "10000000000\n", "output": "5000000000\n"}, {"type": "stdin_stdout", "input": "10000000010\n", "output": "5000000005\n"}, {"type": "stdin_stdout", "input": "10010000010\n", "output": "5005000005\n"}, {"type": "stdin_stdout", "input": "10010000110\n", "output": "5005000055\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\nPetr has just bought a new car. ...
[{"type": "stdin_stdout", "input": "15\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "15\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "15\n297\n16...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a connected undire...
[{"type": "stdin_stdout", "input": "10 10\n1 3\n9 6\n4 5\n1 9\n8 6\n1 7\n3 2\n5 7\n5 3\n10 5\n", "output": "YES\n1001010110\n"}, {"type": "stdin_stdout", "input": "10 10\n4 3\n6 8\n5 3\n8 1\n2 9\n9 8\n3 6\n10 2\n9 3\n6 3\n", "output": "YES\n1110010111\n"}, {"type": "stdin_stdout", "input": "10 10\n1 5\n9 6\n4 5\n1 9\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 are given two arrays a and b...
[{"type": "stdin_stdout", "input": "5\n1 11 7 6 5\n9 11 2 18 3\n", "output": "1162\n"}, {"type": "stdin_stdout", "input": "5\n1 11 7 6 5\n9 11 2 9 3\n", "output": "1077\n"}, {"type": "stdin_stdout", "input": "5\n1 11 7 6 5\n9 11 3 6 3\n", "output": "1021\n"}, {"type": "stdin_stdout", "input": "5\n1 11 7 2 5\n9 11 3 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\nThe Third Doctor Who once correc...
[{"type": "stdin_stdout", "input": "18 16 20 4\n0 0\n0 1\n1 7\n1 7\n", "output": "18 16\n17 15\n18 16\n19 17\n"}, {"type": "stdin_stdout", "input": "18 16 20 4\n0 0\n0 1\n1 7\n1 6\n", "output": "18 16\n17 15\n18 16\n19 17\n"}, {"type": "stdin_stdout", "input": "18 8 20 4\n1 1\n0 1\n1 7\n1 7\n", "output": "19 9\n18 8\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\nDemonstrative competitions will ...
[{"type": "stdin_stdout", "input": "10101 82934069\n", "output": " 76527701\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...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNow that Kuroni has reached 10 y...
[{"type": "stdin_stdout", "input": "((()((()()))))(\n", "output": "1\n12\n1 2 3 5 6 7 8 10 11 12 13 14\n"}, {"type": "stdin_stdout", "input": "(((((())()))()(\n", "output": "1\n12\n1 2 3 4 5 6 7 8 10 11 12 14\n"}, {"type": "stdin_stdout", "input": "((()(())()))()(\n", "output": "1\n10\n1 2 3 5 6 8 10 11 12 14\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\nSlime and his n friends are at a...
[{"type": "stdin_stdout", "input": "100\n4364 698 1003 1128 1513 39 4339 969 7452 3415 1154 1635 6649 136 1442 50 834 1680 107 978 983 3176 4017 1692 1113 1504 1118 396 1975 2053 2366 3022 3007 167 610 4649 14659 2331 4565 318 7232 204 7131 6122 2885 5748 1998 3833 6799 4219 8454 8698 4964 1736 1554 1665 2425 4227 1967...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle Petya very much likes com...
[{"type": "stdin_stdout", "input": "274842194 1000000000\n", "output": "1162261466\n"}, {"type": "stdin_stdout", "input": "274842194 1000100000\n", "output": "1162105233\n"}, {"type": "stdin_stdout", "input": "387420489 225159023\n", "output": "1000000001\n"}, {"type": "stdin_stdout", "input": "922263603 387506683\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\nBeing stuck at home, Ray became ...
[{"type": "stdin_stdout", "input": "5\n20 809014\n289 -254 1 -109 -167 93 23 -37 -31 -109 204 59 296 49 132 0 -28 35 -197 -266\n20 458494\n113 218 -292 -298 179 258 -257 -20 296 76 -145 93 -282 -261 -159 -45 255 -107 171 63\n14 876161\n69 74 12 2 177 -113 103 93 38 -48 282 169 205 145\n26 731742\n76 190 -227 -81 -293 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n piranhas with sizes ...
[{"type": "stdin_stdout", "input": "6\n5\n6 3 4 4 5\n3\n1 1 1\n5\n4 4 3 4 4\n5\n5 5 4 3 2\n3\n1 1 1\n5\n5 4 3 5 5\n", "output": "1\n-1\n2\n2\n-1\n1\n"}, {"type": "stdin_stdout", "input": "6\n5\n5 3 4 4 5\n3\n1 1 1\n5\n4 4 3 4 4\n5\n5 5 4 3 2\n3\n1 1 2\n5\n5 4 3 5 5\n", "output": "1\n-1\n2\n2\n3\n1\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\nThere are n glasses on the table...
[{"type": "stdin_stdout", "input": "100\n1 0\n1 0\n1 0\n1 0\n1 0\n1 1\n1 0\n1 0\n1 0\n1 1\n1 0\n1 0\n1 0\n1 0\n1 0\n1 0\n1 0\n1 0\n1 1\n1 0\n1 0\n1 0\n1 0\n1 1\n1 0\n1 1\n1 0\n1 1\n1 1\n1 0\n1 0\n1 0\n1 1\n1 0\n1 0\n1 0\n1 1\n1 1\n1 0\n1 1\n1 0\n1 1\n1 1\n1 0\n1 0\n2 0\n1 0\n1 1\n1 0\n1 0\n1 0\n1 0\n1 1\n1 0\n1 0\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\nAfter reaching your destination,...
[{"type": "stdin_stdout", "input": "20\n5 166\n11 21 31 41 51\n5 37\n11 21 31 41 51\n5 231\n11 21 31 41 51\n5 58\n11 21 31 41 51\n5 157\n11 21 31 41 51\n5 179\n11 21 31 41 51\n5 150\n11 21 31 41 51\n5 122\n11 20 27 37 47\n5 204\n11 21 31 41 51\n5 62\n3 13 23 8 43\n5 136\n43 58 51 86 34\n5 42\n31 25 62 45 100\n5 36\n20 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs a teacher, Riko Hakozaki ofte...
[{"type": "stdin_stdout", "input": "6 12\n1 3 16656021\n1 4 8763000\n1 5 8763000\n1 6 16307467\n2 3 8763000\n2 4 1\n2 5 8763000\n2 6 1\n3 5 8763000\n3 6 8763000\n4 5 8763000\n4 6 2\n", "output": "8603110\n"}, {"type": "stdin_stdout", "input": "6 12\n1 3 16656021\n1 4 8763000\n1 5 8763000\n1 6 8763000\n2 3 8763000\n2 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\nThis is an interactive problem.\...
[{"type": "stdin_stdout", "input": "10\n7 5\n1 17\n6 25\n3 1\n18 0\n3 17\n7 -1\n-1 -1\n1 0\n", "output": "? 1\n? 5\n? 9\n? 10\n\n!\n1 3\n1 8\n5 7\n"}, {"type": "stdin_stdout", "input": "10\n7 2\n1 17\n6 25\n3 1\n13 0\n3 17\n7 -1\n-1 -1\n1 0\n", "output": "? 1\n? 2\n? 5\n? 10\n\n!\n1 3\n1 8\n2 7\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given n points on a plan...
[{"type": "stdin_stdout", "input": "40\n-8 24\n2 -1\n1 -18\n72 -70\n5 -4\n-308 436\n-19 40\n36 -35\n-178 265\n-1 2\n-7 30\n-1 0\n3 -2\n200 -285\n17 -16\n-35 74\n0 -4\n-86 106\n-1 4\n-7 6\n0 1\n-5 4\n-2 3\n6 -5\n-4 5\n181 -262\n76 -118\n0 0\n-7 18\n-58 104\n-5 6\n-6 12\n-3 4\n1 0\n11 -10\n-86 130\n-3 6\n153 -236\n-183 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\nThe Little Elephant has found a ...
[{"type": "stdin_stdout", "input": "300 7\nXXWXWWXXWWWBBXXXWWBWBWXWWWXXWBXXBXWWXXXWXWXBXWBWWWXBBWBXBXWXWBBBBXWBXWBBBXBXXXXBWXXXWBBXWXXBBWBBXBBXWXBXWBWXBWXXXXWXBWBBWXWXWXWWBWWWXXWWBBBXBXBWXBXXWWWBWWWBXWWXXWXWBWWWBWWWXXBBWXWXWXXWXXXXBWBXXBXBBBXBBWWXWBBXXWBBXBBXXBWXXWBWWBXWXXWWXXBXBWBWXWBBBWXXWXXWBWBBXWWBBWXXXBBWWXXXXBBBB...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 boys and m girls stu...
[{"type": "stdin_stdout", "input": "1 852\n", "output": "GBGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nComing up with a new problem isn...
[{"type": "stdin_stdout", "input": "30\nwaiphwcqrrinr\no\nqiqehzmgsjdoqd\nkjexeesevrlowxhghq\njudikhzkj\nz\nxo\nlsdzypkfqro\nsshgcxsky\ngecntpcmoojfwp\nsvmytmcfhc\njrsrvsvbaiumlmkptn\ns\nwpcsovfjlyspviflk\nktvyzvddgllht\nszahigtmklglrcocbo\nznligfxkgxzkcfeu\nliryvzmqwhr\nxgrxkgiehxztv\netrjxdczppafly\njrdgajschhwsci\nd...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 kangaroos with pocke...
[{"type": "stdin_stdout", "input": "100\n154\n60\n97\n638\n139\n150\n570\n579\n601\n647\n804\n237\n245\n549\n288\n347\n778\n282\n916\n441\n974\n145\n957\n886\n655\n702\n930\n618\n132\n520\n972\n48\n94\n54\n682\n433\n896\n134\n845\n636\n242\n842\n125\n141\n240\n130\n409\n666\n948\n938\n604\n110\n474\n484\n364\n40\n807\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\nImagine you have an infinite 2D ...
[{"type": "stdin_stdout", "input": "18855321\n", "output": "106661800\n"}, {"type": "stdin_stdout", "input": "34609610\n", "output": "195781516\n"}, {"type": "stdin_stdout", "input": "40000000\n", "output": "226274168\n"}, {"type": "stdin_stdout", "input": "38450759\n", "output": "217510336\n"}, {"type": "stdin_stdout"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarpus develops an interesti...
[{"type": "stdin_stdout", "input": "20\n-1 32 37 -1 -1 -1 57 -1 -1 40 31 33 -1 -1 39 47 43 -1 35 32\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "19\n23 26 -1 -1 35 38 41 -1 -1 -1 53 -1 59 62 6 7 8 9 -1\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "18\n21 19 -1 -1 -1 48 50 -1 54 -1 5 1 -1 -1 -1 37...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKolya got string s for his birth...
[{"type": "stdin_stdout", "input": "wqlvwkiiqfmesejedhyjjfgzqfmiqyaiqefzaywrdundcmbfvhdflrpvkitbltbrzedvozltptkaanbpmjvsdnpthcepfydrdlscexczxwzyatupzlxdhnezdsipeyjqmbvoavsgeuulkqkexpwpttvxeovcjrqnzdeiaatzglvwkiiqfmesejedhyjjfgzqfmiqyaiq\n141\n", "output": "334\n"}, {"type": "stdin_stdout", "input": "nemtbujbscvkgxnbqbo...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPaul hates palindromes. He assum...
[{"type": "stdin_stdout", "input": "302 4\nabdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdcbdc...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Berland State University is ...
[{"type": "stdin_stdout", "input": "100\n4 1 1 1 3 3 2 5 1 2 1 2 1 1 1 6 1 3 1 1 1 1 2 4 1 1 4 2 2 8 2 2 1 8 2 4 3 3 8 1 3 2 3 2 1 3 8 2 2 3 1 1 2 2 5 1 4 3 1 1 3 1 3 1 7 1 1 1 3 2 1 2 2 3 7 2 1 4 3 2 1 1 3 4 1 1 3 5 1 8 4 1 1 1 3 10 2 2 1 2\n100\n1 1 5 2 13 2 2 3 6 12 1 13 8 1 1 16 1 1 5 6 2 4 6 4 2 7 4 1 7 3 3 9 5 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\nTwo players play a simple game. ...
[{"type": "stdin_stdout", "input": "50 50 50 50\n", "output": "Second\n"}, {"type": "stdin_stdout", "input": "48 50 12 11\n", "output": "Second\n"}, {"type": "stdin_stdout", "input": "49 50 11 12\n", "output": "Second\n"}, {"type": "stdin_stdout", "input": "50 50 87 50\n", "output": "Second\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\nDeveloping tools for creation of...
[{"type": "stdin_stdout", "input": "-1000000000 -1000000000 1000000000 1000000000\n", "output": "2000000002000000001"}, {"type": "stdin_stdout", "input": "-1000000000 -999999999 1000000000 999999999\n", "output": "2000000000000000000"}, {"type": "stdin_stdout", "input": "-999999999 -1000000000 999999999 1000000000\n", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAnd while Mishka is enjoying her...
[{"type": "stdin_stdout", "input": "10 1000 998 596\n1681 18\n2048 59\n2110 98\n2201 185\n2282 327\n2250 743\n3529 893\n1844 999\n1618 960\n1564 934\n", "output": "1.6778523489932886\n"}, {"type": "stdin_stdout", "input": "10 1001 458 393\n826 363\n1241 4\n1402 9\n1441 18\n1800 417\n1804 555\n1248 997\n1207 990\n1116 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\nLet’s define a grid to be a set ...
[{"type": "stdin_stdout", "input": "ABCDEFGHIJKLMNOPQRSGTUVWXYZ\n", "output": "ABCDEFGHIJKLM\nZYXWVUTSRQPON\n"}, {"type": "stdin_stdout", "input": "MKBGVNDJRAWUEHFSYLIZCOPTXKQ\n", "output": "MKBGVNDJRAWUE\nQXTPOCZILYSFH\n"}, {"type": "stdin_stdout", "input": "ABACDEFGHIJKLMNOPQRSTUVWXYZ\n", "output": "OPQRSTUVWXYZA\nNM...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 servers in a laborat...
[{"type": "stdin_stdout", "input": "1 10\n4 1 1\n9 1 1\n10 1 1\n12 1 1\n13 1 1\n15 1 1\n16 1 1\n18 1 1\n19 1 1\n20 1 1\n", "output": "1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n"}, {"type": "stdin_stdout", "input": "4 10\n1 1 1\n3 1 2\n4 1 2\n6 1 2\n8 1 2\n13 1 2\n16 1 1\n17 1 2\n19 3 1\n20 1 1\n", "output": "1\n1\n2\n1\n1\n1\n1\n1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOleg the client and Igor the ana...
[{"type": "stdin_stdout", "input": "tinkoff\nzscoder\n", "output": "fzfsirk\n"}, {"type": "stdin_stdout", "input": "tinkogf\nzscoder\n", "output": "fzgsirk"}, {"type": "stdin_stdout", "input": "thnkogf\nzscoder\n", "output": "fzgshrk"}, {"type": "stdin_stdout", "input": "ffoknht\nzscoder\n", "output": "fzfshrk"}, {"typ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKaren has just arrived at school...
[{"type": "stdin_stdout", "input": "19\n519879446 764655030 680293934 914539062 744988123 317088317 653721289 239862203 605157354 943428394 261437390 821695238 312192823 432992892 547139308 408916833 829654733 223751525 672158759\n", "output": "\n265109293\n"}, {"type": "stdin_stdout", "input": "19\n519879446 764655030...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 All-Berland National Olympia...
[{"type": "stdin_stdout", "input": "20\nphp8vy 1\nkeeona 0\n8 0\nwzf4eb 0\n16 1\n9 0\nf2548d 0\n11 0\nyszsig 0\nyyf4q2 0\n1pon1p 1\njvpwuo 0\nd9stsx 0\ne14bkx 1\n5 0\n17 0\nsbklx4 0\nsfms2u 1\n6 0\n18 1\n", "output": "16\nmove 16 1\nmove 18 2\nmove 5 10\nmove 6 12\nmove 1pon1p 3\nmove e14bkx 4\nmove php8vy 5\nmove sfms...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAbsent-minded Masha got set of n...
[{"type": "stdin_stdout", "input": "3\n0 1 3 5 6 8\n1 2 4 5 7 8\n2 3 4 6 7 9\n", "output": "98\n"}, {"type": "stdin_stdout", "input": "3\n0 1 2 3 4 5\n6 7 8 9 0 1\n2 3 4 5 6 7\n", "output": "87\n"}, {"type": "stdin_stdout", "input": "3\n5 1 2 9 6 4\n9 0 6 4 2 8\n4 6 2 8 3 7\n", "output": "10\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\nVasya and Kolya play a game with...
[{"type": "stdin_stdout", "input": "jkeaagakbifeaechkifkdghcjcgighidcgdccgbdbcackfgaebkddabgijkhjkaffkabacekdkjekeccegbecbkecbgbgcacgdackcdfjefaifgbigahkbedidfhjbikejdhejcgideaeejdcefeeccaefbddejkbdkfagfcdjbikbidfggkidcdcic\n", "output": "0.44919786096256686\n"}, {"type": "stdin_stdout", "input": "jkeaagakbifeaechkifkd...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMishka received a gift of multic...
[{"type": "stdin_stdout", "input": "10 5 293149357\n79072863 760382815 358896034 663269192 233367425 32795628 837363300 46932461 179556769 763342555\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "18 2 86\n665 408 664 778 309 299 138 622 229 842 498 389 140 976 456 265 963 777\n", "output": "YES\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\nRhezo and his friend Vanya love ...
[{"type": "stdin_stdout", "input": "4\n-1 -1 -5 21\n\nAQTMHT", "output": "16\n"}, {"type": "stdin_stdout", "input": "4\n-1 -3 22 -2\n\nTIXTL?", "output": "20\n"}, {"type": "stdin_stdout", "input": "4\n10 0 -1 24\n\nMNASGR", "output": "23\n"}, {"type": "stdin_stdout", "input": "4\n0 -1 -1 40\n\nMNASGR", "output": "39\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\nN persons are standing in a row....
[{"type": "stdin_stdout", "input": "5\n49 10 1 -4 -1", "output": "190\n"}, {"type": "stdin_stdout", "input": "5\n49 10 2 -4 -1", "output": "189\n"}, {"type": "stdin_stdout", "input": "5\n49 10 0 -4 -1", "output": "191\n"}, {"type": "stdin_stdout", "input": "5\n4 -1 107 3 0", "output": "216\n"}, {"type": "stdin_stdout",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N children standing in...
[{"type": "stdin_stdout", "input": "6\n16 10 33 1 2 1", "output": "196\n"}, {"type": "stdin_stdout", "input": "6\n16 10 66 1 2 1", "output": "295\n"}, {"type": "stdin_stdout", "input": "6\n16 10 48 1 2 1", "output": "241\n"}, {"type": "stdin_stdout", "input": "6\n16 18 66 1 2 1", "output": "313\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\nWe have N integers. The i-th int...
[{"type": "stdin_stdout", "input": "10\n1 14 159 2653 58979 323846 2643383 27950288 419716939 9375105820", "output": "103715608\n"}, {"type": "stdin_stdout", "input": "10\n1 14 159 2653 58979 376446 2643383 27950288 419716939 9375105820", "output": "104328928\n"}, {"type": "stdin_stdout", "input": "10\n1 14 159 2653 58...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 strings A, B...
[{"type": "stdin_stdout", "input": "baaaa`aaaa aabaaaaaaa aaaaa`aaab", "output": "YES\n"}, {"type": "stdin_stdout", "input": "baaaaaaa`` `aaaaaabaa aaaaa`aaab", "output": "YES\n"}, {"type": "stdin_stdout", "input": "baaabaaa`` `aaaaaabaa aaaaa`aaab", "output": "YES\n"}, {"type": "stdin_stdout", "input": "baaabaaa`` `aa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 permutation P_1 ...
[{"type": "stdin_stdout", "input": "8 2\n4 5 7 8 3 1 2 6", "output": "1\n2\n3\n6\n5\n4\n7\n8\n"}, {"type": "stdin_stdout", "input": "8 6\n4 5 7 8 3 1 2 6", "output": "4\n5\n7\n8\n3\n1\n2\n6\n"}, {"type": "stdin_stdout", "input": "8 5\n4 5 7 8 3 1 2 6", "output": "4\n5\n6\n8\n3\n1\n2\n7\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\nDr .: Peter. I did.\n\nPeter: Se...
[{"type": "stdin_stdout", "input": "1\n0 1 0 0 0 0 0 0 0 0\n1 1 1 0 0 0 0 0 0 0\n0 1 0 0 0 0 0 0 0 0\n0 0 0 0 0 1 0 0 0 0\n0 0 0 1 0 0 1 0 0 0\n0 0 0 0 1 1 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 1 0\n0 0 0 0 0 0 0 1 1 1\n0 0 0 0 0 0 0 0 1 0", "output": "0 0 0 0 1 0 1 0 0 0\n0 1 0 1 1 0 1 1 0 0\n0 0 1 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\nI decided to move and decided to...
[{"type": "stdin_stdout", "input": "6 3\n2 1\n0 2\n5 8\n1 3\n1 5\n-2 2\n1 1 1 59 30 16\n3 -4\n-3 0\n2 -2\n45 11\n90 6\n135 1\n2 1\n1 3\n5 2\n0 1 1 124 30 22\n-3 0\n1 -2\n37 2\n0 0", "output": "1 2 3 4 5\nNA\n"}, {"type": "stdin_stdout", "input": "6 3\n2 1\n1 2\n5 3\n1 2\n1 5\n-2 3\n1 1 1 90 30 45\n3 -4\n-3 0\n2 -2\n45 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nproblem\n\nGiven two strings, fi...
[{"type": "stdin_stdout", "input": "ABRACADAARA\nECADADABRBCRDARA\nUPWJCIRUCAXIIRGL\nSBQNYBSBZDFNEV", "output": "4\n0\n"}, {"type": "stdin_stdout", "input": "DBRACAAAARA\nECADADBBRBCRDARA\nLCRIIXACURIGJWPU\nSBQNYBSBZDFOEV", "output": "3\n0\n"}, {"type": "stdin_stdout", "input": "DBRACAAAARA\nECADADBBRBBRDARA\nLCRIIXACU...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem Statement\n\nThere is a ...
[{"type": "stdin_stdout", "input": "3 3\nac#\nb#C\n.BA\n3 3\naaZ\na#Z\naZZ\n3 3\n..#\n.#.\n#..\n1 50\nabcdefghijklmnopqrstuvwxyYXWVUTSRQPONMLKJIHGFEDCBA\n1 50\naAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyY\n1 50\nabcdefghijklmnopqrstuvwxyABCDEFGHIJKLMNOPQRSTUVWXY\n1 50\naaaaaaaaaabbbbbbbbbbcccccCCCCCBBBBBBBBBBAAAA...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem statement\n\nThere is a ...
[{"type": "stdin_stdout", "input": "2\n10 -2", "output": "Second\n"}, {"type": "stdin_stdout", "input": "2\n-1 10", "output": "First\n"}, {"type": "stdin_stdout", "input": "2\n-2 2", "output": "Second\n"}, {"type": "stdin_stdout", "input": "2\n-2 4", "output": "Second\n"}, {"type": "stdin_stdout", "input": "2\n-2 8", "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given n segments on a co...
[{"type": "stdin_stdout", "input": "1\n1 1000000000000000000\n", "output": "1000000000000000000 \n"}, {"type": "stdin_stdout", "input": "1\n0 1000000000000000000\n", "output": "1000000000000000001\n"}, {"type": "stdin_stdout", "input": "1\n2 1000000000000000000\n", "output": "999999999999999999 \n"}, {"type": "stdin_st...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDima the hamster enjoys nibbling...
[{"type": "stdin_stdout", "input": "36\n3 41 82 123 174 216 432 864 1080 1228 2149 4298 8596 11052 22104 33156 35919 71838 179595 359190 431028 862056 994680 1315440 1753920 3507840 7015680 10523520 21047040 26500200 53000400 106000800 132501000 176668000 353336000 530004000\n", "output": "Yes\n"}, {"type": "stdin_stdo...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIvan places knights on infinite ...
[{"type": "stdin_stdout", "input": "2163\n", "output": "0 1\n0 2\n0 3\n0 4\n0 5\n0 6\n0 7\n0 8\n0 9\n0 10\n0 11\n0 12\n0 13\n0 14\n0 15\n0 16\n0 17\n0 18\n0 19\n0 20\n0 21\n0 22\n0 23\n0 24\n0 25\n0 26\n0 27\n0 28\n0 29\n0 30\n0 31\n0 32\n0 33\n0 34\n0 35\n0 36\n0 37\n0 38\n0 39\n0 40\n0 41\n0 42\n0 43\n0 44\n0 45\n0 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\nPetya loves lucky numbers. We al...
[{"type": "stdin_stdout", "input": "99994\n", "output": "abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabc...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n students and m clubs...
[{"type": "stdin_stdout", "input": "20 20\n0 0 3 2 1 2 2 3 2 2 1 1 0 3 0 0 1 1 1 3\n15 1 20 13 6 12 16 8 3 14 10 5 18 17 4 9 2 11 7 19\n20\n2\n10\n7\n4\n6\n5\n14\n8\n9\n18\n13\n11\n19\n1\n16\n20\n17\n12\n15\n3\n", "output": "4\n4\n4\n4\n4\n4\n4\n4\n2\n2\n2\n2\n2\n2\n2\n2\n2\n1\n0\n0\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 two arrays a and b...
[{"type": "stdin_stdout", "input": "10\n6 3 0 5 4 5 5 5 8 5\n3 8 2 9 5 4 1 0 3 6\n", "output": "0 1 0 0 0 4 6 7 1 8 "}, {"type": "stdin_stdout", "input": "10\n6 3 0 5 4 5 5 4 8 5\n3 8 2 9 5 4 1 0 3 6\n", "output": "0 1 0 0 0 4 6 6 1 8\n"}, {"type": "stdin_stdout", "input": "10\n6 3 0 5 6 5 5 5 8 5\n3 8 2 9 5 4 1 0 3 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\nYou are given a graph with 3 ⋅ n...
[{"type": "stdin_stdout", "input": "1\n5 39\n1 2\n3 4\n5 6\n7 8\n1 9\n3 10\n3 11\n5 12\n5 13\n7 14\n7 15\n9 2\n10 2\n11 2\n12 2\n13 2\n14 2\n15 2\n9 4\n10 4\n11 4\n12 4\n13 4\n14 4\n15 4\n9 6\n10 6\n11 6\n12 6\n13 6\n14 6\n15 6\n9 8\n10 8\n11 8\n12 8\n13 8\n14 8\n15 8\n", "output": "IndSet\n9 10 11 12 13 \n"}, {"type":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a sequence a_1, a_...
[{"type": "stdin_stdout", "input": "10\n-27433367 -21216390 1 303383863 -799030648 -1 160141051 -1 -342089574 -215298491\n", "output": "28 27\n"}, {"type": "stdin_stdout", "input": "10\n4 2 -11 4 1 3 -4 9 2 3\n", "output": "28 27\n"}, {"type": "stdin_stdout", "input": "10\n4 2 -4 3 1 2 -4 3 2 3\n", "output": "28 27\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 string t_1t_2 ... t_k is goo...
[{"type": "stdin_stdout", "input": "7\nAAABABB\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "7\nBBABAAA\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "7\nBAAAABB\n", "output": "12\n"}, {"type": "stdin_stdout", "input": "7\nABABAAB\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "7\nBBAAA...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 years of hard work scienti...
[{"type": "stdin_stdout", "input": "10\n1101010101\n1110101010\n0111010101\n1011101010\n0101110101\n1010111010\n0101011101\n1010101110\n0101010111\n1010101011\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "10\n1111100000\n0010100000\n0110111000\n0000001000\n1011001010\n0010100001\n0010111000\n0011001010\n00...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCalculate the number of ways to ...
[{"type": "stdin_stdout", "input": "200000 199998\n", "output": "508670650\n"}, {"type": "stdin_stdout", "input": "200000 100000\n", "output": "668585001\n"}, {"type": "stdin_stdout", "input": "200000 132521\n", "output": "660798392\n"}, {"type": "stdin_stdout", "input": "200000 89177\n", "output": "773611800\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\nYou are given a deck of n cards ...
[{"type": "stdin_stdout", "input": "51\n51 50 16 48 47 46 45 44 43 42 41 40 39 38 37 33 35 34 36 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 49 15 14 13 12 11 10 4 8 7 6 5 9 3 2 1\n", "output": "51\n2 50 1\n2 1 50\n4 48 1 1 1\n5 1 1 1 43 5\n6 3 44 1 1 1 1\n6 1 1 1 1 1 46\n8 44 1 1 1 1 1 1 1\n8 1 1 1 1 1 1 1 44\n9 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\nOn the competitive programming p...
[{"type": "stdin_stdout", "input": "5\n5\n1 5 3 4 2\n4\n1 3 2 1\n5\n1 3 3 3 2\n10\n1 2 3 4 5 6 7 8 9 10\n3\n3 3 2\n", "output": "\n10111\n0001\n00111\n1111111111\n000\n"}, {"type": "stdin_stdout", "input": "5\n5\n1 5 3 4 2\n4\n1 3 2 1\n5\n1 3 3 3 1\n10\n1 2 3 4 5 10 7 8 9 10\n3\n3 3 2\n", "output": "10111\n0001\n00001\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPositive integer x is called div...
[{"type": "stdin_stdout", "input": "2\n14\n100\n", "output": "527\n21311\n"}, {"type": "stdin_stdout", "input": "2\n14\n110\n", "output": "527\n25199\n"}, {"type": "stdin_stdout", "input": "2\n14\n111\n", "output": "527\n25651\n"}, {"type": "stdin_stdout", "input": "2\n60\n25\n", "output": "7747\n1711\n"}, {"type": "st...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSergey attends lessons of the N-...
[{"type": "stdin_stdout", "input": "ttspivgoupgupvgpusvppogsseueusuglpiugssviuutlvgvugtpovuvspvpipggooplgvgugpogvesppulovugsvuougveiivgvslllviogpvtolepglguuellotpvgevspvoiiggiiplppgosuguvtstttpielteuglspgeoeeuivtptggltoltpgliviotsospvitupiopisoetupvvspooilsopslpoloptigstspoiuutiuvvuvlpplvioitsuvlpvtleveslslovolloogsgpv...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 inve...
[{"type": "stdin_stdout", "input": "80 6 99\n48 97 9 77 73 21 86 78 48 5 71 16 42 67 90 27 30 52 41 86 53 4 60 17 66 38 94 46 51 51 70 11 1 16 74 53 17 12 82 95 51 33 83 70 45 27 90 57 67 2 68 15 20 61 47 90 11 5 95 33 69 35 79 51 95 45 10 17 12 88 93 43 31 31 85 68 85 81 70 43\n47 92 59 85 73 38\n", "output": "95 38 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\nYou've got a list of program war...
[{"type": "stdin_stdout", "input": "60 3\n2012-03-16 16:15:25: Disk size is\n2012-03-16 16:15:25: Network failute\n2012-03-16 16:16:29: Cant write varlog\n2012-03-16 16:16:42: Unable to start process\n2012-03-16 16:16:43: Disk size is too small\n2012-03-16 16:16:53: Timeout detected\n", "output": "2012-03-16 16:16:43\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\nEmuskald is an avid horticulturi...
[{"type": "stdin_stdout", "input": "20 15\n7 8720.017100830131\n2 13067.215819731118\n8 58623.690996\n9 184322.3412850205\n6 227999.61123331118\n2 279836.330518\n9 282807.34217112145\n2 311057.23684687156\n1 312315.562927\n5 459200.373445\n14 563454.265947\n11 647366.9355815595\n13 679761.613732\n4 684192.647497\n3 733...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nShaass has decided to hunt some ...
[{"type": "stdin_stdout", "input": "100\n54 15 25 18 64 62 23 59 70 137 50 26 87 35 75 86 0 22 6 60 70 41 21 9 75 50 25 3 69 14 39 68 64 46 59 99 2 0 21 76 90 12 61 42 12 91 36 39 47 41 93 81 66 57 70 36 68 89 52 1 19 93 67 22 76 20 8 81 123 18 100 73 61 93 75 80 53 72 40 20 2 86 33 70 27 16 11 26 55 44 47 55 94 58 2 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\nVasya and Petya wrote down all i...
[{"type": "stdin_stdout", "input": "1000000000\n", "output": "Vasya\n"}, {"type": "stdin_stdout", "input": "1000000001\n", "output": "Vasya\n"}, {"type": "stdin_stdout", "input": "0000000001\n", "output": "Vasya\n"}, {"type": "stdin_stdout", "input": "947039074\n", "output": "Vasya\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\nLet's call a number k-good if it...
[{"type": "stdin_stdout", "input": "10 6\n1234560\n1234560\n1234560\n1234560\n1234560\n1234560\n1234560\n1234560\n1234560\n1234560\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "10 6\n2416023\n1234560\n1234560\n1234560\n1234560\n1234560\n1234560\n1234560\n1234560\n1234560\n", "output": "9\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\nSalve, mi amice.\n\nEt tu quidem...
[{"type": "stdin_stdout", "input": "100 100 100 100 100\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "100 110 100 100 100\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "100 110 100 110 100\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "60 120 82 71 53\n", "output": "10\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\nPashmak's homework is a problem ...
[{"type": "stdin_stdout", "input": "10 12\n1 2 2\n2 1 2\n1 3 1\n3 1 1\n1 4 1\n4 1 1\n2 3 1\n3 2 1\n2 4 1\n4 2 1\n3 4 2\n4 3 2\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "4 12\n1 2 2\n2 1 2\n1 3 1\n3 1 1\n1 4 1\n4 1 1\n2 3 1\n3 2 1\n2 4 1\n4 2 1\n3 4 2\n4 3 2\n", "output": "2\n"}, {"type": "stdin_stdout", "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nShuseki Kingdom is the world's l...
[{"type": "stdin_stdout", "input": "7 13\n6 1\n7 2\n3 7\n6 5\n3 6\n7 4\n3 5\n4 1\n3 1\n1 5\n1 6\n4 2\n2 4\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "7 13\n6 1\n7 2\n3 7\n6 5\n3 6\n7 4\n3 7\n4 1\n3 1\n1 5\n1 6\n4 2\n2 4\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "7 13\n6 1\n7 2\n3 7\n6 5\n3 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\nThere are many anime that are ab...
[{"type": "stdin_stdout", "input": "28567 13\n28079 24675 1\n18409 26720 1\n980 10815 1\n20794 16571 1\n7376 19861 1\n10805 706 1\n4255 16391 1\n27376 18263 1\n10019 28444 1\n6574 28053 1\n5036 16610 1\n3543 7122 1\n512 9554 1\n", "output": "928433852\n"}, {"type": "stdin_stdout", "input": "28567 13\n28079 24675 1\n184...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWhen Kefa came to the restaurant...
[{"type": "stdin_stdout", "input": "18 17 16\n298794979 56088167 220017066 212013239 193074498 269869999 238524920 107690830 236214025 114513789 305713075 41451289 198089336 246759776 267311824 142373649 312495533 217782770\n9 4 70536531\n13 14 235114377\n18 4 38527037\n3 7 39141694\n1 17 15392162\n6 17 35451325\n17 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\nIn Absurdistan, there are n town...
[{"type": "stdin_stdout", "input": "4 6\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "10 5\n2 5\n1 2\n1 4\n1 3\n3 2\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "5 5\n4 2\n3 5\n4 5\n5 1\n1 2\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "4 5\n1 3\n2 1\n3 4...
code_stdio