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\nMatryoshka\n\nMatryoshka is a fa... | [{"type": "stdin_stdout", "input": "2\n1 4 6\n4 2 3\n3\n2 5 2\n3 3 4\n5 5 10\n1\n1 1 2\n2 2 0\n3 3 1\n4 4 4\n5 10 14\n4\n2 1 0\n2 1 1\n3 1 1\n3 1 1\n5 1 1\n10\n3 1 4\n1 5 9\n3 6 7\n3 5 8\n9 7 9\n3 2 0\n8 2 5\n2 6 4\n3 2 8\n3 2 7\n0", "output": "48\n270\n2\n12\n312\n3\n5\n860\n"}, {"type": "stdin_stdout", "input": "2\n1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCutlet Sandwich\n\nIn some world... | [{"type": "stdin_stdout", "input": "17 3 1 1 1 1 1\n2 -1\n1 1", "output": "-1\n"}, {"type": "stdin_stdout", "input": "29 3 1 1 1 1 1\n2 -1\n1 1", "output": "-1\n"}, {"type": "stdin_stdout", "input": "5 1 1 1 1 1 1\n2 -1\n2 1", "output": "-1\n"}, {"type": "stdin_stdout", "input": "5 3 1 1 1 1 1\n2 -1\n1 1", "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\nConstraints\n\n* 1 β€ |V| β€ 1000\... | [{"type": "stdin_stdout", "input": "42 0 1\n2 -1 3\n0 5 55\n1 0 -2\n-2 0 1\n2 4 -1", "output": "INF\n0\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\nINF\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\nInitially there was an array a c... | [{"type": "stdin_stdout", "input": "50 200000\n0 199989 0 0 0 0 200000 200000 0 200000 0 200000 200000 0 0 200000 0 0 0 0 200000 200000 200000 200000 0 0 0 200000 0 0 0 0 200000 200000 0 200000 0 200000 0 200000 200000 0 200000 0 199999 199980 199978 199978 199964 199952\n", "output": "YES\n199989 199989 199989 199989 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 pillars aligned in a... | [{"type": "stdin_stdout", "input": "100\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPetya's friends made him a birth... | [{"type": "stdin_stdout", "input": "500\n()))))()()(()((((())))((((()()((()))))))((()())))()(()(()))()()()))())))()))))))(()()(()((()))()(((()(()(()())(((())()((()((()((())(()()()(()(()())(()(((((((((()))(()()()))))())((()()))))()(((()()()((((((()()()()()(())))))((((((())(()()())(((((((((((()(()))()(((()))())))))))((()... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecall that a binary search tree... | [{"type": "stdin_stdout", "input": "1000000\n", "output": "0"}, {"type": "stdin_stdout", "input": "908995\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "365825\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "123856\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "265206\n", "output": "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\nSanta Claus has received letters... | [{"type": "stdin_stdout", "input": "10\n5 48258 84644 992412 548310 132019\n5 132019 556600 548310 94345 992412\n6 132019 771663 523582 548310 463969 556600\n7 556600 132019 992412 523582 548310 70239 84644\n4 504172 548310 523582 286042\n7 548310 84644 771663 556600 132019 463969 48258\n5 556600 771663 463969 523582 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\nAnna and Maria are in charge of ... | [{"type": "stdin_stdout", "input": "96 70\n30 37\n47 56\n19 79\n15 28\n2 43\n43 54\n59 75\n42 22\n38 18\n18 14\n47 41\n60 29\n35 11\n90 4\n14 41\n11 71\n41 24\n68 28\n45 92\n14 15\n34 63\n77 32\n67 38\n36 8\n37 4\n58 95\n68 84\n69 81\n35 23\n56 63\n78 91\n35 44\n66 63\n80 19\n87 88\n28 14\n62 35\n24 23\n83 37\n54 89\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\nDenis, after buying flowers and ... | [{"type": "stdin_stdout", "input": "10 10\n1101001\n0110000\n0111010\n0010000\n1010000\n0111000\n1011011\n1010010\n1101011\n1111110\n", "output": "9941743758\n"}, {"type": "stdin_stdout", "input": "10 10\n0101111\n0000000\n1111011\n1011011\n1011011\n1111011\n0010010\n1010010\n1101111\n0000000\n", "output": "8993391761\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 permutation of length n is an ... | [{"type": "stdin_stdout", "input": "3\n2\n1 2\n6\n0 0 3 10 4 3\n5\n3 6 3 1 10\n", "output": "2 1\n3 4 10 3 0 0\n10 1 3 6 3\n"}, {"type": "stdin_stdout", "input": "3\n2\n1 2\n6\n0 1 10 5 4 3\n5\n2 6 3 1 10\n", "output": "2 1\n3 4 5 10 1 0\n10 1 3 6 2\n"}, {"type": "stdin_stdout", "input": "3\n2\n1 2\n6\n0 1 10 5 4 3\n5\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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, you have the array a ... | [{"type": "stdin_stdout", "input": "5\n1\n13\n42\n2538\n1000000000\n", "output": "0\n6\n11\n99\n63244\n"}, {"type": "stdin_stdout", "input": "5\n1\n10\n143\n255\n1000000000\n", "output": "0\n5\n22\n30\n63244\n"}, {"type": "stdin_stdout", "input": "5\n1\n13\n143\n751\n1000001000\n", "output": "0\n6\n22\n53\n63244\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 Super Duper Secret Meeting o... | [{"type": "stdin_stdout", "input": "-565 -444 -419 -421\n30\n363 -249 790\n704 57 999\n-316 -305 119\n-778 -543 373\n-589 466 190\n516 -174 893\n-742 -662 390\n-382 825 1000\n520 -732 909\n-220 -985 555\n-49 -697 396\n-701 -882 520\n-105 227 691\n-113 -470 231\n-503 98 1088\n236 69 759\n150 393 951\n414 381 1000\n1096 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 multiplication op... | [{"type": "stdin_stdout", "input": "13\na\na\na\na\na\na\na\na\na\na\na\na\nb\na\na\na\na\na\na\na\na\na\na\na\nb\na\n", "output": "a\na\na\na\na\na\n-1\na\na\na\na\na\n-1\n"}, {"type": "stdin_stdout", "input": "13\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\nb\na\n", "output": "a\na\na\na\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string s of leng... | [{"type": "stdin_stdout", "input": "3\n3 2 -1\n010\n5 -2 5\n01001\n6 -1 -12\n110111\n", "output": "4\n15\n-30\n"}, {"type": "stdin_stdout", "input": "3\n3 3 -1\n010\n5 -2 5\n01001\n6 -1 -12\n110111\n", "output": "7\n15\n-30\n"}, {"type": "stdin_stdout", "input": "3\n3 3 -2\n011\n5 -2 5\n01001\n6 -1 -12\n110111\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\nYou are given two polynomials:\n... | [{"type": "stdin_stdout", "input": "69 69\n-7 38 -3 -22 65 -78 -65 -99 -76 63 0 -4 -78 -51 54 -61 -53 60 80 34 -96 162 -78 -96 21 -10 -86 33 -9 -81 -19 -2 -76 -3 -66 -80 -55 -21 -50 37 -86 -37 47 44 76 -39 54 -25 41 -86 -3 -25 -67 94 18 67 27 -5 -30 -69 2 -76 7 -97 -52 -35 -55 -20 92 2\n90 -94 37 41 -27 -54 96 -15 -60 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 bracket sequence is called reg... | [{"type": "stdin_stdout", "input": "))())))))))())))))()()))()()))))())))))()))))))))))))(()))())(()))))(()))))())))((((()()))))()))()))\n", "output": "48\n"}, {"type": "stdin_stdout", "input": ")))()))()))))()((((())))()))))(()))))(())()))(()))))))))))))())))))()))))()()))()())))))())))))))())\n", "output": "48\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\nIahub has drawn a set of n point... | [{"type": "stdin_stdout", "input": "50\n-768 -243\n-741 -984\n-370 213\n-808 571\n-726 442\n234 452\n-105 -990\n-876 -278\n987 473\n-968 -531\n-274 -842\n259 -655\n-59 -555\n976 -396\n878 -85\n551 213\n675 599\n-990 -507\n1 48\n-147 919\n-218 798\n-191 928\n916 263\n-975 169\n567 -967\n394 16\n-224 915\n280 -613\n804 -... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 group of n schoolboys decided ... | [{"type": "stdin_stdout", "input": "40 40 61\n28 59 8 27 45 67 33 32 61 3 29 2 3 37 8 8 10 61 1 2 65 28 34 27 8 35 45 49 30 49 10 23 23 53 20 48 14 74 16 6\n69 56 34 66 42 73 45 49 29 70 26 77 73 26 78 11 50 69 64 72 78 66 66 29 80 40 50 75 58 47 78 113 41 70 52 52 69 22 69 66\n", "output": "23 960\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\nGeorge is a cat, so he really li... | [{"type": "stdin_stdout", "input": "69756649467079322827497669450385938193725265564551073376856848456377282337192553343102536673046067874193973249293390979688852602950724884726382282903675659200865787042684264196306648305545290076062924087939978017987667847105325657080274323400258982046115892228300171243907466293917094... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPasha has a positive integer a w... | [{"type": "stdin_stdout", "input": "1541326723729813719 14\n", "output": "9541132672372813719\n"}, {"type": "stdin_stdout", "input": "191919191919119911 100\n", "output": "999999991111111111\n"}, {"type": "stdin_stdout", "input": "219810011901120912 100\n", "output": "999822211111110000\n"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne day Vasya came across three ... | [{"type": "stdin_stdout", "input": "A>B\nC<B\nA>C\n", "output": "Impossible\n"}, {"type": "stdin_stdout", "input": "A<B\nB>C\nC>A\n", "output": "Impossible\n"}, {"type": "stdin_stdout", "input": "A>B\nC<B\nC;tg&A\n", "output": "Impossible\n"}, {"type": "stdin_stdout", "input": "A<:B\nB>C\nC... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 the sum of two perm... | [{"type": "stdin_stdout", "input": "84\n83 4 68 34 24 2 48 38 22 51 5 62 31 67 66 53 49 70 9 71 46 41 30 8 50 17 28 79 15 80 32 43 14 74 29 42 81 60 56 65 23 0 77 76 58 78 1 11 37 27 75 35 18 73 54 20 57 33 36 6 61 69 64 55 39 10 3 45 13 26 59 82 21 25 63 52 16 44 47 72 19 12 7 40\n63 41 80 52 36 45 17 69 22 66 37 21 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\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\n11146 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":... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\n3 4\n3 4\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "4 6\n1 2\n1 1\n1 4\n2 3\n2 4\n3 4\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "4 6\n1 4\n1 1\n1 4\n2 3\n2 4\n3 4\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "4 6\n1 2... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA MIPT student named Misha has a... | [{"type": "stdin_stdout", "input": "100\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "51614.556434047350\n"}, {"type": "stdin_stdout", "input": "99\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 an attempt to escape the Misc... | [{"type": "stdin_stdout", "input": "491 172\n01111101111111100000111010110001010001110111000010101111101000100010010111011101110110111101101010111000111000011100011010010010111111000011011010100110001000011100111000001011100010001111101111101000111001100110010100101000001110010100100100100101001100010101001000010000111... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nEvery year, hundreds of people c... | [{"type": "stdin_stdout", "input": "1000\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "942\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "952\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "191\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "289\n", "output": "1\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\nEfim just received his grade for... | [{"type": "stdin_stdout", "input": "320 142\n2704701300865535.432223312233434114130011113220102420131323010344144201124303144444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444447444444444444444444444444444444615444444482101673308979557675074444444444444446... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 plays The Elder Trolls IV:... | [{"type": "stdin_stdout", "input": "1000000 1000000 1000000 1000000000\n", "output": "1000000000000000000\n"}, {"type": "stdin_stdout", "input": "1000000 1000000 1001000 1000000000\n", "output": "1001000000000000000\n"}, {"type": "stdin_stdout", "input": "1000000 1000000 1011000 1000000000\n", "output": "10110000000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRick and Morty are playing their... | [{"type": "stdin_stdout", "input": "7000\n7 419 1631 1925 3861 6940 379 493\n29 5389 5925 2923 4696 972 6125 3779 6044 5477 1305 6488 5059 5515 3238 3863 248 6947 4023 6168 1915 6607 2991 2220 2023 200 4457 6398 1017 447\n", "output": "Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIt's one more school day now. Sa... | [{"type": "stdin_stdout", "input": "545668929424440387 508692735816921376\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "251656215122324104 164397544865601257\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "669038685745448997 501718093668307460\n", "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\nSlava plays his favorite game \"... | [{"type": "stdin_stdout", "input": "11124\n", "output": "16686\n2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 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\nCount the number of distinct seq... | [{"type": "stdin_stdout", "input": "495219 444706662\n", "output": "115165527\n"}, {"type": "stdin_stdout", "input": "34601 35742833\n", "output": "60054095\n"}, {"type": "stdin_stdout", "input": "524 991033864\n", "output": "172439543\n"}, {"type": "stdin_stdout", "input": "225 315096300\n", "output": "413133630\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\nDima is a beginner programmer. D... | [{"type": "stdin_stdout", "input": "15 12\n2\n10\n5\n2\n8\n2\n8\n6\n4\n10\n12\n1\n", "output": "12\n13\n3\n12\n10\n12\n10\n14\n9\n13\n11\n1\n"}, {"type": "stdin_stdout", "input": "15 12\n9\n10\n5\n2\n8\n2\n8\n6\n4\n10\n12\n1\n", "output": "5\n13\n3\n12\n10\n12\n10\n14\n9\n13\n11\n1\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\nPetya studies at university. The... | [{"type": "stdin_stdout", "input": "100 43\n76 77 1\n24 25 1\n2 3 1\n85 86 1\n49 50 1\n15 16 1\n30 31 1\n78 79 1\n54 55 1\n58 59 1\n17 18 1\n67 68 1\n21 22 1\n80 81 1\n35 36 1\n8 9 1\n83 84 1\n44 45 1\n62 63 1\n64 65 1\n72 73 1\n27 28 1\n56 57 1\n12 13 1\n40 41 1\n32 33 1\n52 53 1\n70 71 1\n97 98 1\n37 38 1\n87 88 1\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\nMishka started participating in ... | [{"type": "stdin_stdout", "input": "100 90\n90 90 90 90 90 90 55 21 90 90 90 90 90 90 90 90 90 90 69 83 90 90 90 90 90 90 90 90 93 95 92 98 92 97 91 92 92 91 91 95 94 95 100 100 96 97 94 93 90 90 95 95 97 99 90 95 98 91 94 96 99 99 94 95 95 97 99 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 12 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\nNaruto is a fan of numbers, he l... | [{"type": "stdin_stdout", "input": "2\n3 2 6 4\n1 2 3 4 9\n7 1 2 5\n0 2 -1 -1 6\n\nSAMPLE", "output": "0\n0\n"}, {"type": "stdin_stdout", "input": "2\n5 2 3 5\n1 2 1 6 11\n5 2 0 5\n1 2 1 9 6\n\nSAMPLE", "output": "2\n1\n"}, {"type": "stdin_stdout", "input": "2\n10 2 2 5\n1 0 3 1 9\n5 2 1 5\n1 3 3 2 6\n\nSAMPME", "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\nAfter Joeffrey chocked to death,... | [{"type": "stdin_stdout", "input": "293\n20 6005\n1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n56 1362\n1 0 0 1 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n2 4237\n1 1\n17 410\n0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n22 2366\n1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 2 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\nShil is your new boss and he lik... | [{"type": "stdin_stdout", "input": "yvqszlrqoxkfaupflahrnwygzetlwynhxalauuzhaaeoxzkyroertpxdwxlngzfoxregqxqhgmoklururjaetlwwnsggpyarhrxwgfaqhoecwrwwaewfsnwuaeurualuytawoeuaowtulstcumwntegoxjjsuptrjvbaouygwahnzdbnxsexdwtlngcxaxtbnrfqgrblxqntqnmeqtqwaalzjgqgoellzxlylnjqoaydqgprvaezoremrlghjaoobeysywoouzjzhwhexezcakesevlv... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 use the 24-h... | [{"type": "stdin_stdout", "input": "17 -4 435 10 -1", "output": "25095\n"}, {"type": "stdin_stdout", "input": "17 -4 722 10 -1", "output": "42315\n"}, {"type": "stdin_stdout", "input": "-1 -3 436 11 -1", "output": "26235\n"}, {"type": "stdin_stdout", "input": "-1 -3 239 11 -1", "output": "14415\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\nGiven is a positive integer N.\n... | [{"type": "stdin_stdout", "input": "141750", "output": "200930633\n"}, {"type": "stdin_stdout", "input": "200000", "output": "400000008"}, {"type": "stdin_stdout", "input": "3437", "output": "118300\n"}, {"type": "stdin_stdout", "input": "3093", "output": "95976\n"}, {"type": "stdin_stdout", "input": "1020", "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\nWe have a sequence of N integers... | [{"type": "stdin_stdout", "input": "10 998244353\n10 10 10 9 5 12 0 4 7 0", "output": "559205848\n"}, {"type": "stdin_stdout", "input": "10 1051516890\n10 15 10 1 5 4 0 8 4 0", "output": "142815647\n"}, {"type": "stdin_stdout", "input": "10 918571889\n10 9 10 7 7 3 0 11 4 0", "output": "551061978\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\nIn some other world, today is th... | [{"type": "stdin_stdout", "input": "4\n4320\n7204\n4320\n4320", "output": "16562\n"}, {"type": "stdin_stdout", "input": "4\n7514\n7204\n4320\n4320", "output": "19601\n"}, {"type": "stdin_stdout", "input": "4\n4320\n3600\n4320\n4320", "output": "14400\n"}, {"type": "stdin_stdout", "input": "4\n7514\n7204\n4821\n4320", "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 permutation of the int... | [{"type": "stdin_stdout", "input": "10 8\n10 3 6 8 7 10 9 1 2 4\n2 1\n4 1\n5 9\n4 2\n6 2\n3 5\n8 9\n7 9", "output": "2\n"}, {"type": "stdin_stdout", "input": "10 8\n10 3 6 8 7 10 9 1 2 4\n2 1\n3 1\n5 9\n4 2\n6 2\n3 5\n8 9\n7 9", "output": "7\n"}, {"type": "stdin_stdout", "input": "10 8\n10 3 6 8 7 10 9 1 2 4\n2 1\n4 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\nSnuke is buying a lamp. The ligh... | [{"type": "stdin_stdout", "input": "4 32\n13 18 1 14 1 14 4 0 1 1", "output": "19\n"}, {"type": "stdin_stdout", "input": "7 19\n2 17 6 18 2 14 4 0 4 1", "output": "30\n"}, {"type": "stdin_stdout", "input": "4 19\n15 6 10 13 2 14 3 3 3 1", "output": "8\n"}, {"type": "stdin_stdout", "input": "4 19\n15 6 10 2 0 14 3 2 6 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n<image>\n\n\nThere used to be a ... | [{"type": "stdin_stdout", "input": "44 3\n45 10\n0 0", "output": "40\n33\n"}, {"type": "stdin_stdout", "input": "75 2\n16 14\n0 0", "output": "23\n10\n"}, {"type": "stdin_stdout", "input": "18 3\n45 10\n0 0", "output": "14\n33\n"}, {"type": "stdin_stdout", "input": "26 3\n45 10\n0 0", "output": "17\n33\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\nAt Aizu Riverside Hospital, inpa... | [{"type": "stdin_stdout", "input": "5\n263 1519 1817\n2 1240 1985\n11656 1896 4132\n10001 503 3107\n51 1421 2690\n3\n345 1628 2181\n7 3910 1590\n5982 2525 3616\n0", "output": "11656 6028\n5982 6141\n"}, {"type": "stdin_stdout", "input": "5\n263 1519 1817\n2 1240 1985\n11656 1896 4132\n10001 503 3107\n51 1421 2690\n3\n3... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPlease find the greatest common ... | [{"type": "stdin_stdout", "input": "010 90\n11 496", "output": "10\n1\n"}, {"type": "stdin_stdout", "input": "102 24\n101 116", "output": "6\n1\n"}, {"type": "stdin_stdout", "input": "110 103\n30 10", "output": "1\n10\n"}, {"type": "stdin_stdout", "input": "98 224\n28 84", "output": "14\n28\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\nAt 17:00, special agent Jack sta... | [{"type": "stdin_stdout", "input": "6 6\n4 4 X X T T\n4 7 8 2 X 7\n1 X X X 1 8\n1 2 X X X 6\n1 1 2 4 4 7\nS S 2 3 X X\n2 10\nT 1\n1 X\n1 X\n1 X\n1 1\n1 X\n1 X\n1 1\n1 X\nS S\n2 10\nT X\n1 X\n1 X\n1 X\n1 1\n1 X\n1 X\n1 1\n1 X\nS S\n10 10\nT T T T T T T T T T\nX 2 X X X X X 3 4 X\n9 8 9 X X X 2 9 X 9\n7 7 X 7 3 X X 8 9 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\nMr. Yamada Springfield Tanaka wa... | [{"type": "stdin_stdout", "input": "2\n-100 -20 100 20\n-20 -100 18 100\n2\n-100 -20 -20 -100\n20 100 100 20\n0", "output": "4\n3\n"}, {"type": "stdin_stdout", "input": "2\n-100 -20 100 20\n-20 -100 20 100\n2\n-100 -34 -20 -100\n20 100 100 20\n0", "output": "4\n3\n"}, {"type": "stdin_stdout", "input": "2\n-100 -20 100 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor given two circles $c1$ and $... | [{"type": "stdin_stdout", "input": "-1 -2 2\n-1 0 1", "output": "-1.9682458366 -0.2500000000 -0.0317541634 -0.2500000000\n"}, {"type": "stdin_stdout", "input": "-1 -2 2\n-2 0 1", "output": "-2.6000000000 -0.8000000000 -1.0000000000 -0.0000000000\n"}, {"type": "stdin_stdout", "input": "-2 -2 2\n-2 0 1", "output": "-2.96... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor a set $S$ of integers, perfo... | [{"type": "stdin_stdout", "input": "9\n0 1\n0 2\n0 3\n3 2\n1 0\n1 2\n0 3\n0 4\n3 2 10", "output": "1\n2\n3\n3\n1\n2\n3\n2\n3\n2\n3\n"}, {"type": "stdin_stdout", "input": "9\n0 1\n0 4\n0 3\n3 2\n1 0\n1 2\n0 3\n0 4\n3 2 10", "output": "1\n2\n3\n3\n1\n3\n4\n3\n4\n3\n4\n"}, {"type": "stdin_stdout", "input": "9\n0 1\n0 2\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\nRudolf is on his way to the cast... | [{"type": "stdin_stdout", "input": "30\n011110110100010000011001000100\n110111101001011001100001101101\n", "output": "146\n"}, {"type": "stdin_stdout", "input": "30\n011110110100010000011001000100\n110111101000011001100001101101\n", "output": "153\n"}, {"type": "stdin_stdout", "input": "30\n0111101101000100000110010001... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "1 2\n\nseY\n\nNo\n\nYes\n\nYds\n", "output": "1 1\n1 1\n1 1\n"}, {"type": "stdin_stdout", "input": "10 2\n\nYes\n\nNo\n\nYes\n\nYes\n", "output": "2 2\n"}, {"type": "stdin_stdout", "input": "1 2\n\nYes\n\nNo\n\nYer\n\nYes\n", "output": "1 1\n"}, {"type": "stdin_stdout", "input": "1 2... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\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\nSalem gave you n sticks with int... | [{"type": "stdin_stdout", "input": "113\n86 67 31 33 72 100 88 63 16 12 79 80 76 45 31 96 44 10 24 33 53 11 56 100 23 57 9 48 28 73 18 48 12 89 73 9 51 11 82 94 90 92 34 99 54 58 33 67 35 87 58 90 94 64 57 80 87 99 84 99 20 1 63 12 16 40 50 95 33 58 7 23 71 89 53 15 95 29 71 16 65 21 66 89 82 30 6 45 6 66 58 32 27 78 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\nBerland SU holds yet another tra... | [{"type": "stdin_stdout", "input": "7 200000\n66 57 15 65 32 46 30\n66 31 64 9 63 57 65\n", "output": "-1"}, {"type": "stdin_stdout", "input": "7 200000\n66 57 15 65 32 46 30\n7 31 64 9 63 57 65\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "6 200000\n66 57 15 65 32 46 30\n7 31 64 9 63 57 65\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\nLet's define a function f(p) on ... | [{"type": "stdin_stdout", "input": "1000000\n", "output": "943169120\n"}, {"type": "stdin_stdout", "input": "955654\n", "output": "416395816\n"}, {"type": "stdin_stdout", "input": "425221\n", "output": "973943578\n"}, {"type": "stdin_stdout", "input": "786432\n", "output": "755978297\n"}, {"type": "stdin_stdout", "inpu... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKamil likes streaming the compet... | [{"type": "stdin_stdout", "input": "32\n402528994560 0 0 0 0 0 0 932646223872 893192888700 0 813583026900 0 0 0 0 143521875000 0 177570054144 186624000000 0 517655600000 202145625000 341007975000 0 116252718750 0 148561875000 0 304819200000 248474688000 0 103125000000\n29 25\n20 24\n8 21\n23 3\n32 14\n29 30\n31 24\n28 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecently, Norge found a string s... | [{"type": "stdin_stdout", "input": "200 13\nvgfjhgkgwkftaeqejmbgildembgxdbskxfndwmcckjfkbeekxkgakmcjhclqsecpnkaigcxxhfghgegfadjktckftdhtifriemfifakygoesjfginnddjjklwiwlbjsgftwhtjdxmcadpvhaeddxwnmguwhetwbmffbmvdvuhecgjckddrbikgwkrfwfhdhqolidgkfm\na b c d e f g h i j k l m\n", "output": "578\n"}, {"type": "stdin_stdout",... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two integers a and... | [{"type": "stdin_stdout", "input": "10\n164 252\n94 226\n38 254\n196 255\n35 256\n174 257\n251 495\n246 527\n9 260\n149 261\n", "output": "36\n112\n126\n128\n128\n256\n240\n480\n96\n168\n"}, {"type": "stdin_stdout", "input": "10\n164 252\n94 253\n171 254\n196 255\n35 256\n174 257\n251 258\n239 259\n9 260\n98 261\n", "o... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNash designed an interesting yet... | [{"type": "stdin_stdout", "input": "10\n-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1\n-1 -1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 -1 -1\n-1 -1 -1 -1 3 3 3 4 3 5 3 6 3 7 3 8 -1 -1 -1 -1\n-1 -1 4 2 4 3 4 4 4 5 4 6 4 7 4 8 -1 -1 -1 -1\n-1 -1 5 2 5 3 5 3 5 5 5 6 5 7 5 9 5 9 -1 -1\n-1 -1 6 2 6 3 6 5 6 5 6 6 6 7 6 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\nHaving read half of the book cal... | [{"type": "stdin_stdout", "input": "DaABYAOivguEueXufuoUeoiLiuEuEIeZAdoPgaUIIrUtoodAALPESiUaEbqitAphOIIEAogrjUBZLnIALGbazIermGEiAAdDAOFaaizopuUuuEugOHsXTAelFxAyZXWQXiEEKkGiIVdUmwiThDOiEyiuOEaiIAAjEQyaEuOiUGOuuzvaIEUEAhXEuOliOeEkJuJaUaszUKePiQuwXSuoQYEeUOgOeuyvOwhUuitEEKDVOaUaoiaIyiAEkyXeuiEkUorUYCaOXEAiUYPnUMaURebouLUO... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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's favorite subjects are His... | [{"type": "stdin_stdout", "input": "10\n238517256500070918 988176216\n363959778883784349 933416507\n631238591652944446 530795521\n557307185726829409 1481431174\n86402035814143715 513728064\n101626841876448103 26556040\n598448092106640578 746411314\n733629261048200000 361714100\n624561301519202735 38\n106258810456388771... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMonocarp had a sequence a consis... | [{"type": "stdin_stdout", "input": "4\n4\n4 -5 11 -4\n3\n2 3 -4\n2\n1 1\n4\n10 -3 0 2\n5\n-1 -2 -3 -1 -5\n5\n-1 -2 -3 -4 -4\n1\n-1\n1\n0\n", "output": "15\n12\n0\n0\n"}, {"type": "stdin_stdout", "input": "4\n4\n4 -9 12 -6\n3\n2 3 -1\n2\n0 1\n4\n10 -3 0 3\n5\n-1 -2 -3 0 -10\n5\n-2 -2 -3 -4 -5\n1\n-1\n1\n0\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\nCirno gave AquaMoon a chessboard... | [{"type": "stdin_stdout", "input": "6\n4\n0110\n6\n011011\n5\n01010\n20\n10001111110110111000\n20\n00110110100110111101\n20\n11001111011000100010\n", "output": "3\n6\n1\n1287\n1287\n1001\n"}, {"type": "stdin_stdout", "input": "6\n4\n0110\n6\n011011\n5\n01011\n20\n10001111110110111000\n20\n00110110100110111101\n20\n1110... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Berland the opposition is goi... | [{"type": "stdin_stdout", "input": "250\n5 3 5 1 3 5 3 4 4 3 1 5 2 2 1 1 5 2 3 3 2 5 4 3 2 4 2 3 5 4 1 2 3 5 2 2 5 4 1 3 3 5 4 4 4 4 4 2 4 2 3 5 1 4 3 3 2 3 5 3 3 4 4 2 3 1 3 4 1 4 5 4 1 2 3 4 1 5 3 3 2 3 5 4 2 5 2 2 3 5 4 3 5 4 2 1 4 1 4 1 1 3 5 1 1 2 1 3 4 5 4 3 2 5 1 3 5 1 1 3 3 5 1 4 5 1 2 1 1 5 5 3 5 1 4 1 4 4 4 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\nOne day n students come to the s... | [{"type": "stdin_stdout", "input": "100 72\n2 88\n55 80\n22 20\n78 52\n66 74\n91 82\n59 77\n97 93\n46 44\n99 35\n73 62\n58 24\n6 16\n47 41\n98 86\n23 19\n39 68\n32 28\n85 29\n37 40\n16 62\n19 61\n84 72\n17 15\n76 96\n37 31\n67 35\n48 15\n80 85\n90 47\n79 36\n39 54\n57 87\n42 60\n34 56\n23 61\n92 2\n88 63\n20 42\n27 81\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 people came to a party. Then t... | [{"type": "stdin_stdout", "input": "1\n108\n", "output": "106\n"}, {"type": "stdin_stdout", "input": "1\n157\n", "output": "155\n"}, {"type": "stdin_stdout", "input": "1\n168\n", "output": "166\n"}, {"type": "stdin_stdout", "input": "1\n299\n", "output": "297\n"}, {"type": "stdin_stdout", "input": "1\n111\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\nOne beautiful day Vasily the bea... | [{"type": "stdin_stdout", "input": "100000 4\n", "output": "266669.98044222436\n"}, {"type": "stdin_stdout", "input": "66666 8\n", "output": "355558.62761817535\n"}, {"type": "stdin_stdout", "input": "66666 11\n", "output": "488893.1129749911\n"}, {"type": "stdin_stdout", "input": "11905 7\n", "output": "55562.46664223... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSimon has a prime number x and a... | [{"type": "stdin_stdout", "input": "26 7\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2\n", "output": "49\n"}, {"type": "stdin_stdout", "input": "26 2\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "1 1139170813\n800000011\n", "output": "1\n"}, {"type"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nArthur and Alexander are number ... | [{"type": "stdin_stdout", "input": "200000000 794 1000 117 2000000000\n", "output": "2038505096\n"}, {"type": "stdin_stdout", "input": "20000000 280 1000 25 2000000000\n", "output": "2030769231\n"}, {"type": "stdin_stdout", "input": "13597422 280 1000 42 2000000000\n", "output": "2073489121\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\nLet's call an undirected graph o... | [{"type": "stdin_stdout", "input": "5\n24 228\n24 228\n24 228\n24 228\n24 228\n", "output": "1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n1 9\n1 10\n1 11\n1 12\n1 13\n1 14\n1 15\n1 16\n1 17\n1 18\n1 19\n1 20\n1 21\n1 22\n1 23\n1 24\n2 3\n2 4\n2 5\n2 6\n2 7\n2 8\n2 9\n2 10\n2 11\n2 12\n2 13\n2 14\n2 15\n2 16\n2 17\n2 18\n2 19\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\nIahub is training for the IOI. W... | [{"type": "stdin_stdout", "input": "100 100 100\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 12 19 20 21 22 23 24 25 30 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 6 43 44 45 46 47 48 49 99 12 52 53 54 55 56 57 58 92 60 61 62 63 64 65 66 67 68 21 70 71 84 73 74 75 76 77 78 79 118 81 98 83 84 85 86 87 88 89 90 164 92 93 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 (s1,... | [{"type": "stdin_stdout", "input": "aaababaaaaaaaaaaaaabaaaaaaaaaabaaaaaaaaaaaaa\nbbbbbbbbbbbbbbbbbbbbbabbbbbbbbbbbbbbbbbbbbabbbbbbbbabbbb\nccccccccbccccccccccccccccaccccccccccccccccbbccccccccccccccccaaacccccccccccccccc\n", "output": "1116 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 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 sequence a1, a2, .... | [{"type": "stdin_stdout", "input": "10 6\n4 2 1 5 12 7 9 8 10 4\n1 3\n1 10\n2 10\n2 9\n5 5\n2 8\n", "output": "-1\n9\n-1\n-1\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "10 6\n4 2 1 5 6 7 9 8 10 4\n1 3\n1 10\n2 10\n2 9\n5 5\n2 8\n", "output": "-1\n9\n-1\n-1\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "10 6\n4 2 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\nSasha and Ira are two best frien... | [{"type": "stdin_stdout", "input": "1000000\n", "output": "627314155\n"}, {"type": "stdin_stdout", "input": "999999\n", "output": "192151599\n"}, {"type": "stdin_stdout", "input": "524287\n", "output": "295397547\n"}, {"type": "stdin_stdout", "input": "178481\n", "output": "845172388\n"}, {"type": "stdin_stdout", "inpu... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nShapur was an extremely gifted s... | [{"type": "stdin_stdout", "input": "1010000011010110011101001101110001110010000111011101110010110110111111001001110100101100010101010001\n0111101000111100101100000101111010100100001000011101010100110011100011010011010101000100101011100011\n", "output": "110110101110101011000100100000101101011000111100000010011000010101... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFirst-rate specialists graduate ... | [{"type": "stdin_stdout", "input": "prntaxhysjfcfmrjngdsitlguahtpnwgbaxptubgpwcfxqehrulbxfcjssgocqncscduvyvarvwxzvmjoatnqfsvsilubexmwugedtzavyamqjqtkxzuslielibjnvkpvyrbndehsqcaqzcrmomqqwskwcypgqoawxdutnxmeivnfpzwvxiyscbfnloqjhjacsfnkfmbhgzpujrqdbaemjsqphokkiplblbflvadcyykcqrdohfasstobwrobslaofbasylwiizrpozvhtwyxtzl\n",... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne particularly well-known fact... | [{"type": "stdin_stdout", "input": "10 9\n2 3\n6 8\n10 1\n1 8\n6 7\n8 7\n10 5\n7 10\n2 5\n", "output": "no\n"}, {"type": "stdin_stdout", "input": "10 9\n2 3\n6 8\n10 1\n1 8\n6 7\n8 7\n10 5\n7 10\n2 2\n", "output": "no\n"}, {"type": "stdin_stdout", "input": "10 9\n2 3\n6 8\n10 1\n1 8\n6 7\n8 7\n10 4\n7 10\n2 2\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\nAnton is playing a very interest... | [{"type": "stdin_stdout", "input": "256 22 22\n45 42\n21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42\n21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42\n21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42\n21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Literature lesson Sergei ... | [{"type": "stdin_stdout", "input": "1 1 1000000000000000000 1 1\n", "output": "1000000000000000000 1000000000000000000 1000000000000000000\n"}, {"type": "stdin_stdout", "input": "1 100 1000000000000000000 1 35\n", "output": "10000000000000000 10000000000000000 10000000000000000\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 year of 2012 is coming...\n\... | [{"type": "stdin_stdout", "input": "22\nCleo likes Snowy\nCleo likes Troll\nChapay likes Dracul\nSnowy likes Troll\nDracul likes Chapay\nDracul likes Snowy\nChapay likes Cleo\nSnowy likes Chapay\nDracul likes Troll\nAnka likes Hexadecimal\nSnowy likes Anka\nHexadecimal likes Cleo\nHexadecimal likes Troll\nDracul likes ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWherever the destination is, who... | [{"type": "stdin_stdout", "input": "20 50000 50000\n2 45955 55488\n1 19804 29337\n2 3767 90811\n2 24025 33558\n1 46985 56518\n2 21094 30627\n2 5787 15320\n1 4262 91306\n2 37231 46764\n1 18125 27658\n1 36532 12317\n1 31330 40863\n1 18992 28525\n1 29387 38920\n1 44654 54187\n2 45485 55018\n2 36850 46383\n1 44649 54182\n1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given several queries. I... | [{"type": "stdin_stdout", "input": "100\n611\n513\n544\n463\n38\n778\n116\n317\n848\n664\n440\n108\n718\n54\n334\n876\n234\n22\n944\n305\n159\n245\n513\n691\n639\n65\n308\n324\n813\n459\n164\n116\n331\n993\n184\n224\n853\n769\n121\n687\n93\n930\n751\n308\n485\n1386\n400\n695\n95\n751\n175\n972\n121\n654\n242\n610\n1074... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya has a non-negative integer... | [{"type": "stdin_stdout", "input": "1000000000\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "1031575393\n", "output": "1031575390\n"}, {"type": "stdin_stdout", "input": "1022742286\n", "output": "1022742290\n"}, {"type": "stdin_stdout", "input": "1259496606\n", "output": "1259496610\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\nWe consider a positive integer p... | [{"type": "stdin_stdout", "input": "10000\n", "output": "10800100"}, {"type": "stdin_stdout", "input": "8020\n", "output": "10000180\n"}, {"type": "stdin_stdout", "input": "9411\n", "output": "10214200"}, {"type": "stdin_stdout", "input": "8888\n", "output": "10110061"}, {"type": "stdin_stdout", "input": "9999\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\nYou are given a sequence a consi... | [{"type": "stdin_stdout", "input": "100\n-100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 -100... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPetya loves volleyball very much... | [{"type": "stdin_stdout", "input": "15 29\n6 6\n7 12 7\n11 3 7\n4 5 18\n13 9 18\n3 8 12\n6 1 7\n4 1 4\n12 5 18\n10 8 15\n2 10 1\n9 7 11\n2 4 10\n2 14 3\n15 12 14\n1 13 8\n11 4 1\n15 11 2\n1 5 9\n5 2 5\n9 10 5\n15 2 17\n11 5 1\n14 15 14\n10 1 16\n15 9 2\n13 15 6\n13 5 1\n7 12 6\n12 5 13\n8 26\n35 17\n16 14\n12 13\n21 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\nTwo participants are each given ... | [{"type": "stdin_stdout", "input": "12 12\n6 7 5 4 7 8 2 9 12 5 3 5 1 6 7 3 7 9 5 7 1 8 6 8\n6 4 2 1 7 8 1 6 8 5 9 8 1 5 7 2 5 9 6 3 9 2 9 4\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "12 12\n1 6 2 6 8 3 6 4 4 8 7 2 7 5 9 4 2 4 9 5 8 5 3 2\n2 8 6 9 2 6 7 4 6 5 6 3 5 8 7 8 7 1 1 9 9 7 7 3\n", "output": "-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\nValentine week has started and C... | [{"type": "stdin_stdout", "input": "10\n1000\n4913 1000 405224 328509 512 592704 343 857375 39304 8000 614125 79507 287496 373248 39304 250047 10843 68921 1728 12167 493039 29791 614125 2744 287496 79507 2197 343 389017 704969 262144 287496 35937 373248 884736 753571 125000 148877 50653 12167 205379 226981 857375 31443... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nStatement: Security is the major... | [{"type": "stdin_stdout", "input": "20\n77098906505852940\n23695632789598785\n83179477858357140\n38835312821902340\n20531402854248883\n79217919497750700\n97700573573820292\n61817719996906820\n76683795335702609\n12297584302723408\n37055948958732184\n94997957651503400\n99667860986664907\n28605950158089400\n87323704292066... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 text each other ev... | [{"type": "stdin_stdout", "input": "1 1\namit am\namit\n\nSAMPLE", "output": "am\n"}, {"type": "stdin_stdout", "input": "1 1\namit am\namit\n\nSAMQLE", "output": "am\n"}, {"type": "stdin_stdout", "input": "1 1\namit bm\namit\n\nSAMPLE", "output": "bm\n"}, {"type": "stdin_stdout", "input": "1 1\namit an\namit\n\nSALQLE"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven is a string S consisting o... | [{"type": "stdin_stdout", "input": "11101111011111000000000110000001111100011111000000001101111110000000111111111", "output": "323558395\n"}, {"type": "stdin_stdout", "input": "11101111011101000000000110000001111100011111000000001101111110000000111111111", "output": "979142942\n"}, {"type": "stdin_stdout", "input": "11... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N people living on a n... | [{"type": "stdin_stdout", "input": "7\n14 14 3 13 56 2 37", "output": "2319\n"}, {"type": "stdin_stdout", "input": "7\n0 1 0 20 141 0 -1", "output": "16580\n"}, {"type": "stdin_stdout", "input": "7\n0 1 0 20 141 1 -1", "output": "16535\n"}, {"type": "stdin_stdout", "input": "7\n1 1 0 20 141 1 -1", "output": "16490\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 N ID cards, and there ar... | [{"type": "stdin_stdout", "input": "101000 1\n1 100000", "output": "100000\n"}, {"type": "stdin_stdout", "input": "101000 1\n1 100100", "output": "100100\n"}, {"type": "stdin_stdout", "input": "101000 1\n1 100110", "output": "100110\n"}, {"type": "stdin_stdout", "input": "101000 1\n1 100010", "output": "100010\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\nFind the number of integers betw... | [{"type": "stdin_stdout", "input": "98765432109876543210\n66", "output": "678072802\n"}, {"type": "stdin_stdout", "input": "98765432109876543210\n18", "output": "852803440\n"}, {"type": "stdin_stdout", "input": "98765432109876543210\n11", "output": "501683936\n"}, {"type": "stdin_stdout", "input": "98765432109876543210... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string S consist... | [{"type": "stdin_stdout", "input": "100000010", "output": "7\n"}, {"type": "stdin_stdout", "input": "100000101", "output": "6\n"}, {"type": "stdin_stdout", "input": "000000000", "output": "9\n"}, {"type": "stdin_stdout", "input": "100000011", "output": "7\n"}, {"type": "stdin_stdout", "input": "100001011", "output": "5... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn Takahashi Kingdom, there is a... | [{"type": "stdin_stdout", "input": "7 3\n2 16\n4 2\n5 -1\n1 4\n-1 7", "output": "IMPOSSIBLE\n"}, {"type": "stdin_stdout", "input": "7 3\n2 16\n4 2\n5 -1\n1 1\n-1 7", "output": "IMPOSSIBLE\n"}, {"type": "stdin_stdout", "input": "7 3\n2 16\n4 2\n5 -1\n1 4\n0 7", "output": "IMPOSSIBLE\n"}, {"type": "stdin_stdout", "input"... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.