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\nYou are given a prime number p, ... | [{"type": "stdin_stdout", "input": "7 7 3\n4 0 5 3 1 2 6\n", "output": "0"}, {"type": "stdin_stdout", "input": "6 11 2\n1 2 3 4 5 6\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "6 10 2\n1 2 3 4 5 6\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "6 10 2\n1 2 3 4 5 0\n", "output": "1\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\nAsterix, Obelix and their tempor... | [{"type": "stdin_stdout", "input": "btbdpnzdenxueteteytvkwnegodyhmdwhmrmbftrifytzudumzlacwytsuzefqfpjesdblxhpcsidgksisjdmhyxmmugrjmtfcgxmcgpmvbxbyszdugvmoyjeeqsywcvuqskcjotyhvdijyslgfvyujxthngnonasgnbzzygyikheelirdfsvuicbiazfdeqecbtbdpnzdenxueteteytvkwnegodyhmdwhmrmbftrifytzudumzlacwytsuzefqfpjesdblxhpcsidgksisjdmhyxmm... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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[3R2 as DJ Mashiro - Happiness B... | [{"type": "stdin_stdout", "input": "10 83\n1 3\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n2 2\n1 4\n2 2\n2 3\n2 3\n2 3\n2 3\n2 3\n2 3\n1 4\n1 5\n1 7\n2 2\n2 2\n1 5\n2 2\n1 3\n2 1\n2 6\n1 5\n2 6\n2 9\n1 2\n2 5\n1 2\n2 5\n2 4\n2 4\n1 2\n1 2\n1 4\n2 6\n2 6\n2 4\n2 4\n1 2\n1 2\n2 4\n2 4\n2 3\n2 3\n1 2\n2 9\n1 2\n1 2\n1 2\n2 6\n2 6\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\nYou are given an array a_1, a_2,... | [{"type": "stdin_stdout", "input": "3\n1\n7\n4\n1 1 3 5\n6\n3 2 1 5 6 4\n", "output": "7\n5 3 1 1\n6 5 4 3 2 1\n"}, {"type": "stdin_stdout", "input": "3\n1\n7\n4\n1 1 3 5\n6\n3 2 1 5 6 4\n", "output": "7\n5 3 1 1\n6 5 4 3 2 1\n"}, {"type": "stdin_stdout", "input": "3\n1\n7\n4\n0 1 3 5\n6\n3 2 1 5 6 4\n", "output": "7\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\nLet's define the following recur... | [{"type": "stdin_stdout", "input": "8\n1 4\n487 1\n487 2\n487 3\n487 4\n487 5\n937 6\n487 1\n", "output": "42\n487\n519\n528\n544\n564\n1000\n487\n"}, {"type": "stdin_stdout", "input": "8\n1 4\n487 1\n487 2\n487 3\n487 4\n487 5\n487 6\n487 10\n", "output": "42\n487\n519\n528\n544\n564\n588\n716\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an array a_1, a_2,... | [{"type": "stdin_stdout", "input": "11\n1\n0\n1\n1\n1\n2\n1\n3\n1\n4\n1\n5\n1\n6\n1\n7\n1\n8\n1\n9\n26\n11140000000090000000002111\n", "output": "0\n1\n0\n0\n0\n0\n0\n0\n0\n0\n37\n"}, {"type": "stdin_stdout", "input": "11\n1\n0\n1\n1\n1\n2\n1\n3\n1\n0\n1\n5\n1\n6\n1\n7\n1\n8\n1\n9\n26\n11140000000090000000002111\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\nLindsey Buckingham told Stevie N... | [{"type": "stdin_stdout", "input": "2\n-3 1\n1 3 5 7 9 11\n1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n", "output": "18\n1000000000000000000\n"}, {"type": "stdin_stdout", "input": "2\n-3 1\n1 3 5 7 9 11\n1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000 110... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOnce upon a time in the Kingdom ... | [{"type": "stdin_stdout", "input": "1987385827\n", "output": "3123034907 15899086625\n"}, {"type": "stdin_stdout", "input": "1286843196\n", "output": "1286843244 10294745577\n"}, {"type": "stdin_stdout", "input": "1600010311\n", "output": "1936854671 12800082497\n"}, {"type": "stdin_stdout", "input": "1856589245\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\nThere is a graph of n rows and 1... | [{"type": "stdin_stdout", "input": "4\n2 3 1\n999999 1000000\n2 3 2\n999999 1000000\n2 3 1\n1000000 1584412\n2 3 1\n100 1000000\n", "output": "1\n2\n0\n0\n"}, {"type": "stdin_stdout", "input": "4\n2 3 1\n285716 1000000\n2 3 2\n999999 1000000\n2 3 1\n1000000 1584412\n2 3 1\n100 1000000\n", "output": "0\n2\n0\n0\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\nAn array is called beautiful if ... | [{"type": "stdin_stdout", "input": "5\n0 11 12 13 14\n", "output": "\n120"}, {"type": "stdin_stdout", "input": "5\n0 12 1 13 14\n", "output": "24\n"}, {"type": "stdin_stdout", "input": "5\n1 3 0 13 48\n", "output": "120\n"}, {"type": "stdin_stdout", "input": "5\n1 18 2 13 26\n", "output": "24\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\nIn some country live wizards. Th... | [{"type": "stdin_stdout", "input": "10 7 8\n2 4\n3 13\n4 7\n5 1\n9 16\n10 9\n12 18\n16 4\n17 16\n20 10\n", "output": "4.285714285714286\n4.511857892036909\n5.642857142857143\n13.071428571428573\n13.071428571428573\n13.071428571428573\n13.51185789203691\n18.28571428571429\n18.511857892036907\n21.514285714285712\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\nPolycarpus has a ribbon, its len... | [{"type": "stdin_stdout", "input": "3043 317 1141 2438\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "3399 2035 2 3334\n", "output": "683\n"}, {"type": "stdin_stdout", "input": "4000 500 1000 2000\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "4000 500 1000 1671\n", "output": "8\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\nThose days, many boys use beauti... | [{"type": "stdin_stdout", "input": "yufkkfwyhhvcjntsgsvpzbhqtmtgyxifqoewmuplphykmptfdebjxuaxigomjtwgtljwdjhjernkitifbomifbhysnmadtnyn\n", "output": "CHAT WITH HER!\n"}, {"type": "stdin_stdout", "input": "yufkkfwyhhvcjntsgsvpzbhqtmtgyxifqoewmuplphykmptfdebjxuaxigomjtwgtljwdjhjernkitifbomifbhxsnmadtnyn\n", "output": "CHA... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 board has got a painted tree... | [{"type": "stdin_stdout", "input": "50\n1 574339\n0 409333\n0 330634\n0 420557\n0 323095\n0 63399\n0 69999\n1 82396\n1 90197\n0 265793\n0 65065\n1 38496\n1 43632\n1 95792\n1 61780\n1 87623\n1 31246\n0 48483\n1 76824\n1 81693\n1 66004\n1 72826\n1 146477\n1 12359\n1 27042\n1 12542\n0 81514\n0 28986\n1 73958\n1 8219\n0 56... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFarmer John has just given the c... | [{"type": "stdin_stdout", "input": "98\n94 24 17 133 275858941 58 91 57 13 468038892 42 195790073 494005784 8 468106970 518962936 33 27 67 72 42 206673418 10 82 23 34 29 77 90 39 9 67 34 71 29 95 49 48 60 69 86 71 94 77 48 74 19 96700186 5 67 867418949 663483223 64 64 78 23 8 60 7 17 96 71 70 20 5 63 35 34 63 30 86 76 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nReforms continue entering Berlan... | [{"type": "stdin_stdout", "input": "98 24\n52 20 12 75 44 22 22 25 28 100 8 41 31 47 95 87 5 54 7 49 32 46 42 37 45 22 29 11 54 98 46 94 10 47 114 2 15 108 17 82 46 22 32 62 89 37 30 26 92 77 69 11 59 78 24 66 88 10 32 93 46 14 57 20 5 69 53 99 81 94 67 22 54 31 49 52 46 51 49 4 53 31 4 66 28 38 103 5 40 75 15 52 87 16... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 often uses public transpor... | [{"type": "stdin_stdout", "input": "680 871 347 800\n10 100\n872 156 571 136 703 201 832 213 15 333\n465 435 870 173 660 237 694 594 423 405 27 866 325 490 255 989 128 345 278 125 708 210 771 848 961 448 871 190 745 343 532 174 103 999 874 221 252 500 886 129 185 208 137 425 758 34 696 15 198 981 91 50 545 885 194 583 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSereja showed an interesting gam... | [{"type": "stdin_stdout", "input": "100 1000\n10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA and B are preparing themselves... | [{"type": "stdin_stdout", "input": "-2 -2 2 1 4 0 -2 4 5 4 -5 -5 2 1 1 -1 0 -5 -2 3 -2 4 5 2 3 -5\nqgzhbkitmqwttdyoyvcbxincwjryzknubpacsngorexaldfurondbednowemnnlphhboycfavsovisrmfaefusoobingjhsmrukx\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "-2 -2 2 1 4 0 -2 4 5 4 -5 -5 2 1 1 -1 0 -5 -2 3 -2 6 5 2 3 -5\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn this task you need to process... | [{"type": "stdin_stdout", "input": "3 3\nB 16671 5044\nS 23924 4895\nS 76276 1905\n", "output": "S 76276 1905\nS 23924 4895\nB 16671 5044\n"}, {"type": "stdin_stdout", "input": "3 3\nB 16671 5006\nS 23924 4895\nS 76276 1905\n", "output": "S 76276 1905\nS 23924 4895\nB 16671 5006\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\nArya has n opponents in the scho... | [{"type": "stdin_stdout", "input": "1 100\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\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\nPolandBall is playing a game wit... | [{"type": "stdin_stdout", "input": "2 2\nkremowka\nwadowicka\nkremowka\nwiedenska\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "2 2\nkremowak\nwadowicka\nkremowka\nwiedenska\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "2 2\nkremowak\nwadowicka\nkremowka\nwiedanske\n", "output": "NO\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\nMolly Hooper has n different kin... | [{"type": "stdin_stdout", "input": "89 -7\n5972 4011 3914 670 3727 2913 6935 6927 2118 6645 7141 3585 9811 2859 459 8870 6578 8667 468 5152 3241 7455 7323 8817 4866 1040 5102 9146 621 5002 396 4967 9822 4200 3899 4416 5225 9415 9606 4802 5589 1798 9094 5453 7163 264 1026 6187 3918 4237 -17 4306 8960 3321 2927 9205 6248... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOkabe needs to renovate the Futu... | [{"type": "stdin_stdout", "input": "10\n3 2 6 5 1 2 1 1 2 1\n1 2 2 3 1 4 1 1 1 1\n1 1 3 1 2 2 2 1 1 1\n1 3 1 2 1 2 1 1 1 1\n12 1 4 3 3 1 1 1 2 1\n8 1 1 1 1 3 6 5 1 3\n1 1 1 2 4 1 3 2 1 1\n1 1 1 1 1 1 1 2 1 1\n1 2 1 1 1 1 1 1 1 1\n2 1 1 1 1 1 1 1 1 2\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "10\n3 2 6 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\nDoubly linked list is one of the... | [{"type": "stdin_stdout", "input": "100\n0 0\n0 0\n0 0\n97 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 29\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n12 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSnark and Philip are preparing t... | [{"type": "stdin_stdout", "input": "10 4\n1 0 1 0\n1 0 0 1\n1 1 0 1\n1 0 1 1\n1 1 0 1\n1 0 1 0\n0 0 0 0\n0 0 1 0\n1 0 1 0\n0 0 1 1\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "10 4\n0 0 1 1\n0 0 1 1\n0 0 1 1\n0 0 1 1\n0 0 1 1\n0 0 1 1\n0 0 1 1\n0 0 1 1\n0 0 1 1\n1 1 0 0\n", "output": "YES\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\nYou are given a rooted tree cons... | [{"type": "stdin_stdout", "input": "5 2\n1 3 2 3 5\n2 3\n5 1\n3 4\n4 1\n2\n1 2\n2 3\n", "output": "2\n5\n"}, {"type": "stdin_stdout", "input": "5 2\n1 3 2 3 5\n2 3\n5 2\n3 4\n4 1\n2\n1 2\n2 3\n", "output": "2\n5\n"}, {"type": "stdin_stdout", "input": "5 2\n1 3 3 3 5\n2 3\n5 2\n3 4\n4 1\n2\n1 2\n2 3\n", "output": "3\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 two positive integ... | [{"type": "stdin_stdout", "input": "1000000000000000000\n1000000000000000000\n", "output": "1000000000000000000\n"}, {"type": "stdin_stdout", "input": "1000000000000000000\n1000000000100000000\n", "output": "1000000000000000000\n"}, {"type": "stdin_stdout", "input": "999999999999999999\n1000000000000000000\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\nMusicians of a popular band \"Fl... | [{"type": "stdin_stdout", "input": "7 7\n1 6 745325\n2 3 3581176\n2 4 19\n3 6 71263060078\n5 4 170098\n7 4 163953\n5 6 15994\n1 297404206755 82096176217 14663411 187389745 21385 1317789\n", "output": "1 393607 7555959 393569 53373 21385 721475\n"}, {"type": "stdin_stdout", "input": "7 7\n1 6 745325\n2 3 3581176\n2 4 19... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 boys are sitting in a circle. ... | [{"type": "stdin_stdout", "input": "4\n0 3 10 3\n\nR@LOLF", "output": "10\n"}, {"type": "stdin_stdout", "input": "4\n1 3 13 7\n\nEAPMLS", "output": "12\n"}, {"type": "stdin_stdout", "input": "4\n1 3 33 7\n\nELMOAS", "output": "32\n"}, {"type": "stdin_stdout", "input": "4\n1 3 17 7\n\nRANPMG", "output": "16\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\nβCan you answer this million dol... | [{"type": "stdin_stdout", "input": "3 11\n5 5 r\n13 10 N\n39 10 y\n482 13 O\n51 11 K\n67 10 v\n5298 20 7\n591 20 i\n7126 17 8\n430 13 W\n155 11 z", "output": "0\n"}, {"type": "stdin_stdout", "input": "3 11\n5 5 r\n13 10 N\n39 10 y\n482 13 O\n51 11 K\n67 10 v\n5298 20 7\n574 20 i\n7126 17 8\n430 13 W\n155 11 z", "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\nOur monk loves food. Hence,he to... | [{"type": "stdin_stdout", "input": "6\n1\n2 -1\n2 11\n2 10\n1\n1\n\nSANPKE", "output": "No Food\n10\n11\n"}, {"type": "stdin_stdout", "input": "6\n1\n2 -1\n2 17\n2 10\n1\n1\n\nSANPKE", "output": "No Food\n10\n17\n"}, {"type": "stdin_stdout", "input": "6\n1\n2 -1\n2 10\n2 10\n1\n1\n\nELPLAS", "output": "No Food\n10\n10\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 non-negative integer K, we... | [{"type": "stdin_stdout", "input": "2\n3 2 7 8\n12 3 1 15", "output": "10\n23\n"}, {"type": "stdin_stdout", "input": "2\n0 2 7 8\n12 3 1 15", "output": "13\n23\n"}, {"type": "stdin_stdout", "input": "2\n0 2 10 8\n6 3 1 15", "output": "16\n17\n"}, {"type": "stdin_stdout", "input": "2\n15 2 4 4\n7 6 1 26", "output": "13\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 is standing on a multi... | [{"type": "stdin_stdout", "input": "10000000019", "output": "10000000018"}, {"type": "stdin_stdout", "input": "6069423871", "output": "23434326\n"}, {"type": "stdin_stdout", "input": "65898355", "output": "13179674\n"}, {"type": "stdin_stdout", "input": "68833649", "output": "68833648\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\nThere is an arithmetic progressi... | [{"type": "stdin_stdout", "input": "107 10000000000007 1000000000000007 1055093371", "output": "58425676\n"}, {"type": "stdin_stdout", "input": "107 10000000000007 1000000000000007 498250141", "output": "152045046\n"}, {"type": "stdin_stdout", "input": "107 17664785118816 1000000000000007 498250141", "output": "2402025... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 us consider a grid of square... | [{"type": "stdin_stdout", "input": "9\n17 18 51 18 28 45 112 45 23", "output": "917046249"}, {"type": "stdin_stdout", "input": "9\n17 18 51 18 34 45 112 45 23", "output": "938229436"}, {"type": "stdin_stdout", "input": "9\n17 18 51 18 34 45 190 45 23", "output": "353713429"}, {"type": "stdin_stdout", "input": "9\n17 18... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAtCoDeer the deer is going on a ... | [{"type": "stdin_stdout", "input": "2\n-3 4 1\n111 4 -1", "output": "No\n"}, {"type": "stdin_stdout", "input": "2\n5 2 3\n100 0 0", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "2\n5 2 2\n100 1 -1", "output": "No\n"}, {"type": "stdin_stdout", "input": "2\n5 2 1\n111 1 0", "output": "Yes\n"}, {"type": "stdin_st... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given N items.\nThe valu... | [{"type": "stdin_stdout", "input": "5 1 5\n1000000000000000 999999999999999 999999999999998 455140417295801 999999999999996", "output": "1000000000000000.00000000\n1\n"}, {"type": "stdin_stdout", "input": "5 1 5\n1000000000000000 999999999999999 999999999999998 999999999999997 999999999999996", "output": "1000000000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 foxes Jiro and Saburo are pl... | [{"type": "stdin_stdout", "input": "WBWBWBBBWW", "output": "6\n"}, {"type": "stdin_stdout", "input": "WWBBCWBWBV", "output": "7\n"}, {"type": "stdin_stdout", "input": "XWBBCWBWBV", "output": "8\n"}, {"type": "stdin_stdout", "input": "XWVBCWBWCB", "output": "9\n"}, {"type": "stdin_stdout", "input": "WWBBBWBWBW", "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\nSeen from above, there is a grid... | [{"type": "stdin_stdout", "input": "1111\n00001\n0110\n11111\n1010\n00011\n1010\n01011\n1111", "output": "RRRRDDDDLLLLRULRDRRULRULULDLUDRURRDDDRUUUULLLL\n"}, {"type": "stdin_stdout", "input": "1111\n01001\n0010\n11101\n1110\n00111\n1110\n10001\n1110", "output": "RRRRDDDDUUUULLLDDRURLDRDLLLDRRRLLLURRULLUDRUUL\n"}, {"typ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBlackjack is a type of card game... | [{"type": "stdin_stdout", "input": "1\n3 7 4\n13 7 13\n10 2\n10 1 1\n0", "output": "11\n14\n0\n12\n12\n"}, {"type": "stdin_stdout", "input": "1\n11 3 4\n1 7 8\n2 1\n10 3 1\n0", "output": "11\n17\n16\n13\n14\n"}, {"type": "stdin_stdout", "input": "1\n7 7 3\n11 10 8\n8 1\n10 2 1\n0", "output": "11\n17\n0\n19\n13\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\nHave you ever had an infinite lo... | [{"type": "stdin_stdout", "input": "6\n10 SET d 1\n20 SET h 5\n100 ADD s s i\n110 SUB i i c\n120 IF i 100\n124 HALT", "output": "c=0\nd=1\nh=5\ni=0\ns=0\n"}, {"type": "stdin_stdout", "input": "6\n10 SET c 1\n20 SET h 5\n100 ADD s s i\n110 SUB i i c\n209 IF j 100\n200 HALT", "output": "c=1\nh=5\ni=0\nj=0\ns=0\n"}, {"typ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJOI is playing with a nail in th... | [{"type": "stdin_stdout", "input": "5 2\n2 1 1\n2 1 3", "output": "10\n"}, {"type": "stdin_stdout", "input": "9 2\n2 1 1\n2 1 3", "output": "10\n"}, {"type": "stdin_stdout", "input": "5 2\n2 2 1\n2 1 3", "output": "12"}, {"type": "stdin_stdout", "input": "1 2\n2 1 1\n2 1 3", "output": "0\n"}, {"type": "stdin_stdout", "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolygons are the most fundamenta... | [{"type": "stdin_stdout", "input": "3\n1 1\n3 4\n6 -1\n\n7\n1 -1\n10 10\n-1 20\n3 33\n0 70\n100 40\n100 -1\n\n0", "output": "1 9.5\n2 5426.0\n"}, {"type": "stdin_stdout", "input": "3\n1 1\n3 4\n6 -1\n\n7\n1 -1\n10 10\n-1 20\n3 33\n0 40\n100 40\n100 0\n\n0", "output": "1 9.5\n2 3921.5\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\n500-yen Saving\n\n\"500-yen Savi... | [{"type": "stdin_stdout", "input": "4\n800\n700\n1600\n600\n4\n300\n1205\n1600\n30\n4\n300\n700\n1600\n650\n3\n1001\n2000\n638\n3\n250\n250\n1000\n4\n1251\n1466\n698\n299\n0", "output": "2 2900\n4 3135\n3 3250\n2 1639\n3 1500\n4 3714\n"}, {"type": "stdin_stdout", "input": "4\n800\n700\n1600\n600\n4\n300\n1205\n1600\n30... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 the sum of divisors of ... | [{"type": "stdin_stdout", "input": "1\n2\n2\n1\n1\n14\n16\n27\n66290451\n187711252\n124798312\n100001000\n0", "output": "deficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\ndeficient number\na... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 came to a square to look fo... | [{"type": "stdin_stdout", "input": "5 5\n10 7\n-3 -8\n2 11\n6 0\n-1 3\n-3 1 3 13\n-1 -1 9 5\n-3 -16 10 11\n-1 0 5 4\n-1 -13 15 10", "output": "2\n2\n5\n1\n3\n"}, {"type": "stdin_stdout", "input": "5 5\n10 7\n-3 -8\n2 11\n10 0\n-1 3\n-3 1 3 13\n-1 -1 9 5\n-3 -16 12 11\n0 0 5 4\n-1 -13 15 10", "output": "2\n1\n5\n0\n3\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\nBroken crypto generator\n\nJAG (... | [{"type": "stdin_stdout", "input": "A+A++A\nZ-Z--Z+-Z\n[ESRVEER]\nJ---?---J\n++++++++A+++Z-----------A+++Z\n[[++-+--?[--++-?++-+++L]][-+-----+-O]]++++---+L\n.", "output": "ABC\nZYXZ\nREEVRSE\nJAG\nICPC\nJAPAN\n"}, {"type": "stdin_stdout", "input": "A+A++A\nZ-ZZ--+-Z\n[ESRVEER]\nJ---?---J\n++++++++A+++Z-----------A+++Z\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nB-Mansion and courier\n\nProblem... | [{"type": "stdin_stdout", "input": "1 1 110\n18", "output": "108\n"}, {"type": "stdin_stdout", "input": "1 0 110\n11", "output": "110\n"}, {"type": "stdin_stdout", "input": "1 3 110\n18", "output": "104\n"}, {"type": "stdin_stdout", "input": "1 0 192\n16", "output": "192\n"}, {"type": "stdin_stdout", "input": "1 1 192\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nproblem\n\nGiven a sequence $ a_... | [{"type": "stdin_stdout", "input": "8\n0 1 1 -24 -1 1 1 0", "output": "1 2 3 5 6 7 8\n"}, {"type": "stdin_stdout", "input": "8\n-1 0 12 16 3 1 0 -1", "output": "1 2 6 7 8\n"}, {"type": "stdin_stdout", "input": "8\n-1 0 12 8 3 1 0 -1", "output": "1 2 6 7 8\n"}, {"type": "stdin_stdout", "input": "8\n5 2 4 9 4 9 2 5", "ou... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nShell Sort\n\nShell Sort is a ge... | [{"type": "stdin_stdout", "input": "5\n10\n1\n5\n9\n1", "output": "2\n4 1\n1\n1\n1\n5\n9\n10\n"}, {"type": "stdin_stdout", "input": "5\n10\n1\n5\n7\n1", "output": "2\n4 1\n1\n1\n1\n5\n7\n10\n"}, {"type": "stdin_stdout", "input": "5\n6\n1\n10\n7\n1", "output": "2\n4 1\n4\n1\n1\n6\n7\n10\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\nWrite a program which reads a $ ... | [{"type": "stdin_stdout", "input": "3 4\n1 4 -2 1\n0 3 0 -1\n4 1 0 0\n0\n-2\n3\n0", "output": "-14\n-6\n-2\n"}, {"type": "stdin_stdout", "input": "3 4\n0 7 -13 0\n0 0 0 1\n4 2 2 0\n1\n1\n3\n-1", "output": "-32\n-1\n12\n"}, {"type": "stdin_stdout", "input": "3 4\n0 7 -13 0\n0 0 0 1\n4 2 2 0\n1\n2\n3\n-1", "output": "-25... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 ve... | [{"type": "stdin_stdout", "input": "912738218 530309782 -939253776\n592805323 -930297022 -567581994 -829432319\n", "output": "1218437463.3854325\n"}, {"type": "stdin_stdout", "input": "912738218 530309782 -939253776\n592805323 -930297022 -567581994 -31761631\n", "output": "1677516792.7100685\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\nAlice's hair is growing by leaps... | [{"type": "stdin_stdout", "input": "4 20 1000000000\n1000000000 1000000000 1000000000 1000000000\n1 1 1\n1 4 1\n0\n1 1 1000000000\n1 4 1000000000\n0\n1 1 1000000000\n1 4 1000000000\n1 1 1000000000\n1 4 1000000000\n1 1 1000000000\n1 4 1000000000\n1 1 1000000000\n1 4 1000000000\n0\n1 2 1\n0\n1 3 1\n0\n1 2 1\n", "output":... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's call an array good if ther... | [{"type": "stdin_stdout", "input": "4\n500000 500000 1000000 1000000\n", "output": "2\n3 4\n"}, {"type": "stdin_stdout", "input": "4\n500000 251993 1000000 1000000\n", "output": "0\n\n"}, {"type": "stdin_stdout", "input": "6\n4 7 1 1 1 1\n", "output": "5\n2 3 4 5 6\n"}, {"type": "stdin_stdout", "input": "4\n2 1000000 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an n Γ m table, co... | [{"type": "stdin_stdout", "input": "3 5\nAGCAG\nAGCAG\nAGCAG\n", "output": "AGCTC\nCTAGA\nAGCTC\n"}, {"type": "stdin_stdout", "input": "3 5\nGACGA\nAGCAG\nAGCAG\n", "output": "AGCGA\nCTATC\nAGCGA\n"}, {"type": "stdin_stdout", "input": "3 5\nAGGAC\nGACGA\nGACGA\n", "output": "AGAGC\nCTCTA\nAGAGC\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\nRamesses came to university to a... | [{"type": "stdin_stdout", "input": "10 10\n1 1 1 0 1 1 0 0 0 1\n1 1 1 1 0 0 0 0 0 1\n0 1 0 0 0 0 0 0 1 0\n0 0 0 0 0 1 0 0 0 0\n0 1 1 1 0 1 1 1 0 0\n0 0 0 1 1 1 0 1 0 0\n0 0 0 0 1 1 0 0 1 1\n0 0 0 1 1 0 1 1 1 1\n1 1 0 1 1 0 1 1 0 0\n1 0 0 0 0 0 0 0 1 0\n0 1 0 1 0 1 1 1 0 0\n0 1 1 0 0 0 0 0 0 1\n0 1 0 0 0 1 0 0 0 0\n0 1 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe only difference between easy... | [{"type": "stdin_stdout", "input": "10 50\n10 10 10 10 10 10 10 10 10 10\n", "output": "0 0 0 0 0 1 2 3 4 5 \n"}, {"type": "stdin_stdout", "input": "10 71\n10 10 10 10 10 10 10 10 10 10\n", "output": "0 0 0 0 0 0 0 1 2 3\n"}, {"type": "stdin_stdout", "input": "10 71\n10 10 10 10 10 10 10 10 10 14\n", "output": "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\nIn the city of Saint Petersburg,... | [{"type": "stdin_stdout", "input": "1000010011100010111000001101000011001010011101011001101100000001011011000000101101101011101111011011\n", "output": "50\n"}, {"type": "stdin_stdout", "input": "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\n", "output": "50\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 positive integer... | [{"type": "stdin_stdout", "input": "100 4\n94 94 83 27 80 73 61 38 34 95 72 96 59 36 52 15 122 78 39 22 21 57 54 59 9 32 81 64 51 90 67 41 18 58 93 76 44 62 77 61 31 70 39 73 111 57 43 31 27 85 36 26 58 48 35 23 124 53 3 14 40 67 53 19 70 81 98 12 91 15 92 90 89 86 58 30 67 73 72 69 68 47 30 7 89 41 17 97 45 6 4 23 13 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBees Alice and Alesya gave beeke... | [{"type": "stdin_stdout", "input": "24 4\nSETS\nETES\nSSST\nESTE\nTSES\nSSES\nTESS\nSEEE\nETEE\nETSS\nSSEE\nESTT\nSTSS\nTTTT\nTEEE\nTSEE\nESET\nTTTE\nETTT\nSTEE\nSTTE\nESSS\nTEET\nTETE\n", "output": "31\n"}, {"type": "stdin_stdout", "input": "24 4\nSETS\nETES\nSSST\nESTE\nTSES\nSSES\nTESS\nEESE\nETEE\nETSS\nSSEE\nESTT\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBessie has way too many friends ... | [{"type": "stdin_stdout", "input": "1\n19 1000000000\n15 8 22 12 10 16 2 17 14 7 20 23 9 18 3 19 21 11 1\n", "output": "43478261\n"}, {"type": "stdin_stdout", "input": "1\n19 1000000000\n15 8 22 12 10 16 2 17 14 7 20 23 9 14 3 19 21 11 1\n", "output": "43478261\n"}, {"type": "stdin_stdout", "input": "1\n19 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\nThe sequence of m integers is ca... | [{"type": "stdin_stdout", "input": "6\n5\n1 4 3 2 1\n6\n2 4 1 3 3 1\n4\n2 1 1 2\n4\n1 3 3 1\n12\n2 1 3 5 5 6 7 8 9 1 10 2\n3\n1 2 1\n", "output": "2\n1 4\n4 1\n0\n1\n2 2\n0\n0\n2\n1 2\n2 1\n"}, {"type": "stdin_stdout", "input": "6\n5\n1 4 3 2 1\n6\n2 4 1 3 2 1\n4\n2 1 1 3\n4\n1 3 3 1\n12\n2 1 3 4 5 6 7 8 9 1 10 2\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\nThere are n models in the shop n... | [{"type": "stdin_stdout", "input": "4\n23\n3198 4895 1585 3916 2650 5552 876 2731 1971 126 2152 6910 1096 4103 1074 2594 2897 3983 3830 3460 729 576 3281\n1\n0000000010\n2\n1 1\n100\n1 2 3 4 5 2 7 10 9 14 11 12 13 14 24 16 17 33 19 20 21 22 23 24 25 26 27 28 29 41 31 32 56 34 35 36 37 38 39 40 41 42 43 44 45 46 54 48 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\nNaman has two binary strings s a... | [{"type": "stdin_stdout", "input": "12\n011001010101\n111001010101\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "12\n011101010101\n101001010101\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "12\n011101010101\n111001010101\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "10\n1111100000\n11... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPetya loves lucky numbers very m... | [{"type": "stdin_stdout", "input": "86451 754 85 84\n", "output": "4444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 matrix a consist... | [{"type": "stdin_stdout", "input": "2 3\n16 16 11\n16 16 16\n", "output": "720720 786256 720720\n786256 720720 786256\n"}, {"type": "stdin_stdout", "input": "2 3\n12 16 16\n13 14 16\n", "output": "720720 786256 720720\n749281 720720 786256\n"}, {"type": "stdin_stdout", "input": "2 3\n16 16 15\n12 21 16\n", "output": "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\nVasya has recently bought some l... | [{"type": "stdin_stdout", "input": "100 3000\n1 4\n2 1\n3 3\n1 1\n5 4\n4 1\n2 1\n5 4\n1 1\n3 3\n4 3\n3 4\n4 2\n2 4\n1 2\n3 4\n5 3\n1 4\n2 4\n4 5\n1 2\n5 2\n2 2\n3 2\n4 4\n1 4\n5 5\n3 4\n4 1\n3 3\n5 2\n3 3\n4 1\n1 5\n4 3\n5 3\n4 2\n3 3\n3 5\n5 1\n5 1\n3 3\n4 3\n1 3\n4 1\n2 3\n1 3\n1 2\n5 5\n5 2\n1 5\n4 2\n1 1\n1 1\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\nKirito is stuck on a level of th... | [{"type": "stdin_stdout", "input": "9983 34\n6626 5976\n4448 3568\n2794 2309\n3741 8806\n4754 129\n2780 9275\n5785 9243\n3915 6159\n2609 4331\n238 6756\n6987 3887\n3384 5711\n4349 5563\n1135 4483\n9151 1584\n1500 766\n1608 4440\n7768 5005\n7205 2360\n9088 2933\n3923 7814\n7538 9372\n7504 165\n5277 1636\n2061 4384\n7668... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nValera considers a number beauti... | [{"type": "stdin_stdout", "input": "10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDo you remember how Kai construc... | [{"type": "stdin_stdout", "input": "2559\n52555995269265555695922255525995255259555259252562655622526292929555265526255252526255555296956995596262965522222225655655262255226222259622295225295525265995566255556225522559559295225625559595222652\n", "output": "48\n"}, {"type": "stdin_stdout", "input": "2569\n0962996596622... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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Β«BersoftΒ» company is working on ... | [{"type": "stdin_stdout", "input": "713,572,318,890,577,657,646,146,373,783,392,229,455,871,20,593,573,336,26,381,280,916,907,732,820,713,111,840,570,446,184,711,481,399,788,647,492,15,40,530,549,506,719,782,126,20,778,996,712,761,9,74,812,418,488,175,103,585,900,3,604,521,509,513,145,708,990,361,682,827,791,22,596,780... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDZY loves planting, and he enjoy... | [{"type": "stdin_stdout", "input": "10\n1 10 4313\n2 6 2842\n3 6 7059\n4 6 3007\n5 6 6195\n7 6 3962\n8 6 3413\n9 6 7658\n10 6 8049\n3\n3\n2\n1\n4\n4\n5\n2\n1\n1\n", "output": "7059\n"}, {"type": "stdin_stdout", "input": "10\n2 1 8760\n3 1 3705\n4 1 1862\n5 2 7332\n6 3 7015\n7 5 4866\n8 3 4465\n9 7 8886\n10 3 9362\n2\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\nGeorge has recently entered the ... | [{"type": "stdin_stdout", "input": "100\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 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\nA permutation is a sequence of i... | [{"type": "stdin_stdout", "input": "100\n9 6 3 28 10 2 2 11 2 1 25 3 13 5 14 13 4 14 2 16 12 27 8 1 7 9 8 19 33 23 4 1 15 6 7 12 2 8 30 4 1 31 6 1 15 5 18 3 2 24 7 3 1 20 10 8 26 22 3 3 9 6 1 10 1 5 1 3 7 6 11 10 1 16 19 5 9 4 4 4 2 18 12 21 11 5 2 32 17 29 2 4 8 1 7 5 3 2 17 1\n", "output": "12\n1 1 1 1 1 1 2 1 3 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\nAlice and Bob love playing one-d... | [{"type": "stdin_stdout", "input": "50 1 1\n50\n1 13 21 37 30 48 23 19 6 49 36 14 9 24 44 10 41 28 20 2 15 11 45 3 25 33 50 38 35 47 31 4 12 46 32 8 42 26 5 7 27 16 29 43 39 22 17 34 40 18\n", "output": "50\n"}, {"type": "stdin_stdout", "input": "50 7 3\n50\n17 47 1 12 21 25 6 5 49 27 34 8 16 38 11 44 48 9 2 20 3 22 33... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 semester is already ending, ... | [{"type": "stdin_stdout", "input": "8\n", "output": "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\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\nVasya started working in a machi... | [{"type": "stdin_stdout", "input": "-1315489005576995761\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "-1287027209222040878\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "-1503133216326740481\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "-1638150760258347909\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\nBerland has n cities connected b... | [{"type": "stdin_stdout", "input": "10 45\n3 5\n2 3\n4 8\n2 5\n6 8\n10 7\n2 1\n3 7\n5 10\n6 1\n9 8\n3 1\n2 10\n6 7\n1 7\n7 9\n6 9\n9 3\n4 2\n2 6\n5 6\n5 8\n3 4\n10 8\n7 8\n4 6\n9 1\n5 5\n7 4\n1 10\n9 2\n2 8\n6 10\n9 8\n1 5\n7 2\n10 3\n3 8\n2 10\n1 1\n10 7\n1 3\n1 8\n10 2\n4 10\n", "output": "0\n"}, {"type": "stdin_stdo... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSomeone gave Alyona an array con... | [{"type": "stdin_stdout", "input": "10\n1 1 1 10000000 10000000 10000000 10000000 10000000 10000000 10000000\n", "output": "9\n"}, {"type": "stdin_stdout", "input": "10\n1 1 1 10000000 10000000 10000000 10000000 10000000 10000000 11000000\n", "output": "9\n"}, {"type": "stdin_stdout", "input": "15\n1 2 2 20 23 25 28 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\nDr. Bruce Banner hates his enemi... | [{"type": "stdin_stdout", "input": "100\n", "output": "I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that I hate that I love that 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\nThe organizers of a programming ... | [{"type": "stdin_stdout", "input": "14 12 3 8 4 14\n30\nS,M\nS,M\nXL\nXXXL\nXXL,XXXL\nXXL,XXXL\nXXXL\nS,M\nXXL,XXXL\nM,L\nXXL\nXXL,XXXL\nXL,XXL\nL,XL\nXXL,XXXL\nM\nS,M\nXXXL\nXXL,XXXL\nXXL,XXXL\nM\nM,L\nS,M\nS,M\nXXL,XXXL\nXL,XXL\nXXL,XXXL\nXXL,XXXL\nS,M\nM,L\n", "output": "YES\nS\nS\nXL\nXXXL\nXXL\nXXL\nXXXL\nS\nXXL\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\nInzane finally found Zane with a... | [{"type": "stdin_stdout", "input": "11 1 5\n6\n1 2\n2 3\n3 4\n4 5\n5 6\n6 11\n7 8\n8 9\n9 10\n10 11\n", "output": "0\n\n"}, {"type": "stdin_stdout", "input": "11 1 5\n6\n1 2\n2 3\n3 4\n4 5\n5 6\n6 7\n7 8\n8 9\n9 10\n10 11\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "10 1 5\n5\n1 2\n1 3\n1 4\n1 5\n10 6\n10 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\nA permutation p of size n is an ... | [{"type": "stdin_stdout", "input": "1000 4\n", "output": "373086956251\n"}, {"type": "stdin_stdout", "input": "800 4\n", "output": "152620985001\n"}, {"type": "stdin_stdout", "input": "792 4\n", "output": "146597632567\n"}, {"type": "stdin_stdout", "input": "850 4\n", "output": "194577888126\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\nAfter the Tatvik Hiring Challeng... | [{"type": "stdin_stdout", "input": "10\n`abbccdkkeffgxhhiijjdellmmnnooqpqprrstttuvuvwxxfyyzz\naaaabaaaaaaaaaaa`aaaaaaaaaaaab`aaabaaaabaa\nabcdefghijrlmnopqkstuvwxyz\n-..............................aaaaaa`aaaaaabaaaaaaba\n,........a..........,,,,+,.,,,,,,,,,,,,,,aaaaaaaab.aba\nwwwlllllllllmklvwvvvuvuvvkkkkkkkkkkkkdddddd... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 young mischievous boy Harsh, g... | [{"type": "stdin_stdout", "input": "1000\n637440000\n497933618\n104308126\n54379600\n735895362\n146758511\n172457069\n786824866\n792402682\n2932951\n280042089\n190772473\n647479785\n613419369\n465129597\n173755079\n611820068\n311399952\n18559\n244257083\n243465884\n889140268\n511454427\n656283414\n5014973\n74313994\n43... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 three boxes A, B, and C,... | [{"type": "stdin_stdout", "input": "111 110 110", "output": "110 111 110\n"}, {"type": "stdin_stdout", "input": "110 110 110", "output": "110 110 110\n"}, {"type": "stdin_stdout", "input": "110 110 111", "output": "111 110 110\n"}, {"type": "stdin_stdout", "input": "100 100 100", "output": "100 100 100"}, {"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\nTakahashi and Aoki are training ... | [{"type": "stdin_stdout", "input": "30901 15700\n2647944172 11366428589\n5864465524 4464634034", "output": "23\n"}, {"type": "stdin_stdout", "input": "12000 15700\n3390000000 3810000000\n5550000000 2130000000", "output": "113"}, {"type": "stdin_stdout", "input": "30901 15700\n8541952587 11366428589\n5864465524 44646340... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 non-negative i... | [{"type": "stdin_stdout", "input": "2020 3053", "output": "0\n"}, {"type": "stdin_stdout", "input": "2845 3053", "output": "1\n"}, {"type": "stdin_stdout", "input": "1022 3053", "output": "0\n"}, {"type": "stdin_stdout", "input": "1022 2650", "output": "0\n"}, {"type": "stdin_stdout", "input": "1022 4340", "output": "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 positive integers ... | [{"type": "stdin_stdout", "input": "10 111", "output": "101\n"}, {"type": "stdin_stdout", "input": "110 40", "output": "-70\n"}, {"type": "stdin_stdout", "input": "111 40", "output": "-71\n"}, {"type": "stdin_stdout", "input": "111 62", "output": "-49\n"}, {"type": "stdin_stdout", "input": "111 68", "output": "-43\n"},... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N people. The name of ... | [{"type": "stdin_stdout", "input": "5\nMASHIKE\nRUMOI\nOBIRA\nOROBAH\nHOROKANAI", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\nMASHIKE\nIOMUR\nOBIRA\nOROBAH\nHOROKANAI", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\nMASHIKE\nIOMUR\nARIBO\nOROBAH\nHOROKANAI", "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\nAoki is in search of Takahashi, ... | [{"type": "stdin_stdout", "input": "101\n-1", "output": "-5100.000000000000\n"}, {"type": "stdin_stdout", "input": "101\n-2", "output": "-2550.000000000000\n"}, {"type": "stdin_stdout", "input": "101\n141", "output": "36.170212765957\n"}, {"type": "stdin_stdout", "input": "101\n233", "output": "21.888412017167\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\nYour friend who lives in undiscl... | [{"type": "stdin_stdout", "input": "291", "output": "158467928000\n"}, {"type": "stdin_stdout", "input": "188", "output": "1040975000\n"}, {"type": "stdin_stdout", "input": "214", "output": "3701387000\n"}, {"type": "stdin_stdout", "input": "190", "output": "1147676000\n"}, {"type": "stdin_stdout", "input": "143", "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\nToday is the ticket release date... | [{"type": "stdin_stdout", "input": "3 57\n1 4\n1 -2\n1 2", "output": "171000\n24000\n-12000\n12000\n"}, {"type": "stdin_stdout", "input": "3 57\n1 3\n1 -2\n1 2", "output": "171000\n18000\n-12000\n12000\n"}, {"type": "stdin_stdout", "input": "3 16\n1 4\n1 -2\n1 5", "output": "48000\n24000\n-12000\n30000\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\nMr. Dango's family has an extrem... | [{"type": "stdin_stdout", "input": "12 2\n0 2 2\n0 2 2\n2 1\n0 1 100\n2 1\n0 1 -1\n2 1\n0 1 -1\n0 0", "output": "0\n100\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "3 2\n0 2 2\n0 2 1\n2 1\n0 1 100\n2 1\n0 1 -1\n2 1\n0 1 -1\n0 0", "output": "0\n100\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "3 2\n1 2 2\n0 2 1\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\nMary Thomas has a number of shee... | [{"type": "stdin_stdout", "input": "5 35\n.a....a....a....a....f....f....f...\nbc#.#cd#.#de#.#eb#.#cb#.#dc#.#ed#.\n.#..f.#....#....#....#....#....#...\n..e##..............................\n.b#................................", "output": "Yes"}, {"type": "stdin_stdout", "input": "5 60\n.a....a....a....a....f....f....f..... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 solve the geometric proble... | [{"type": "stdin_stdout", "input": "128 205", "output": "205\n"}, {"type": "stdin_stdout", "input": "110 161", "output": "161\n"}, {"type": "stdin_stdout", "input": "13 204", "output": "102\n"}, {"type": "stdin_stdout", "input": "11 251", "output": "251\n"}, {"type": "stdin_stdout", "input": "10 103", "output": "103\n"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are $n$ candy boxes in fro... | [{"type": "stdin_stdout", "input": "50 49 1000\n30 37 34 31 26 44 32 12 36 15 5 5 31 24 17 24 43 19 17 23 45 2 24 17 23 48 20 44 46 44 13 4 29 49 33 41 14 25 46 43 7 47 28 25 2 30 37 37 19 32\nGBBBRBGRBRBRGRGRBBGBGRRBGGRBGRBRRRRRRRBRGRGGGGBRGG\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "50 37 500\n25 43 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 number obtained by multiplyi... | [{"type": "stdin_stdout", "input": "3 16\n2 35\n1 140\n0", "output": "10\n18\n39\n"}, {"type": "stdin_stdout", "input": "6 16\n2 35\n1 140\n0", "output": "7\n18\n39\n"}, {"type": "stdin_stdout", "input": "6 9\n10 36\n1 172\n0", "output": "3\n12\n43\n"}, {"type": "stdin_stdout", "input": "3 8\n2 27\n1 140\n0", "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\nAn **anagram** is the result of ... | [{"input": "\"Buckethead\"\n\"DeathCubeK\"", "output": "[true]", "fn_name": "is_anagram"}, {"input": "\"dumble\"\n\"bumble\"", "output": "[false]", "fn_name": "is_anagram"}, {"input": "\"foefet\"\n\"toffee\"", "output": "[true]", "fn_name": "is_anagram"}, {"input": "\"ound\"\n\"round\"", "output": "[false]", "fn_name":... | code_functional |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.