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 and Bob are playing One Ca...
[{"type": "stdin_stdout", "input": "-1 -4", "output": "Alice\n"}, {"type": "stdin_stdout", "input": "-2 -3", "output": "Alice\n"}, {"type": "stdin_stdout", "input": "-2 -4", "output": "Alice\n"}, {"type": "stdin_stdout", "input": "-2 -6", "output": "Alice\n"}, {"type": "stdin_stdout", "input": "-2 -8", "output": "Alice...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 participants in the ...
[{"type": "stdin_stdout", "input": "12 14 3\ncaababaccaba", "output": "No\nYes\nYes\nYes\nYes\nYes\nYes\nNo\nNo\nYes\nYes\nYes\n"}, {"type": "stdin_stdout", "input": "12 14 3\nabaccababaac", "output": "Yes\nYes\nYes\nNo\nNo\nYes\nYes\nYes\nYes\nYes\nYes\nNo\n"}, {"type": "stdin_stdout", "input": "12 16 2\ncabbabaacaaa"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 one card each with the ...
[{"type": "stdin_stdout", "input": "1 2 3\n4 1 10\n5 1 10", "output": "YES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "1 2 3\n5 6 10\n4 9 10", "output": "YES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "1 2 3\n7 1 10\n5 1 10", "output": "YES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "1 4 3\n5 6 10\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\nDr. Sato, a botanist, invented a...
[{"type": "stdin_stdout", "input": "3 3\n1.8036677694351575 3.7376015310643522 0.9359006248557373\n4.789021816134845 2.456993805979323 1.0\n3.0 1.470921439035275 1.5624820640788264\n2 7\n1.2643980385584639 1.3805003041132355\n2.3877376705228617 1.9499455465451372\n0 0", "output": "17.90\n67.31\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\nEkiden competitions are held eve...
[{"type": "stdin_stdout", "input": "7 11\n2 4 2\n1 6 2\n2 4 2\n1 5 10\n2 6 2\n6 4 1\n6 5 1\n3 6 1\n4 7 0\n5 5 6\n6 7 1", "output": "4\n3\n4\n5\n7\n"}, {"type": "stdin_stdout", "input": "7 11\n2 1 2\n1 3 1\n2 3 2\n3 4 4\n2 6 1\n4 4 1\n3 5 2\n3 6 1\n4 7 3\n5 7 7\n6 7 1", "output": "4\n1\n2\n6\n7\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\nproblem\n\nJOI took six subjects...
[{"type": "stdin_stdout", "input": "100\n-3\n8\n108\n-12\n-4", "output": "212\n"}, {"type": "stdin_stdout", "input": "100\n-7\n8\n108\n-12\n-1", "output": "215\n"}, {"type": "stdin_stdout", "input": "100\n66\n-13\n-1\n-2\n2", "output": "167\n"}, {"type": "stdin_stdout", "input": "100\n106\n-5\n-1\n-2\n3", "output": "20...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSeiji Hayashi had been a profess...
[{"type": "stdin_stdout", "input": "16\n10 8\n2 2\n2 6\n2 7\n6 6\n4 8\n4 2\n5 5\n4 8\n10 2\n6 7\n7 7\n7 8\n8 1\n5 4\n9 1\n10 3\n4 3\n8\n6 4\n2 2\n2 1\n2 4\n3 4\n4 2\n5 3\n1 1\n3 2\n3 3\n0", "output": "5\n5\n"}, {"type": "stdin_stdout", "input": "16\n10 9\n2 4\n2 6\n2 7\n6 6\n4 8\n4 2\n5 5\n4 8\n6 4\n6 7\n7 6\n7 8\n8 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\nOne of the questions children of...
[{"type": "stdin_stdout", "input": "3\n101 0 500\n-500.243 -199.7339381714296 -300.2711264812515\n0 176 354\n2\n0 1 1 1.1788431079539103\n-1 0 2 1.57\n3\n1 1 0\n0 1 0\n2 0 1\n4\n1 -2 -1 0.9553\n1 0 -1 0.9554\n-2 -2 1 0.9553\n-2 0 -1 0.9554\n3\n1 0 0\n1 2 0\n0 0 1\n4\n1 -1 -1 2.346642102923443\n-1 4 -1 2.792119841628054...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIncome Inequality\n\nWe often co...
[{"type": "stdin_stdout", "input": "7\n27 15 2 15 15 23 15\n4\n10 20 30 5\n1\n1 1 1 2 1 1 1 0 1 110\n7\n90 122 90 90 90 9 10\n7\n2 8 2 8 2 11 8\n0", "output": "5\n2\n1\n1\n2\n1\n1\n2\n3\n"}, {"type": "stdin_stdout", "input": "7\n27 15 2 18 15 23 15\n4\n10 20 30 5\n1\n1 1 1 2 1 1 1 0 1 110\n7\n90 122 90 90 90 5 10\n7\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\nIkta, who hates to lose, has rec...
[{"type": "stdin_stdout", "input": "...............\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\nproblem\n\nGiven the lengths of ...
[{"type": "stdin_stdout", "input": "-23 -12", "output": "-7238.229473871\n"}, {"type": "stdin_stdout", "input": "-26 -9", "output": "-3053.628059289\n"}, {"type": "stdin_stdout", "input": "-74 -8", "output": "-2144.660584851\n"}, {"type": "stdin_stdout", "input": "-11 -4", "output": "-268.082573106\n"}, {"type": "stdin...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor a dynamic array $A = \\\\{a_...
[{"type": "stdin_stdout", "input": "8\n0 -1\n0 14\n0 1\n2\n0 4\n1 0\n1 0\n1 1", "output": "-1\n-1\n14\n"}, {"type": "stdin_stdout", "input": "8\n0 -1\n0 9\n1 1\n2\n0 4\n1 0\n1 0\n1 1", "output": "9\n-1\n-1\n4\n"}, {"type": "stdin_stdout", "input": "8\n0 -1\n0 2\n0 3\n2\n0 4\n1 0\n1 0\n1 0", "output": "-1\n-1\n-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\nBajtek, known for his unusual gi...
[{"type": "stdin_stdout", "input": "100\n57 81 176 211 251 311 346 404 469 506 563 587 682 717 757 817 852 910 975 1012 1069 1093 1188 1223 1263 1323 1358 1416 1481 1518 1575 1599 1694 1729 1769 1829 1864 1922 1987 2024 2081 2105 2200 2235 2275 2335 2370 2428 2493 2530 2587 2611 2706 2741 2781 2841 2876 2934 2999 3036 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 telephone number is a sequence...
[{"type": "stdin_stdout", "input": "109\n8800880880088088880888808880888088800880888088088088888080880000080000800000808008008800080008000888000808880\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "109\n194738436769545519120557423157544990694461710781832332842159709627880402291528792654921639807013409671450...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSeryozha conducts a course dedic...
[{"type": "stdin_stdout", "input": "3000 3000 10 4\n122375063 551934841 132649021 999999937\n", "output": "218197599525055\n"}, {"type": "stdin_stdout", "input": "3000 3000 4 10\n623629309 917769297 890844966 987654319\n", "output": "215591588260257\n"}, {"type": "stdin_stdout", "input": "3000 3000 1000 1000\n794639486...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 chips on a numbe...
[{"type": "stdin_stdout", "input": "66\n17474 17509 20550 10873 31311 10156 24680 28012 29609 8266 18126 20151 648 2722 13599 9467 8289 17005 1 31436 21443 265 21543 32682 11647 30228 15498 1331 8459 20026 24054 23702 15400 7243 3017 10315 451 22673 6648 30210 27673 27232 4178 13529 23071 28654 8969 23505 27681 14437 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\nAlice got many presents these da...
[{"type": "stdin_stdout", "input": "1000000000 1000000000\n", "output": "751201557\n"}, {"type": "stdin_stdout", "input": "534571158 222043261\n", "output": "212941625\n"}, {"type": "stdin_stdout", "input": "922338645 900544285\n", "output": "187784871\n"}, {"type": "stdin_stdout", "input": "188186551 379116090\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\nLong is a huge fan of CFC (Codef...
[{"type": "stdin_stdout", "input": "4\n3 5 3\n..R..\n...R.\n....R\n6 4 6\nR..R\nRR..\nRRRR\nRRRR\nR..R\nR..R\n5 5 12\nRRR..\nR.R..\nRRR..\nRR...\nR...R\n2 31 62\nRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\nRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\n", "output": "aaabb\ncccbb\nccccc\naaaa\nbaaa\nbbcc\ndddc\neeee\nffff\nabcdd\needdd\nfghii\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given n integers. You ne...
[{"type": "stdin_stdout", "input": "15\n6 7 11 8 13 11 4 20 17 12 9 15 18 13 9\n", "output": "15\n3 5\n13 11 20 15 7 \n6 13 9 18 12 \n8 4 11 9 17 \n"}, {"type": "stdin_stdout", "input": "15\n17 5 20 11 14 9 5 12 10 11 5 6 1 12 18\n", "output": "15\n3 5\n5 12 11 17 9 \n6 5 12 20 14 \n10 1 5 11 18 \n"}, {"type": "stdin_s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp is preparing the first ...
[{"type": "stdin_stdout", "input": "100\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 lot of people associate Logo p...
[{"type": "stdin_stdout", "input": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\n50\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\n40\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\nThere are n piles of stones, whe...
[{"type": "stdin_stdout", "input": "7\n3\n2 5 10\n8\n1 2 1 1 1 1 1 1\n6\n2 2 5 4 5 6\n6\n1 1 2 1 2 1\n1\n1000000000\n5\n1 4 2 1 1\n3\n1 1 1\n", "output": "First \nSecond\nFirst \nFirst \nFirst \nSecond\nFirst \n"}, {"type": "stdin_stdout", "input": "7\n3\n2 5 10\n8\n1 2 1 1 1 1 1 1\n6\n2 2 5 4 5 6\n6\n1 1 2 1 2 1\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\nLately, Mr. Chanek frequently pl...
[{"type": "stdin_stdout", "input": "2\n18\n122\n", "output": "14\n114\n"}, {"type": "stdin_stdout", "input": "2\n20\n122\n", "output": "15\n114\n"}, {"type": "stdin_stdout", "input": "2\n12\n122\n", "output": "9\n114\n"}, {"type": "stdin_stdout", "input": "2\n10\n122\n", "output": "8\n114\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\nA sequence of non-negative integ...
[{"type": "stdin_stdout", "input": "5\n4\n4 3 7 20\n4\n1 2 4 5\n5\n1 0 3 4 5\n4\n11 16 15 1\n1\n0\n", "output": "0 4 0 3\n0 1 3 2\n0 1 0 3 2\n0 11 16 30\n0\n"}, {"type": "stdin_stdout", "input": "5\n4\n4 3 7 20\n4\n1 2 4 5\n5\n1 0 3 6 5\n4\n11 16 15 1\n1\n0\n", "output": "0 4 0 3\n0 1 3 2\n0 1 0 1 2\n0 11 16 30\n0\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\nAfter a team finished their trai...
[{"type": "stdin_stdout", "input": "10894 92356\n", "output": "46178\n46179\n46177\n46180\n46176\n46181\n46175\n46182\n46174\n46183\n46173\n46184\n46172\n46185\n46171\n46186\n46170\n46187\n46169\n46188\n46168\n46189\n46167\n46190\n46166\n46191\n46165\n46192\n46164\n46193\n46163\n46194\n46162\n46195\n46161\n46196\n46160...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 is an amateur busines...
[{"type": "stdin_stdout", "input": "1000000000000000000 999999999999999999\n", "output": "999999999999999999\n"}, {"type": "stdin_stdout", "input": "1000010000000000000 999999999999999999\n", "output": "999999999999999999\n"}, {"type": "stdin_stdout", "input": "999999999999999998 999999999999999997\n", "output": "89999...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nValera has n counters numbered f...
[{"type": "stdin_stdout", "input": "15 31\n8 11\n7 14\n12 8\n2 1\n6 4\n3 11\n3 1\n8 9\n3 8\n15 5\n5 11\n9 10\n8 6\n1 10\n1 14\n1 8\n11 12\n14 15\n7 9\n7 3\n13 14\n3 2\n3 4\n4 5\n14 5\n6 14\n15 7\n11 13\n15 1\n10 7\n5 11\n5 3 7 4 1 0 0 3 3 1 6 3 2 0 3\n", "output": "3\n6 7 10 \n"}, {"type": "stdin_stdout", "input": "15 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nManao is trying to open a rather...
[{"type": "stdin_stdout", "input": "2000\n", "output": "1333335000\n"}, {"type": "stdin_stdout", "input": "1837\n", "output": "1033182073\n"}, {"type": "stdin_stdout", "input": "1999\n", "output": "1331335999\n"}, {"type": "stdin_stdout", "input": "1241\n", "output": "318541121\n"}, {"type": "stdin_stdout", "input": "1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe famous joke programming lang...
[{"type": "stdin_stdout", "input": "HQQQQQQQHQQQQHQHQQQHHQHHHQQHQQQQHHQHHQHHHHHHQQQQQQQQHHQQQQQHHQQQQHHHQQQQQQQQHQQQHQHQQQQQQHHHQHHQHQHHQQQQQHQQHQHQQQHQHQHHHHQQHQHQQQQQHQQQHQQQHQQHQHQQHQQQQQQ\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "HQQQQQQQHQQQQHQHQQQHHQHHHQQHQQQQHHQHHQHHHHHHQQQQQQQQHHQQQQQHHQQHQHHHQQ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nXenia lives in a city that has n...
[{"type": "stdin_stdout", "input": "100 100\n48 73 63 16 49 88 36 17 66 6 87 13 94 52 58 70 71 52 7 70 25 42 24 36 57 9 79 26 75 39 13 14 38 26 33 66 88 28 75 98 53 48 67 54 63 25 69 87 88 32 72 17 36 35 29 67 74 89 70 47 20 90 78 13 94 57 32 73 29 74 45 78 85 64 81 56 12 65 19 67 34 86 55 71 41 33 76 13 100 47 44 76 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\nThe bear has a string s = s1s2.....
[{"type": "stdin_stdout", "input": "pbearjbearbebearnbabcffbearbearwubearjezpiorrbearbearjbdlbearbearqbearjbearwipmsbearoaftrsebearzsnqb\n", "output": "4419\n"}, {"type": "stdin_stdout", "input": "pbearjbearbebfarnbabcffbearbearwubearjezpiorrbearbearjbdlbearbearqbearjbearwipmsbearoaftrsebearzsnqb\n", "output": "4353\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\nLittle Chris is a huge fan of li...
[{"type": "stdin_stdout", "input": "5\n1 0 1 0 1\n0 1 0 1 0\n1 0 1 0 1\n0 1 0 1 0\n1 0 1 0 1\n7\n3\n2 4\n1 3\n3\n2 5\n1 2\n3\n", "output": "111\n"}, {"type": "stdin_stdout", "input": "5\n1 0 1 1 1\n0 1 0 1 0\n1 0 1 1 1\n0 1 0 1 0\n1 0 1 0 0\n7\n3\n2 4\n1 3\n3\n2 5\n1 1\n3\n", "output": "000\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\nKuriyama Mirai has killed many m...
[{"type": "stdin_stdout", "input": "56\n43 100 44 66 65 11 26 75 96 77 5 15 75 96 11 44 11 97 75 53 33 26 32 33 90 26 68 72 5 44 53 26 33 88 68 25 84 21 25 92 1 84 21 66 94 35 76 51 11 95 67 4 61 3 34 18\n27\n1 20 38\n1 11 46\n2 42 53\n1 8 11\n2 11 42\n2 35 39\n2 37 41\n1 48 51\n1 32 51\n1 36 40\n1 31 56\n1 18 38\n2 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\nn participants of the competitio...
[{"type": "stdin_stdout", "input": "1011000000 0001000\n", "output": "511059994500000 511059489505999500\n"}, {"type": "stdin_stdout", "input": "1011100000 0001000\n", "output": "511161099450000 511160594406049500\n"}, {"type": "stdin_stdout", "input": "1011110000 0001000\n", "output": "511171210495000 5111707054460545...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNew Year is coming in Tree World...
[{"type": "stdin_stdout", "input": "10\n1 2 938\n1 6 23\n1 10 727\n1 9 814\n9 5 644\n8 5 39\n2 7 999\n1 3 666\n5 4 577\n10\n9 1099\n5 64\n4 318\n3 373\n4 548\n7 219\n5 43\n5 27\n3 155\n8 359\n", "output": "5336.333333333333\n4524.333333333333\n3730.733333333333\n3518.3333333333335\n3886.3333333333335\n3418.333333333333...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOm Nom is the main character of ...
[{"type": "stdin_stdout", "input": "6\n87 62 58 32 81 92 12 50 23 27 38 39 64 74 16 35 84 59 91 87 14 48 90 47 44 95 64 45 31 11 67 5 80 60 36 15 91 3 21 2 40 24 37 69 5 50 23 37 49 19 68 21 49 9 100 94 45 41 22 31 31 48 25 70 25 25 95 88 82 1 37 53 49 31 57 74 94 45 55 93 43 37 13 85 59 72 15 68 3 90 96 55 100 64 63 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\nProfessor GukiZ is concerned abo...
[{"type": "stdin_stdout", "input": "5 3\n999999999 999999999 999999999 999999999 19992232\n", "output": " 1339997413"}, {"type": "stdin_stdout", "input": "19 100000\n1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1\n", "output": " ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlmost every text editor has a b...
[{"type": "stdin_stdout", "input": "8\n\n\n\ny\nW\n\n\n\n3B\n\nw\nV\n\n\n\nL\nSr\n\n\nV\n\n5\n\nAq\n\n\n\nJ\nR\n\n04\nJ\nv\nUh\n\n\n\nY\nG\n4\n\nG\nb\n\n\n9\n\n6\nd\n\n2\n\n\nE\n7\n\nr\n\n\n\n\nKC\ns\nE\n\nab\n4\nx\n\n\n\n\n\nEe\n4\n\nl\n\np\n\nG\nM\n\n\nn\n\n\nm0\n\nw\n\n\nP\n\n\n\n0\n\n\n", "output": "****\n*8 *\n* ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are b blocks of digits. Ea...
[{"type": "stdin_stdout", "input": "100 1000000000 42 97\n2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 1 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2\n", "output": "253082707\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\nOn her way to programming school...
[{"type": "stdin_stdout", "input": "100 100\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "100 101\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "110 111\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "111 111\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "100 99\n", "outp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDO YOU EXPECT ME TO FIND THIS OU...
[{"type": "stdin_stdout", "input": "10\n5 5 10 10 10 2 4 3 4 10\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "10\n5 5 10 10 10 1 4 3 4 10\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "10\n3 5 10 10 10 1 4 3 4 10\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "10\n3 5 10 10 10 1 4 3 5 10\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 the beginning of the new year...
[{"type": "stdin_stdout", "input": "89946\n", "output": "aabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaab...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasily has a deck of cards consi...
[{"type": "stdin_stdout", "input": "100\n12 9 97 55 14 8 55 34 35 67 3 18 73 92 41 49 15 60 18 66 9 26 97 47 43 88 71 97 19 63 48 96 79 53 8 47 69 49 21 23 77 12 21 176 66 9 29 13 61 69 54 77 10 13 4 68 37 74 7 6 29 76 55 72 89 4 78 27 29 82 18 83 12 4 32 69 89 85 66 13 92 54 38 5 26 56 17 55 29 4 17 39 29 94 3 67 85 7...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given set of n points in...
[{"type": "stdin_stdout", "input": "11\n358 -724 -232 53 -520\n486 -554 -328 53 -220\n358 -554 -232 -372 -520\n358 -554 -232 308 -520\n868 -554 448 53 -520\n478 -554 -322 53 -600\n358 296 -232 53 -520\n256 -554 -368 53 -520\n230 -554 -136 53 -820\n-182 -554 173 53 -160\n358 -554 -232 53 -520\n", "output": "1\n11\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\nOnce upon a time in the galaxy o...
[{"type": "stdin_stdout", "input": "-47 -7 -43 5 -8 -10 13\n13\n-7 -40 -34 5 3\n6 -2 3\n-1 -1 -4\n-6 -1 2\n-36 45 33 10 2\n-4 -6 1\n0 -14 -5\n14 -15 6 1 3\n-1 -1 0\n1 -1 -1\n0 -1 1\n9 -32 10 6 2\n-1 6 -1\n-4 -2 -5\n45 -31 2 11 2\n0 14 8\n-12 -11 0\n-5 35 -3 7 2\n-9 1 1\n-3 -9 1\n-17 -13 -6 2 1\n2 0 1\n-45 -41 16 10 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\nInstructors of Some Informatics ...
[{"type": "stdin_stdout", "input": "100 3 30\n20 10 8 3 97 20 40 4 58 24 105 56 26 21 66 1 126 4 21 46 8 2 9 21 0 13 24 53 58 23 3 107 1 22 189 3 31 4 31 0 3 0 9 43 19 74 92 7 71 22 46 26 31 49 18 3 10 9 9 110 30 2 40 21 33 4 11 14 47 4 1 37 3 19 18 63 10 53 19 35 11 57 8 3 11 27 23 5 45 15 127 27 23 48 3 8 20 33 5 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\nGiven an array A(A0, A1…. An-1) ...
[{"type": "stdin_stdout", "input": "1000 2 997 1000\n30018 884 323 24597 1680 10042 12834 3877 29077 17866 24269 31308 15852 5031 18387 1451 3518 32420 26307 15204 7734 31889 4673 12125 11316 11545 10328 20545 4422 21227 13074 18888 11476 26648 15174 23609 28058 20924 15794 19757 3931 30433 30281 21909 24788 16032 3015...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Monk wants to teach all its ...
[{"type": "stdin_stdout", "input": "30\n317 36 191 1392 377 107 41 1092 229 503 447 1442 481 719 551 351 11 10 394 207 630 78 113 955 673 728 4773 567 1432 309", "output": "387621135\n"}, {"type": "stdin_stdout", "input": "30\n317 36 191 1392 100 107 41 1092 88 503 447 1442 1694 719 551 351 11 10 766 207 630 78 113 955...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSnuke is standing on a two-dimen...
[{"type": "stdin_stdout", "input": "139 159 2856 1003", "output": "588676804\n"}, {"type": "stdin_stdout", "input": "139 307 16230 589", "output": "518297224\n"}, {"type": "stdin_stdout", "input": "314 159 2856 589", "output": "373278476\n"}, {"type": "stdin_stdout", "input": "139 159 2856 589", "output": "507735392\n"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is an integer sequence A o...
[{"type": "stdin_stdout", "input": "6\n0 153 10 14 23", "output": "57\n"}, {"type": "stdin_stdout", "input": "6\n0 153 10 14 17", "output": "51\n"}, {"type": "stdin_stdout", "input": "6\n0 153 10 14 26", "output": "60\n"}, {"type": "stdin_stdout", "input": "6\n0 153 10 10 23", "output": "53"}, {"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 bags of biscuits. Th...
[{"type": "stdin_stdout", "input": "45 1\n17 55 85 55 74 20 90 67 40 121 39 178 91 50 16 38 14 43 24 68 25 9 89 71 41 16 53 11 61 15 85 72 62 67 42 26 36 66 4 87 59 91 4 24 26", "output": "17592186044416\n"}, {"type": "stdin_stdout", "input": "45 1\n17 55 85 55 74 20 90 67 40 121 39 178 91 50 16 38 14 43 24 68 25 9 89 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSnuke has decided to play with N...
[{"type": "stdin_stdout", "input": "2000 1000", "output": "674286644"}, {"type": "stdin_stdout", "input": "2000 1100", "output": "270390985"}, {"type": "stdin_stdout", "input": "2000 1001", "output": "353739079"}, {"type": "stdin_stdout", "input": "2000 0100", "output": "973529324"}, {"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\nOne day, Snuke was given a permu...
[{"type": "stdin_stdout", "input": "8\n5 3 8 1 2 6 7 4", "output": "84\n"}, {"type": "stdin_stdout", "input": "8\n4 5 8 1 2 6 7 3", "output": "86\n"}, {"type": "stdin_stdout", "input": "8\n5 4 8 1 2 6 7 3", "output": "85"}, {"type": "stdin_stdout", "input": "4\n2 3 1 4", "output": "17\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\nObesity is cited as the cause of...
[{"type": "stdin_stdout", "input": "1011,50.0,1.60\n1002,60.1,0.70\n1003,60.0,0.80\n1004,80.0,1.71\n1005,90.0,1.60", "output": "1002\n1003\n1004\n1005\n"}, {"type": "stdin_stdout", "input": "1011,50.0,1.60\n1102,60.1,0.70\n1003,60.0,0.80\n1004,80.0,1.71\n1005,80.0,1.60", "output": "1102\n1003\n1004\n1005\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\nRelative B came to Mr. A's house...
[{"type": "stdin_stdout", "input": "20 21\n1 0\n14 8\n7\n4 0 1 1\n6 -1 1 3\n2 0 3 3\n1 0 5 0\n5 1 7 3\n2 -1 2 7\n2 -1 6 8\n20 20\n9 9\n1 1\n6\n2 0 1 1\n1 0 5 0\n2 1 1 4\n5 0 1 0\n4 1 6 10\n4 0 8 5\n0 0", "output": "NG\nNG\n"}, {"type": "stdin_stdout", "input": "20 21\n1 0\n14 8\n7\n4 0 1 1\n6 -1 1 3\n2 0 3 3\n1 0 5 0\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 this problem, we consider a s...
[{"type": "stdin_stdout", "input": "a[3]\na[0]=a[1]\n.\nx[1]\nx[0]=x[0]\n.\na[0]\na[0]=1\n.\nb[2]\nb[0]=2\nb[1]=b[b[0]]\nb[0]=b[1]\n.\ng[2]\nG[10]\ng[0]=0\ng[1]=G[0]\n.\na[2147483647]\na[0]=1\nB[2]\nB[a[0]]=2\na[B[a[0]]]=3\na[2147483646]=b[2]\n.\n.", "output": "2\n2\n2\n3\n4\n6\n"}, {"type": "stdin_stdout", "input": "a...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 rabbit Taro decided to hold a ...
[{"type": "stdin_stdout", "input": "0 5\n-2 2 0\n1 3 6\n2 -1 8\n5 1 10\n1 2 2", "output": "0\n"}, {"type": "stdin_stdout", "input": "0 5\n-2 2 0\n1 3 6\n2 -1 8\n5 1 10\n1 3 2", "output": "0\n"}, {"type": "stdin_stdout", "input": "0 5\n-2 2 0\n1 3 6\n2 -1 8\n5 1 10\n1 3 4", "output": "0\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\nFor a given polygon g and target...
[{"type": "stdin_stdout", "input": "4\n3 0\n15 -1\n0 1\n-1 0\n3\n-1 -2\n1 0\n-1 -1", "output": "0\n1\n0\n"}, {"type": "stdin_stdout", "input": "4\n3 0\n8 -1\n0 1\n-1 2\n3\n-1 -2\n0 -1\n0 -1", "output": "0\n0\n0\n"}, {"type": "stdin_stdout", "input": "4\n-1 -1\n4 -2\n3 -1\n1 4\n2\n0 1\n1 0\n-2 1", "output": "2\n2\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 a sequence of integers $A = ...
[{"type": "stdin_stdout", "input": "4\n-2 -1 1 2", "output": "-2 -1 1 2\n"}, {"type": "stdin_stdout", "input": "4\n-2 -1 0 2", "output": "-2 -1 0 2\n"}, {"type": "stdin_stdout", "input": "4\n-2 -1 0 4", "output": "-2 -1 0 4\n"}, {"type": "stdin_stdout", "input": "4\n-1 0 1 10", "output": "-1 0 1 10\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\nThe executive chef is trying to ...
[{"type": "stdin_stdout", "input": "5\n6 2\n4 -1\n0 28\n3 1\n0 76", "output": "2\n3\n25\n28\n104\n"}, {"type": "stdin_stdout", "input": "5\n0 2\n0 -1\n12 11\n4 1\n5 25", "output": "2\n3\n10\n11\n34\n"}, {"type": "stdin_stdout", "input": "5\n0 2\n2 1\n12 20\n4 0\n13 11", "output": "2\n1\n17\n17\n28\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\nA plane is flying at a constant ...
[{"type": "stdin_stdout", "input": "2 1000000000\n304257720 349183572\n464960891 551998862\n", "output": "1131963823\n"}, {"type": "stdin_stdout", "input": "2 1000000000\n231403049 328821611\n335350528 883433844\n", "output": "1645501878\n"}, {"type": "stdin_stdout", "input": "2 1000000000\n205773571 705350420\n8847841...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 non-empty string is called pal...
[{"type": "stdin_stdout", "input": "21\narozaupalanalapuazora\n", "output": "aaaaaaaallnoopprruuzz\n"}, {"type": "stdin_stdout", "input": "16\ngagadbcgghhchbdf\n", "output": "aabbccddfgggghhh\n"}, {"type": "stdin_stdout", "input": "15\nabacabadabacaba\n", "output": "aaaaaaaabbbbccd\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 Squareland national forest i...
[{"type": "stdin_stdout", "input": "0 1000\n1000 0\n1000 1000\n", "output": "2001\n0 1000\n1 1000\n2 1000\n3 1000\n4 1000\n5 1000\n6 1000\n7 1000\n8 1000\n9 1000\n10 1000\n11 1000\n12 1000\n13 1000\n14 1000\n15 1000\n16 1000\n17 1000\n18 1000\n19 1000\n20 1000\n21 1000\n22 1000\n23 1000\n24 1000\n25 1000\n26 1000\n27 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\nLunar New Year is approaching, a...
[{"type": "stdin_stdout", "input": "14\nXXX.XXXXX..X.X\nX..XX..X...X..\n.....X.XX..XXX\n.X..X..XXX.XX.\n...XXXX.XX..XX\n.X..XX...XXX..\nXX.XX.XX..XXX.\n.X..X.....X.XX\n...XXX...XX.XX\nXXX.XX.XX.X.XX\nX.XXXX..XX.XX.\n.X.XX....X....\nX..XX..X.XX.X.\n..X...XX....XX\n", "output": "2"}, {"type": "stdin_stdout", "input": "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\nInternational Women's Day is com...
[{"type": "stdin_stdout", "input": "8 2\n1 2 2 3 2 4 6 10\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "8 2\n2 2 2 2 2 4 6 10\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "8 2\n1 2 2 2 2 4 6 10\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "8 2\n2 2 2 2 2 4 7 10\n", "output": "6\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\nThis is an interactive problem.\...
[{"type": "stdin_stdout", "input": "1000\n2\n2 998\n2 530\n", "output": "? 1 1 1 1000\n? 1 1 2 1000\n? 1 1 3 1000\n? 1 1 4 1000\n? 1 1 5 1000\n? 1 1 6 1000\n? 1 1 7 1000\n? 1 1 8 1000\n? 1 1 9 1000\n? 1 1 10 1000\n? 1 1 11 1000\n? 1 1 12 1000\n? 1 1 13 1000\n? 1 1 14 1000\n? 1 1 15 1000\n? 1 1 16 1000\n? 1 1 17 1000\n?...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an array a_1, a_2,...
[{"type": "stdin_stdout", "input": "7 6\n-6 1 -1 -1 -2 -4 -1\n", "output": "-43\n"}, {"type": "stdin_stdout", "input": "7 7\n-3 0 -1 -2 -2 -4 -1\n", "output": "-55\n"}, {"type": "stdin_stdout", "input": "7 6\n-5 1 -1 -1 -2 -4 -1\n", "output": "-42\n"}, {"type": "stdin_stdout", "input": "7 6\n-3 0 -1 -2 -2 -4 -1\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\nYou are given three strings s, t...
[{"type": "stdin_stdout", "input": "1\naaaaaabbbbbbbbcccccccccccdddd\naaaaabbbbbbccccccccddddddddd\naaaaabbbbbbbbbcccccccccddddd\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "1\naaaaaabbbbbbbbcccccccccccdddd\naaaaabbbbbbccccccccddddddddd\ndddddcccccccccbbbbbbbbbaaaaa\n", "output": "NO\n"}, {"type": "stdin_s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a robot on a coordinate...
[{"type": "stdin_stdout", "input": "4\n4\nLRUD\n4\nLURD\n5\nRRUDU\n5\nLRDDL\n", "output": "1 2 \n1 4 \n3 4 \n1 2 \n"}, {"type": "stdin_stdout", "input": "4\n4\nLRUD\n4\nLURD\n5\nRURDU\n5\nLRDDL\n", "output": "1 2 \n1 4 \n4 5 \n1 2 \n"}, {"type": "stdin_stdout", "input": "4\n4\nDURL\n4\nLURD\n5\nUDURR\n5\nLRDDL\n", "out...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n boys and m girls att...
[{"type": "stdin_stdout", "input": "30 30 30\n", "output": "118264581548187697"}, {"type": "stdin_stdout", "input": "30 29 19\n", "output": "1396982287132530\n"}, {"type": "stdin_stdout", "input": "30 30 19\n", "output": "2044156982307300\n"}, {"type": "stdin_stdout", "input": "30 29 42\n", "output": "277508869722315\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\nPolycarp wants to buy exactly n ...
[{"type": "stdin_stdout", "input": "10\n208790602 104395300\n208790602 104395300\n208790602 104395300\n208790602 104395300\n208790602 104395300\n208790602 104395300\n208790602 104395300\n208790602 104395300\n208790602 104395300\n208790602 104395300\n", "output": "104395301\n104395301\n104395301\n104395301\n104395301\n1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have a set of n discs, the i...
[{"type": "stdin_stdout", "input": "10 10\n2 10 8 7 9 3 4 6 5 1\n10 4\n10 1\n10 6\n10 8\n10 2\n10 9\n10 7\n10 3\n10 5\n", "output": "9\n9\n9\n8\n7\n6\n6\n4\n2\n0\n"}, {"type": "stdin_stdout", "input": "10 10\n2 10 8 7 9 3 4 6 5 1\n9 4\n10 1\n10 6\n10 8\n10 2\n10 9\n10 7\n10 3\n10 5\n", "output": "9\n9\n9\n9\n8\n7\n6\n4...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have a multiset containing s...
[{"type": "stdin_stdout", "input": "20\n1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "20\n1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 3\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "20\n1 2 1 2 1 2 0 2 1 2 1 2 1 2 1 2 1 2 1 3\n", "output": "12\n"}, {"type": "std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two arrays a and b...
[{"type": "stdin_stdout", "input": "4\n3 4\n0 2 -1\n1 2 2\n\n2 6\n1 4\n2 5\n\n4 4\n2 2 3 -1\n3 5 2 4\n\n1 0\n5\n5\n", "output": "Yes\nYes\nNo\nNo\n"}, {"type": "stdin_stdout", "input": "4\n3 4\n0 2 -1\n1 2 2\n\n2 6\n1 4\n2 5\n\n4 4\n2 2 3 -1\n1 5 2 4\n\n1 0\n5\n5\n", "output": "Yes\nYes\nNo\nNo\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\nPetya loves lucky numbers very m...
[{"type": "stdin_stdout", "input": "50\n44747747774474747747747447777447774747447477444474\n", "output": "YES"}, {"type": "stdin_stdout", "input": "50\n44444444444444444444444444444444444444444444444444\n", "output": "YES"}, {"type": "stdin_stdout", "input": "50\n77777777777777777777777777777777777777777777777777\n", "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are many sunflowers in the...
[{"type": "stdin_stdout", "input": "5\n3 3\nX.X\n...\nX.X\n4 4\n....\n.X.X\n....\n.X.X\n5 5\n.X...\n....X\n.X...\n.....\nX.X.X\n1 10\n....X.X.X.\n2 2\n..\n..\n", "output": "\nXXX\n..X\nXXX\nXXXX\n.X.X\n.X..\n.XXX\n.X...\n.XXXX\n.X...\n.X...\nXXXXX\nXXXXXXXXXX\n..\n..\n"}, {"type": "stdin_stdout", "input": "5\n3 3\nX.X\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNikephoros and Polycarpus play r...
[{"type": "stdin_stdout", "input": "1457057352\nR\nPSRSRSSRPSRRSSSRSRRPRSPPSPPRPSRRPPRSRRSPPSPPSPRPRPRPSSRPRPRRPSSSSSPSRRRPSRSPPSPSRRSPSSRSRPSPRRRSRRRPSPRPPRPPPPPRPPRRRRRRPPRRSPSPSSPSSPRPRSPPRRRPSPSRSRRRRRPPPSRPRSPPSSRRRRPRPPRSPSSPRRRPPPPPRRSRSPRPPSRPRSRSRRPRRRPRSRSPRRRSRSSRPPPRRSRRSSRRPSRPPRSPSPRPRSSSRSSRRPSRRRRPSRRPP...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n cities in the countr...
[{"type": "stdin_stdout", "input": "100 6\n15 20 32 8 29 10 33 15 9 26 28 21 34 7 41 23 9 17 16 15 14 29 25 31 24 26 13 18 19 40 9 16 36 32 39 11 4 31 37 28 32 40 7 18 45 21 15 45 6 15 27 22 27 41 28 7 22 43 25 40 6 7 32 31 36 14 5 27 31 28 23 9 13 14 7 25 28 33 40 22 44 9 29 26 41 30 16 15 31 42 13 40 36 44 17 29 32 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\nLittle penguin Polo likes permut...
[{"type": "stdin_stdout", "input": "16281\n", "output": "265087242\n1 0 5 4 3 2 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIahub got lost in a very big des...
[{"type": "stdin_stdout", "input": "999999989 38\n999999980 999999981\n10 8\n2 5\n999999978 999999981\n999999978 999999985\n7 9\n8 10\n9 10\n999999984 999999980\n6 6\n999999985 999999986\n999999982 999999978\n999999981 999999987\n8 5\n999999982 999999980\n999999989 999999980\n999999988 999999983\n999999982 999999984\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\nValera is a little boy. Yesterda...
[{"type": "stdin_stdout", "input": "15\nrxeeeeeeeeeeeer\nereeeeeeeeeeere\needeeeeeeeeeoee\neeereeeeeeeewee\neeeereeeeebeeee\nqeeeereeejedyee\neeeeeerereeeeee\neeeeeeereeeeeee\neeeeeerereeeeze\neeeeereeereeeee\neeeereeeeegeeee\neeereeeeeeereee\neereeeeeeqeeved\ncreeeeeeceeeere\nreeerneeeeeeeer\n", "output": "NO\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\nMany students live in a dormitor...
[{"type": "stdin_stdout", "input": "0 14299 32984 96001 30445\n77723 0 75669 14101 55389\n30897 17295 0 52675 29987\n36518 108118 11343 0 64020\n91242 50085 86272 62454 0\n", "output": "747422\n"}, {"type": "stdin_stdout", "input": "0 14299 32984 96001 30445\n77723 0 75669 14101 55389\n30897 17295 0 52675 29987\n36518 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDreamoon is standing at the posi...
[{"type": "stdin_stdout", "input": "+--+------\n??????????\n", "output": "0.0439453125\n"}, {"type": "stdin_stdout", "input": "+-----+---\n??????????\n", "output": "0.0439453125\n"}, {"type": "stdin_stdout", "input": "---+-----+\n??????????\n", "output": "0.0439453125\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\nVasya bought the collected works...
[{"type": "stdin_stdout", "input": "17079\n", "output": "2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 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\nATMs of a well-known bank of a s...
[{"type": "stdin_stdout", "input": "58 5\n1 6 9 18 34 41 82 99 164 179 183 204 240 396 636 1224 2023 2856 4488 4705 5712 9180 9266 18360 18850 20270 23086 60810 190701 197064 211140 214200 222970 243240 263510 314442 425670 486480 708288 789888 1009800 1025349 1054040 1094580 1325184 1579776 1748076 2050698 2635100 289...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 probability theory the fo...
[{"type": "stdin_stdout", "input": "20\n3 21\n15 28\n21 26\n4 6\n13 28\n20 23\n22 27\n4 13\n1 7\n5 35\n3 3\n16 30\n9 32\n9 16\n3 7\n21 22\n24 29\n6 25\n15 25\n28 33\n51\n", "output": "3.349496664437241e-05\n"}, {"type": "stdin_stdout", "input": "20\n10 21\n18 29\n4 8\n1 27\n24 29\n5 5\n22 22\n4 5\n1 4\n7 12\n11 23\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\nWhile Patrick was gone shopping,...
[{"type": "stdin_stdout", "input": "2 100\n2 1\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2\n", "output": "Possible\n2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProfessor GukiZ makes a new robo...
[{"type": "stdin_stdout", "input": "-1000000000 -1000000000\n1000000000 -1000000000\n", "output": "2000000000\n"}, {"type": "stdin_stdout", "input": "-1000000000 -1000000000\n1000000000 1000000000\n", "output": "2000000000\n"}, {"type": "stdin_stdout", "input": "-1000000000 1000000000\n1000000000 -1000000000\n", "outpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKarlsson has visited Lillebror a...
[{"type": "stdin_stdout", "input": ". . .\n . . O .\n. . O O .\n . . . .\n . . .\n", "output": "Lillebror\n"}, {"type": "stdin_stdout", "input": "O O .\n O O . .\n. . . . .\n . . . .\n . O .\n", "output": "Lillebror\n"}, {"type": "stdin_stdout", "input": ". . O\n . O O .\nO . O . O\n O O O O\n . . O\n", "output": "L...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle Artem likes electronics. ...
[{"type": "stdin_stdout", "input": "13 21 1\n2 11\n", "output": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSo many wall designs to choose f...
[{"type": "stdin_stdout", "input": "100000000 100 100\n", "output": "807624\n"}, {"type": "stdin_stdout", "input": "100000100 100 100\n", "output": "515397\n"}, {"type": "stdin_stdout", "input": "100000000 100 1\n", "output": "245069\n"}, {"type": "stdin_stdout", "input": "100000000 1 100\n", "output": "389182\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\nSonya was unable to think of a s...
[{"type": "stdin_stdout", "input": "75\n392 593 98 1017 515 448 220 310 475 79 539 294 208 828 75 534 875 493 94 205 656 105 546 493 60 188 222 108 788 504 809 621 934 455 307 236 630 298 938 62 850 421 839 134 950 256 934 817 209 559 866 67 990 835 534 672 733 768 757 516 959 893 275 315 692 927 321 554 801 805 885 12...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLocal authorities have heard a l...
[{"type": "stdin_stdout", "input": "69 6 15\n3845 22036 69001 38625 10662 85485 88195 12883 2257 101913 40235 87797 15559 15841 74716 92979 167517 49466 68603 123491 99905 35606 65184 98603 68232 54398 105580 63002 38979 41488 9636 24737 15892 173020 69670 29711 1460 473 32171 717 21097 108932 86760 55720 116079 61122 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFacetook is a well known social ...
[{"type": "stdin_stdout", "input": "kmircqsffq\n14\nfrnf likes xgmmp's post\nfnfdpupayp commented on syz's post\nxefshpn commented on xgmmp's post\nm posted on gdwydzktok's wall\neskm likes pqmbnuc's post\npnqiapduhz likes zzqvjdz's post\nx likes nouuurc's post\nvnyxhoukuo posted on uhblapjab's wall\nblpjpxn likes zvwb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAndryusha is an orderly boy and ...
[{"type": "stdin_stdout", "input": "50\n50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 10 4 3 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\nEach evening Roma plays online p...
[{"type": "stdin_stdout", "input": "20 7\n?LLLLLWWWWW?????????\n", "output": "WLLLLLWWWWWWWWWWDDDW\n"}, {"type": "stdin_stdout", "input": "20 6\n?LLLLLWWWWW?????????\n", "output": "WLLLLLWWWWWWWWWDDDDW\n"}, {"type": "stdin_stdout", "input": "20 5\n?LLLLLWWWWW?????????\n", "output": "WLLLLLWWWWWWWWDDDDDW"}, {"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\nIvan had string s consisting of ...
[{"type": "stdin_stdout", "input": "20\nadabacabaeabacabada 1 359\nabadabacabafabaca 1 213\nacabagabacaba 1 315\ncabaeabacabadabacab 1 268\nfabacabadabacabaeab 1 352\ncabafabacabada 1 28\nacabadabacabaea 1 67\ncabadabacabaeabacaba 1 484\nabacabadabacaba 1 209\nacabaiabacaba 1 251\nacabafabacabadabac 1 475\nabacabaeabac...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 animals in the queue...
[{"type": "stdin_stdout", "input": "150 2476\n70 21 114 127 22 11 29 59 51 59 35 3 53 88 5 8 44 4 8 100 1 27 1 25 27 56 48 22 23 103 85 66 14 58 20 7 176 11 19 26 105 97 83 3 29 30 52 92 59 11 135 37 59 8 66 20 47 19 143 16 93 18 57 71 1 13 141 1 119 6 2 87 40 68 28 22 20 53 31 19 15 33 32 9 70 63 16 26 77 7 45 52 73 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\nLuba has to do n chores today. i...
[{"type": "stdin_stdout", "input": "100 1 99\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 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\nA correct expression of the form...
[{"type": "stdin_stdout", "input": "100277221476489181970323375139380435110027722147648918197032337513938043511002772214764891819703233751393804351100277221476489181970323375139380435120055444295297836394064675027876087022005544429529783639406467502787608702\n", "output": "1002772214764891819703233751393804351100277221...
code_stdio