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\nJulia is going to cook a chicken...
[{"type": "stdin_stdout", "input": "312200625484460654 543737694709247394 1000000000000000000\n", "output": "\n1231537069224786756.000000000000\n"}, {"type": "stdin_stdout", "input": "81413279254461199 310548139128293806 1000000000000000000\n", "output": "\n1572837149684581510.000000000000\n"}, {"type": "stdin_stdout",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\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": "15\n-12454 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\n229...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBerland Football Cup starts real...
[{"type": "stdin_stdout", "input": "500000000001 1000000000000 100 100\n", "output": "49999999999900\n"}, {"type": "stdin_stdout", "input": "500000000001 1000000000000 110 100\n", "output": "50000000000100\n"}, {"type": "stdin_stdout", "input": "1000000000000 750000000001 10 100\n", "output": "5000000000020\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\nLet \\mathrm{popcount}(n) be the...
[{"type": "stdin_stdout", "input": "23\n00110111001011011001111", "output": "3\n3\n2\n2\n3\n3\n2\n3\n3\n3\n2\n2\n3\n2\n2\n2\n2\n3\n2\n3\n3\n3\n2\n"}, {"type": "stdin_stdout", "input": "23\n00110111001011011101111", "output": "4\n4\n3\n3\n4\n3\n3\n3\n4\n4\n3\n4\n3\n3\n4\n3\n3\n3\n4\n3\n3\n3\n2\n"}, {"type": "stdin_stdou...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven is a positive even number ...
[{"type": "stdin_stdout", "input": "1100000", "output": "298228697\n"}, {"type": "stdin_stdout", "input": "0110000", "output": "784164463\n"}, {"type": "stdin_stdout", "input": "0110010", "output": "189920713\n"}, {"type": "stdin_stdout", "input": "1100010", "output": "865187132\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\nYou are given four digits N_1, N...
[{"type": "stdin_stdout", "input": "-1 3 13 -1", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-1 2 13 -1", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-1 2 17 -1", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-1 2 -1 24", "output": "NO\n"}, {"type": "stdin_stdout", "input": "-1 2 17 -2", "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 string S and T con...
[{"type": "stdin_stdout", "input": "aaaaaaaaaaaaaaab\naaaabaaaaaaaaaaa", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "aaaaaaaaaaaaaaab\naaaaaaaaaaaaaaab", "output": "Yes"}, {"type": "stdin_stdout", "input": "aaaaaabaaaaaaaab\naaaabaaaaaaaaaaa", "output": "No\n"}, {"type": "stdin_stdout", "input": "aaaaaabaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 sandglass that runs fo...
[{"type": "stdin_stdout", "input": "1111100011 0101011000", "output": "1010089011\n"}, {"type": "stdin_stdout", "input": "1111100111 0101011000", "output": "1010089111\n"}, {"type": "stdin_stdout", "input": "1100001110 0010011100", "output": "1089990010\n"}, {"type": "stdin_stdout", "input": "1110001110 0010011100", "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\nSnuke arranged N colorful balls ...
[{"type": "stdin_stdout", "input": "21 77 68\n16 73\n16 99\n19 66\n2 87\n2 16\n7 17\n10 36\n18 68\n2 38\n10 74\n13 55\n21 21\n3 7\n12 41\n13 88\n18 6\n2 12\n13 87\n1 18\n2 27\n13 15", "output": "908107200"}, {"type": "stdin_stdout", "input": "21 77 68\n16 73\n16 99\n19 66\n2 87\n2 16\n7 17\n3 36\n18 68\n2 38\n10 74\n13...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 balls and N+1 holes ...
[{"type": "stdin_stdout", "input": "1000 100 100", "output": "649620280.957660079002380"}, {"type": "stdin_stdout", "input": "1110 100 110", "output": "894375868.485796213150\n"}, {"type": "stdin_stdout", "input": "1110 101 110", "output": "894383190.732867240906\n"}, {"type": "stdin_stdout", "input": "1110 111 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\n<image>\n\n\nMy grandmother uses...
[{"type": "stdin_stdout", "input": "5\n11\n731", "output": "1 4\n1 2 8\n1 2 8 16 64 128 512\n"}, {"type": "stdin_stdout", "input": "5\n17\n731", "output": "1 4\n1 16\n1 2 8 16 64 128 512\n"}, {"type": "stdin_stdout", "input": "5\n17\n994", "output": "1 4\n1 16\n2 32 64 128 256 512\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 number obtained by multiplyi...
[{"type": "stdin_stdout", "input": "3 16\n2 35\n1 140\n0", "output": "10\n18\n39\n"}, {"type": "stdin_stdout", "input": "6 16\n2 35\n1 140\n0", "output": "7\n18\n39\n"}, {"type": "stdin_stdout", "input": "6 9\n10 36\n1 172\n0", "output": "3\n12\n43\n"}, {"type": "stdin_stdout", "input": "3 8\n2 27\n1 140\n0", "output":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nproblem\n\nSoccer is popular in ...
[{"type": "stdin_stdout", "input": "4\n1 1 0 21\n1 4 2 0\n1 -1 12 2\n4 3 1 3\n4 16 6 1\n-1 1 1 12", "output": "1\n4\n2\n2\n"}, {"type": "stdin_stdout", "input": "4\n1 2 0 19\n2 3 2 2\n1 0 22 1\n3 3 3 -1\n3 16 6 0\n0 1 -1 8", "output": "2\n3\n1\n4\n"}, {"type": "stdin_stdout", "input": "4\n1 2 0 19\n2 3 8 1\n2 0 22 1\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\nExample\n\nInput\n\nanagram\ngra...
[{"type": "stdin_stdout", "input": "anagram\ngrandmosher", "output": "4\n"}, {"type": "stdin_stdout", "input": "anbgram\ngrandmosher", "output": "3\n"}, {"type": "stdin_stdout", "input": "anbfram\ngrandmosher", "output": "2\n"}, {"type": "stdin_stdout", "input": "narfamb\nreoahmodsrg", "output": "1\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\nThere are n rabbits, one in each...
[{"type": "stdin_stdout", "input": "4 10\n1 0 1\n1 0 2\n3 1 2\n2 0 1\n1 3 3\n3 0 1\n1 0 1\n3 0 2\n1 2 3\n3 0 2", "output": "YES\nNO\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "8 10\n1 0 1\n1 0 2\n3 1 3\n2 0 1\n1 3 3\n3 0 1\n1 0 1\n3 0 2\n1 1 3\n3 0 0", "output": "NO\nNO\nYES\nYES\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\nD: Anipero 2012\n\nAnipero Summe...
[{"type": "stdin_stdout", "input": "1 1\n-1 -3 54", "output": "54\n"}, {"type": "stdin_stdout", "input": "1 0\n0 -10 25", "output": "25\n"}, {"type": "stdin_stdout", "input": "1 0\n-2 -2 -1", "output": "-1\n"}, {"type": "stdin_stdout", "input": "1 4\n0 2 108", "output": "108\n"}, {"type": "stdin_stdout", "input": "1 0\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem\n\nGiven the integer n, ...
[{"type": "stdin_stdout", "input": "127", "output": "128\n"}, {"type": "stdin_stdout", "input": "255", "output": "256\n"}, {"type": "stdin_stdout", "input": "175", "output": "16\n"}, {"type": "stdin_stdout", "input": "111", "output": "16"}, {"type": "stdin_stdout", "input": "101", "output": "2\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\nDraw a frame which has a height ...
[{"type": "stdin_stdout", "input": "5 7\n2 1\n17 12\n0 0", "output": "#######\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\nVova plans to go to the conferen...
[{"type": "stdin_stdout", "input": "10\n10 1 1 1\n10 1 1 2\n10 1 1 3\n10 1 1 4\n10 1 1 5\n10 1 1 6\n10 1 1 7\n10 1 1 8\n10 1 1 9\n10 1 1 10\n", "output": "9\n8\n7\n6\n5\n4\n3\n2\n1\n0\n"}, {"type": "stdin_stdout", "input": "10\n10 2 1 1\n10 2 1 2\n10 2 1 3\n10 2 1 4\n10 2 1 5\n10 2 1 6\n10 2 1 7\n10 2 1 8\n10 2 1 9\n10...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya wants to buy himself a nic...
[{"type": "stdin_stdout", "input": "8\n54 29 4\n40 94 7\n54 44 1\n26 74 4\n4 5 1\n25 18 3\n90 28 3\n0 11 9\n", "output": "126\n"}, {"type": "stdin_stdout", "input": "8\n58 29 4\n40 74 5\n54 27 1\n18 74 4\n5 8 1\n25 18 3\n90 28 3\n3 7 5\n", "output": "147\n"}, {"type": "stdin_stdout", "input": "8\n58 29 4\n40 74 5\n54 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\nDora loves adventures quite a lo...
[{"type": "stdin_stdout", "input": "1 100\n855 316 601 28 311 798 783 276 504 1230 521 358 377 467 623 767 481 645 855 608 157 95 273 261 110 713 948 897 872 476 855 337 147 377 648 441 215 1231 505 69 858 99 877 187 237 115 824 98 955 192 773 99 538 385 861 849 772 993 470 249 582 635 986 515 84 7 476 831 903 74 79 54...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 going to sleep now and w...
[{"type": "stdin_stdout", "input": "2 1\n500000000000000000 1000010000000000000\n700000000\n", "output": "YES\n500000000000000000 1\n"}, {"type": "stdin_stdout", "input": "2 2\n1 1000000000000000000\n1000000000000000000 1000000000000000000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "2 2\n1 100000000000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 write all the positive int...
[{"type": "stdin_stdout", "input": "1000000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "100000000083\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "523452345325\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "999999999999\n", "output": "9\n"}, {"type": "stdin_stdout", "input": "100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp analyzes the prices of ...
[{"type": "stdin_stdout", "input": "5\n6\n3 5 4 12 2 5\n1\n1000000\n2\n2 0\n10\n31 41 59 26 82 66 97 127 23 84\n7\n2 2 1 2 3 4 5\n", "output": "4\n0\n1\n8\n2\n"}, {"type": "stdin_stdout", "input": "5\n6\n3 5 4 12 2 5\n1\n1000000\n2\n2 0\n10\n31 41 50 26 82 66 97 127 23 84\n7\n2 2 1 2 3 4 5\n", "output": "4\n0\n1\n8\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\nIn order to do some research, n^...
[{"type": "stdin_stdout", "input": "135\n", "output": "1 270 271 540 541 810 811 1080 1081 1350 1351 1620 1621 1890 1891 2160 2161 2430 2431 2700 2701 2970 2971 3240 3241 3510 3511 3780 3781 4050 4051 4320 4321 4590 4591 4860 4861 5130 5131 5400 5401 5670 5671 5940 5941 6210 6211 6480 6481 6750 6751 7020 7021 7290 7291...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 the easier version of th...
[{"type": "stdin_stdout", "input": "100\n1 1 0 1 1 1 1 0 1 0 0 1 1 1 1 1 0 1 0 1 0 1 1 1 1 1 0 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 1 0 1 0 1 1 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 1 0 1 1 1 1\n", "output": "1908\n"}, {"type": "stdin_stdout", "input": "100\n1 1 1 1 0 1 1 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarp has built his own web s...
[{"type": "stdin_stdout", "input": "5\nabacaba\nzyxaabcaabkjh\nonetwothree\nthreetwoone\none\nzzonneyy\none\nnone\ntwenty\nten\n", "output": "YES\nYES\nNO\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "5\nabacaba\nzyxaabcaabkjh\nonetwothree\nthreetwoone\none\nzzonneyy\neno\nnone\ntwenty\nten\n", "output": "YES\nYES\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\nTanya wants to go on a journey a...
[{"type": "stdin_stdout", "input": "10\n10 60 12 13 14 15 16 66 18 130\n", "output": "130\n"}, {"type": "stdin_stdout", "input": "10\n10 60 12 13 14 15 16 77 18 130\n", "output": "130\n"}, {"type": "stdin_stdout", "input": "9\n18 11 24 7 18 10 1 20 17\n", "output": "24\n"}, {"type": "stdin_stdout", "input": "9\n4 10 21...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJohnny has recently found an anc...
[{"type": "stdin_stdout", "input": "10\n10 5\n11 73\n17 21\n1 1\n96 3\n2 128\n0001 1100611139403776\n1000000000000000000 1000000001000000000\n7 1\n10 8\n", "output": "1\n-1\n-1\n0\n2\n2\n-1\n-1\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "10\n10 5\n11 73\n17 18\n1 1\n96 3\n2 128\n0001 1100611139403776\n1000000000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 of leng...
[{"type": "stdin_stdout", "input": "1\n20 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n", "output": "20000000000 20000000000\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\nThe \\text{gcdSum} of a positive...
[{"type": "stdin_stdout", "input": "3\n17\n110\n182\n", "output": "18\n110\n183\n"}, {"type": "stdin_stdout", "input": "3\n17\n110\n359\n", "output": "18\n110\n360\n"}, {"type": "stdin_stdout", "input": "3\n17\n100\n359\n", "output": "18\n102\n360\n"}, {"type": "stdin_stdout", "input": "3\n33\n100\n359\n", "output": "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\nOn a strip of land of length n t...
[{"type": "stdin_stdout", "input": "1\n\n101 1\n1\n1000000000\n", "output": "1000000000 1000000001 1000000002 1000000003 1000000004 1000000005 1000000006 1000000007 1000000008 1000000009 1000000010 1000000011 1000000012 1000000013 1000000014 1000000015 1000000016 1000000017 1000000018 1000000019 1000000020 1000000021 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\nVasya has been playing Plane of ...
[{"type": "stdin_stdout", "input": "10\nj 10\ni 9\nh 8\ng 7\nf 6\ne 5\nd 4\nc 3\nb 2\na 1\n", "output": "10\na noob\nb noob\nc noob\nd noob\ne random\nf random\ng random\nh average\ni hardcore\nj pro\n"}, {"type": "stdin_stdout", "input": "10\na 1\nb 2\nc 3\nd 4\ne 5\nf 6\ng 7\nh 8\ni 9\nj 10\n", "output": "10\na noob\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 developing his own prog...
[{"type": "stdin_stdout", "input": "21\n try \n try \n try \n try \n try \n try \n try \n try \n try \n try \n throw( qtSMze) \ncatch(LY,\"x3 j\")\ncatch(hgSAFgbMGx,\"moByu\")\ncatch(LmydVQgv,\"hbZl\")\ncatch(oK,\"B6OZx qy\")\ncatch(rrtnRQB,\"7VFkQMv\")\ncatch(CASqQXaz,\"d9oci1Kx\")\ncatch(CTCzs...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nManao has invented a new mathema...
[{"type": "stdin_stdout", "input": "105 154\n", "output": "106\n0 105\n1 104\n2 103\n3 102\n4 101\n5 100\n6 99\n7 98\n8 97\n9 96\n10 95\n11 94\n12 93\n13 92\n14 91\n15 90\n16 89\n17 88\n18 87\n19 86\n20 85\n21 84\n22 83\n23 82\n24 81\n25 80\n26 79\n27 78\n28 77\n29 76\n30 75\n31 74\n32 73\n33 72\n34 71\n35 70\n36 69\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\nXenia has a set of weights and p...
[{"type": "stdin_stdout", "input": "1100000011\n1000\n", "output": "YES\n1 2 9 10 9 10 9 10 9 10 9 10 9 10 9 10 9 2 9 10 9 10 9 10 9 10 9 10 9 10 9 10 9 2 9 10 9 10 9 10 9 10 9 10 9 10 9 10 9 2 9 10 9 10 9 10 9 10 9 10 9 10 9 10 9 2 9 10 9 10 9 10 9 10 9 10 9 10 9 10 9 2 9 10 9 10 9 10 9 10 9 10 9 10 9 10 9 2 9 10 9 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\nRecently, the bear started study...
[{"type": "stdin_stdout", "input": "9\n9999991 9999943 9999883 4658161 4657997 2315407 2315263 1000003 1000033\n13\n9999991 9999991\n9999943 9999943\n9999883 9999883\n4658161 4658161\n4657997 4657997\n2315407 2315407\n2315263 2315263\n1000003 1000003\n1000033 1000033\n2 2000000000\n2000000000 2000000000\n9999992 200000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\n1000000 900001 800002 700003 600004 500005 400006 300007 200008 100009 "}, {"type": "stdin_stdout", "input": "10\n63649 456347 779 458642 201571 534312 583774 283450 377377 79066\n", "output": "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\nRyouko is an extremely forgetful...
[{"type": "stdin_stdout", "input": "100 100\n28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCelebrating the new year, many p...
[{"type": "stdin_stdout", "input": "10\n142699629 183732682\n229190264 203769218\n582937498 331846994\n637776490 872587100\n646511567 582113351\n708368481 242093919\n785185417 665206490\n827596004 933089845\n905276008 416253629\n916536536 583835690\n5\n9 10\n4 9\n1 10\n6 10\n4 5\n", "output": "0\n0\n149978016\n0\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\nA sweet little monster Om Nom lo...
[{"type": "stdin_stdout", "input": "925819493 47350513 28377591 119226256 49881078\n", "output": "510796638\n"}, {"type": "stdin_stdout", "input": "930064129 32726326 25428197 158103592 64501049\n", "output": "355994758\n"}, {"type": "stdin_stdout", "input": "238447222 36679609 23634069 64467968 41539167\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\nConsider the infinite sequence o...
[{"type": "stdin_stdout", "input": "99999998250180\n", "output": "14142135\n"}, {"type": "stdin_stdout", "input": "100000000000000\n", "output": "1749820\n"}, {"type": "stdin_stdout", "input": "1001000000000\n", "output": "1404260\n"}, {"type": "stdin_stdout", "input": "1001000001000\n", "output": "1405260\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 workers in a company...
[{"type": "stdin_stdout", "input": "10 6\n3 0 0 0 0 0 0 1 0 0\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "10 6\n3 1 0 0 0 0 0 1 0 0\n", "output": "6\n"}, {"type": "stdin_stdout", "input": "10 6\n3 0 1 0 0 0 0 1 0 1\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "10 6\n3 0 0 0 0 0 0 1 0 1\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\nRunning with barriers on the cir...
[{"type": "stdin_stdout", "input": "50 100\n0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98\n1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\nInput\n\nThe only line of th...
[{"type": "stdin_stdout", "input": "4357087936\n", "output": "YES"}, {"type": "stdin_stdout", "input": "3333333333\n", "output": "YES"}, {"type": "stdin_stdout", "input": "2577546136\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "1513778395\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "2989131141...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 few years ago Sajjad left his ...
[{"type": "stdin_stdout", "input": "120494\n", "output": "60246\n"}, {"type": "stdin_stdout", "input": "116591\n", "output": "58295\n"}, {"type": "stdin_stdout", "input": "110052\n", "output": "55025\n"}, {"type": "stdin_stdout", "input": "101000\n", "output": "50499\n"}, {"type": "stdin_stdout", "input": "150380\n", "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Fire Lord attacked the Frost...
[{"type": "stdin_stdout", "input": "23\n99 110 99 100 100 100 100 99 100 99 99 100 000 100 99 111 100 100 100 99 99 99 99\n", "output": "ARARARARARARARARARARARARALLLLLLLLLLLLAARARARARARARARARARARARARALLLLLLLLLLLLAARARARARARARARARARARARARALLLLLLLLLLLLAARARARARARARARARARARARARALLLLLLLLLLLLAARARARARARARARARARARARARALLLLLL...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 likes to play with numb...
[{"type": "stdin_stdout", "input": "19\n46875000000000000 732421875000000 5859375000000000 11444091796875 2929687500000000 187500000000000000 91552734375000 11718750000000000 3000000000000000000 22888183593750 1464843750000000 375000000000000000 45776367187500 183105468750000 93750000000000000 366210937500000 234375000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 introduce a number system ...
[{"type": "stdin_stdout", "input": "1000000001\n", "output": "48999999802\n"}, {"type": "stdin_stdout", "input": "1897400395\n", "output": "92972619108\n"}, {"type": "stdin_stdout", "input": "1100000001\n", "output": "53899999802\n"}, {"type": "stdin_stdout", "input": "1533257378\n", "output": "75129611275\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\nAlice and Bob are fighting over ...
[{"type": "stdin_stdout", "input": "3\nh will niw\nwill g\nuodby ro tomorwor\nyadot ro tnmorsov nda yetterday\nh card yot\ndac daz\n\nT@LPLE", "output": "You draw some.\nYou draw some.\nYou draw some.\n"}, {"type": "stdin_stdout", "input": "3\nh wjll win\nwill i\ntoday or tomorrow\ntoday or tomorrow and yesterday\ni da...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 climbing stairs. There ...
[{"type": "stdin_stdout", "input": "123461 123460 998998998", "output": "998875538\n"}, {"type": "stdin_stdout", "input": "123461 123460 405371410", "output": "405247950\n"}, {"type": "stdin_stdout", "input": "123461 123460 375772283", "output": "375648823\n"}, {"type": "stdin_stdout", "input": "123461 123460 45956662"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTeam India is playing too much c...
[{"type": "stdin_stdout", "input": "1000\n509869197\n704921863\n747550363\n299599178\n307311852\n292108723\n323673613\n406319034\n5990172\n892556229\n812345922\n189962849\n544886888\n836735222\n79035005\n635127190\n588939927\n354303480\n599514650\n49434020\n908869585\n113013398\n833715652\n721245910\n582288889\n2394574...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have N lamps numbered 1 to N,...
[{"type": "stdin_stdout", "input": "9479599 4999", "output": "395563313\n"}, {"type": "stdin_stdout", "input": "4734557 4999", "output": "743624188\n"}, {"type": "stdin_stdout", "input": "9999999 4999", "output": "90395416"}, {"type": "stdin_stdout", "input": "7100253 4999", "output": "2548353\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\nServal is fighting with a monste...
[{"type": "stdin_stdout", "input": "11000 1", "output": "11000\n"}, {"type": "stdin_stdout", "input": "10010 1", "output": "10010\n"}, {"type": "stdin_stdout", "input": "10001 1", "output": "10001\n"}, {"type": "stdin_stdout", "input": "11010 1", "output": "11010\n"}, {"type": "stdin_stdout", "input": "10101 1", "outpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N people standing in a...
[{"type": "stdin_stdout", "input": "13 4\nLRRLRLRRLRLLR", "output": "11\n"}, {"type": "stdin_stdout", "input": "13 8\nLRRLRLRRLRLLR", "output": "12\n"}, {"type": "stdin_stdout", "input": "13 8\nRLLRLRRLRLRRL", "output": "12\n"}, {"type": "stdin_stdout", "input": "13 9\nRLLRLRRLRLRRL", "output": "12\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\nWe have a rectangular grid of sq...
[{"type": "stdin_stdout", "input": "2 6 11\n2 1\nRLDRRUDDLRL\nURRDRLLDLRD", "output": "NO\n"}, {"type": "stdin_stdout", "input": "5 6 11\n2 0\nRLDRRUDDLRL\nURRDRLLDLRD", "output": "NO\n"}, {"type": "stdin_stdout", "input": "4 6 11\n2 1\nRLDRRUDDLRL\nURRDRLLDLRD", "output": "NO\n"}, {"type": "stdin_stdout", "input": "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\nButCoder Inc. runs a programming...
[{"type": "stdin_stdout", "input": "1110010000100001010 -1 -2", "output": "2220020000200002023\n"}, {"type": "stdin_stdout", "input": "1110010000100001010 -1 -3", "output": "1110010000100001013\n"}, {"type": "stdin_stdout", "input": "1100000010001000010 -1 -10", "output": "244444446666888893\n"}, {"type": "stdin_stdout...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs I was cleaning up the warehou...
[{"type": "stdin_stdout", "input": "3\n43\n-1", "output": "0.292893218813 1.70710678119\n-0.0858570939893 -6.55687643314\n"}, {"type": "stdin_stdout", "input": "3\n80\n-1", "output": "0.292893218813 1.70710678119\n-8.93660061545 -0.370363928973\n"}, {"type": "stdin_stdout", "input": "3\n159\n-1", "output": "0.292893218...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 architect, Devunky, who lives...
[{"type": "stdin_stdout", "input": "15\n100\n1000000000\n1\n0", "output": "19\n155\n9358757000\n1\n"}, {"type": "stdin_stdout", "input": "15\n110\n1000000000\n1\n0", "output": "19\n178\n9358757000\n1\n"}, {"type": "stdin_stdout", "input": "15\n101\n1000000000\n3\n0", "output": "19\n157\n9358757000\n3\n"}, {"type": "std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have a cross-section paper w...
[{"type": "stdin_stdout", "input": "3 5\n1 -1 -1\n1 -1 0", "output": "no\n"}, {"type": "stdin_stdout", "input": "3 5\n1 -1 -1\n1 -1 1", "output": "no\n"}, {"type": "stdin_stdout", "input": "3 2\n1 -1 -1\n1 -1 1", "output": "no\n"}, {"type": "stdin_stdout", "input": "3 5\n1 -1 -1\n1 -2 0", "output": "no\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\nGood evening, contestants.\n\nIf...
[{"type": "stdin_stdout", "input": "367 186 151\n179 10 203\n271 37 39\n103 230 1\n27 104 285\n253 50 85\n1 1 1\n9075 337 210\n307 40 79\n331 221 177\n259 170 40\n269 75 102\n0 0 0", "output": "92809\n6709\n12037\n103\n153739\n14503\n2\n899429\n10667\n412717\n22699\n38669\n"}, {"type": "stdin_stdout", "input": "367 186...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFrom 1603 to 1867, people call t...
[{"type": "stdin_stdout", "input": "2\n10 11\n11 12\n2\nN 2\nE 1\n2\n10 11\n11 12\n2\nN 2\nW 1\n3\n0 15\n5 10\n5 15\n5\nW 20\nS 10\nN 20\nE 10\nS 10\n0", "output": "Yes\nNo\nNo\n"}, {"type": "stdin_stdout", "input": "2\n10 11\n11 12\n2\nN 2\nE 1\n2\n10 11\n11 12\n2\nN 3\nW 1\n3\n0 15\n5 10\n5 15\n5\nW 20\nS 10\nN 20\nE...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n2\n1 2\n\n\n...
[{"type": "stdin_stdout", "input": "2\n-1 -12", "output": "12\n"}, {"type": "stdin_stdout", "input": "2\n-1 12", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2\n-1 24", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2\n-2 24", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2\n-2 22", "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\nC: Prayer (Pray)\n\nSome twins a...
[{"type": "stdin_stdout", "input": "-1 -1 -3 -1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-2 -1 -3 -1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-2 -1 -4 -1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "0 -1 -4 -1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "0 -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\nWrite a program which print coor...
[{"type": "stdin_stdout", "input": "5\n-1 3\n1 15\n-1 1\n-1 -1\n-1 -1", "output": "-1 -1\n-1 -1\n-1 1\n-1 3\n1 15\n"}, {"type": "stdin_stdout", "input": "5\n-1 3\n1 15\n-1 0\n-1 -1\n-1 -1", "output": "-1 -1\n-1 -1\n-1 0\n-1 3\n1 15\n"}, {"type": "stdin_stdout", "input": "5\n-1 3\n1 22\n-1 0\n-1 -1\n-1 -1", "output": "-...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDigory Kirke and Polly Plummer a...
[{"type": "stdin_stdout", "input": "4\n####\n##.#..#\n##..#.#\n##.#....#", "output": "0\n2\n1\n2\n"}, {"type": "stdin_stdout", "input": "4\n####\n#..#.##\n##..#.#\n##.#....#", "output": "0\n1\n1\n2\n"}, {"type": "stdin_stdout", "input": "4\n####\n#..#.##\n#.#..##\n##.#....#", "output": "0\n1\n2\n2\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\nThere is one apple tree in Arkad...
[{"type": "stdin_stdout", "input": "10\n1 2 2 3 3 4 4 5 5\n", "output": "1 1 1 1 1 2 2 3 5 5 \n"}, {"type": "stdin_stdout", "input": "10\n1 1 1 1 1 1 1 1 1\n", "output": "1 1 1 1 1 1 1 1 1 9 \n"}, {"type": "stdin_stdout", "input": "10\n1 1 2 4 2 4 1 8 8\n", "output": "1 1 1 1 1 1 2 2 3 6\n"}, {"type": "stdin_stdout", "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nEveryone knows that computers be...
[{"type": "stdin_stdout", "input": "2\n236675740 1140949963\n555555555 555555555\n", "output": "ds10utsusdtedslss10utsusdtedslss10utsusdtedslss10utsusdtedslss10utsusdtedslss10utsusdtedslss10utsusdtedslss10utsusdtedslss10utsusdtedslss10utsusdtedslss10utsusdtedslss10utsusdtedslss10utsusdtedslss10utsusdtedslss10utsusdteds...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlice and Bob are playing a game...
[{"type": "stdin_stdout", "input": "50 75\n2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "50 75\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\nVus the Cossack has a field with...
[{"type": "stdin_stdout", "input": "1 2 10\n01\n4 1 5 1\n1 2 1 16\n3 4 3 5\n1 1 1 5\n4 3 6 5\n1 1 1 3\n1 3 4 5\n3 2 3 6\n3 1 5 2\n3 1 3 5\n", "output": "1\n8\n1\n3\n5\n2\n6\n2\n3\n2\n"}, {"type": "stdin_stdout", "input": "1 2 10\n01\n4 1 5 2\n1 2 1 4\n3 4 3 5\n1 3 1 5\n4 3 5 5\n1 1 3 3\n1 3 4 5\n3 2 3 4\n3 1 5 2\n3 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\nYou are given a tree with n node...
[{"type": "stdin_stdout", "input": "40\n11 8\n18 34\n21 23\n6 7\n23 28\n27 14\n8 18\n12 1\n27 4\n11 30\n40 22\n29 19\n17 32\n13 12\n15 9\n34 5\n27 37\n20 2\n18 33\n39 13\n27 17\n35 1\n40 3\n11 21\n1 35\n20 10\n27 20\n1 16\n27 6\n11 26\n38 36\n40 11\n17 25\n2 38\n40 39\n1 15\n12 27\n30 29\n14 14\n", "output": "12 1 1\n1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's denote correct match equat...
[{"type": "stdin_stdout", "input": "100\n928\n970\n950\n921\n1007\n974\n353\n999\n964\n920\n926\n942\n934\n918\n930\n901\n977\n961\n978\n962\n951\n909\n994\n953\n946\n993\n982\n922\n1789\n932\n904\n910\n991\n937\n963\n988\n278\n903\n956\n976\n967\n958\n902\n986\n960\n965\n940\n914\n955\n987\n952\n971\n939\n966\n938\n91...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 a harder version of the ...
[{"type": "stdin_stdout", "input": "100\n))()()(())()()(()()())((()()())())((())())((()))(())()((()))((())())()((()())())(()())(())(()(()))((\n", "output": "23\n24 31"}, {"type": "stdin_stdout", "input": "100\n()()()()()()()()()()())(()()()()()()()()()()()()()()()()()()()())(()()()()()()()()()()()()()()()()()\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\nBalph is learning to play a game...
[{"type": "stdin_stdout", "input": "WWWOOOOOOWWW\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "WWWOONOOOWWW\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "WWWOONOOOVWW\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "WVWOONOOOVWW\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "WOWO...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 arrays a_1, a_2,...
[{"type": "stdin_stdout", "input": "100 2\n0 1\n0 0\n0 1\n0 1\n0 1\n1 1\n0 2\n1 1\n0 -1\n0 4\n1 0\n0 0\n1 0\n1 1\n1 1\n0 1\n0 1\n0 1\n1 0\n0 0\n0 1\n0 1\n-1 1\n-1 0\n1 0\n1 1\n1 1\n1 0\n1 0\n0 1\n1 1\n1 -1\n0 0\n1 0\n1 1\n1 1\n1 1\n1 1\n1 0\n1 0\n1 0\n1 1\n0 0\n1 0\n0 1\n0 1\n0 0\n-1 0\n1 1\n2 0\n0 1\n0 0\n1 0\n1 1\n1 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n per nextum in unam tum XI co...
[{"type": "stdin_stdout", "input": "0\n1\n-2\n-3\n-4\n-5\n-6\n-7\n-8\n-9\n10\n", "output": "f(10) = MAGNA NIMIS!\nf(-9) = -3642.00\nf(-8) = -2557.17\nf(-7) = -1712.35\nf(-6) = -1077.55\nf(-5) = -622.76\nf(-4) = -318.00\nf(-3) = -133.27\nf(-2) = -38.59\nf(1) = 6.00\nf(0) = 0.00\n"}, {"type": "stdin_stdout", "input": "0\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJett is tired after destroying t...
[{"type": "stdin_stdout", "input": "4\n1\n10\n28\n0111101000000000100\n", "output": "1\n2\n2\n28\n"}, {"type": "stdin_stdout", "input": "4\n1\n10\n28\n0101101000000000100\n", "output": "1\n2\n2\n28\n"}, {"type": "stdin_stdout", "input": "4\n2\n10\n28\n0101101000000000100\n", "output": "1\n2\n2\n28\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\nYou are given a string s of even...
[{"type": "stdin_stdout", "input": "3\n2\n10\n4\n0110\n8\n11101000\n", "output": "0\n1\n2\n"}, {"type": "stdin_stdout", "input": "3\n2\n10\n4\n0110\n8\n11100001\n", "output": "0\n1\n3\n"}, {"type": "stdin_stdout", "input": "3\n2\n10\n4\n1010\n8\n11101000\n", "output": "0\n0\n2\n"}, {"type": "stdin_stdout", "input": "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\nBarbara was late for her math cl...
[{"type": "stdin_stdout", "input": "100\n1 2 2 2 1 1 2 2 0 2 2 0 1 0 0 0 0 1 0 0 0 1 1 2 1 1 2 2 0 2 0 2 1 1 0 2 1 0 1 2 1 2 2 1 1 1 2 1 1 1 0 1 1 0 0 2 2 1 2 2 1 0 1 0 0 2 1 2 1 1 0 2 1 0 2 0 2 1 2 0 0 0 1 1 2 0 1 0 2 2 2 1 1 1 0 2 2 1 1 1\n*-+\n", "output": "1+2*2*2*1*1*2*2+0+2*2+0+1+0+0+0+0+1+0+0+0+1+1+2*1*1*2*2+0+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\nn heroes fight against each othe...
[{"type": "stdin_stdout", "input": "2\n8\n1 9 1 9 8 10 10 10\n5\n10 10 10 10 10\n", "output": "6\n0\n"}, {"type": "stdin_stdout", "input": "2\n8\n1 9 1 9 8 10 16 10\n5\n10 10 10 10 10\n", "output": "6\n0\n"}, {"type": "stdin_stdout", "input": "2\n8\n1 9 2 9 8 10 16 10\n5\n10 10 10 10 10\n", "output": "7\n0\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\nYou are given an array a of n in...
[{"type": "stdin_stdout", "input": "1\n100 120 153\n1 1 2 5 4 5 6 7 8 9 10 11 12 13 14 15 16 17 24 19 20 21 22 23 43 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 66 66 67 68 69 70 71 72 73 74 75 76 119 78 79 80 81 82 83 84 85 133 56 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\nA connected undirected graph is ...
[{"type": "stdin_stdout", "input": "40 43\n1 2\n1 3\n1 4\n4 5\n5 6\n1 7\n5 8\n7 9\n2 10\n10 11\n11 12\n2 13\n13 14\n14 15\n15 16\n16 17\n17 18\n18 19\n19 20\n20 21\n21 22\n22 23\n23 24\n24 25\n25 2\n3 26\n26 27\n27 28\n28 29\n29 30\n30 31\n31 32\n32 3\n4 33\n33 34\n34 35\n35 36\n36 37\n37 4\n5 38\n38 39\n39 40\n40 5\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\nVasya has found a piece of paper...
[{"type": "stdin_stdout", "input": "48\n4 7 12 16 23 43 61 112 134 141 243 267 484 890 1427 1558 1653 2263 2889 3313 3730 5991 10176 18243 18685 36555 40006 62099 70557 106602 122641 125854 213236 309698 379653 713328 999577 1021356 2007207 2886237 4994645 5812125 11576387 14215887 26060277 35989707 36964781 57933366\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 star map in Berland is a check...
[{"type": "stdin_stdout", "input": "10 10 40\n**********\n**********\n**********\n**********\n**********\n**********\n**********\n**********\n**********\n**********\n", "output": "6 9\n5 9\n7 9\n6 8\n6 10\n"}, {"type": "stdin_stdout", "input": "10 10 59\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\nRecently, a start up by two stud...
[{"type": "stdin_stdout", "input": "OVWIHIWVYXMVAAAATOXWOIUUHYXHIHHVUIOOXWHOXTUUMUUVHVWWYUTIAUAITAOMHXWMTTOIVMIVOTHOVOIOHYHAOXWAUVWAVIVM\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "QDPINBMCRFWXPDBFGOZVVOCEMJRUCTOADEWEGTVBVBFWWRPGYEEYGPRWWFBVBVTGEWEDAOTCURJMECOVVZOGFBDPXWFRCMBNIPDQ\n", "output": "NO\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\nPeter wrote on the board a stric...
[{"type": "stdin_stdout", "input": "98\n?\n?0\n2?\n6?\n6?\n69\n??\n??\n96\n1?2\n??3\n104\n??4\n1?9\n??2\n18?\n?01\n205\n?19\n244\n??8\n?5?\n?5?\n276\n??3\n???\n???\n?28\n?3?\n3??\n??8\n355\n4?0\n4??\n?10\n??1\n417\n4?9\n?3?\n4?4\n?61\n?8?\n???\n507\n?2?\n???\n??6\n5?7\n540\n5?9\n???\n?7?\n5??\n591\n?9?\n6?0\n620\n??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\nWhen Darth Vader gets bored, he ...
[{"type": "stdin_stdout", "input": "97 78153\n2 2 1 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 4 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 1 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2\n", "output": "620983468\n"}, {"type": "stdin_stdout", "input": "97 78153\n2 2 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nCompanies always have a lot of e...
[{"type": "stdin_stdout", "input": "111\n15 45 14 65 49 25 102 86 14 80 54 73 43 78 42 32 47 60 55 66 84 69 49 22 26 72 89 52 26 80 71 35 56 2 88 23 23 53 65 92 46 73 29 65 88 99 19 99 87 10 47 96 109 20 60 89 63 105 29 92 109 20 95 65 31 89 107 3 3 50 58 9 28 39 104 42 41 36 70 49 59 96 16 9 3 108 38 42 2 67 32 86 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\nEach employee of the \"Blake Tec...
[{"type": "stdin_stdout", "input": "28 7\n1-a 1-b 1-c 1-d 1-e 1-f 1-t 1-a 1-b 1-c 1-d 1-e 1-f 1-j 1-a 1-b 1-c 1-d 1-e 1-f 1-g 1-a 1-b 1-c 1-d 1-e 1-f 2-g\n1-a 1-b 1-c 1-d 1-e 1-f 1-g\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "28 7\n1-a 1-b 1-c 1-d 1-e 1-f 1-t 1-a 1-b 1-c 1-d 1-e 1-f 1-j 1-a 1-b 1-c 1-d 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\nConsider 2n rows of the seats in...
[{"type": "stdin_stdout", "input": "100 400\n", "output": "201 1 202 2 203 3 204 4 205 5 206 6 207 7 208 8 209 9 210 10 211 11 212 12 213 13 214 14 215 15 216 16 217 17 218 18 219 19 220 20 221 21 222 22 223 23 224 24 225 25 226 26 227 27 228 28 229 29 230 30 231 31 232 32 233 33 234 34 235 35 236 36 237 37 238 38 239 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 imagine: there is a chess ...
[{"type": "stdin_stdout", "input": "1000000 1000000\n", "output": "1000000\n"}, {"type": "stdin_stdout", "input": "666667 1000000\n", "output": "333334\n"}, {"type": "stdin_stdout", "input": "871866 348747\n", "output": "174374\n"}, {"type": "stdin_stdout", "input": "863029 287677\n", "output": "287677\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\nVasya and Petya take part in a C...
[{"type": "stdin_stdout", "input": "26\n3 -1 71 -1 42\n85 72 48 38 -1\n-1 -1 66 24 -1\n46 -1 60 99 107\n53 106 51 -1 104\n-1 17 98 54 -1\n44 107 66 65 102\n47 40 62 34 5\n-1 10 -1 98 -1\n-1 69 47 85 75\n12 62 -1 15 -1\n48 63 72 32 99\n91 104 111 -1 -1\n92 -1 52 -1 11\n118 25 97 1 108\n-1 61 97 37 -1\n87 47 -1 -1 21\n79...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMike has a string s consisting o...
[{"type": "stdin_stdout", "input": "scfwrjevejrwfcs\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "thdaonpepdoadht\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "scfwrievejrwfcs\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "thdaodpepnoadht\n", "output": "YES\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\nYet another round on DecoForces ...
[{"type": "stdin_stdout", "input": "6\n10 10\n3 6 3 7\n4 9 5 9\n5 4 5 3\n7 1 8 1\n9 10 8 10\n7 7 7 8\n0 5 2 3\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n4 6\n4 3 3 3\n4 2 4 1\n3 6 2 6\n2 4 2 3\n1 1 1 2\n1 2 2 1\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "5\n7 5\n5 3 5 2\n3 5 2 5\n1 3 1 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\nPolycarp loves lowercase letters...
[{"type": "stdin_stdout", "input": "200\nZlJwrzzglgkjqtmoseaapqtqxbrorjptpejjmchztutkglqjxxqgnuxeadxksnclizglywqmtxdhrbbmooxijiymikyIOlSBShUOGUghPJtSxmToNUHDdQIMoFzPOVYAtLRtXyuOErmpYQFAeKMJKlqZCEVEuhSCCtBnQnOncTqYpaLbhutwhplyJGxtuXQiEfuvOzWr\n", "output": "24\n"}, {"type": "stdin_stdout", "input": "200\nPUVgmHVAXlBaxUI...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 studies music. \n\nHe has ...
[{"type": "stdin_stdout", "input": "F# F# F#\n", "output": "strange\n"}, {"type": "stdin_stdout", "input": "D# D# F#\n", "output": "strange\n"}, {"type": "stdin_stdout", "input": "G# G# A\n", "output": "strange\n"}, {"type": "stdin_stdout", "input": "G# C# D\n", "output": "strange\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\nWhile Grisha was celebrating New...
[{"type": "stdin_stdout", "input": "100000 100000 100000 100000\n", "output": "100000.0000000000"}, {"type": "stdin_stdout", "input": "67708 82422 32854 21110\n", "output": "13188.320546325507\n"}, {"type": "stdin_stdout", "input": "51007 74589 14733 37356\n", "output": "3734.3960661418787\n"}, {"type": "stdin_stdout",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn order to put away old things ...
[{"type": "stdin_stdout", "input": "20180214 5\n", "output": "11\n 4 3 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\nUtkarsh being a very talkative c...
[{"type": "stdin_stdout", "input": "20 11\n\nQAMQLE", "output": "0.389111\n"}, {"type": "stdin_stdout", "input": "24 13\n\nELRMAQ", "output": "0.408818\n"}, {"type": "stdin_stdout", "input": "25 11\n\nELRMAQ", "output": "0.194940\n"}, {"type": "stdin_stdout", "input": "12 12\n\nFLRMAQ", "output": "0.613080\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\nWe have an undirected graph G wi...
[{"type": "stdin_stdout", "input": "170 1 3", "output": "170\n168\n167\n166\n165\n164\n163\n162\n161\n160\n159\n158\n157\n156\n155\n154\n153\n152\n151\n150\n149\n148\n147\n146\n145\n144\n143\n142\n141\n140\n139\n138\n137\n136\n135\n134\n133\n132\n131\n130\n129\n128\n127\n126\n125\n124\n123\n122\n121\n120\n119\n118\n117...
code_stdio