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\nWe have a tree with N vertices n...
[{"type": "stdin_stdout", "input": "1954\n568 757 961730273\n550 1885 428046284\n495 564 599174480\n1444 1861 204768778\n292 1156 425880342\n557 1842 556767010\n658 678 605336669\n69 1546 725755442\n151 1906 272636023\n375 931 121557459\n644 1239 150615956\n379 392 702779205\n156 518 166442662\n914 1880 467238632\n194 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 an undirected graph G wi...
[{"type": "stdin_stdout", "input": "2000 999 1001\n", "output": "2000\n1999\n1998\n1997\n1996\n1995\n1994\n1993\n1992\n1991\n1990\n1989\n1988\n1987\n1986\n1985\n1984\n1983\n1982\n1981\n1980\n1979\n1978\n1977\n1976\n1975\n1974\n1973\n1972\n1971\n1970\n1969\n1968\n1967\n1966\n1965\n1964\n1963\n1962\n1961\n1960\n1959\n195...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDuring the lunch break all n Ber...
[{"type": "stdin_stdout", "input": "10\n419946 201769\n245945 0\n842799 113073\n836998 245945\n0 794376\n692107 836998\n113073 904403\n904403 987165\n201769 692107\n794376 842799\n", "output": "419946 794376 201769 842799 692107 113073 836998 904403 245945 987165 \n"}, {"type": "stdin_stdout", "input": "10\n189071 8522...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLong ago, Vasily built a good fe...
[{"type": "stdin_stdout", "input": "50\n1 3083990 976356336 922018335 1 170272482 1 547248035 1 1 1 1 1 928379588 1 1 1 270052499 315045369 1 1 556091215 1 655608230 424079072 1 1 185387009 77360256 1 1 942696777 228860271 1 487787709 1 437229749 167886535 1 1 904578415 319694007 1 313704390 1 1 957736320 771147030 458...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are b blocks of digits. Ea...
[{"type": "stdin_stdout", "input": "100 1000000000 42 97\n2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2 5 1 8 8 1 5 2 1 2\n", "output": "590949100\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\nAn exam for n students will take...
[{"type": "stdin_stdout", "input": "128\n", "output": "128\n127 125 123 121 119 117 115 113 111 109 107 105 103 101 99 97 95 93 91 89 87 85 83 81 79 77 75 73 71 69 67 65 63 61 59 57 55 53 51 49 47 45 43 41 39 37 35 33 31 29 27 25 23 21 19 17 15 13 11 9 7 5 3 1 128 126 124 122 120 118 116 114 112 110 108 106 104 102 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\nYou are given a program you want...
[{"type": "stdin_stdout", "input": "10 39\n0 1 0 1 0 1 1 0 1 1\n0 1\n0 2\n0 3\n0 4\n0 5\n0 6\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n1 9\n2 3\n2 4\n2 5\n2 6\n2 7\n2 8\n2 9\n3 4\n3 6\n3 7\n3 8\n3 9\n4 5\n4 6\n4 7\n4 9\n5 6\n5 7\n5 8\n5 9\n6 8\n6 9\n7 8\n7 9\n8 9\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "10 39...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 rare article in the Internet i...
[{"type": "stdin_stdout", "input": "A,3,B,2,C,0,D,1,E,0,F,1,G,0,H,1,I,1,J,0,K,1,L,0,M,2,N,0,O,1,P,0\n", "output": "4\nA K M \nB F H L N O \nC D G I P \nE J \n"}, {"type": "stdin_stdout", "input": "hello,2,ok,0,bye,0,test,0,one,1,two,2,a,0,b,0\n", "output": "3\nhello test one \nok bye two \na b \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\nOm Nom really likes candies and ...
[{"type": "stdin_stdout", "input": "2 100 59\n....................................................................................................\n.DR.D..DLLR.LDRR..L.LDRRRDLD.LDRR.LLR.R...DRLD.RRLL.L.D..R.LD.DL....LR.LR.DRLD.....L.D..RD...D.LL.R.\n", "output": "0 0 0 1 0 0 0 1 1 0 0 2 0 0 0 1 1 1 0 1 0 0 0 1 1 2 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\nToastman came up with a very eas...
[{"type": "stdin_stdout", "input": "19\noxoxoxoxooxoooxxoox\nxxxxxxxxoxxoxoooooo\noxoxoxooxxxooxxxooo\nxxoxxxooxooxxxoxxox\noxoxooxxxooooxxoxox\nxxxoooxoxxoxxoxxxoo\noxooxxxoooooxxoooxo\nxxooxooxoxxoxxoxxoo\noxxxxooooxxxooooxxx\nooxooxoxxoxxoxooxoo\nxxxooooxxxooooxoxox\noooxoxooxxoxooxooxx\nxxoooxxxooooxxoooxo\nooxxxoo...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne day Ms Swan bought an orange...
[{"type": "stdin_stdout", "input": "27 3\n12 77 80\n", "output": "8 21 18 13 5 27 14 2 20 23 12 17 10 4 6 11 3 26 1 24 16 9 7 25 22 19 15 \n43 32 46 48 51 37 41 49 77 30 40 28 34 38 44 35 31 45 52 50 47 29 36 53 42 39 33 \n62 61 78 63 81 55 70 79 67 73 58 69 59 64 80 54 56 57 68 72 65 60 71 66 74 75 76 \n"}, {"type": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn Summer Informatics School, if...
[{"type": "stdin_stdout", "input": "100\n73 81 39 85 48 49 37 20 66 41 79 32 54 71 31 50 48 29 10 85 81 20 20 20 48 54 70 40 71 31 49 77 50 33 12 87 19 12 54 39 87 10 20 39 81 18 70 53 86 7 33 37 62 9 77 54 50 30 70 81 66 12 41 12 20 23 87 73 91 75 94 49 18 71 81 32 79 85 30 94 48 10 41 62 73 90 40 70 90 91 33 100 79 9...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's denote that some array $b$...
[{"type": "stdin_stdout", "input": "10 11\n-1 11 -1 -1 -1 -1 10 -1 -1 -1\n", "output": "100000000\n"}, {"type": "stdin_stdout", "input": "10 14\n-1 9 11 11 -1 -1 -1 -1 -1 -1\n", "output": "62748517\n"}, {"type": "stdin_stdout", "input": "10 14\n-1 -1 6 -1 -1 -1 9 -1 -1 -1\n", "output": "810903912\n"}, {"type": "stdin_s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are three horses living in...
[{"type": "stdin_stdout", "input": "5 1000000000\n812747000 266266300 444091950 694572960 414735290\n", "output": "28926258177\n"}, {"type": "stdin_stdout", "input": "2 1000000000\n2 1000000000\n", "output": "28926258177\n"}, {"type": "stdin_stdout", "input": "1 1000000000\n1000000000\n", "output": "281663002102\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\nAll cities of Lineland are locat...
[{"type": "stdin_stdout", "input": "10\n-857422304 -529223472 82412729 145077145 188538640 265299215 527377039 588634631 592896147 702473706\n", "output": "328198832 1559896010\n328198832 1231697178\n62664416 939835033\n43461495 1002499449\n43461495 1045960944\n76760575 1122721519\n61257592 1384799343\n4261516 14460569...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIahub is a big fan of tourists. ...
[{"type": "stdin_stdout", "input": "50\n3987477 8934938 4067156 6712855 7269334 5039822 9533601 9335400 5992073 2619268 438734 8620973 4347619 4307947 2249161 815221 7615258 8244100 8341666 5908546 6646952 4812769 6215114 7479369 6290438 5623785 6466133 9953199 3525873 4326034 3510072 8117068 2342953 1717542 9766539 65...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn Berland recently a new collec...
[{"type": "stdin_stdout", "input": "5 10000\n1000000000 888888888 777777777 666666666 959595959\n", "output": "140\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAnn and Borya have n piles with ...
[{"type": "stdin_stdout", "input": "100\n444272562 25 25 0 49 73291074 64 100 638092144 756033694 0 700405846 16 25 25 100 36 25 269573395 288578186 366853675 36 81 49 4 0 25 49 9 64 0 4 36 36 49 0 64 64 532899768 1 64 9 549673690 25 64 4 817183855 25 146555318 36 495564252 100 49 9 36 100 49 100 4 100 9 64 9 432227412...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Berland Forest can be repres...
[{"type": "stdin_stdout", "input": "20 20\n....................\n....................\n..XXXXXXXXXXXXXXXXXX\n..XXXXXXXXXXXXXXXXXX\n..XXXXXXXXXXXXXXXXXX\n..XXXXXXXXXXXXXXXXXX\n..XXXXXXXXXXXXXXXXXX\n..XXXXXXXXXXXXXXXXXX\n..XXXXXXXXXXXXXXXXXX\n..XXXXXXXXXXXXXXXXXX\n..XXXXXXXXXXXXXXXXXX\n..XXXXXXXXXXXXXXXXXX\n..XXXXXXXXXXX...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 chessboard, and he enj...
[{"type": "stdin_stdout", "input": "8 35\n......................-............\n...-..........-........-...........\n...........-.......................\n-..................................\n...................................\n...........-............-.........-\n.........-.........-.--............\n......................
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDreamoon has a string s and a pa...
[{"type": "stdin_stdout", "input": "a\nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAmr loves Chemistry, and special...
[{"type": "stdin_stdout", "input": "20\n1 2 3 4 6 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 100000\n", "output": "113"}, {"type": "stdin_stdout", "input": "20\n1 2 3 4 6 8 16 20 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536\n", "output": "99"}, {"type": "stdin_stdout", "input": "17\n100000 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNura wants to buy k gadgets. She...
[{"type": "stdin_stdout", "input": "1 93 46 46\n1\n1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2 1\n1 2\n2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOhana Matsumae is trying to clea...
[{"type": "stdin_stdout", "input": "20\n10101011101000011010\n11111010001100110101\n01011100010000001111\n10110100000101010011\n11010001110111101101\n00100110011011101010\n01000110101011001100\n01101100111101101101\n10111010010100111100\n00010010110001101110\n10111110010000101010\n10010111110100100100\n1101011100111111...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n servers in a laborat...
[{"type": "stdin_stdout", "input": "1 10\n4 1 1\n9 1 1\n10 1 1\n12 1 1\n13 1 1\n15 1 1\n16 1 1\n18 1 1\n19 1 1\n20 1 1\n", "output": "1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n"}, {"type": "stdin_stdout", "input": "4 10\n1 1 1\n3 1 2\n4 1 2\n6 1 2\n8 1 2\n13 1 2\n16 1 1\n17 1 2\n19 3 1\n20 1 1\n", "output": "1\n1\n2\n1\n1\n1\n1\n1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConsider 2n rows of the seats in...
[{"type": "stdin_stdout", "input": "100 103\n", "output": "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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Как известно, в теплую погоду мн...
[{"type": "stdin_stdout", "input": "50 15001\n1269 1580 5431 5916 6642 14145 15760 19922 20589 22062 24138 33454 33505 35916 37012 42577 43140 49457 54720 55188 56205 56639 56870 57997 58379 59088 59297 61805 61861 63005 64013 68848 71182 71497 72715 73008 75616 76042 76614 80690 83089 85033 86408 92392 92763 93833 950...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTavas is a strange creature. Usu...
[{"type": "stdin_stdout", "input": "173700 6\nbcabcbcbcbaaacaccaacaccaabacabaacbcacbbccaccbcacbabcaccccccaacacabbbbbacabbaaacbcbbaccaccabbbbaabbacacbabccaabcabbbcacaaccbabbcaaaaaabccbbcabcacbcbcabcbcbbaabacaaccccabacaaaccacaaabbacacabbcccacbaabcacacbbaaaccaccbaccccccbccaabcacaacabaccababacabcccbcbbacbabacbcbabacbbaccaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n[Image] \n\n\n-----Input-----\n\...
[{"type": "stdin_stdout", "input": "3\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "0\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "1\n", "output": "14\n"}, {"type": "stdin_stdout", "input": "2\n", "output": "12\n"}, {"type": "stdin_stdout", "input": "6\n", "output": "10\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\nAcingel is a small town. There w...
[{"type": "stdin_stdout", "input": "20 5\n8 1 13 19 3 14 5 2 4 6 12 18 20 17 16 15 11 10 7 9\n12 18 20 17 16 15 11 10 7 9 8 1 13 19 3 14 5 2 4 6\n5 2 4 6 12 18 20 17 16 15 11 10 7 9 8 1 13 19 3 14\n5 2 4 6 12 18 20 17 16 15 11 10 7 9 8 1 13 19 3 14\n8 1 13 19 3 14 5 2 4 6 12 18 20 17 16 15 11 10 7 9\n", "output": "86\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 two lists of segme...
[{"type": "stdin_stdout", "input": "3\n3 5\n1 2\n3 4\n2 1000000000\n1 1\n999999999 999999999\n10 3\n5 10\n7 8\n", "output": "7\n2000000000\n0\n"}, {"type": "stdin_stdout", "input": "1\n200000 598920770\n24529366 24846325\n35694819 90253337\n", "output": "703962247\n"}, {"type": "stdin_stdout", "input": "1\n200000 88635...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 recently started worki...
[{"type": "stdin_stdout", "input": "870 396 187 223 444 202 222 732\n", "output": "999.794532443395 550.781715159771\n699.893362547183 538.645476249672\n784.946681273591 467.322738124836\n314.602137963862 -93.569417800670\n484.708775416679 -236.214894050342\n955.053318726409 324.677261875164\n1040.106637452818 253.3545...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n[Image] \n\nIt's the end of July...
[{"type": "stdin_stdout", "input": "433 3\nFZDDHMJGBZCHFUXBBPIEBBEFDWOMXXEPOMDGSMPIUZOMRZQNSJAVNATGIWPDFISKFQXJNVFXPHOZDAEZFDAHDXXQKZMGNSGKQNWGNGJGJZVVITKNFLVCPMZSDMCHBTVAWYVZLIXXIADXNYILEYNIQHKMOGMVOCWGHCWIYMPEPADSJAAKEGTUSEDWAHMNYJDIHBKHVUHLYGNGZDBULRXLSAJHPCMNWCEAAPYMHDTYWPADOTJTXTXUKLCHWKUSZRHEKQEFPVJEJJHRWCKYOIWAL...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Kingdom of Kremland is a tre...
[{"type": "stdin_stdout", "input": "44\n42 44 4 24 29 17 32 30 30 9 28 9 22 16 20 41 17 19 41 23 28 19 38 44 1 34 41 34 19 36 32 37 22 31 4 3 27 23 21 21 26 39 20 8\n", "output": "6926"}, {"type": "stdin_stdout", "input": "40\n35 33 20 13 21 4 16 21 22 35 20 39 32 29 27 5 24 3 12 10 15 13 2 31 1 11 20 39 17 37 21 10 36...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDevu and his brother love each o...
[{"type": "stdin_stdout", "input": "10 10\n23 100 38 38 73 54 59 69 44 86\n100 100 100 100 100 100 100 100 100 100\n", "output": "416\n"}, {"type": "stdin_stdout", "input": "1 1\n401114\n998223974\n", "output": "997822860\n"}, {"type": "stdin_stdout", "input": "1 1\n1000000000\n1000000000\n", "output": "0\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\nThe research center Q has develo...
[{"type": "stdin_stdout", "input": "100 1 100\n59\n37\n53\n72\n37\n15\n8\n93\n92\n74\n11\n11\n68\n16\n92\n40\n76\n20\n10\n86\n76\n5\n9\n95\n5\n81\n44\n57\n10\n24\n22\n2\n57\n6\n26\n67\n48\n95\n34\n97\n55\n33\n70\n66\n51\n70\n74\n65\n35\n85\n37\n9\n27\n43\n65\n6\n5\n57\n54\n27\n22\n41\n8\n29\n10\n50\n9\n68\n78\n9\n92\n3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA permutation of length $k$ is a...
[{"type": "stdin_stdout", "input": "30\n14 20 2 18 17 14 13 2 2 12 9 2 9 15 26 11 20 23 6 9 22 1 6 19 17 1 9 15 15\n23 27 15 20 29 22 25 11 26 14 27 19 15 29 27 29 23 27 13 29 26 15 21 23 26 14 25 21 18\n", "output": "12 14 1 15 21 6 13 25 9 29 15 18 20 23 27 26 22 14 23 19 2 26 17 29 11 2 15 9 27 20 \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\nTeacher thinks that we make a lo...
[{"type": "stdin_stdout", "input": "100 1\n", "output": "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}, {"type": "stdin_stdout", "input": "88 9\n", "output": "1011235955056179775280898876404494382022471910112359550561797752808988764044943820224719"}, {"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\nThis problem differs from the ne...
[{"type": "stdin_stdout", "input": "10\n4915446 7629450 1632197 6804641 4858420 8397903 3657129 9543999 8324770 9285052\n", "output": "280933096"}, {"type": "stdin_stdout", "input": "9\n824676 969582 907196 835924 807294 691340 523083 581257 830608\n", "output": "892416655"}, {"type": "stdin_stdout", "input": "5\n10000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPermutation p is an ordered set ...
[{"type": "stdin_stdout", "input": "13\n", "output": "695720788\n"}, {"type": "stdin_stdout", "input": "15\n", "output": "150347555\n"}, {"type": "stdin_stdout", "input": "11\n", "output": "890786230\n"}, {"type": "stdin_stdout", "input": "9\n", "output": "734832000\n"}, {"type": "stdin_stdout", "input": "7\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\nVasya has recently got a job as ...
[{"type": "stdin_stdout", "input": "1 1000000000 1\n0 1000000000\n", "output": "0"}, {"type": "stdin_stdout", "input": "0 1000000000 1000000000\n", "output": "1"}, {"type": "stdin_stdout", "input": "0 1000000000 1\n", "output": "1000000000"}, {"type": "stdin_stdout", "input": "0 1000000000 1\n", "output": "1000000000"}...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRoman and Denis are on the trip ...
[{"type": "stdin_stdout", "input": "4\nqe\nnd\niqryhukieskfvaeettersinksrmazelxtgvartuz\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAfter a hard day Vitaly got very...
[{"type": "stdin_stdout", "input": "100\nqDpInBmCrFwXpDbFgOzVvOcEmJrUcToAdEwEgTvBvBfWwRpGyEaXgDdRwVlQnYgWmWhMrHaIzPyXvGaFlRsVzHhZrOuVpXrKxFzAmWwPlFtNfPtJxVmLuHjKfYyArHrEnSwSzOvDpQhCgCqLlAcNpGhXrEeFuCmAqIkXyYtSsQwIxJzNiIuTgEbVuWrMwPrAlLyKaZ\n", "output": "42\n"}, {"type": "stdin_stdout", "input": "26\nzAyBxCwDvEuFtGsHrI...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 kingdom of Lazyland is the h...
[{"type": "stdin_stdout", "input": "19 2\n1 1 1 2 2 1 1 2 1 2 2 2 2 2 2 2 1 2 2\n92 91 86 3 32 40 25 14 51 10 53 35 28 51 60 73 31 22 66\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "18 12\n6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6\n47 4 41 56 75 16 29 45 100 76 53 48 79 30 56 84 60 86\n", "output": "425\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\nGiven is a string S consisting o...
[{"type": "stdin_stdout", "input": "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAmidakuji is a traditional metho...
[{"type": "stdin_stdout", "input": "100 8 8\n", "output": "467571711\n"}, {"type": "stdin_stdout", "input": "100 8 3\n", "output": "938282570\n"}, {"type": "stdin_stdout", "input": "100 8 1\n", "output": "755868507\n"}, {"type": "stdin_stdout", "input": "15 8 5\n", "output": "437760187\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\nYou are given three integers A, ...
[{"type": "stdin_stdout", "input": "27 39 17\n", "output": "17\n"}, {"type": "stdin_stdout", "input": "19 43 41\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "39 49 21\n", "output": "19\n"}, {"type": "stdin_stdout", "input": "26 37 19\n", "output": "16\n"}, {"type": "stdin_stdout", "input": "13 48 20\n", "ou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi has a maze, which is a...
[{"type": "stdin_stdout", "input": "20 20\n....................\n###################.\n....................\n.###################\n....................\n###################.\n....................\n.###################\n....................\n###################.\n....................\n.###################\n................
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn some other world, today is Ch...
[{"type": "stdin_stdout", "input": "50 4321098765432109\n", "output": "2160549382716056\n"}, {"type": "stdin_stdout", "input": "50 2251799813685246\n", "output": "1125899906842623\n"}, {"type": "stdin_stdout", "input": "50 2251799813685247\n", "output": "1125899906842624\n"}, {"type": "stdin_stdout", "input": "50 22517...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne day, liouzhou_101 got a chat...
[{"type": "stdin_stdout", "input": "10\nmiao..FLhPl_Wjslala.\nmiao. tdEGtfdJlala.\nGAzEUlala.\nKCcmOa .aKBlZyYsdu.V\nmiao.lala.\njKylnM,FXK\nmiao.GBWqjGH.v\nmiao.RefxS Cni.\nOxaaEihuHQR_s,\nmiao.a,Axtlala.\n", "output": "OMG>.< I don't know!\nOMG>.< I don't know!\nFreda's\nOMG>.< I don't know!\nOMG>.< I don't know!\nOM...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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(Легенда будет поправлена позже)...
[{"type": "stdin_stdout", "input": "10\n991309218 517452607 870021923 978357992 136426010 10601767 302627526 883615372 163475700 600546765\n", "output": "991309218 517452607 870021923 517452607 136426010 136426010 978357992 302627526 870021923\n"}, {"type": "stdin_stdout", "input": "2\n656402233 488475947\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\n— Oh my sweet Beaverette, would ...
[{"type": "stdin_stdout", "input": "20\n-808998072 733614990 579897311 -337992089 579897311 120800519 -337992089 -803027570 733614990 -686536765 733614990 -803027570 -803027570 733614990 120800519 -803027570 -686536765 579897311 -808998072 -686536765\n", "output": "4215055101 13\n1 4 7 8 10 12 13 15 16 17 18 19 20 "}, ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKate has a set $S$ of $n$ intege...
[{"type": "stdin_stdout", "input": "104\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 2 3 3 4 5 5 5 6 7 7 7 7 8 9 9 10 11 11 11 11 12 13 13 13 13 14 15 15 16 17 17 17 18 19 19 19 20 21 21 22 23 23 24 25 25 26 27 27 28 29 29 30 31 31 32 33 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 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\nHarry Potter is on a mission to ...
[{"type": "stdin_stdout", "input": "9\nliyzmbjwnzryjokufuxcqtzwworjeoxkbaqrujrhdidqdvwdfzilwszgnzglnnbogaclckfnbqovtziuhwvyrqwmskx\nliyzmbjwnzryjokufuxcqtzwworjeoxkbaqrujrhdidqdvwdfzilwszgnzglnnbogaclckfnbqovtziuhwvyrqwmskx\nliyzmbjwnzryjokufuxcqtzwworjeoxkbaqrujrhdidqdvwdfzilwszgnzglnnbogaclckfnbqovtziuhwvyrqwmskx\nhr...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne day Nikita found the string ...
[{"type": "stdin_stdout", "input": "bbabbbbbaaba\n", "output": "10"}, {"type": "stdin_stdout", "input": "bbabbbaabbbb\n", "output": "9"}, {"type": "stdin_stdout", "input": "bbabbbababaa\n", "output": "9"}, {"type": "stdin_stdout", "input": "aabbaababbab\n", "output": "8"}, {"type": "stdin_stdout", "input": "babbbaab\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 Imperial stormtroope...
[{"type": "stdin_stdout", "input": "10 -4 -4\n2 -4\n2 0\n-4 2\n5 -4\n-3 -5\n1 4\n-4 2\n-3 5\n0 -3\n2 4\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "10 5 -3\n1 1\n2 -1\n2 2\n1 -2\n4 -5\n1 4\n0 1\n1 -4\n-2 0\n-4 -5\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "10 -3 3\n3 -5\n4 3\n0 -2\n0 0\n3 -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\nThis is an easier version of the...
[{"type": "stdin_stdout", "input": "10\n-93796614 30297417 22968703\n-91631822 -13274485 54175787\n-91631822 30297417 22968703\n-75960156 -13274485 22968703\n-75960156 30297417 22968703\n-91631822 -92047004 65302423\n-91631822 30297417 -16296706\n-75960156 88346795 54175787\n-93796614 30297417 -16296706\n-75960156 3029...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGildong has bought a famous pain...
[{"type": "stdin_stdout", "input": "9 4\nBWBBWWWWW\nWWBWBWWWW\nWBWBBBBBB\nBWWWBBBWW\nWWBWBWBWW\nWBWWBBWWB\nWWWBWBWBW\nBBWBBBWWW\nWWWWBBWBW\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "7 3\nWWWWWWW\nBWWWWWB\nWWWWBWW\nWBBBWWB\nBBWWBBB\nWBBWWWW\nBWBBBWB\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe R2 company has n employees w...
[{"type": "stdin_stdout", "input": "7 6 5\n0 1 0 1 1 1\n0 1 1 0 1 1\n1 0 1 1 1 0\n1 0 1 1 1 1\n1 1 1 1 1 0\n1 1 1 0 1 0\n1 0 1 0 0 0\n4 1\n2 6\n7 3\n7 1\n5 3\n", "output": "1 2 4 4 3 4 2 "}, {"type": "stdin_stdout", "input": "10 1 10\n0\n0\n0\n0\n0\n0\n1\n0\n1\n0\n7 1\n9 1\n9 1\n7 1\n9 1\n9 1\n9 1\n7 1\n9 1\n9 1\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\nVasiliy likes to rest after a ha...
[{"type": "stdin_stdout", "input": "12\n35345 58181 32223 84621 35905 73863 99537 30666 67771 39229 36847 29038\n23\n55052824\n82504840\n35160556\n78141700\n73401989\n86305919\n39430705\n31939373\n23501765\n4406029\n61436920\n14295390\n34275309\n28028753\n85724689\n70158847\n2396455\n66994588\n84024224\n30175981\n65622...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 cities of Byteland and Berla...
[{"type": "stdin_stdout", "input": "15\n-9518 R\n-6858 P\n-6726 B\n-6486 R\n-4496 P\n-4191 P\n-772 B\n-258 R\n-194 P\n1035 R\n2297 P\n4816 B\n5779 R\n9342 B\n9713 B\n", "output": "25088\n"}, {"type": "stdin_stdout", "input": "8\n-839 P\n-820 P\n-488 P\n-334 R\n-83 B\n187 R\n380 B\n804 P\n", "output": "2935\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\nBecause of budget cuts one IT co...
[{"type": "stdin_stdout", "input": "498\n", "output": "5392730685240975000"}, {"type": "stdin_stdout", "input": "500\n", "output": "5567867859752100000"}, {"type": "stdin_stdout", "input": "321\n", "output": "163013183025830865"}, {"type": "stdin_stdout", "input": "139\n", "output": "212332162372330"}, {"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\nMahmoud wrote a message s of len...
[{"type": "stdin_stdout", "input": "55\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000\n", "output": "383381198\n55\n1\n"}, {"type": "stdin_stdout", "input": "100\nygdbmqpyofbcoqom...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOne day Vasya came up to the bla...
[{"type": "stdin_stdout", "input": "25\n17 14\n19 1\n24 16\n23 13\n20 15\n24 23\n18 25\n4 1\n18 9\n2 17\n14 12\n25 2\n13 6\n21 9\n19 3\n11 18\n10 13\n12 19\n3 17\n12 1\n10 6\n15 1\n18 21\n11 21\n23 22\n8 11\n11 16\n10 23\n2 9\n25 7\n15 5\n22 24\n13 22\n5 10\n5 20\n4 15\n5 6\n12 4\n3 14\n16 22\n8 24\n7 17\n25 9\n21 8\n8...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKris works in a large company \"...
[{"type": "stdin_stdout", "input": "10 1 1\n2 1 1000000000\n", "output": "1000000000 \n1000000000 \n1000000000 \n1000000000 \n1000000000 \n1000000000 \n1000000000 \n1000000000 \n1000000000 \n1000000000 \n"}, {"type": "stdin_stdout", "input": "1 10 1\n1 1 1000000000\n", "output": "1000000000 1000000000 1000000000 100000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGardener Alexey teaches competit...
[{"type": "stdin_stdout", "input": "11\n9969 9945 9994 9914 9959 10000 9928 9985 9973 9939 9933\n", "output": "6051630681"}, {"type": "stdin_stdout", "input": "11\n2367 2279 5630 8823 5312 8316 2915 6412 4111 7540 4263\n", "output": "2020697314"}, {"type": "stdin_stdout", "input": "11\n9991 9968 9984 9924 9915 9925 995...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 8 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 29...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nn people are standing on a coord...
[{"type": "stdin_stdout", "input": "26 10\n495492 7 1\n256604 5 2\n511773 3 2\n590712 4 1\n206826 7 2\n817878 4 2\n843915 1 1\n349160 3 1\n351298 4 1\n782251 8 2\n910928 4 1\n662354 4 2\n468621 2 2\n466991 7 2\n787303 6 2\n221623 8 2\n343518 6 1\n141123 7 1\n24725 6 1\n896603 3 2\n918129 8 2\n706071 6 2\n512369 2 2\n60...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 School №0 of the capital of ...
[{"type": "stdin_stdout", "input": "220\n1 1 3 1 3 1 1 3 1 3 3 3 3 1 3 3 1 3 3 3 3 3 1 1 1 3 1 1 1 3 2 3 3 3 1 1 3 3 1 1 3 3 3 3 1 3 3 1 1 1 2 3 1 1 1 2 3 3 3 2 3 1 1 3 1 1 1 3 2 1 3 2 3 1 1 3 3 3 1 3 1 1 1 3 3 2 1 3 2 1 1 3 3 1 1 1 2 1 1 3 2 1 2 1 1 1 3 1 3 3 1 2 3 3 3 3 1 3 1 1 1 1 2 3 1 1 1 1 1 1 3 2 3 1 3 1 3 1 1 3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlyona has recently bought a min...
[{"type": "stdin_stdout", "input": "100 2000\n61 77 55 79 29 99 68 31 78 53 80 91 78 52 84 95 92 84 23 65 86 89 84 98 83 40 50 88 53 74 52 53 52 61 69 90 81 95 98 100 92 79 94 93 80 84 76 34 40 56 65 72 95 91 95 80 45 89 58 96 99 96 78 64 43 96 50 68 62 92 59 65 77 64 94 92 69 97 48 76 53 92 100 94 88 70 29 100 93 78 6...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n pearls in a row. Let...
[{"type": "stdin_stdout", "input": "10\n460626451 460626451 460626451 460626451 460626451 460626451 460626451 460626451 460626451 460626451\n", "output": "5\n1 2\n3 4\n5 6\n7 8\n9 10\n"}, {"type": "stdin_stdout", "input": "10\n933677171 80672280 80672280 933677171 933677171 933677171 933677171 80672280 80672280 9336771...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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. Apple, a gourmet, works as e...
[{"type": "stdin_stdout", "input": "10 24\n<><>>>><>>><>>>>>>>><<>>\n<><>>>><>>><>>>>>>>><<>>\n>><>>>><>>><>>>>>>>><>>>\n<<<><><<<<<<><<><>>><<<>\n<<<=<=<<<<<<><<=<>==<<<>\n>><>>>><>>><>>>>>>>><>>>\n>>>>>>>>>>>>>>>>>>>>>>>>\n<<<<<<<<<<<<=<<<<=<<<<<<\n<><>>>><>>><>>>>>>>><<>>\n<><>>>><>>><>>>>>>>><<>>\n", "output": "Yes...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Maxim has found an arra...
[{"type": "stdin_stdout", "input": "100 5 100\n-45 -36 -55 -96 -49 8 -88 -87 -82 51 27 -33 -65 0 -1 -42 -58 -19 -11 77 -54 14 -49 -90 -35 -9 -2 -48 0 -21 44 22 37 -32 -81 64 28 85 -77 44 18 -74 -50 62 8 -74 41 -15 -91 -93 -2 57 -12 2 -2 -90 84 6 -62 -14 72 85 86 -71 -59 57 -89 -4 78 56 56 24 -15 -78 27 -30 -31 -52 -92 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVova is again playing some compu...
[{"type": "stdin_stdout", "input": "9 1 20\n4 19\n", "output": "53\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nSTRIKE\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nSTRIKE\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHEAL\nHE...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 wants to pass n exams and ...
[{"type": "stdin_stdout", "input": "9 846678 205000\n102282 593538\n246630 24854\n545346 409737\n334264 443193\n37717 191227\n154582 913095\n97105 345066\n65504 578960\n163348 394257\n", "output": "2441209588\n"}, {"type": "stdin_stdout", "input": "10 10 10\n9 8\n3 9\n3 6\n10 5\n5 5\n6 10\n10 3\n6 7\n2 3\n9 8\n", "outp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlice became interested in perio...
[{"type": "stdin_stdout", "input": "3\n29939939929\n", "output": "100100100100\n"}, {"type": "stdin_stdout", "input": "3\n3021001003\n", "output": "100100100100\n"}, {"type": "stdin_stdout", "input": "10\n9969441321\n", "output": "9969441322\n"}, {"type": "stdin_stdout", "input": "3\n999999999\n", "output": "1001001001...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAnatoly lives in the university ...
[{"type": "stdin_stdout", "input": "166\nrbbbbbbbbbbbbrbrrbbrbbbrbbbbbbbbbbrbbbbbbrbbbrbbbbbrbbbbbbbrbbbbbbbrbbrbbbbbbbbrbbbbbbbbbbbbbbrrbbbrbbbbbbbbbbbbbbrbrbbbbbbbbbbbrbbbbbbbbbbbbbbrbbbbbbbbbbbbbbbbbbbbbb\n", "output": "70\n"}, {"type": "stdin_stdout", "input": "100\nbrbbbrrrbbrbrbbrbbrbbbbrbbrrbbbrrbbbbrbrbbbbbbbbb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSuppose that you are in a campus...
[{"type": "stdin_stdout", "input": "5 5 3\n.....\n.....\n*...*\n*....\n.*...\n", "output": "18\n"}, {"type": "stdin_stdout", "input": "4 4 2\n....\n....\n....\n....\n", "output": "24\n"}, {"type": "stdin_stdout", "input": "3 3 4\n.*.\n*.*\n.*.\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "3 3 1\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\nYou've got an undirected graph, ...
[{"type": "stdin_stdout", "input": "50 47\n21 17 47 15 50 47 47 41 28 18 27 47 29 28 32 26 16 26 8 22 27 10 45 21 17 30 31 38 14 8 9 40 29 35 41 24 22 14 40 46 44 34 40 31 48 40 8 50 1 28\n7 5\n50 2\n42 5\n36 28\n8 44\n36 3\n40 15\n33 18\n5 50\n1 6\n25 20\n39 24\n45 35\n14 27\n14 39\n17 47\n19 49\n28 7\n7 13\n34 3\n22 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMonocarp has got two strings $s$...
[{"type": "stdin_stdout", "input": "101\nbabbbbabbbbaabbbbbbbabbbababababbbbbbbbabaababbababbaaabbababbbbbbbbbaabbbababbbbbabbbbbabbbaabbbaabb\nbbabbbbbbabbbbbbbbbbbabbbbbbbbbbabbabbbbbbbbbbbabbababbbabbabbbbbbbbbbbbbaabbbabbbbabbabbbbababbbbbab\n", "output": "20\n2 7\n12 13\n21 25\n27 29\n31 40\n42 43\n45 50\n54 55\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\nDima worked all day and wrote do...
[{"type": "stdin_stdout", "input": "100\n8820100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000026601\n", "output": "88201000000000000000000000000000000000000000000000000000000000000000000000000000000000000026601\n"}, {"type": "stdin_stdout", "input": "99\n92858678988128683760262...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 zombies are gathering in the...
[{"type": "stdin_stdout", "input": "10\n0000000000\n0000000000\n0000000000\n0000000000\n0000000000\n0000000000\n0012100000\n0024200000\n0012100000\n0000000000\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "10\n0000000000\n0122210000\n0244420100\n0122210000\n0000000000\n0000000000\n0000000000\n0000000000\n00...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe define $x \\bmod y$ as the re...
[{"type": "stdin_stdout", "input": "500000 250000\n", "output": "803991687\n"}, {"type": "stdin_stdout", "input": "123456 78901\n", "output": "963821949\n"}, {"type": "stdin_stdout", "input": "500000 500\n", "output": "882447093\n"}, {"type": "stdin_stdout", "input": "500000 200\n", "output": "123055441\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\nThere are n incoming messages fo...
[{"type": "stdin_stdout", "input": "108 576 610 844 573\n242 134 45 515 430 354 405 179 174 366 155 4 300 176 96 36 508 70 75 316 118 563 55 340 128 214 138 511 507 437 454 478 341 443 421 573 270 362 208 107 256 471 436 378 336 507 383 352 450 411 297 34 179 551 119 524 141 288 387 9 283 241 304 214 503 559 416 447 49...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBreaking Good is a new video gam...
[{"type": "stdin_stdout", "input": "13 58\n9 12 0\n8 11 0\n4 8 0\n2 12 1\n9 1 1\n10 6 1\n5 2 1\n3 9 0\n8 3 0\n9 10 0\n8 5 1\n11 3 0\n11 1 0\n2 6 1\n12 3 1\n11 6 0\n1 12 0\n2 1 1\n11 13 0\n6 8 1\n11 5 1\n8 9 0\n1 4 0\n12 7 1\n5 12 0\n11 7 0\n10 2 0\n5 10 1\n9 4 1\n7 5 1\n2 11 0\n13 12 1\n10 3 1\n1 13 0\n7 1 0\n6 3 0\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\nA soldier wants to buy w bananas...
[{"type": "stdin_stdout", "input": "859 453892 543\n", "output": "126416972"}, {"type": "stdin_stdout", "input": "1000 1000000000 1000\n", "output": "0"}, {"type": "stdin_stdout", "input": "634 87973 214\n", "output": "14497197"}, {"type": "stdin_stdout", "input": "432 10000 241\n", "output": "12587552"}, {"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\nKaavi, the mysterious fortune te...
[{"type": "stdin_stdout", "input": "babbaaababbbbabbaaaababbbaabababbaabbaababbaaabaabbabaabbaababababbaabaaabaaaaababbaabaaaaabaabbabaaababbbb\nbbaabbbbabbbbaaaaaababbbabaaabbbbabababbbaabbbbbabaababbaabaaabaabbababababaaaaabaabbabaaabaaaaaaaaaaaaabbb\n", "output": "284471294"}, {"type": "stdin_stdout", "input": "cbaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKefa wants to celebrate his firs...
[{"type": "stdin_stdout", "input": "15 1234\n2738 322313356\n1160 970909702\n2594 902749351\n3126 324754476\n3151 177963947\n3424 396145897\n5578 737768323\n3423 687640543\n381 848813098\n1058 197211286\n936 650181776\n1025 776492538\n3598 142176544\n3595 680519527\n1191 32199940\n", "output": "3634263641\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\nDo you know a story about the th...
[{"type": "stdin_stdout", "input": "987 50\n221 959\n221 553\n959 695\n553 959\n819 437\n371 295\n695 553\n959 347\n595 699\n652 628\n553 347\n868 589\n695 221\n282 714\n351 703\n104 665\n755 436\n556 511\n695 347\n221 347\n243 874\n695 847\n863 501\n583 145\n786 221\n38 286\n72 397\n808 658\n724 437\n911 548\n405 759\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFinally! Vasya have come of age ...
[{"type": "stdin_stdout", "input": "37 3813 32\n117\n1 1 4 5 6 8 10 13 13 16 18 19 20 23 30 32 33 38 49 59 66 69 96 157 160 183 205 292 301 320 349 360 370 372 384 400 410 413 423 434 434 445 451 463 464 490 494 496 497 517 528 532 556 572 607 647 668 689 708 729 748 806 819 879 905 905 915 925 928 931 959 970 1133 114...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 loves ciphers. He has i...
[{"type": "stdin_stdout", "input": "qwertyuioasdfghjklrtyuiodfghjklqwertyuioasdfssddxb\n", "output": "dfogihujyktlrqlwkejrhtgyfudisoaaosidufystsrdedwxqb\n"}, {"type": "stdin_stdout", "input": "qwertyuioasdfghjklrtyuiodfghjklqwertyuioasdfssdda\n", "output": "dfogihujyktlrqlwkejrhtgyfudisoaaosidufystsrdedwaq\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\nAnton likes to play chess, and s...
[{"type": "stdin_stdout", "input": "379\nAADAAAAAADDAAAAAADAADADADDAAAAADADDAADAAAADDDADAAAAAAADAADAAAAAAADAAAAAAAAADAAAAAAADAAAAAAAAAAADDDADAAAAAAAADAADADAAAADAAAAAAAAAAAAAAAAADAAAADDDAADAAAAAAADAAADAAADAADDDADDAAADAAAAAADDDADDDAAADAAAADAAAAAAAAADAAADAAAAAAAAADAAAAAAAAAAAAAAAAAADADAAAAAAAAAAADAAAAADAAAADAAAAAAAAAAAAAD...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 an integer N, we will choose...
[{"type": "stdin_stdout", "input": "1000000000\n", "output": "499999999500000000\n"}, {"type": "stdin_stdout", "input": "999999999\n", "output": "499999998500000001\n"}, {"type": "stdin_stdout", "input": "999999998\n", "output": "499999997500000003\n"}, {"type": "stdin_stdout", "input": "234679769\n", "output": "275372...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 dots in a two-dimens...
[{"type": "stdin_stdout", "input": "1000\n75100 60743\n9726 45312\n39324 37026\n6218 24919\n37911 86455\n24562 12622\n88324 30198\n33847 67328\n2909 91511\n42029 31498\n41511 74704\n96712 15653\n86190 59227\n59789 67915\n15677 3177\n66597 62255\n27003 69079\n83921 51556\n49566 24925\n44399 87252\n70161 73909\n7368 2727...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFind the number of sequences of ...
[{"type": "stdin_stdout", "input": "1000000000 100\n", "output": "926307829\n"}, {"type": "stdin_stdout", "input": "314159265 35\n", "output": "457397712\n"}, {"type": "stdin_stdout", "input": "900000000 89\n", "output": "780773257\n"}, {"type": "stdin_stdout", "input": "899999999 92\n", "output": "409296605\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\nTakahashi has a water bottle wit...
[{"type": "stdin_stdout", "input": "100 100 1000000\n", "output": "0.0000000000\n"}, {"type": "stdin_stdout", "input": "82 84 416241\n", "output": "28.3216596827\n"}, {"type": "stdin_stdout", "input": "22 75 24126\n", "output": "66.3790171829\n"}, {"type": "stdin_stdout", "input": "45 72 83481\n", "output": "53.8288157...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 N sticks that are ...
[{"type": "stdin_stdout", "input": "2000\n1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 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\nAs a token of his gratitude, Tak...
[{"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "314159265 358979323846264338\n", "output": "31\n"}, {"type": "stdin_stdout", "input": "275278675 992237867823568722\n", "output": "32\n"}, {"type": "stdin_stdout", "input": "10000 1099511...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 an integer n not less than 0...
[{"type": "stdin_stdout", "input": "1000000000000000000\n", "output": "124999999999999995\n"}, {"type": "stdin_stdout", "input": "999003990299500294\n", "output": "124875498787437525\n"}, {"type": "stdin_stdout", "input": "237590337949089028\n", "output": "29698792243636116\n"}, {"type": "stdin_stdout", "input": "19073...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle Chris is very keen on his...
[{"type": "stdin_stdout", "input": "10\n1 100000 199999 299998 399997 499996 599995 699994 799993 899992\n", "output": "10\n100009 200008 300007 400006 500005 600004 700003 800002 900001 1000000 \n"}, {"type": "stdin_stdout", "input": "10\n63649 456347 779 458642 201571 534312 583774 283450 377377 79066\n", "output": "...
code_stdio