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\nLunar New Year is approaching, a...
[{"type": "stdin_stdout", "input": "10 15\n132 138 38 75 14 115 129 68 119 118\n728344 513371 120930 757031 137753 453796 348671 185533 966778 521678\n4 58\n1 8\n8 22\n3 98\n2 111\n6 158\n2 82\n1 170\n1 26\n1 4\n4 76\n10 106\n5 100\n4 116\n7 62\n", "output": "43907798\n5826752\n4081726\n15058400\n56984181\n67179393\n33...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nZS the Coder and Chris the Baboo...
[{"type": "stdin_stdout", "input": "8 6 6\n0 0 0 0 0 0 0 0\n709812879 751993522 552838834 932579085 381597201 889756688\n77223016 35398130 932703875 852137134 124534767 472656085\n828677108 158247840 540181954 573979204 389860841 490718346\n666733838 404533406 50010075 311518758 460372535 69832342\n591244215 400838850 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNastya received one more array o...
[{"type": "stdin_stdout", "input": "94 58\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 29 58 1 1 1 29 58 58 1 1 29 1 1 1 1 2 1 58 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 29 1 1 1 1 1 58 1 29 1 1 1 1 1 1 1 1 1 1 1 1 58 1 1 1 1 1 2 1 1 1\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "90 45\n15 1 1 1 1 3 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\nYour task is to calculate the nu...
[{"type": "stdin_stdout", "input": "100000 200000\n", "output": "707899035\n"}, {"type": "stdin_stdout", "input": "150000 200000\n", "output": "270223789\n"}, {"type": "stdin_stdout", "input": "200000 200000\n", "output": "668956439\n"}, {"type": "stdin_stdout", "input": "1000 200000\n", "output": "664520775\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\nVanya and his friend Vova play a...
[{"type": "stdin_stdout", "input": "20 5 15\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n", "output": "Both\nVova\nVova\nBoth\nBoth\nVova\nVova\nBoth\nBoth\nVova\nVova\nBoth\nBoth\nVova\nVova\nBoth\nBoth\nVova\nVova\nBoth\n"}, {"type": "stdin_stdout", "input": "11 22 33\n55\n56\n57\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\nA permutation p is an ordered gr...
[{"type": "stdin_stdout", "input": "55 0\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 91 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlong a road running in an east-...
[{"type": "stdin_stdout", "input": "1 1 3\n1\n10000000000\n2\n9999999999\n5000000000\n", "output": "10000000000\n10000000000\n14999999998\n"}, {"type": "stdin_stdout", "input": "2 3 4\n100\n600\n400\n900\n1000\n150\n2000\n899\n799\n", "output": "350\n1400\n301\n399\n"}, {"type": "stdin_stdout", "input": "1 1 1\n1\n2\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\nIn Takahashi Kingdom, there is a...
[{"type": "stdin_stdout", "input": "10 10 10\n1 6\n2 9\n4 5\n4 7\n4 7\n5 8\n6 6\n6 7\n7 9\n10 10\n1 8\n1 9\n1 10\n2 8\n2 9\n2 10\n3 8\n3 9\n3 10\n1 10\n", "output": "7\n9\n10\n6\n8\n9\n6\n7\n8\n10\n"}, {"type": "stdin_stdout", "input": "5 10 5\n3 4\n1 4\n1 2\n1 1\n2 5\n2 5\n1 2\n1 3\n3 5\n3 4\n1 2\n1 1\n5 5\n1 5\n2 4\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have an integer N.\nPrint an ...
[{"type": "stdin_stdout", "input": "29\n", "output": "2329089562801\n"}, {"type": "stdin_stdout", "input": "30\n", "output": "2329089562801\n"}, {"type": "stdin_stdout", "input": "28\n", "output": "80313433201\n"}, {"type": "stdin_stdout", "input": "23\n", "output": "5354228881\n"}, {"type": "stdin_stdout", "input": "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\nOlya loves energy drinks. She lo...
[{"type": "stdin_stdout", "input": "10 10 1000\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n7 6 1 3\n", "output": "2"}, {"type": "stdin_stdout", "input": "10 10 1000\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\nThere are $n$ students in the fi...
[{"type": "stdin_stdout", "input": "20\ngrkbifiedubnohaektjo\nizxghhzkwfpbsmfsrvzr\njjkvyqppaqotfnqkogvs\ngphjvgjewixdzonunipv\nilfwfngxaiwutzafueot\nirbntjytnvppbgyyllmk\njotpbafckwsufccigskt\njbzfmhjzeoxruiebctsj\nijvxpeybbhrezjuajkkp\njdqriujmuvcvphlcsxfm\nykwqjokeljlnyqpirlvp\nyhcczukakwarzzloccim\nmmygnzejmxmoksms...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 was trying to solve the ...
[{"type": "stdin_stdout", "input": "43\n", "output": "1 2\n1 3\n1 4\n2 5\n2 6\n1 7\n1 8\n1 9\n1 10\n1 11\n1 12\n1 13\n1 14\n1 15\n1 16\n1 17\n1 18\n1 19\n1 20\n1 21\n1 22\n1 23\n1 24\n1 25\n1 26\n1 27\n1 28\n1 29\n1 30\n1 31\n1 32\n1 33\n1 34\n1 35\n1 36\n1 37\n1 38\n1 39\n1 40\n1 41\n1 42\n1 43\n1 2\n1 3\n1 4\n1 5\n1 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nValera has array a, consisting o...
[{"type": "stdin_stdout", "input": "43\n475 2165 8771 7146 8980 7209 9170 9006 6278 6661 4740 6321 7532 6869 3788 7918 1707 5070 3809 5189 2494 8255 1123 3197 190 5712 9873 3286 9997 133 9030 3067 8043 5297 5398 4240 8315 2141 1436 3297 247 8438 2300\n0111011100100011110010011110011011010001101\n", "output": "222013\n"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle penguin Polo has an n × m...
[{"type": "stdin_stdout", "input": "7 5 47\n9583 1734 4601 5353 2110\n3802 5165 7985 6293 324\n7045 653 9160 7891 4930\n1781 3520 4178 2298 3943\n1405 2956 5447 5494 6528\n3097 1640 7750 4883 8032\n4225 8455 1875 4789 4366\n", "output": "1508\n"}, {"type": "stdin_stdout", "input": "7 7 47\n47 47 47 47 47 47 47\n47 47 4...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecently Luba bought a very inte...
[{"type": "stdin_stdout", "input": "100 1000000\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "output": "12\n"}, {"type": "stdin_stdout", "input": "6 1200\n86400...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Susie listens to fairy ta...
[{"type": "stdin_stdout", "input": "67\n1 1\n3 8\n4 10\n7 8\n9 2\n10 1\n11 5\n12 8\n13 4\n16 6\n18 3\n19 3\n22 5\n24 6\n27 5\n28 3\n29 3\n30 5\n32 5\n33 10\n34 7\n35 8\n36 5\n41 3\n42 2\n43 5\n46 4\n48 4\n49 9\n52 4\n53 9\n55 1\n56 4\n59 7\n68 7\n69 4\n71 9\n72 10\n74 5\n76 4\n77 9\n80 7\n81 9\n82 5\n83 5\n84 9\n85 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\nYou are given a rooted tree with...
[{"type": "stdin_stdout", "input": "7\n1 1 2 3 1 4\n3 3 1 1 1 2 3\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "6\n1 2 2 1 5\n2 1 1 1 1 1\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "5\n1 2 1 4\n1 1 1 2 2\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "4\n1 2 1\n1 2 3 4\n", "output": "4\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a programming language ...
[{"type": "stdin_stdout", "input": "17 21\n187<9>82<818<4229\n8 14\n4 10\n11 17\n8 8\n4 12\n6 6\n5 12\n10 12\n15 16\n7 7\n3 8\n4 8\n8 9\n8 10\n5 7\n1 7\n11 12\n3 6\n6 11\n8 16\n6 9\n", "output": "0 1 1 0 0 0 0 0 0 0 \n0 0 0 0 0 0 0 0 0 0 \n1 1 0 0 0 0 0 1 1 0 \n0 0 1 0 0 0 0 0 0 0 \n0 0 0 0 0 0 0 0 0 0 \n0 0 0 0 0 0 0 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou've got a undirected graph G,...
[{"type": "stdin_stdout", "input": "30 70 4\n22 1\n1 25\n27 5\n25 10\n10 2\n29 4\n29 26\n28 18\n15 18\n25 11\n11 10\n11 28\n4 11\n4 26\n26 7\n26 18\n18 21\n14 17\n17 30\n30 9\n30 6\n30 27\n27 22\n22 15\n22 8\n8 4\n8 17\n17 16\n16 19\n16 12\n12 23\n23 20\n20 1\n1 23\n23 15\n15 24\n24 28\n28 21\n21 9\n21 27\n29 13\n13 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\nYou are given two integers $n$ a...
[{"type": "stdin_stdout", "input": "1000 10\n", "output": "414070642\n"}, {"type": "stdin_stdout", "input": "1000 2\n", "output": "917124963\n"}, {"type": "stdin_stdout", "input": "723 9\n", "output": "157557417\n"}, {"type": "stdin_stdout", "input": "678 7\n", "output": "778650919\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\nKuro is living in a country call...
[{"type": "stdin_stdout", "input": "70 42 32\n25 50\n51 7\n39 61\n1 33\n20 5\n1 70\n1 63\n42 35\n64 16\n1 11\n39 42\n20 54\n11 14\n57 44\n1 59\n55 40\n25 3\n31 18\n38 68\n57 23\n39 57\n28 10\n39 20\n42 26\n58 6\n20 56\n57 2\n13 21\n15 69\n39 64\n1 39\n62 53\n39 13\n1 41\n22 12\n13 30\n68 67\n20 31\n51 15\n57 32\n59 34\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 phone numbers in Pol...
[{"type": "stdin_stdout", "input": "9\n111111111\n111111110\n111111100\n111111000\n111110000\n111100000\n111000000\n110000000\n100000000\n", "output": "111111111\n111111110\n111111100\n111111000\n111110000\n111100000\n111000000\n110000000\n00000000\n"}, {"type": "stdin_stdout", "input": "10\n302417715\n621211824\n47445...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWhen Valera has got some free ti...
[{"type": "stdin_stdout", "input": "50 2\n124 214 63 73 996 760 38 571 451 300 970 1 706 937 837 494 619 88 851 411 957 990 842 613 821 649 627 34 693 678 734 116 816 985 705 940 499 493 922 967 854 439 112 644 961 438 189 572 655 550\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "30 60\n16 13 22 38 13 35 17 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp is currently developing...
[{"type": "stdin_stdout", "input": "9\ncodehorses 5\n3\nwebfrmk 6\nmashadb 1\nmashadb 2\n\ncommons 2\n0\n\nmashadb 3\n0\n\nwebfrmk 6\n2\nmashadb 3\ncommons 2\n\nextra 4\n1\nextra 3\n\nextra 3\n0\n\nextra 1\n0\n\nmashadb 1\n1\nextra 3\n\nmashadb 2\n1\nextra 1\n", "output": "4\ncommons 2\nextra 1\nmashadb 2\nwebfrmk 6\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\nIvan wants to write a letter to ...
[{"type": "stdin_stdout", "input": "aaaaaaabaaaabbbbaaaaaaabbaaaaaaaaaabbabaaaaaabaaaaabaaaaaaaabaaaaaaaaaaaaaaaabaaaaaabaaaaaaaaabbaaabaaaaabbaaabaaaaabaaabaaaaaabaaaaaaaaaaabaabaaabaaaaabbbbaaaaaaaaaaaaaaabaaaaaaaaababaaabaaaaaaaaaabaaaaaaaabaaaabbbbaaaaaaabbaaaaaaaaaabbabaaaaaabaaaaabaaaaaaaabaaaaaaaaaaaaaaaabaaaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSimon has a prime number x and a...
[{"type": "stdin_stdout", "input": "26 7\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2\n", "output": "49\n"}, {"type": "stdin_stdout", "input": "26 2\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "1 800000011\n800000011\n", "output": "1\n"}, {"type":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAsya loves animals very much. Re...
[{"type": "stdin_stdout", "input": "64\n2 20\n37 55\n42 29\n36 54\n35 50\n60 41\n25 61\n31 51\n9 43\n26 28\n48 56\n13 64\n17 19\n8 12\n52 16\n24 44\n1 18\n58 15\n5 30\n3 7\n62 22\n53 14\n11 38\n10 49\n47 59\n40 45\n33 4\n23 39\n63 57\n32 46\n34 6\n27 21\n20 55\n29 54\n35 60\n61 51\n9 26\n48 13\n19 12\n52 44\n1 58\n5 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\nThere is a forest that we model ...
[{"type": "stdin_stdout", "input": "20\n7571542 9868879\n3634934 5986987\n2297651 5538795\n9701582 8250721\n-2913168 4968483\n8838674 5771883\n-3348778 8326335\n-577797 750161\n-7223138 9113512\n-1808146 6044926\n-756446 417388\n4700417 1550148\n-5568937 20029\n-9170707 6103893\n7445655 7161843\n8820510 4145867\n-44669...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAt the big break Nastya came to ...
[{"type": "stdin_stdout", "input": "20 47\n4 6 11 15 9 17 3 1 19 14 12 8 2 5 7 20 16 18 13 10\n18 10\n6 3\n15 17\n18 7\n6 5\n19 10\n6 7\n11 3\n1 10\n17 3\n6 14\n7 10\n19 5\n12 10\n1 8\n6 11\n18 5\n6 8\n12 8\n1 5\n20 10\n16 8\n6 10\n20 19\n17 8\n13 10\n2 5\n19 8\n6 9\n16 3\n16 10\n19 7\n17 16\n10 16\n8 9\n12 5\n17 10\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\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 "}, {"type": "stdin_stdout", "input": "10 50\n9 9 9 9 9 9 9 9 9 9\n", "output": "0 0 0 0 0 1 2 3 4 5 "}, {"type": "stdin_stdout", "input": "8 2\n1 1 1 1 1 1 1 1\n", "output": "0 0 1 2 3 4 5 6 "}, {"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\nOn a certain meeting of a ruling...
[{"type": "stdin_stdout", "input": "9 37\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\nConsider a rooted tree. A rooted...
[{"type": "stdin_stdout", "input": "20\n1\n1\n1\n1\n2\n2\n2\n3\n3\n3\n4\n4\n4\n5\n5\n5\n1\n1\n1\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "13\n1\n2\n2\n2\n1\n6\n6\n6\n1\n10\n10\n10\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "12\n1\n1\n1\n2\n5\n5\n5\n5\n1\n2\n2\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\nThe array a with n integers is g...
[{"type": "stdin_stdout", "input": "10 3\n512008 512008 452221 512008 314256 123232 314256 512008 314256 123232\n", "output": "4 10\n"}, {"type": "stdin_stdout", "input": "5 2\n171230 171230 171230 171230 171230\n", "output": "1 5\n"}, {"type": "stdin_stdout", "input": "9 3\n6 5 1 2 3 2 1 4 5\n", "output": "3 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\nAlice likes snow a lot! Unfortun...
[{"type": "stdin_stdout", "input": "13\n1 1 1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "1 1 1 1 1 1 1 1 1 1 1 1 1\n"}, {"type": "stdin_stdout", "input": "10\n11 39 16 34 25 3 12 11 31 16\n10 0 4 9 8 9 7 8 9 2\n", "output": "10 0 9 27 27 30 28 17 12 4\n"}, {"type": "stdin_stdout", "input": "10\n20 35...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya has a sequence of cubes an...
[{"type": "stdin_stdout", "input": "10 1 10\n6 7 6 1 10 10 9 5 3 9\n7 10 9 6 1 5 9 3 10 6\n", "output": "TRUTH\n"}, {"type": "stdin_stdout", "input": "8 3 6\n5 3 1 1 1 1 3 5\n3 3 1 1 1 1 5 5\n", "output": "LIE\n"}, {"type": "stdin_stdout", "input": "7 1 4\n2 5 5 5 4 3 4\n2 5 5 5 4 3 4\n", "output": "TRUTH\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\nA permutation of length $n$ is a...
[{"type": "stdin_stdout", "input": "583291\n", "output": "135712853"}, {"type": "stdin_stdout", "input": "1000000\n", "output": "23581336"}, {"type": "stdin_stdout", "input": "336161\n", "output": "234634596"}, {"type": "stdin_stdout", "input": "885131\n", "output": "329995454"}, {"type": "stdin_stdout", "input": "4823...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIvan is a novice painter. He has...
[{"type": "stdin_stdout", "input": "4 6\n3 4\n2 3\n2 1\n1 3\n1 4\n4 2\n", "output": "4\n1 7\n1 3\n1 4\n1 5\n4\n2 8\n2 2\n2 3\n2 6\n4\n3 9\n3 1\n3 2\n3 4\n4\n4 10\n4 1\n4 5\n4 6\n"}, {"type": "stdin_stdout", "input": "7 4\n3 4\n3 5\n5 7\n2 5\n", "output": "1\n1 5\n2\n2 6\n2 4\n3\n3 7\n3 1\n3 2\n2\n4 8\n4 1\n4\n5 9\n5 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\nYou are given an array of $n$ in...
[{"type": "stdin_stdout", "input": "100 0\n4 20 52 2 7 36 8 73 9 99 13 19 14 89 32 2 6 2 16 21 47 22 66 23 25 95 28 4 29 64 30 31 7 48 32 51 35 37 77 57 40 42 56 40 43 44 46 13 47 12 48 49 24 51 69 53 54 98 21 57 59 61 62 52 63 30 68 32 69 39 8 67 71 59 72 81 76 77 11 82 85 14 83 33 86 89 89 90 43 96 91 31 93 69 58 94 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 been in love with Coronav...
[{"type": "stdin_stdout", "input": "48 14\n1 1 1 1 1 6 1 1 1 1 1 1 3 3 1 1 1 1 1 2 2 2 1 1 1 1 1 1 2 1 4 1 1 1 1 1 1 1 1 1 1 7 1 1 1 1 1 5\n", "output": "42"}, {"type": "stdin_stdout", "input": "18 445\n89 24 6 83 53 67 17 38 39 45 2 98 72 29 38 59 78 98\n", "output": "18022"}, {"type": "stdin_stdout", "input": "10 6\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\nNaman has two binary strings $s$...
[{"type": "stdin_stdout", "input": "12\n011001010101\n111001010101\n", "output": "-1"}, {"type": "stdin_stdout", "input": "10\n1111100000\n1111100001\n", "output": "-1"}, {"type": "stdin_stdout", "input": "10\n1111100000\n0000011111\n", "output": "5"}, {"type": "stdin_stdout", "input": "10\n1010111110\n1011101101\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\nA well-known art union called \"...
[{"type": "stdin_stdout", "input": "10 3\n6 10 3\n2 7 9\n10 4 7\n6 3 4\n6 2 6\n8 4 4\n5 9 8\n6 9 7\n2 7 10\n2 6 2\n", "output": "19 32 39 43 49 53 61 68 78 80 "}, {"type": "stdin_stdout", "input": "7 1\n80\n92\n24\n88\n40\n45\n7\n", "output": "80 172 196 284 324 369 376 "}, {"type": "stdin_stdout", "input": "3 3\n3 9 4...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe academic year has just begun...
[{"type": "stdin_stdout", "input": "50\nUUUUUUUUUUUUUUUUUUUUUUUUUDDDDDDDDDDDDDDDDDDDDDDDDD\n", "output": "51 102 153 204 255 306 357 408 459 510 561 612 663 714 765 816 867 918 969 1020 1071 1122 1173 1224 1275 1275 1224 1173 1122 1071 1020 969 918 867 816 765 714 663 612 561 510 459 408 357 306 255 204 153 102 51 "}, ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSeryozha has a very changeable c...
[{"type": "stdin_stdout", "input": "7\ni\nam\nnot\nmain\nin\nthe\nfamily\n<3i<>3am<3the<3<main<3in<3the<3><3family<3\n", "output": "no\n"}, {"type": "stdin_stdout", "input": "3\ni\nlove\nyou\n<3i<3lo<3ve<3y<<<<<<<ou3<3\n", "output": "yes\n"}, {"type": "stdin_stdout", "input": "3\ni\nlove\nyou\n<3i<3love<23you<3ww\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\nA social network for dogs called...
[{"type": "stdin_stdout", "input": "10 10\n999999991 1000000000\n999999992 1000000000\n999999993 1000000000\n999999994 1000000000\n999999995 1000000000\n999999996 1000000000\n999999997 1000000000\n999999998 1000000000\n999999999 1000000000\n1000000000 1000000000\n", "output": "1999999991\n1999999992\n1999999993\n199999...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have to restore the wall. Th...
[{"type": "stdin_stdout", "input": "100 52 92 72\n67 100 56 15 0 92 26 74 44 61 6 44 45 19 22 19 9 85 67 78 24 61 81 99 62 84 5 71 11 65 5 97 9 72 11 81 81 64 65 91 52 21 20 53 68 91 4 75 84 88 72 27 48 23 9 65 14 6 54 55 6 1 89 78 40 45 98 45 27 51 94 72 67 81 20 19 38 64 14 40 57 21 82 99 37 92 21 22 30 14 65 93 60 8...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPetya and Gena love playing tabl...
[{"type": "stdin_stdout", "input": "186\n2 1 2 1 1 1 1 1 2 1 1 2 2 2 1 1 2 2 1 1 1 2 1 1 2 2 1 1 1 2 2 1 1 1 1 1 2 1 1 1 2 1 2 1 1 2 1 1 1 2 2 2 2 2 2 2 1 2 1 2 1 1 2 1 2 2 1 1 1 1 1 2 2 1 2 2 1 2 2 1 1 1 2 2 1 1 2 2 1 2 2 1 2 2 2 2 2 1 1 1 1 2 1 1 2 2 2 2 2 2 1 1 1 1 1 2 1 1 2 2 1 2 2 1 1 1 1 1 2 2 1 1 2 2 1 2 2 2 1 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasily the bear has got a sequen...
[{"type": "stdin_stdout", "input": "39\n37749932 37750076 37750391 37750488 37750607 37750812 37750978 37751835 37752173 37752254 75497669 75497829 75497852 75498044 75498061 75498155 75498198 75498341 75498382 75498465 150994988 150994989 150995009 150995019 150995024 150995030 150995031 150995069 150995072 805306369 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNadeko's birthday is approaching...
[{"type": "stdin_stdout", "input": "100\ndddddccccdddddaaaaabbbbbbbbbbbbbaaacdcabbacccacccccbdbbadddbbddddbdaaccacdddbbbaddddbbbbdcbbbdddddda\n50\n54 b\n48 d\n45 b\n52 c\n52 a\n48 a\n54 b\n45 a\n47 d\n50 d\n53 a\n34 a\n51 b\n48 d\n47 d\n47 a\n48 d\n53 b\n52 d\n54 d\n46 a\n38 a\n52 b\n49 a\n49 b\n46 c\n54 a\n45 b\n35 c\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHiking club \"Up the hill\" just...
[{"type": "stdin_stdout", "input": "100\n4\n", "output": "5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 is reading a e-book. The f...
[{"type": "stdin_stdout", "input": "5\n20 10 2 9\n1000000000 2 89 4\n1000000000 2 89 8\n1000000000 89 1 1000000000\n1000000000 1000000000 2 3\n", "output": "4\n23\n12\n1\n-1\n"}, {"type": "stdin_stdout", "input": "1\n1000000000 3 1000000000 2\n", "output": "499999999\n"}, {"type": "stdin_stdout", "input": "1\n100000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGathering darkness shrouds the w...
[{"type": "stdin_stdout", "input": "50 1 19\n-5213 -1\n2021 -1\n-4479 1\n1569 -1\n1618 1\n-8318 1\n3854 1\n8190 -1\n9162 1\n8849 1\n-5545 -1\n-7898 -1\n728 1\n-2175 -1\n6453 -1\n2999 1\n4716 1\n-2192 -1\n7938 -1\n1910 -1\n-6863 -1\n5230 -1\n-2782 -1\n-2587 -1\n-3389 1\n-332 -1\n5915 1\n-2604 1\n-8907 1\n-2019 1\n2992 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 flower shop has got n bouquets...
[{"type": "stdin_stdout", "input": "25\n742168 377547 485672 437223 96307 902863 759104 747933 512899 410317 588598 666688 823202 257684 520631 910066 168864 71499 899972 565350 764848 754913 929040 864132 289976\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "20\n274039 899325 798709 157662 963297 276599 529...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe famous joke programming lang...
[{"type": "stdin_stdout", "input": "HQQQQQQQHQQQQHQHQQQHHQHHHQQHQQQQHHQHHQHHHHHHQQQQQQQQHHQQQQQHHQQQQHHHQQQQQQQQHQQQHQHQQQQQQHHHQHHQHQHHQQQQQHQQHQHQQQHQHQHHHHQQHQHQQQQQHQQQHQQQHQQHQHQQHQQQQQQ\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "HQQQHQQHQHQQQQHQQQHQHQHQQQHQQQQHQQHHQQQQQHQQQQHQQQQQHQQQQQHQQQQQHHQQQQ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 army of n droids is lined up ...
[{"type": "stdin_stdout", "input": "49 2 1971\n794 866\n401 575\n341 83\n103 208\n352 134\n260 878\n497 931\n630 570\n885 464\n23 663\n60 775\n416 870\n955 405\n392 961\n530 258\n73 404\n736 923\n44 436\n594 314\n904 138\n980 163\n76 720\n879 809\n81 838\n263 599\n218 139\n659 493\n848 754\n656 302\n490 7\n204 530\n184...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAncient Egyptians are known to h...
[{"type": "stdin_stdout", "input": "((((4?6)?9)?((5?(7?1))?(6?(4?(((((((7?3)?7)?(((((8?(6?7))?((1?2)?(5?8)))?8)?7)?4))?6)?7)?1)?((7?(2?((1?(((8?(((((2?7)?(((((3?6)?3)?(((((9?5)?7)?(1?(5?5)))?(8?((3?(1?2))?((8?5)?(7?((9?((9?8)?7))?1))))))?1))?1)?(9?2)))?((7?5)?((9?(4?(9?6)))?(8?(((5?7)?2)?(6?(3?8)))))))?(((4?(2?2))?(7?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\nOne day, Yuhao came across a pro...
[{"type": "stdin_stdout", "input": "30\n)(((())()())()(\n))(()()()(\n))()((\n)())(()\n())())((\n((((())\n(((()))(\n(())\n)()(((()(()\n((())))(\n)()()())((\n))))(()\n()(((()\n)()()(\n(())())\n(()()(())(\n)()((\n)(()(())))\n))))(())((\n)()(()(((((\n(()))((\n()())\n((()()()))\n()((((((((()\n)(()(\n)(((())(()\n)((((()(\n((...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are two popular keyboard l...
[{"type": "stdin_stdout", "input": "buneohqdgxjsafrmwtzickvlpy\nzblwamjxifyuqtnrgdkchpoves\n4RZf8YivG6414X1GdDfcCbc10GA0Wz8514LI9D647XzPb66UNh7lX1rDQv0hQvJ7aqhyh1Z39yABGKn24g185Y85ER5q9UqPFaQ2JeK97wHZ78CMSuU8Zf091mePl2OX61BLe5KdmUWodt4BXPiseOZkZ4SZ27qtBM4hT499mCirjy6nB0ZqjQie4Wr3uhW2mGqBlHyEZbW7A6QnsNX9d3j5aHQN0H6GF8J0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nEugeny has array a = a_1, a_2, ....
[{"type": "stdin_stdout", "input": "10 10\n-1 1 -1 1 -1 -1 -1 -1 -1 -1\n6 7\n2 5\n3 6\n1 3\n3 5\n4 5\n3 4\n1 6\n1 1\n1 1\n", "output": "1\n1\n1\n0\n0\n1\n1\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "9 9\n-1 1 1 1 1 1 1 1 1\n1 7\n5 6\n1 4\n1 1\n1 1\n6 8\n1 1\n6 7\n3 5\n", "output": "0\n1\n0\n0\n0\n0\n0\n1\n0\n"}, ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nВ самолёте есть n рядов мест. Ес...
[{"type": "stdin_stdout", "input": "30 1\nPPP-PPP.-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP\nPPP-PPPP-PPP...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Greatest Secret Ever consist...
[{"type": "stdin_stdout", "input": "18 6\n", "output": "1 1 5 2 1 6 4 6 3 4 5 3 3 2 6 5 4 2\n"}, {"type": "stdin_stdout", "input": "11 3\n", "output": "3 1 2 1 1 2 3 2 2 3 1\n"}, {"type": "stdin_stdout", "input": "10 2\n", "output": "1 1 2 1 1 2 2 1 2 2\n"}, {"type": "stdin_stdout", "input": "9 3\n", "output": "3 1 1 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIt's been almost a week since Po...
[{"type": "stdin_stdout", "input": "10 5\n1384 1129 1780 1960 1567 1928 12 1523 1165 344\n", "output": "6931.3333333333\n"}, {"type": "stdin_stdout", "input": "10 4\n127 1459 718 1183 880 1044 1857 1340 725 1496\n", "output": "4574.4285714286\n"}, {"type": "stdin_stdout", "input": "8 2\n1 2 4 100000 123 456 789 1\n", "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n piles of pebbles on ...
[{"type": "stdin_stdout", "input": "100 67\n82 34 100 55 38 32 97 34 100 49 49 41 48 100 74 51 53 50 46 38 35 69 93 61 96 86 43 59 90 45 52 100 48 45 63 60 52 66 83 46 66 47 74 37 56 48 42 88 39 68 38 66 77 40 60 60 92 38 45 57 63 91 85 85 89 53 64 66 99 89 49 54 48 58 94 65 78 34 78 62 95 47 64 50 84 52 98 79 57 69 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\nVasya became interested in bioin...
[{"type": "stdin_stdout", "input": "318\nTATCAATCGGTACGTGCGCATCATTGTCAATCGGGCTTCATGGCTTGCGGGCGCTACCCGAGGGGAAGCTGCGGACAGGTAGGTAAGATACACACGAACCAAACGGAGTTATGTTGGATAAATTGGCTGGAAGGGCGTAGGTATATCGAGTCGCGGACCTGGCATAGACTATCAGGGGCAGCGGTACAAGGCAACCGTGAGCGGGGTCTGCCCACCATTAGACCGATGCGCCGGCTCGTATATGTGATTCTGGTGAAAAGTATCATGCCGGGACGCGTA...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLeonid wants to become a glass c...
[{"type": "stdin_stdout", "input": "5 15 10\nH 8\nH 9\nV 1\nH 2\nH 6\nH 4\nH 1\nV 2\nH 13\nV 3\n", "output": "40\n40\n32\n24\n24\n24\n24\n18\n12\n8\n"}, {"type": "stdin_stdout", "input": "15 5 10\nV 13\nV 10\nV 3\nH 2\nV 9\nV 7\nV 2\nH 1\nV 4\nH 3\n", "output": "65\n50\n35\n21\n18\n12\n12\n12\n9\n6\n"}, {"type": "stdin...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Fair Nut found a string $s$....
[{"type": "stdin_stdout", "input": "babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab\n", "output": "813881762"}, {"type": "stdin_stdout", "input": "amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb\n", "output": "9871...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 two integers X and...
[{"type": "stdin_stdout", "input": "-100 -100\n", "output": "-100 0\n"}, {"type": "stdin_stdout", "input": "-100 100\n", "output": "0 -100\n"}, {"type": "stdin_stdout", "input": "-39 -69\n", "output": "-54 15\n"}, {"type": "stdin_stdout", "input": "100 -100\n", "output": "0 100\n"}, {"type": "stdin_stdout", "input": "-...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are two 100-story building...
[{"type": "stdin_stdout", "input": "1 100 100 100\n", "output": "10000\n"}, {"type": "stdin_stdout", "input": "1 100 50 100\n", "output": "9950\n"}, {"type": "stdin_stdout", "input": "1 100 33 65\n", "output": "6468\n"}, {"type": "stdin_stdout", "input": "1 100 33 67\n", "output": "6567\n"}, {"type": "stdin_stdout", "i...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nArkady's morning seemed to be st...
[{"type": "stdin_stdout", "input": "2\n64 23 81 66 95 91 56 12 48 24 78 36 67 57 75 88 82 98 83 46 100 58 62 80 8 4 28 74 70 50 42 11 68 18 19 6 94 59 13 72 37 31 90 41 60 34 86 55 76 69 32 21 73 84 3 52 92 79 61 63 38 87 17 14 29\n65 89 14 93 58 60 80 64 28 91 70 48 19 55 75 21 100 98 88 69 7 42 41 81 8 76 54 87 16 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\nYou will receive 5 points for so...
[{"type": "stdin_stdout", "input": "LEHLLLLLLHAFGEGLLHAFDLHHLLLLLDGGEHGGHLLLLLLLLDFLCBLLEFLLCBLLCGLEDLGGLECLDGLEHLLLGELLLEGLLLLGDLLLDALD\n", "output": "49\n"}, {"type": "stdin_stdout", "input": "ABCDEFGHIJKLMNOPQRSTUVWXYZ\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "THISISTHELASTTEST\n", "output": "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\nThanks to the Doctor's help, the...
[{"type": "stdin_stdout", "input": "1 1\n1 1\n2 2 551454259 292052813\n1 755275238 645143315\n1 936400451 457379982\n1 873148501\n1 181471857\n", "output": "584105626\n"}, {"type": "stdin_stdout", "input": "1 1\n1 1\n2 2 205003324 933814220\n1 974625469 989301423\n1 762016619 720019121\n1 389607162\n1 162417396\n", "ou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a rooted tree on $...
[{"type": "stdin_stdout", "input": "2 100000 1000000000000000000\n1000000000 1000000000\n1\n", "output": "1"}, {"type": "stdin_stdout", "input": "3 3 2200000000\n1000000000 1000000000 1000000000\n1 2\n", "output": "2"}, {"type": "stdin_stdout", "input": "7 2 91648\n7 3 6 2 5 4 1\n1 1 1 1 3 2\n", "output": "4"}, {"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\nVasya commutes by train every da...
[{"type": "stdin_stdout", "input": "10\n2 10 8 7 8 8 10 9 10\n", "output": "63\n"}, {"type": "stdin_stdout", "input": "9\n2 9 7 6 9 7 8 9\n", "output": "52\n"}, {"type": "stdin_stdout", "input": "8\n3 7 7 8 8 7 8\n", "output": "37\n"}, {"type": "stdin_stdout", "input": "7\n7 3 4 6 6 7\n", "output": "35\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\nAs you could know there are no m...
[{"type": "stdin_stdout", "input": "100\n25 6 46 37 87 99 70 31 46 12 94 40 87 56 28 8 94 39 13 12 67 13 71 39 83 48 40 14 62 41 16 71 20 41 83 41 68 98 23 82 62 83 62 35 49 22 31 21 66 98 54 39 34 52 11 28 47 89 25 44 68 36 91 46 82 86 88 48 27 93 7 9 53 36 16 100 84 84 44 25 58 66 16 46 72 21 91 78 4 17 44 17 47 67 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\nThe classic programming language...
[{"type": "stdin_stdout", "input": "45\n--X\n++X\nX--\n++X\n++X\nX++\n--X\n--X\n--X\n--X\n--X\n--X\n--X\nX++\n++X\nX--\n++X\n++X\nX--\nX++\nX--\n--X\nX--\n++X\n++X\n--X\n--X\nX--\nX--\n--X\n++X\nX--\n--X\n++X\n++X\n--X\n--X\nX--\n++X\n++X\nX++\nX++\n++X\n++X\nX++\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 construction of subway in Be...
[{"type": "stdin_stdout", "input": "100\n98 52 63 2 18 96 31 58 84 40 41 45 66 100 46 71 26 48 81 20 73 91 68 76 13 93 17 29 64 95 79 21 55 75 19 85 54 51 89 78 15 87 43 59 36 1 90 35 65 56 62 28 86 5 82 49 3 99 33 9 92 32 74 69 27 22 77 16 44 94 34 6 57 70 23 12 61 25 8 11 67 47 83 88 10 14 30 7 97 60 42 37 24 38 53 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\nOne tradition of ACM-ICPC contes...
[{"type": "stdin_stdout", "input": "7\n14000000003 1000000000000000000\n81000000000 88000000000\n5000000000 7000000000\n15000000000 39000000000\n46000000000 51000000000\n0 1000000000\n0 0\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "15\n143 698\n269 879\n100 728\n86 855\n368 478\n174 368\n442 980\n812 825\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\nEach month Blake gets the report...
[{"type": "stdin_stdout", "input": "100 30\n65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 74 57 115 16 55 88 79 97 21 80 41 56 49 103 61 66 1 36 44 43 82 37 38 106 27 114 51 112 55 87 41 69 31 86 58 27 46 99 18 105 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\nLittle Dima has two sequences of...
[{"type": "stdin_stdout", "input": "100\n2 2 10 3 5 6 4 7 9 8 2 7 5 5 1 7 5 9 2 2 10 3 6 10 9 9 10 7 3 9 7 8 8 3 9 3 9 3 3 6 3 7 9 9 7 10 9 1 1 3 6 2 9 5 9 9 6 2 6 5 6 8 2 10 1 1 6 8 8 4 5 2 6 8 8 5 9 2 3 3 7 7 10 5 4 2 10 6 7 6 5 4 10 6 10 3 9 9 1 5\n3 5 6 4 2 3 2 9 3 8 3 1 10 7 4 3 6 9 3 5 9 5 3 10 4 7 9 7 4 3 3 6 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\nThe Physical education teacher a...
[{"type": "stdin_stdout", "input": "100\n246 485 -940 -186 -841 -98 711 429 -154 164 -244 -111 886 -447 22 480 224 -132 927 812 -243 -152 -843 403 -320 -346 -407 827 645 -903 -172 540 -359 498 270 284 374 -52 -983 -164 -707 -242 -159 -825 -889 661 -629 212 849 -891 -622 810 957 897 -96 -293 -257 822 690 369 -914 212 -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\nShaass has decided to hunt some ...
[{"type": "stdin_stdout", "input": "10\n95 54 36 39 98 30 19 24 14 12\n3\n9 5\n8 15\n7 5\n", "output": "95\n54\n36\n39\n98\n34\n0\n28\n13\n21\n"}, {"type": "stdin_stdout", "input": "10\n48 53 10 28 91 56 81 2 67 52\n2\n2 40\n6 51\n", "output": "87\n0\n23\n28\n141\n0\n86\n2\n67\n52\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\nThink of New York as a rectangul...
[{"type": "stdin_stdout", "input": "100 100\n10\n53 20\n97 6\n12 74\n48 92\n97 13\n47 96\n75 32\n69 21\n95 75\n1 54\n10\n36 97\n41 1\n1 87\n39 23\n27 44\n73 97\n1 1\n6 26\n48 3\n5 69\n", "output": "108\n4\n"}, {"type": "stdin_stdout", "input": "100 100\n10\n86 72\n25 73\n29 84\n34 33\n29 20\n84 83\n41 80\n22 22\n16 89\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's denote correct match equat...
[{"type": "stdin_stdout", "input": "100\n928\n970\n950\n921\n945\n974\n941\n999\n964\n920\n926\n942\n934\n918\n930\n901\n977\n961\n978\n962\n951\n909\n994\n953\n946\n993\n982\n922\n933\n932\n904\n910\n991\n937\n963\n988\n983\n903\n956\n976\n967\n958\n902\n986\n960\n965\n940\n914\n955\n987\n952\n971\n939\n966\n938\n911\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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$ intervals in f...
[{"type": "stdin_stdout", "input": "8 20\n6 10\n6 9\n9 10\n1 3\n5 8\n1 5\n6 8\n6 9\n5 9\n3 8\n8 9\n8 10\n1 9\n8 10\n9 10\n5 7\n6 10\n3 4\n5 9\n7 9\n7 8\n5 6\n9 10\n0 6\n4 8\n7 9\n3 8\n4 10\n", "output": "2\n2\n1\n1\n3\n1\n1\n1\n1\n1\n2\n1\n1\n1\n1\n-1\n2\n1\n2\n3\n"}, {"type": "stdin_stdout", "input": "6 20\n9 10\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\nOnce Max found an electronic cal...
[{"type": "stdin_stdout", "input": "222145 353252\n", "output": "3860750\n"}, {"type": "stdin_stdout", "input": "213 221442\n", "output": "5645356\n"}, {"type": "stdin_stdout", "input": "1 1000000\n", "output": "28733372\n"}, {"type": "stdin_stdout", "input": "1000000 1000000\n", "output": "38\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\nLuba has to do n chores today. i...
[{"type": "stdin_stdout", "input": "100 1 99\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 10...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNew Year is coming, and Jaehyun ...
[{"type": "stdin_stdout", "input": "50 60\n86 57 45 93 17 12 40 10 47 80 18 80 3 9 6 55 13 99 5 76 4 70 100 55 27 91 71 3 65 93 41 74 80 56 90 50 58 13 71 9 47 52 26 73 72 21 15 81 88 28\n40 32 5 16 49 23 3 17 14 10 1 15 1 21 28 22 13 45 12 25 44 48 46 32 36 43 11 8 49 7 7 35 10 14 39 4 42 10 30 27 1 17 31 15 8 41 44 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\nIT City company developing compu...
[{"type": "stdin_stdout", "input": "1000000000000000000\n", "output": "396825396825396"}, {"type": "stdin_stdout", "input": "718281828459045235\n", "output": "285032471610732"}, {"type": "stdin_stdout", "input": "987654321234567890\n", "output": "391926317950225"}, {"type": "stdin_stdout", "input": "504000000000000000\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKsusha the Squirrel is standing ...
[{"type": "stdin_stdout", "input": "10 3\n..........\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "2 100000\n..\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "3 10000\n.#.\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "7 3\n.#.###.\n", "output": "NO\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\nIn the year of $30XX$ participan...
[{"type": "stdin_stdout", "input": "10 10 1 8 4\n10\n2 3 4 5 6 7 8 9\n10\n1 1 3 1\n2 1 7 1\n1 1 9 1\n7 1 4 1\n10 1 7 1\n2 1 7 1\n3 1 2 1\n5 1 2 1\n10 1 5 1\n6 1 9 1\n", "output": "3\n4\n4\n3\n3\n4\n3\n3\n4\n3\n"}, {"type": "stdin_stdout", "input": "4 4 1 0 1\n4\n\n5\n1 1 2 2\n1 3 2 2\n3 3 4 3\n3 2 2 2\n1 2 2 3\n", "out...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis problem is same as the prev...
[{"type": "stdin_stdout", "input": "10\n30518 30518 30518 30518 30518 30518 30518 30518 30518 30518\n", "output": "10"}, {"type": "stdin_stdout", "input": "10\n30518 96518 74071 59971 50121 4862 43967 73607 19138 90754\n", "output": "10"}, {"type": "stdin_stdout", "input": "10\n63649 14562 779 31060 84730 3390 1402 709...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHDD hard drives group data by se...
[{"type": "stdin_stdout", "input": "100\n11 9 35 34 51 74 16 67 26 21 14 80 84 79 7 61 28 3 53 43 42 5 56 36 69 30 22 88 1 27 65 91 46 31 59 50 17 96 25 18 64 55 78 2 63 24 95 48 93 13 38 76 89 94 15 90 45 81 52 87 83 73 44 49 23 82 85 75 86 33 47 19 58 97 37 20 40 10 92 4 6 68 77 54 71 12 62 60 100 39 41 99 72 29 57 8...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDima got into number sequences. ...
[{"type": "stdin_stdout", "input": "8\n851991424 32517099 310793856 776130403 342626527 58796623 49544509 517126753\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "7\n481003311 553247971 728349004 258700257 916143165 398096105 412826266\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "6\n396640239 6200...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have a list of numbers from ...
[{"type": "stdin_stdout", "input": "2\n1000000000 1\n1000000000 500000000\n", "output": "2\n1000000000\n"}, {"type": "stdin_stdout", "input": "3\n3 1\n4 2\n69 6\n", "output": "2\n4\n12\n"}, {"type": "stdin_stdout", "input": "1\n2441139 10\n", "output": "20\n"}, {"type": "stdin_stdout", "input": "1\n2441139 12\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\nYou are given an array $a_1, a_2...
[{"type": "stdin_stdout", "input": "3\n7\n4 6 11 11 15 18 20\n4\n10 10 10 11\n3\n1 1 1000000000\n", "output": "1 2 7\n-1\n1 2 3\n"}, {"type": "stdin_stdout", "input": "1\n15\n3 4 7 8 9 10 11 12 13 14 15 16 32 36 39\n", "output": "1 2 15\n"}, {"type": "stdin_stdout", "input": "1\n14\n1 2 2 2 2 2 2 2 2 2 2 2 2 4\n", "out...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlice is a beginner composer and...
[{"type": "stdin_stdout", "input": "10\n7776 32915 1030 71664 7542 72359 65387 75222 95899 40333\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "10\n1 1 1 1 1 1 1 1 1 1\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "10\n9 6 8 5 5 2 8 9 2 2\n", "output": "9\n"}, {"type": "stdin_stdout", "input": "6\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn the rush of modern life, peop...
[{"type": "stdin_stdout", "input": "20 20\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "output": "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n"}, {"type": "stdin_stdout", "input": "10 2\n10 0 9 0 0 4 2 6 8 0\n", "output": "1\n2\n3\n4\n6\n7\n8\n9\n"}, {"type": "stdin_stdout", "input": "10 1\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\nA film festival is coming up in ...
[{"type": "stdin_stdout", "input": "129 37\n15 22 28 15 30 16 11 20 4 26 14 37 29 17 15 15 14 18 1 9 16 22 13 32 5 18 25 11 6 33 33 22 17 9 1 5 27 27 37 4 6 1 3 18 11 33 6 17 2 24 23 1 1 37 35 21 21 17 18 6 31 17 29 18 10 10 30 31 8 3 25 20 34 11 12 12 24 13 5 27 20 31 28 3 36 2 4 13 14 9 33 25 4 26 36 6 2 7 15 9 20 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\nA and B are preparing themselves...
[{"type": "stdin_stdout", "input": "10\n460626451 802090732 277246428 661369649 388684428 784303821 376287098 656422756 9301599 25720377\n277246428 388684428 661369649 460626451 656422756 802090732 9301599 784303821 376287098\n376287098 802090732 388684428 9301599 656422756 784303821 460626451 277246428\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\nIvan had string s consisting of ...
[{"type": "stdin_stdout", "input": "20\nadabacabaeabacabada 1 359\nabadabacabafabaca 1 213\nacabagabacaba 1 315\ncabaeabacabadabacab 1 268\nfabacabadabacabaeab 1 352\ncabafabacabada 1 28\nacabadabacabaea 1 67\ncabadabacabaeabacaba 1 484\nabacabadabacaba 1 209\nacabaiabacaba 1 251\nacabafabacabadabac 1 475\nabacabaeabac...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nВася купил стол, у которого n но...
[{"type": "stdin_stdout", "input": "100\n8 7 7 5 2 7 7 5 1 8 6 3 6 7 2 4 4 2 6 8 5 6 5 2 6 1 3 9 5 8 7 6 5 4 8 6 5 5 3 2 6 5 4 9 7 1 5 7 9 5 7 4 1 6 5 8 2 6 6 1 4 2 3 2 3 9 3 8 7 1 2 4 5 7 3 5 5 6 3 8 3 6 1 5 5 3 3 3 8 8 1 4 3 6 7 1 1 2 4 4 7 3 7 7 8 9 5 8 6 6 4 7 4 9 3 4 7 5 2 8 4 1 9 7 9 7 9 6 7 7 9 6 1 1 1 9 9 4 4 1...
code_stdio