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\nVampire\n\nMr. C is a vampire. I...
[{"type": "stdin_stdout", "input": "4 3\n-2 -2 3\n1 0 3\n1 1 3\n2 2\n-2 0 8\n-2 2 3\n6 6\n-1 3 1\n-4 3 2\n-2 4 3\n0 -1 0\n1 8 3\n2 4 1\n2 6\n-11 6 1\n-3 1 2\n-6 1 2\n-2 0 4\n-3 -1 5\n-5 -2 6\n0 0", "output": "0.000000\n3.000000\n1.527864\n1.267949\n"}, {"type": "stdin_stdout", "input": "4 3\n-2 -2 3\n1 0 3\n1 1 3\n2 2\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a one-dimensional cellu...
[{"type": "stdin_stdout", "input": "5 4 1 3 3 0\n0 1 2 0 1\n5 7 1 3 2 0\n0 1 2 0 1\n5 13 1 3 2 11\n0 1 2 0 1\n5 5 2 0 1 100\n0 1 2 0 1\n6 6 0 2 3 1000\n0 1 2 0 1 4\n20 1000 0 2 3 1000000000\n0 1 2 0 1 0 1 2 0 1 0 1 2 0 1 0 1 2 0 1\n30 2 1 0 1 1000000000\n0 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\n30 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\nProblem\n\n\"Ritsumeikan Univers...
[{"type": "stdin_stdout", "input": "1234 5 4 789012345678901234 5 6", "output": "1357101234567708000\n"}, {"type": "stdin_stdout", "input": "2017 4 2 789012345678901234 5 6", "output": "1357101234567706652\n"}, {"type": "stdin_stdout", "input": "2684 2 6 699116447311015755 5 1", "output": "1202480289374942482\n"}, {"ty...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nquiz\n\nYou are the director of ...
[{"type": "stdin_stdout", "input": "3 2\n5 2 1 3\n8 2 2 3\n2 3\n13 2 1 2\n3 1 1\n5 1 1\n2 5\n100 1 1\n100 1 1\n100 1 1\n100 1 1\n100 1 1\n3 4\n5 1 1\n5 1 2\n100 2 1 3\n100 2 2 3\n0 0", "output": "14\n22\n501\n196\n"}, {"type": "stdin_stdout", "input": "3 2\n5 2 1 3\n8 2 2 3\n2 3\n13 2 1 2\n3 1 1\n5 1 1\n2 5\n100 1 1\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\nD: Is greed the best?\n\nstory\n...
[{"type": "stdin_stdout", "input": "42 1010", "output": "1050\n"}, {"type": "stdin_stdout", "input": "133 178", "output": "266\n"}, {"type": "stdin_stdout", "input": "16 102", "output": "112\n"}, {"type": "stdin_stdout", "input": "24 128", "output": "144\n"}, {"type": "stdin_stdout", "input": "18 102", "output": "108\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n$N$ persons visited a restaurant...
[{"type": "stdin_stdout", "input": "0 12\n1 -1\n1 4\n0 8\n0 11\n6 19\n7 21", "output": "0\n"}, {"type": "stdin_stdout", "input": "0 12\n0 -1\n1 4\n0 8\n0 11\n6 19\n7 21", "output": "0\n"}, {"type": "stdin_stdout", "input": "0 12\n1 0\n1 14\n0 0\n0 11\n6 19\n7 32", "output": "0\n"}, {"type": "stdin_stdout", "input": "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\nAfter learning a lot about space...
[{"type": "stdin_stdout", "input": "20\niw\nix\nudb\nbg\noi\nuo\njsm\num\ns\nquy\nqo\nbxct\nng\nrmr\nnu\nps\nio\nkh\nw\nk\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "20\niw\nix\nudb\nbg\noi\nuo\njsm\nmu\ns\nquy\nqo\nbxct\nng\nrmr\nnu\nps\nio\nkh\nw\nk\n", "output": "5\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\nIvan wants to play a game with y...
[{"type": "stdin_stdout", "input": "18\nd\nh\ndj\nxh\ndjs\njxh\ndjsh\nzjxh\ndjshf\nkzjxh\ndjshfk\nhkzjxh\ndjshfkj\nkhkzjxh\ndjshfkje\nskhkzjxh\ndjshfkjeh\ndskhkzjxh\ndjshfkjehd\nhdskhkzjxh\ndjshfkjehds\nehdskhkzjxh\ndjshfkjehdsk\njehdskhkzjxh\ndjshfkjehdskh\nkjehdskhkzjxh\ndjshfkjehdskhk\nfkjehdskhkzjxh\ndjshfkjehdskhk...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 all know that a superhero can...
[{"type": "stdin_stdout", "input": "eieoiiieaiuiiauieeuoueeoudljpjrpxdtqkrdfmhktpqrnkmyggywglpfpfmhrbaiioeuaieaouaoioaiuoiuueuaoouaeeoaaaueauueeiuaueuaeouiaaaieeaeiuouoiooauuoeauaiaoouuauuuuocqschpcxrxrgrcsjmwcbyfvtdxqtwha\naoeaoaoueieeioooiaooeoeoitvplxwkprykbhvxylcnxrhpgqclyjgfpzdpqwlcvouooeueoouieioeuouieoaaueuiiiae...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 be some string consisting ...
[{"type": "stdin_stdout", "input": "99985 45273\n", "output": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMisha was interested in water de...
[{"type": "stdin_stdout", "input": "100 74 20\n9 15 16 18 55 41 64 44 5 1 27 31 36 25 71 28 71 35 47 40 21 53 31 11 24 1 69 67 58 16 19 52 33 17 63 1 49 28 17 52 46 60 53 21 21 60 19 63 11 61 10 27 3 22 38 31 45 69 61 18 58 22 8 71 17 1 64 70 56 10 66 47 70 1 45 8 66 8 66 25 39 45 47 7 41 24 41 72 16 42 28 7 15 10 38 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\nYet another education system ref...
[{"type": "stdin_stdout", "input": "50 50 1\n1 1 1\n1 1 2\n1 1 3\n1 1 4\n1 1 5\n1 1 6\n1 1 7\n1 1 8\n1 1 9\n1 1 10\n1 1 11\n1 1 12\n1 1 13\n1 1 14\n1 1 15\n1 1 16\n1 1 17\n1 1 18\n1 1 19\n1 1 20\n1 1 21\n1 1 22\n1 1 23\n1 1 24\n1 1 25\n1 1 26\n1 1 27\n1 1 28\n1 1 29\n1 1 30\n1 1 31\n1 1 32\n1 1 33\n1 1 34\n1 1 35\n1 1 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou play your favourite game yet...
[{"type": "stdin_stdout", "input": "5\n1 1 100000000\n100000000 100000000 100000000\n100000000 1 100000000\n1 100000000 100000000\n100000000 100000000 1\n", "output": "50000000\n50000000\n100000000\n1\n1\n"}, {"type": "stdin_stdout", "input": "5\n0 1 100000000\n100000000 100000000 100000000\n100000000 1 100000000\n1 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\nThis problem is split into two t...
[{"type": "stdin_stdout", "input": "10\n10 2\n4 10\n1 10\n5 10\n10 7\n9 10\n3 10\n1 6\n8 1\n", "output": "16\n8 10 9 2 4 1 5 6 7 3 \n"}, {"type": "stdin_stdout", "input": "10\n6 10\n2 7\n10 1\n10 8\n4 2\n1 5\n1 9\n2 3\n10 2\n", "output": "14\n9 3 4 7 1 10 2 6 5 8 \n"}, {"type": "stdin_stdout", "input": "10\n9 8\n1 3\n7...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 m sets of integers...
[{"type": "stdin_stdout", "input": "7 8\n3 6 6 9 10 7 239\n8 1 16 7 19 2 3 239\n3 2 1 3\n2 4 1\n3 1 3 7\n2 4 3\n5 3 4 5 2 7\n2 5 7\n1 8\n", "output": "63\n"}, {"type": "stdin_stdout", "input": "7 8\n3 6 7 9 10 7 239\n8 1 16 7 19 2 3 239\n3 2 1 3\n2 4 1\n3 1 3 7\n2 4 3\n5 3 4 5 2 7\n2 5 7\n1 8\n", "output": "64\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\nYou are given a string s, consis...
[{"type": "stdin_stdout", "input": "7\n()\n()\n()\n()\n()\n()\n()\n", "output": "1\n1\n1\n1\n1\n1\n1\n"}, {"type": "stdin_stdout", "input": "7\n((\n()\n()\n()\n()\n()\n()\n", "output": "0\n1\n1\n1\n1\n1\n1\n"}, {"type": "stdin_stdout", "input": "7\n((\n()\n()\n)(\n()\n()\n()\n", "output": "0\n1\n1\n0\n1\n1\n1\n"}, {"ty...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two integers n and...
[{"type": "stdin_stdout", "input": "25\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n3 1000000000\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an integer x. Can ...
[{"type": "stdin_stdout", "input": "3\n33\n144\n143\n", "output": "YES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "3\n33\n144\n155\n", "output": "YES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "3\n33\n144\n69\n", "output": "\nYES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "3\n33\n144\n103\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\nTheatre Square in the capital ci...
[{"type": "stdin_stdout", "input": "1000000000 1000000000 1\n", "output": "1000000000000000000\n"}, {"type": "stdin_stdout", "input": "1000000000 987654321 1\n", "output": "987654321000000000\n"}, {"type": "stdin_stdout", "input": "1000000000 989104164 1\n", "output": "989104164000000000\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've got an array a, consistin...
[{"type": "stdin_stdout", "input": "17 14\n271 158 573 88 792 767 392 646 392 392 271 549 402 767 573 925 796\n", "output": "-1 -1\n"}, {"type": "stdin_stdout", "input": "17 14\n271 158 1064 88 2 110 392 646 241 392 271 576 108 100 573 1344 796\n", "output": "2 16\n"}, {"type": "stdin_stdout", "input": "17 14\n271 158 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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's got a staircase that cons...
[{"type": "stdin_stdout", "input": "5\n1 2 3 6 6\n25\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGreg has an array a = a1, a2, .....
[{"type": "stdin_stdout", "input": "4 3 6\n2 1 3 4\n1 2 2\n2 3 2\n3 4 4\n1 2\n1 3\n2 3\n1 2\n1 3\n2 3\n", "output": "10 21 31 20\n"}, {"type": "stdin_stdout", "input": "4 3 6\n2 1 3 4\n1 2 2\n2 4 2\n3 4 4\n1 2\n1 3\n2 3\n1 2\n1 3\n2 3\n", "output": "10 21 31 32\n"}, {"type": "stdin_stdout", "input": "4 3 6\n2 1 3 4\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\nMad scientist Mike entertains hi...
[{"type": "stdin_stdout", "input": "115\n10\n10\n10\n10\n01\n01\n10\n10\n10\n01\n01\n10\n01\n01\n10\n10\n10\n01\n10\n01\n10\n10\n01\n01\n10\n10\n10\n10\n01\n10\n01\n01\n10\n10\n10\n10\n01\n10\n10\n10\n01\n10\n01\n10\n10\n10\n10\n01\n01\n01\n10\n10\n01\n01\n01\n10\n10\n01\n10\n01\n01\n01\n01\n10\n10\n01\n10\n01\n01\n01\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 array consisting o...
[{"type": "stdin_stdout", "input": "58 38\n6384 48910\n97759 90589\n28947 5031\n45169 32592\n85656 26360\n88538 42484\n44042 88351\n42837 79021\n96022 59200\n485 96735\n98000 3939\n3789 64468\n10894 58484\n26422 26618\n25515 95617\n37452 5250\n39557 66304\n79009 40610\n80703 60486\n90344 37588\n57504 61201\n62619 79797...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 probably registered on ...
[{"type": "stdin_stdout", "input": "c7jqaudcqmv8o7zvb5x_gp6zcgl6nwr7tz5or!28.tj8s1m2.wxz5a4id03!rq07?662vy.7.p5?vk2f2mc7ag8q3861rgd0rmbr\n", "output": "Too weak\n"}, {"type": "stdin_stdout", "input": "i6a.,8jb,n0kv4.1!7h?p.96pnhhgy6cl7dg7e4o6o384ys3z.t71kkq,,w,oqi4?u,,m5!rzu6wym_4hm,ohjy!.vvksl?pt,,1\n", "output": "Too...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Dima misbehaved during a ...
[{"type": "stdin_stdout", "input": "1 3034 -9234\n", "output": "23\n12004 21106 24140 30208 33242 39310 42344 48412 51446 54480 57514 60548 63582 66616 69650 72684 75718 78752 81786 87854 90888 96956 99990\n"}, {"type": "stdin_stdout", "input": "5 1 4473\n", "output": "11\n1424330 14353380 17214841 52526348 60470649 69...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 denote as <image> the numb...
[{"type": "stdin_stdout", "input": "18\n1 10\n2 100\n1 1100\n1 10000\n1 100000\n1 1000000\n1 10000000\n1 100010010\n2 1000000000\n1 10001000000\n1 100000000000\n0 1000000100000\n1 10000000000000\n0 110000000000000\n0 1000000000000000\n1 10000000000000000\n2 100000000000000000\n1 1000000000000000000\n", "output": "7\n63...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 loves his phone and also p...
[{"type": "stdin_stdout", "input": "928 467 10\n37 45\n47 278\n17 467\n158 66\n483 198\n83 123\n285 219\n513 187\n380 107\n304 352\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "518 518 10\n37 97\n38 278\n17 467\n158 66\n483 351\n83 123\n285 219\n513 187\n380 75\n304 352\n", "output": "0\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\nPasha decided to invite his frie...
[{"type": "stdin_stdout", "input": "4 1000000000\n1 1 1 1 2 2 2 2\n", "output": "12.0\n"}, {"type": "stdin_stdout", "input": "4 1000000000\n1 1 1 1 1 1 1 1\n", "output": "6.0\n"}, {"type": "stdin_stdout", "input": "4 1000000000\n1 1 1 1 1 0 1 1\n", "output": "0.0\n"}, {"type": "stdin_stdout", "input": "5 16\n1 3 4 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\nTwo positive integers a and b ha...
[{"type": "stdin_stdout", "input": "549755813888 549755813886\n", "output": "274877906944"}, {"type": "stdin_stdout", "input": "549755813887 549755813887\n", "output": "549755813886"}, {"type": "stdin_stdout", "input": "552972910589 546530328573\n", "output": "17179869184"}, {"type": "stdin_stdout", "input": "547616456...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFriends are going to play consol...
[{"type": "stdin_stdout", "input": "100 100\n", "output": "197\n"}, {"type": "stdin_stdout", "input": "100 25\n", "output": "122\n"}, {"type": "stdin_stdout", "input": "100 26\n", "output": "124\n"}, {"type": "stdin_stdout", "input": "155 25\n", "output": "178\n"}, {"type": "stdin_stdout", "input": "155 18\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\nAnton and Dasha like to play dif...
[{"type": "stdin_stdout", "input": "12 -11 20 200\n11 189\n12 108\n19 190\n21 27\n24 193\n26 86\n26 123\n31 180\n39 196\n107 193\n122 46\n129 103\n131 129\n132 135\n142 51\n157 22\n161 27\n195 163\n198 55\n199 64\n", "output": "Anton\n"}, {"type": "stdin_stdout", "input": "12 -11 20 200\n11 189\n12 108\n19 190\n42 27\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecently Adaltik discovered japa...
[{"type": "stdin_stdout", "input": "100\nWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWB\n", "output": "50\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\n"}, {"type": "stdin_stdout", "input": "100\nBWBWBWBWBWBWBW...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJust to remind, girls in Arpa's ...
[{"type": "stdin_stdout", "input": "10 5 100\n64 109 3 94 96 97 52 54 82 26\n796554 444893 214351 43810 684158 1060686 686198 339093 383018 699152\n6 8\n8 3\n3 9\n2 3\n10 3\n", "output": "1495706\n"}, {"type": "stdin_stdout", "input": "10 5 100\n48 73 57 46 95 19 171 73 94 24\n501216 675859 843572 565104 879875 828759 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Mahmoud and Ehab were prac...
[{"type": "stdin_stdout", "input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Kolya decided to get d...
[{"type": "stdin_stdout", "input": "971 108\n706 706 991 706 988 997 996 997 991 996 706 706 996 706 996 984 1000 991 996 1000 724 724 997 991 997 984 997 1000 984 996 996 997 724 997 997 1000 997 724 984 997 996 988 997 706 706 997 1000 991 706 988 997 724 988 706 996 706 724 997 988 996 991 1000 1000 724 988 996 1000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSummer holidays! Someone is goin...
[{"type": "stdin_stdout", "input": "50 2\n74 90\n68 33\n49 88\n52 13\n73 21\n77 63\n27 62\n8 52\n60 57\n42 83\n98 15\n79 11\n77 46\n55 91\n72 100\n70 86\n50 51\n57 39\n20 54\n64 95\n66 22\n79 64\n31 28\n11 89\n1 36\n13 4\n75 62\n16 62\n100 35\n43 96\n97 54\n86 33\n62 63\n94 24\n19 6\n20 58\n38 38\n11 76\n70 40\n44 24\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\nValentin participates in a show ...
[{"type": "stdin_stdout", "input": "15\n. r\n? e\n. s\n. rw\n? y\n. fj\n. zftyd\n? r\n! wq\n? x\n? p\n. ours\n. dto\n. lbyfru\n? q\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "15\n. r\n? e\n. s\n. rw\n? y\n. jf\n. zftyd\n? r\n! wq\n? x\n? p\n. ours\n. dto\n. lbyfru\n? q\n", "output": "2\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 camera you have accidentally l...
[{"type": "stdin_stdout", "input": "100\n1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "100\n1 1 1 1 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\nAfter waking up at hh:mm, Andrew...
[{"type": "stdin_stdout", "input": "20 58\n156216 11 152 99\n", "output": "191884.80000000002\n"}, {"type": "stdin_stdout", "input": "20 58\n93398 43 152 99\n", "output": "114790.40000000001\n"}, {"type": "stdin_stdout", "input": "18 46\n10753 23 46 140\n", "output": "3275.2000000000003\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\nRamesses knows a lot about probl...
[{"type": "stdin_stdout", "input": "9\n1 2\n1 3\n1 4\n1 5\n1 6\n6 7\n7 8\n8 9\n", "output": "Yes\n5\n1 2\n1 3\n1 4\n1 5\n1 9\n"}, {"type": "stdin_stdout", "input": "9\n1 2\n2 3\n1 4\n1 5\n1 6\n6 7\n5 8\n7 9\n", "output": "Yes\n4\n1 3\n1 4\n1 8\n1 9\n"}, {"type": "stdin_stdout", "input": "9\n1 2\n2 3\n1 4\n1 8\n1 6\n6 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\nLittle Arjit is the leader of a ...
[{"type": "stdin_stdout", "input": "20\nOOXO*OOXXO*O*O*OXXOO**XX***OOO*XXX*XOOOOXXX**O***X*OO**X**OOXX*X**OXO*XXXX*X**X*OXX**XX**OXX*XOOOXX*XO*O*X**XXO*O**OX*O*OXXOX*X*XOXO*XX*O***OX**X*XXO*OXX**O*XO**O**O*OO*OXO**XX*OXOO**O**XO*O*OXO**XXXX*OOO***OOOXXXX*X*XX***O*OX***OX*X*OXXO***X*XO*OO*OXOOXO*X*OXX**OX**XX*XX**XO**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\nYou are given N sticks, the leng...
[{"type": "stdin_stdout", "input": "2\n5\n1 8 1 1 11\n3\n13 114 111\n\nSLMPAF", "output": "1 1 1\n13 111 114\n"}, {"type": "stdin_stdout", "input": "2\n5\n0 13 1 1 12\n3\n16 114 100\n\nMATPLF", "output": "-1\n16 100 114\n"}, {"type": "stdin_stdout", "input": "2\n5\n0 8 1 1 11\n3\n10 114 111\n\nSAMPLF", "output": "-1\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 part to play in the W...
[{"type": "stdin_stdout", "input": "4\n120 24 1 34 \n36", "output": "1\n"}, {"type": "stdin_stdout", "input": "4\n120 24 1 11 \n36", "output": "1\n"}, {"type": "stdin_stdout", "input": "4\n45 34 1 34 \n90", "output": "3\n"}, {"type": "stdin_stdout", "input": "4\n45 15 1 34 \n90", "output": "3\n"}, {"type": "stdin_stdou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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* All values in i...
[{"type": "stdin_stdout", "input": "8 5 22\n100 5 10 10 5 1\n56 5 9 1 12 8\n334 7 2 1 2 1\n433 4 5 2 8 2\n568 5 4 3 5 6\n235 3 5 6 10 7\n394 0 6 0 6 2\n1100 8 4 0 7 2", "output": "1392\n"}, {"type": "stdin_stdout", "input": "8 5 22\n100 5 10 10 5 1\n48 5 9 1 12 8\n334 7 2 1 2 1\n433 4 5 2 8 2\n568 5 4 3 5 6\n235 3 5 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\nTakahashi has K 500-yen coins. (...
[{"type": "stdin_stdout", "input": "13 1282", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "10 1282", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "4 1282", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "8 1282", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "10 333", "output": "Yes\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; the i-...
[{"type": "stdin_stdout", "input": "5\n52\n-1\n-2\n-2\n-1", "output": "110\n"}, {"type": "stdin_stdout", "input": "5\n89\n-1\n-2\n-2\n-1", "output": "184\n"}, {"type": "stdin_stdout", "input": "5\n46\n-1\n-4\n-2\n-1", "output": "102\n"}, {"type": "stdin_stdout", "input": "5\n115\n-1\n0\n-2\n-1", "output": "236\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\nThere are a total of A + B cats ...
[{"type": "stdin_stdout", "input": "-1 -1 10", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-2 -1 10", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-3 -1 10", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-3 -1 17", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-5 -1 11", "output": "NO...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "uncopyrightable", "output": "yes"}, {"type": "stdin_stdout", "input": "uncopyrightacle", "output": "no\n"}, {"type": "stdin_stdout", "input": "elcathgirypocnu", "output": "no\n"}, {"type": "stdin_stdout", "input": "elcathgirxpocnu", "output": "no\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\nThere is an image with a height ...
[{"type": "stdin_stdout", "input": "9 20\n.....***....***.....\n....*...*..*...*....\n...*.....**.....*...\n...*.....*......*...\n....*.....*....*....\n.....**..*...**.....\n.......*.*..*.......\n........**.*........\n.........**.........", "output": ".....***....***.....\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\nThere is a magic room in a homes...
[{"type": "stdin_stdout", "input": "10 10\n>>>v..>>>v\n...v..^..v\n>>>>>>^..v\n.........v\n.v<<<<...v\n.v.v.^...v\n.v.v.^<<<<\n.v.v.....v\n.v...^...v\n.?>>>^....\n6 10\n>>>>>>>>>v\n.........v\n.........v\n>>>>v....v\n^...v....v\n^<<<<<<<<<\n0 0", "output": "LOOP\nLOOP\n"}, {"type": "stdin_stdout", "input": "10 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\nBased on the information of the ...
[{"type": "stdin_stdout", "input": "10\n3\n6 11\n12 15\n18 22\n14\n2\n6 14\n13 20\n0", "output": "OK\nOK\n"}, {"type": "stdin_stdout", "input": "10\n3\n6 11\n12 15\n34 22\n14\n2\n6 14\n13 20\n0", "output": "14\nOK\n"}, {"type": "stdin_stdout", "input": "10\n3\n20 11\n2 15\n34 22\n13\n2\n4 14\n13 33\n0", "output": "18\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\nTaro, a boy who hates any ineffi...
[{"type": "stdin_stdout", "input": "123 3 0 2 0 2 0\n1263 14 10 9 3 18 1\n0 0 0 0 0 0 0", "output": "6\n13\n"}, {"type": "stdin_stdout", "input": "167 3 1 2 1 2 1\n1826 9 9 9 1 15 10\n0 0 0 0 0 0 0", "output": "6\n10\n"}, {"type": "stdin_stdout", "input": "123 6 1 2 1 1 2\n999 17 15 9 2 16 10\n0 0 0 0 0 0 0", "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\nWhist is a game played by four p...
[{"type": "stdin_stdout", "input": "H\n4C 8H QS 5D JD KS 8S AH 6H 7H 3S 7S 6D\nTC JC JS KD AC QC QD 2H QH 3H 3C 7C 4D\n6C 9C AS TD 5H 6S 5S KH TH AD 9S 8D 2D\n8C 5C 2S 7D KC 4S TS JH 4H 9H 2C 9D 3D\nD\n8D 9D 9S QS 4H 5H JD JS 9H 6S TH 6H QH\nQD 9C 5S 7S 7H AC 2D KD 6C 3D 8C TC 7C\n5D QC 3S 4S 3H 3D 6D KS JC AS 5C H8 TS...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAn undirected graph is given. Ea...
[{"type": "stdin_stdout", "input": "4 5 50\n1 2\n2 3\n3 4\n4 1\n1 3", "output": "0.437500000000"}, {"type": "stdin_stdout", "input": "4 5 50\n1 2\n2 3\n3 4\n4 2\n1 3", "output": "0.437500000\n"}, {"type": "stdin_stdout", "input": "4 5 50\n2 2\n2 3\n3 4\n4 1\n1 3", "output": "0.250000000\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\nMin Element\n\nGiven the sequenc...
[{"type": "stdin_stdout", "input": "6\n10 17 3 2 6 -1", "output": "6\n"}, {"type": "stdin_stdout", "input": "6\n3 33 0 2 10 -1", "output": "6\n"}, {"type": "stdin_stdout", "input": "6\n3 55 0 2 10 -1", "output": "6\n"}, {"type": "stdin_stdout", "input": "6\n3 55 0 4 10 -1", "output": "6\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\nRemainder of Big Integers\n\nGiv...
[{"type": "stdin_stdout", "input": "10 16", "output": "10\n"}, {"type": "stdin_stdout", "input": "11 12", "output": "11\n"}, {"type": "stdin_stdout", "input": "12 47", "output": "12\n"}, {"type": "stdin_stdout", "input": "14 28", "output": "14\n"}, {"type": "stdin_stdout", "input": "18 11", "output": "7\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\nAs you know, majority of student...
[{"type": "stdin_stdout", "input": "10 10\n7 29\n10 31\n9 40\n5 17\n5 30\n6 85\n2 53\n7 23\n4 57\n10 9\n", "output": "49\n"}, {"type": "stdin_stdout", "input": "10 10\n5 81\n7 68\n7 48\n1 10\n5 37\n7 97\n8 54\n7 41\n7 56\n5 21\n", "output": "110\n"}, {"type": "stdin_stdout", "input": "10 10\n7 29\n10 54\n9 40\n5 17\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\nBerland State University invites...
[{"type": "stdin_stdout", "input": "3\n4\n0 1 0 0 0 0 0\n100000000\n1 0 0 0 1 0 1\n1\n1 0 0 0 0 0 0\n", "output": "22\n233333332\n1\n"}, {"type": "stdin_stdout", "input": "3\n4\n0 1 0 0 0 0 0\n100000000\n1 1 0 0 1 0 1\n1\n1 0 0 0 0 0 0\n", "output": "22\n174999998\n1\n"}, {"type": "stdin_stdout", "input": "3\n4\n0 1 0 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecently you have received two p...
[{"type": "stdin_stdout", "input": "128\n540 90 378 3780 270 35 180 15 6 14 20 3780 2520 140 1080 54 540 120 1890 15 420 840 20 756 10 126 42 54 36 14 216 8 168 210 60 7 63 2 216 21 30 189 28 135 2 630 21 30 60 1512 7560 70 5 12 40 7560 252 378 3 108 5 72 10 3 28 24 1 27 9 45 180 56 1260 945 1080 420 168 2520 18 70 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\nBob is decorating his kitchen, m...
[{"type": "stdin_stdout", "input": "1000 1000\n", "output": "708964705\n"}, {"type": "stdin_stdout", "input": "1000 1001\n", "output": "419685057\n"}, {"type": "stdin_stdout", "input": "1000 122\n", "output": "712990290\n"}, {"type": "stdin_stdout", "input": "1000 0001\n", "output": "46452554\n"}, {"type": "stdin_stdou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 robots have escaped from your ...
[{"type": "stdin_stdout", "input": "4\n2\n-1 -2 0 0 0 0\n-1 -2 0 0 0 0\n3\n1 5 1 1 1 1\n2 5 0 0 0 1\n4 5 1 0 0 1\n2\n754 1337 0 1 1 1\n1336 1337 1 1 0 1\n1\n3 5 1 1 1 1\n", "output": "1 -1 -2\n1 2 -100000\n1 754 -100000\n1 -100000 -100000\n"}, {"type": "stdin_stdout", "input": "4\n2\n-1 -2 0 0 0 0\n-1 -2 0 0 0 0\n3\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\nThe only difference between easy...
[{"type": "stdin_stdout", "input": "50 25\n199970 199997 199998 199988 199999 199981 200000 199990 199974 199985 199932 200000 199966 199999 199999 199951 199983 199975 199974 199996 199974 199992 199979 199995 199955 199989 199960 199975 199983 199990 199950 199952 199999 199999 199962 199939 199979 199977 199962 1999...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs the name of the task implies,...
[{"type": "stdin_stdout", "input": "20\n11 13\n21 38\n29 33\n10 18\n4 9\n2 6\n26 28\n15 39\n12 17\n8 19\n27 36\n20 22\n14 16\n3 5\n1 7\n24 37\n31 35\n30 32\n34 40\n23 25\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "20\n20 22\n9 11\n32 36\n8 12\n14 16\n4 6\n28 30\n29 37\n15 18\n33 35\n27 31\n21 25\n2 7\n19...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRoma is playing a new expansion ...
[{"type": "stdin_stdout", "input": "10 10 10\n51 87\n68 600\n82 1284\n33 936\n55 242\n89 1990\n58 357\n66 666\n62 512\n51 87\n92 1670\n56 280\n56 280\n91 1631\n77 1091\n89 1554\n61 473\n98 1901\n77 1091\n77 1091\n86 15 759\n43 58 386\n68 33 386\n39 62 386\n95 6 386\n74 27 386\n94 7 386\n17 36 386\n105 4 386\n45 56 386\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nToday Johnny wants to increase h...
[{"type": "stdin_stdout", "input": "25 50\n25 2\n6 17\n11 4\n3 18\n11 20\n6 7\n24 15\n1 8\n13 5\n12 25\n15 18\n14 21\n13 6\n5 10\n3 14\n1 2\n23 13\n12 20\n6 4\n8 9\n3 5\n10 7\n20 2\n20 16\n7 4\n8 25\n15 6\n24 14\n2 23\n2 13\n11 3\n16 21\n18 10\n22 1\n5 24\n6 18\n22 23\n4 13\n8 18\n5 20\n22 17\n20 7\n19 15\n10 12\n2 3\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn the game of Mastermind, there...
[{"type": "stdin_stdout", "input": "7\n5 2 4\n3 1 1 2 5\n5 3 4\n1 1 2 1 2\n4 0 4\n5 5 3 3\n4 1 1\n2 3 2 3\n6 1 2\n3 2 1 1 1 1\n6 2 4\n3 3 2 1 1 1\n6 3 6\n1 1 3 2 1 1\n", "output": "YES\n5 1 1 4 2 \nYES\n3 1 1 1 2 \nYES\n3 3 5 5 \nYES\n1 1 1 3 \nYES\n4 4 4 4 3 1 \nYES\n2 1 4 4 1 1 \nYES\n2 1 1 3 1 1 \n"}, {"type": "stdi...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMr. Chanek is currently particip...
[{"type": "stdin_stdout", "input": "6 1\n1 10 10 5 20 100\n1000000 1 10 10 100 1000000\n", "output": "144\n"}, {"type": "stdin_stdout", "input": "6 1\n1 10 10 20 5 100\n1000000 1 10 100 10 1000000\n", "output": "144\n"}, {"type": "stdin_stdout", "input": "6 1\n1 10 10 20 5 100\n1000000 1 6 100 10 1000000\n", "output": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have a knapsack with the cap...
[{"type": "stdin_stdout", "input": "3\n1 3\n3\n6 2\n19 8 19 69 9 4\n7 12\n1 1 1 17 1 1 1\n", "output": "1\n1 \n-1\n6\n1 2 3 5 6 7 \n"}, {"type": "stdin_stdout", "input": "3\n1 3\n3\n6 2\n19 8 19 69 9 4\n7 12\n1 1 1 17 1 1 1\n", "output": "1\n1\n-1\n6\n1 2 3 5 6 7 \n"}, {"type": "stdin_stdout", "input": "3\n1 3\n3\n6 2\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp found under the Christm...
[{"type": "stdin_stdout", "input": "4\n5\n6 5 2 2 8\n3\n2 1 12\n6\n2 1111 2 3 995 1\n5\n1 1 1 1 4\n", "output": "10\n14\n1111\n8\n"}, {"type": "stdin_stdout", "input": "4\n5\n6 5 2 2 8\n3\n2 1 15\n6\n2 1111 2 3 995 1\n5\n1 1 1 1 4\n", "output": "10\n17\n1111\n8\n"}, {"type": "stdin_stdout", "input": "4\n5\n12 3 1 2 3\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have a malfunctioning microw...
[{"type": "stdin_stdout", "input": "1 11111\n1 1110101 7\n", "output": "-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSergey attends lessons of the N-...
[{"type": "stdin_stdout", "input": "ttspivgoupgupvgpusvppogsseueusuglpiugssviuutlvgvugtpovuvspvpipggooplgvgugpogvesppulovugsvuougveiivgvslllviogpvtolepglguuellotpvgevspvoiiggiiplppgosuguvtstttpielteuglopgeoeeuivtptggltoltpgliviotsospvitupiopisoetupvvspooilsopslpoloptigstspoiuutiuvvuvlpplvioitsuvlpvtleveslslovolloogsgpv...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou've got string s, consisting ...
[{"type": "stdin_stdout", "input": "zyxzxzwyxywxxwabcdabdacdbcacdbcacabaaba\n", "output": "zzzyyxxwddddccbba\n"}, {"type": "stdin_stdout", "input": "zyxzxzwyxywxxwabcdabcacdbcacdbdacabaaba\n", "output": "zzzyyxxwddddcbba\n"}, {"type": "stdin_stdout", "input": "thankstosamarasauteddybearsforthiscontest\n", "output": "yt...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJabber ID on the national Berlan...
[{"type": "stdin_stdout", "input": "IGsma3L6YTJRrXS@1g.yR3mC.c.xoCns7Wo1.9C.Oe.5ebkR/_97Ltj3\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "IGsma3K6YTJRrXS@1g.yR3mC.c.xoCns7Wo1.9C.Oe.5ebkR/_97Ltj3\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "POTjlYcxAZsbyZPDh@sPm.z6aVaO.H1wEUhD9YvROQFUk/M_jTHS...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nEmuskald is a well-known illusio...
[{"type": "stdin_stdout", "input": "15\n999999986 268435456\n999999987 67108864\n999999988 16777216\n999999989 4194304\n999999990 1048576\n999999991 262144\n999999992 65536\n999999993 16384\n999999994 4096\n999999995 1024\n999999996 256\n999999997 64\n999999998 16\n999999999 4\n1000000000 1\n", "output": "1000000001"},...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe problem uses a simplified TC...
[{"type": "stdin_stdout", "input": "15 8\n244.1.125.160\n39.50.68.162\n142.253.101.137\n52.239.241.147\n194.4.189.143\n200.238.160.30\n245.78.177.243\n89.249.140.19\n169.51.142.22\n123.246.20.99\n133.44.192.119\n226.240.179.30\n76.209.211.184\n98.15.6.117\n227.219.117.153\n", "output": "-1\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\nSmart Beaver decided to be not o...
[{"type": "stdin_stdout", "input": "200\n1 2 1 1 2 2 1 1 1 1 1 1 2 1 2 2 2 2 2 1 2 2 1 1 2 2 2 2 2 1 2 1 1 2 2 2 1 2 2 2 1 1 2 2 2 1 2 2 1 2 1 2 2 1 2 2 2 2 2 1 2 2 1 2 1 1 2 2 2 2 2 2 2 1 2 2 2 1 1 2 2 2 2 1 1 2 2 1 1 1 2 2 1 1 2 2 1 1 2 2 2 1 2 2 2 1 2 1 2 2 2 2 2 2 2 1 1 1 2 2 2 2 1 2 2 2 1 1 2 2 2 2 2 1 2 1 2 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\nIn one little known, but very be...
[{"type": "stdin_stdout", "input": "54 22 1009\n15 7\n17 7\n11 9\n6 11\n12 9\n13 8\n13 12\n22 11\n20 9\n20 7\n16 11\n19 12\n3 12\n15 9\n1 12\n2 10\n16 10\n16 10\n14 10\n15 11\n11 9\n14 8\n10 10\n16 12\n1 8\n3 8\n21 11\n18 12\n2 6\n9 11\n11 7\n15 9\n20 11\n6 8\n8 8\n19 11\n15 7\n9 9\n22 3\n12 9\n17 9\n17 11\n12 7\n15 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\nPetya is a beginner programmer. ...
[{"type": "stdin_stdout", "input": "150\n48 115 13 9 105 117 41 136 123 32 84 95 62 50 140 106 145 91 57 141 139 35 45 27 129 63 137 10 37 60 44 30 101 119 138 78 22 103 39 134 49 36 25 12 28 67 69 99 148 26 16 87 146 65 8 74 14 38 47 89 81 19 40 11 64 43 110 66 102 3 122 124 100 2 125 42 97 73 121 7 52 23 29 109 1 70 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 sp...
[{"type": "stdin_stdout", "input": "100\n2515 3324 7975 6171 4240 1217 4829 5203 8603 6900 3031 4699 4732 6070 4221 3228 6497 7359 9130 4346 4619 1109 3945 5442 3271 16 9711 2045 6410 2301 3406 8125 6003 1892 1260 9661 3940 6692 4708 7027 4930 6925 1979 5361 4263 3144 867 8639 6230 5562 9714 3676 4231 3347 4733 4920 48...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRyouko is an extremely forgetful...
[{"type": "stdin_stdout", "input": "100 100\n28 28 28 34 28 28 28 40 28 28 28 28 28 28 28 28 28 28 28 28 28 28 47 28 28 28 28 28 28 28 28 28 28 28 28 28 19 28 28 28 28 28 28 28 28 28 28 28 28 28 46 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 49 28 28 28 28 28 28 28 31 28 28 28 28 28 28 28 28 28 28 28 28 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\nAlex doesn't like boredom. That'...
[{"type": "stdin_stdout", "input": "100\n4 8 10 1 8 8 8 1 10 3 1 8 6 8 6 1 10 3 3 3 3 7 2 1 1 6 10 1 7 9 8 10 3 8 6 2 1 6 5 6 10 8 9 7 4 3 10 5 3 9 10 5 10 8 8 5 7 8 9 5 3 18 9 2 7 8 2 10 4 9 2 8 10 10 5 8 5 1 7 3 4 5 2 2 9 3 2 5 6 2 3 10 1 5 9 6 10 4 10 8\n", "output": "392\n"}, {"type": "stdin_stdout", "input": "100\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPetya studies in a school and he...
[{"type": "stdin_stdout", "input": "10\n10\n10\n", "output": "1000\n"}, {"type": "stdin_stdout", "input": "10\n5\n6\n", "output": "300\n"}, {"type": "stdin_stdout", "input": "9\n14\n2\n", "output": "252\n"}, {"type": "stdin_stdout", "input": "4\n3\n10\n", "output": "120\n"}, {"type": "stdin_stdout", "input": "10\n9\n6\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMisha and Vasya participated in ...
[{"type": "stdin_stdout", "input": "1297 2000 101 180\n", "output": "Misha\n"}, {"type": "stdin_stdout", "input": "1250 2500 000 176\n", "output": "Misha\n"}, {"type": "stdin_stdout", "input": "2851 1250 176 130\n", "output": "Misha\n"}, {"type": "stdin_stdout", "input": "1500 1250 180 264\n", "output": "Misha\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\nVanya got an important task — he...
[{"type": "stdin_stdout", "input": "1000000000\n", "output": "8888888899\n"}, {"type": "stdin_stdout", "input": "999999998\n", "output": "8888888880\n"}, {"type": "stdin_stdout", "input": "999999999\n", "output": "8888888889\n"}, {"type": "stdin_stdout", "input": "222222222\n", "output": "1888888896\n"}, {"type": "stdi...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a programing contest na...
[{"type": "stdin_stdout", "input": "3\n1000000\n999999 999998\n999997 999996 999995\n999994 999993 999992 999991\n999990 999989 999988 999987 999986\n", "output": "2 1 4 3 6 5\n"}, {"type": "stdin_stdout", "input": "3\n487060\n3831 161856\n845957 794650 976977\n83847 50566 691206 498447\n698377 156232 59015 382455 6269...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 array a that contains a...
[{"type": "stdin_stdout", "input": "1376\n", "output": "1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 decided to pass a very lar...
[{"type": "stdin_stdout", "input": "11111111111101101111110101011111010101001111001110010011810010110111101101112140110110\n110101100101111101011111111101111111111110111110011111011000111010100111011111000002\n", "output": "110101100101111101011111111101111111111110111110011111011000111010100111011111000002"}, {"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\nAs we all know Barney's job is \...
[{"type": "stdin_stdout", "input": "12\n254904759290707697 475737283258450340 533306428548398547 442127134828578937 779740159015946254 272877594683860919 93000149670491971 632184275887310175 498293278222136720 551099726729989816 149940343283925029 989425634209891686\n", "output": "461895893/385687671\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\nDexterina and Womandark have bee...
[{"type": "stdin_stdout", "input": "1000000 50\n0.034403 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.033928 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.071853 0.000000 0.000000 0.016440 0.000000 0.000000 0.000000 0.000000 0.023167 0.067938 0.000000 0.000000 0.000000 0.000000 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\nIn this problem you will write a...
[{"type": "stdin_stdout", "input": "0-255-255-255-255+255+255+255+255+255\n", "output": "++++++++++++++++++++++++++++++++++++++++++++++++++.>\n+++++++++++++++++++++++++++++++++++++++++++++++++++++.>\n+++++++++++++++++++++++++++++++++++++++++++++++++++++.>\n"}, {"type": "stdin_stdout", "input": "293+235+47+150+222-3-90-...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDue to the recent popularity of ...
[{"type": "stdin_stdout", "input": "5 4 3\n2 1 0 1 2\n0 1 2 1 0\n1 2 1 0 2\n", "output": "209\n"}, {"type": "stdin_stdout", "input": "5 4 3\n2 1 0 1 2\n0 1 2 1 0\n1 2 1 0 1\n", "output": "210\n"}, {"type": "stdin_stdout", "input": "4 4 4\n0 1 3 2\n1 2 0 3\n2 3 1 0\n", "output": "64\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\nEighth-grader Vova is on duty to...
[{"type": "stdin_stdout", "input": "1000010010\n", "output": "2\n1000009977 1000010004\n"}, {"type": "stdin_stdout", "input": "1010011010\n", "output": "2\n1010010985 1010011003\n"}, {"type": "stdin_stdout", "input": "1100011010\n", "output": "2\n1100010985 1100011003\n"}, {"type": "stdin_stdout", "input": "999999979\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\nGirl Lena likes it when everythi...
[{"type": "stdin_stdout", "input": "-44 47\n24\n96 -18\n-50 86\n84 68\n-25 80\n-11 -15\n-62 0\n-42 50\n-57 11\n-5 27\n-44 67\n-77 -3\n-27 -46\n32 63\n86 13\n-21 -51\n-25 -123\n-14 -2\n-21 86\n-92 -94\n-44 -34\n-74 55\n91 -35\n-10 55\n-34 16\n", "output": "208370\n0 1 22 0 2 10 0 3 14 0 4 18 0 5 20 0 6 11 0 7 0 8 24 0 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\nImp is in a magic forest, where ...
[{"type": "stdin_stdout", "input": "1051\n", "output": "145985\n"}, {"type": "stdin_stdout", "input": "2498\n", "output": "699536\n"}, {"type": "stdin_stdout", "input": "1508\n", "output": "247634\n"}, {"type": "stdin_stdout", "input": "2451\n", "output": "681980\n"}, {"type": "stdin_stdout", "input": "1566\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\nThroughout Igor K.'s life he has...
[{"type": "stdin_stdout", "input": "446237720 920085248 296916273 439113596\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "491259590 529594367 305425951 326414536\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "960442940 572344654 77422042 406189391\n", "output": "1\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\nPetya has an array a consisting ...
[{"type": "stdin_stdout", "input": "48\n992 995 992 991 994 992 995 999 996 993 999 995 993 992 1000 992 568 996 991 993 992 998 998 998 999 995 992 992 993 992 992 995 996 995 997 991 997 991 999 994 994 997 1000 32 1000 992 1000 999\n", "output": "12\n568 998 993 996 995 991 994 997 32 992 1000 999\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\nView Russian Translation\n\nLima...
[{"type": "stdin_stdout", "input": "2\n3\n###\n#$.\n##$\n4\n####\n.##.\n.#..\n#...\n\nELPMAS", "output": "YES\nYES\n"}, {"type": "stdin_stdout", "input": "2\n3\n$##\n#\".\n###\n4\n####\n.##.\n.#..\n...#\n\nSAMFLP", "output": "YES\nYES\n"}, {"type": "stdin_stdout", "input": "2\n3\n$##\n#\".\n###\n4\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\nLittle Pandey and GJ are coding ...
[{"type": "stdin_stdout", "input": "50\n86\n185 167 338 174 500 611 873 127 977 68 411 560 882 867 950 515 871 490 716 444 657 565 207 178 667 503 980 371 220 998 576 91 11 989 199 582 269 439 266 678 525 871 180 14 742 447 333 893 400 499 477 708 315 635 706 443 957 663 855 438 280 491 731 753 360 333 806 310 551 381 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 need to handle two extraordi...
[{"type": "stdin_stdout", "input": "25\n0!\n1\n9!\n1828952637\n9!!\n999999999\n456!!!\n123!!!!!!\n5!\n120\n9!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n999999999!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n0!\n1\n2!\n1\n2!\n2\n6\n3!\n4!\n24\n5!\n120\n1077\n6!\n5040!\n7!!\n8!!!\n40320!!\n862380!!!\n9!!!!\n10!!!!!\n...
code_stdio