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\nAlice and Brown loves games. Tod...
[{"type": "stdin_stdout", "input": "13 -1", "output": "Alice\n"}, {"type": "stdin_stdout", "input": "-1 10", "output": "Alice\n"}, {"type": "stdin_stdout", "input": "18 -1", "output": "Alice\n"}, {"type": "stdin_stdout", "input": "-1 14", "output": "Alice\n"}, {"type": "stdin_stdout", "input": "14 -1", "output": "Alice...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi is a magician. He can ...
[{"type": "stdin_stdout", "input": "10 5\n2 14 5 6 9\n3 6 3 9 10\n2 6 8 6 7\n0 1 1 3 14\n2 1 3 8 4", "output": "-1\n"}, {"type": "stdin_stdout", "input": "10 5\n2 14 5 6 9\n3 6 3 9 11\n2 6 8 6 7\n0 1 1 3 14\n2 1 3 8 4", "output": "-1\n"}, {"type": "stdin_stdout", "input": "10 5\n2 14 5 6 9\n3 6 3 9 11\n2 6 8 6 7\n0 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\nWrite a program which reads an i...
[{"type": "stdin_stdout", "input": "35\n011", "output": "4\n348\n"}, {"type": "stdin_stdout", "input": "35\n010", "output": "4\n282\n"}, {"type": "stdin_stdout", "input": "35\n15", "output": "4\n592\n"}, {"type": "stdin_stdout", "input": "35\n26", "output": "4\n282\n"}, {"type": "stdin_stdout", "input": "35\n13", "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\nThere is a bus route as shown in...
[{"type": "stdin_stdout", "input": "2\n1 8\n8 0", "output": "1 2 3 4 5 6 7 8\n8 9 5 4 3 2 1 0\n"}, {"type": "stdin_stdout", "input": "2\n1 9\n8 1", "output": "1 2 3 4 5 6 7 8 9\n8 9 5 4 3 2 1\n"}, {"type": "stdin_stdout", "input": "2\n2 8\n6 2", "output": "2 3 4 5 6 7 8\n6 7 8 9 5 4 3 2\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\nAiz Onsen has a bathhouse and a ...
[{"type": "stdin_stdout", "input": "2\n111 101 -1 -2\n1001 722 131 -3", "output": "-313\n106060\n"}, {"type": "stdin_stdout", "input": "2\n111 001 -1 -2\n1001 722 131 -3", "output": "-113\n106060\n"}, {"type": "stdin_stdout", "input": "2\n111 000 -1 -2\n1001 722 131 -3", "output": "-111\n106060\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\nproblem\n\nFor the integer n (1 ...
[{"type": "stdin_stdout", "input": "1\n119\nOOJOIOIOIIOII\n1\n14\nKIOIIOIOIOJOO\n0", "output": "3\n3\n"}, {"type": "stdin_stdout", "input": "1\n13\nOIIOIOIOIIOIO\n2\n13\nOOIOIOIOIIOII\n0", "output": "4\n2\n"}, {"type": "stdin_stdout", "input": "1\n13\nOOIOIOIOIIOII\n3\n13\nOOIOIOIOIIOII\n0", "output": "4\n1\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\nProblem\n\nUniqlo Uzuki and Rin ...
[{"type": "stdin_stdout", "input": "0 19\n0\n0 0 -1 1 -1", "output": "0\n"}, {"type": "stdin_stdout", "input": "0 19\n0\n0 0 -1 2 -1", "output": "0\n"}, {"type": "stdin_stdout", "input": "0 19\n0\n0 1 -1 2 -1", "output": "0\n"}, {"type": "stdin_stdout", "input": "0 19\n0\n0 2 -1 2 -1", "output": "0\n"}, {"type": "stdin...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA browser-based puzzle game call...
[{"type": "stdin_stdout", "input": "2 4 3 4\n2 1 2 4\n3 3 2 2\n0 3 3 3", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2 4 3 4\n2 1 2 0\n3 3 2 2\n0 3 3 3", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2 1 4 1\n2 2 4 2\n2 4 4 1\n0 4 4 1", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2 4 3 3\n2 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string $S$, whic...
[{"type": "stdin_stdout", "input": "((((((((((*))))))()))", "output": "10\n"}, {"type": "stdin_stdout", "input": "((((((((((*))))))))))", "output": "10"}, {"type": "stdin_stdout", "input": "(((((((()(*))))))()))", "output": "8\n"}, {"type": "stdin_stdout", "input": "(((((((()()*)))))()()", "output": "7\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\nA bipartite graph G = (V, E) is ...
[{"type": "stdin_stdout", "input": "5 17 10\n1 2\n0 0\n0 1\n1 0\n0 0\n2 5", "output": "3\n"}, {"type": "stdin_stdout", "input": "5 17 10\n1 2\n0 0\n0 1\n1 0\n0 0\n3 5", "output": "3\n"}, {"type": "stdin_stdout", "input": "2 10 2\n1 0\n0 0\n-1 3\n0 1\n1 1\n2 3", "output": "1\n"}, {"type": "stdin_stdout", "input": "3 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\nThere are n houses in a row. The...
[{"type": "stdin_stdout", "input": "21989 30630 32548\n", "output": "YES\n3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 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\nThis is an interactive problem.\...
[{"type": "stdin_stdout", "input": "1 4\n\nseY\n\npN\n\nYes\n\nsdY\n", "output": "1 1\n1 1\n1 1\n"}, {"type": "stdin_stdout", "input": "1 4\n\nXes\n\noN\n\nYes\n\nseY\n", "output": "1 1\n1 1\n1 1\n"}, {"type": "stdin_stdout", "input": "1 2\n\nseY\n\npN\n\nYes\n\nsdY\n", "output": "1 1\n1 1\n1 1\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\nThere are n TV shows you want to...
[{"type": "stdin_stdout", "input": "10 798547896 459313948\n40312491 40315265\n40299842 40315264\n40296035 40315263\n40282844 40315262\n40304824 40315261\n40280414 40315260\n40299203 40315259\n40301967 40315258\n40276169 40315257\n40286575 40315256\n", "output": "236433977\n"}, {"type": "stdin_stdout", "input": "4 2882...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 consist...
[{"type": "stdin_stdout", "input": "200\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 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\nToday in the scientific lyceum o...
[{"type": "stdin_stdout", "input": "50\nROWGGKNUITVHOBMKZXOZNBZMQGSFERNCZDFKLRBCFVVDXJEFLP\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "50\nALWLSFLXYPQYMIWXMYMXFYMIVFYJDTJAIGVOAUDAIIAHKNNVTX\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "50\nHKKUWHLYYKBLLEHKVNIRYAPVFTAPRIFUZELKGRDXZNCNWHSAFG\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\"Duel!\"\n\nBetting on the love...
[{"type": "stdin_stdout", "input": "30 27\n000000000010110000101111111111\n", "output": "tokitsukaze\n"}, {"type": "stdin_stdout", "input": "30 27\n100000000010110000101111111111\n", "output": "tokitsukaze\n"}, {"type": "stdin_stdout", "input": "30 16\n100000000010110000101111111111\n", "output": "once again\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\nYou have an integer n. Let's def...
[{"type": "stdin_stdout", "input": "6\n53 61\n35 53\n35 39\n34 53\n34 54\n34 62\n43 54\n23 43\n12 43\n1 54\n1 7\n1 57\n40 62\n30 40\n28 40\n4 62\n4 60\n4 45\n19 61\n19 36\n36 42\n36 52\n10 19\n10 48\n10 46\n2 61\n2 51\n2 27\n5 51\n3 51\n15 27\n22 27\n39 47\n6 47\n6 59\n6 24\n9 47\n9 49\n9 21\n20 39\n14 20\n14 18\n13 14...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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[THE SxPLAY & KIVΞ› - 漂桁](https:/...
[{"type": "stdin_stdout", "input": "10000000000000000 10000000000000000 100 100 10000000000000000 10000000000000000\n10000000000000000 10000000000000000 10000000000000000\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "10000000000000000 10000000000000000 100 100 10000000000000000 10000000000000000\n10000000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\n82 51 81 14 37 17 78 92 64 15 8 86 89 8 87 77 66 10 15 12 100 25 92 47 21 78 20 63 13 49 41 36 41 79 16 87 87 69 3 76 80 60 100 49 70 59 72 8 38 71 45 97 71 14 76 54 81 4 59 46 39 29 92 3 49 22 53 99 59 52 74 31 92 43 42 23 44 9 82 47 7 40 12 9 3 55 37 85 46 22 84 52 98 41 21 77...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWriting light novels is the most...
[{"type": "stdin_stdout", "input": "20 7\n9 7\n3 11\n15 5\n1 3\n11 9\n18 7\n17 18\n20 1\n4 11\n2 11\n12 18\n8 18\n13 2\n19 2\n10 16\n6 13\n5 8\n14 1\n16 13\n", "output": "41\n"}, {"type": "stdin_stdout", "input": "20 7\n9 7\n3 11\n15 5\n1 6\n11 9\n18 7\n17 18\n20 1\n4 11\n2 11\n12 18\n8 18\n13 2\n19 2\n10 16\n6 13\n5 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\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\n"}, {"type": "stdin_stdout", "input": "48 14\n1 1 1 1 1 6 1 1 1 1 1 1 3 3 1 1 2 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\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\nEasy and hard versions are actua...
[{"type": "stdin_stdout", "input": "4\n4 18\n2 1 9 2\n3 2 4 1\n4 1 1 2\n3 20\n2 1 8 1\n3 1 7 2\n5 50\n1 3 100 1\n1 5 10 2\n2 3 123 2\n5 4 55 1\n2 100\n1 2 409 2\n", "output": "0\n0\n11\n6\n"}, {"type": "stdin_stdout", "input": "4\n4 22\n2 1 9 2\n3 2 4 1\n4 1 1 2\n3 20\n2 1 8 1\n3 1 7 2\n5 50\n1 3 100 1\n1 5 10 2\n2 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\nThe pandemic is upon us, and the...
[{"type": "stdin_stdout", "input": "7 29\n6 2 627\n7 6 580\n6 6 624\n2 7 381\n4 6 1263\n7 7 776\n3 5 929\n1 4 313\n7 5 699\n4 4 977\n3 2 586\n5 5 456\n4 5 13\n4 3 935\n3 7 946\n1 5 950\n2 1 597\n1 3 338\n3 4 844\n6 5 523\n7 1 152\n6 7 981\n1 6 947\n5 3 49\n4 2 948\n5 6 734\n1 1 214\n4 7 747\n6 1 533\n", "output": "586\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 po...
[{"type": "stdin_stdout", "input": "4\n3\n1 2 -1\n5\n40 9 13 6 13\n5\n1 1 0 1 1\n4\n7 2 1 10\n", "output": "NO\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "4\n3\n1 2 2\n5\n20 9 15 6 9\n5\n1 1 0 1 1\n4\n5 2 1 10\n", "output": "YES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "4\n3\n1 2 1\n5\n20 9 15 6...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMonocarp and Polycarp are workin...
[{"type": "stdin_stdout", "input": "8\n1 103913\n3\n1 103913\n1 103913\n3\n1 103913\n1 103913\n2\n", "output": "\n1 2 3 "}, {"type": "stdin_stdout", "input": "8\n1 183978\n3\n1 103913\n1 103913\n3\n1 103913\n1 103913\n2\n", "output": "1 2 3\n"}, {"type": "stdin_stdout", "input": "8\n1 227408\n3\n1 103913\n1 103913\n3\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is an infinite set generat...
[{"type": "stdin_stdout", "input": "5\n24 3 5\n10 5 11\n2097 1 4\n19260817 394 623\n19260817 233 264\n", "output": "YES\nNO\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "5\n24 3 5\n10 5 11\n2097 1 4\n19260817 394 227\n19260817 233 264\n", "output": "YES\nNO\nYES\nNO\nYES\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\nAccording to a new ISO standard,...
[{"type": "stdin_stdout", "input": "1 500\nwljexjwjwsxhascgpyezfotqyieywzyzpnjzxqebroginhlpsvtbgmbckgqixkdveraxlgleieeagubywaacncxoouibbhwyxhjiczlymscsqlttecvundzjqtuizqwsjalmizgeekugacatlwhiiyaamjuiafmyzxadbxsgwhfawotawfxkpyzyoceiqfppituvaqmgfjinulkbkgpnibaefqaqiptctoqhcnnfihmzijnwpxdikwefpxicbspdkppznpiqrpkyvcxapoaof...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 desperately need to build so...
[{"type": "stdin_stdout", "input": "tkwkxtvwvtekejkwlwmtxvjxexlxlkmtjxklvjlekljxwleewmxekwtwexvjjwmwjmvjwmeetwjvw\n33\njmwexm 9\nmlvl 11\nltkmvjlvkmtxl 1\njwe 4\nllmkxewtkxkk 2\nveeewmjjlw 0\nexmtwwxkw 8\nexjklmvkkejwx 13\nmmjwkmemwwm 0\ntxetttxe 9\ne 9\nmw 7\nmkmt 3\nwk 0\nmvltketkvww 6\nj 5\nmjmemtjew 11\nvwmmvvlvljv...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 took up the biology of bact...
[{"type": "stdin_stdout", "input": "73 29 73\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n67 70 761\n60 34 641\n33 22 689\n67 35 556\n16 21 192\n1 62 75\n37 5 657\n8 7 606\n37 1 54\n53 1 805\n2 68 652\n20 39 701\n44 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\nImagine that your city is an inf...
[{"type": "stdin_stdout", "input": "44 37298\n-100 -100 -98 -93 -92 -91 -91 -89 -87 -86 -84 -80 -79 -76 -71 -70 -58 -53 -52 -52 -49 -48 -45 -45 -40 -39 -37 -35 -31 -30 -30 -29 -29 -28 -22 -22 -21 -11 -8 -7 -7 -6 -1 0\n", "output": "200\n"}, {"type": "stdin_stdout", "input": "45 45\n-95 -94 -92 -83 -83 -76 -75 -74 -71 -...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya has found a strange device...
[{"type": "stdin_stdout", "input": "9998 10000\n", "output": "4999\n"}, {"type": "stdin_stdout", "input": "9999 10000\n", "output": "5000\n"}, {"type": "stdin_stdout", "input": "6919 10000\n", "output": "1920\n"}, {"type": "stdin_stdout", "input": "6565 10000\n", "output": "1566\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\nAs everyone knows, bears love fi...
[{"type": "stdin_stdout", "input": "15\n44249 54630\n165741 91307\n49455 83026\n52521 88269\n39286 65158\n38282 73821\n96608 30032\n155832 122920\n22021 13546\n161556 192797\n168062 8224\n161221 155335\n5670 180269\n89163 128733\n151226 75254\n", "output": "bbbbbbbbbbbbbbb\n"}, {"type": "stdin_stdout", "input": "15\n44...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLimak is a grizzly bear who desi...
[{"type": "stdin_stdout", "input": "100\n901 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor months Maxim has been coming...
[{"type": "stdin_stdout", "input": "3 1000000000 1\n0 4\n1 1001000000\n256516843 1000000101\n", "output": "1.9999999514\n503145235.6844568849\n372819332.8913071752\n"}, {"type": "stdin_stdout", "input": "3 1000000000 1000000000\n1 2\n0 1000000000\n999999999 1000000000\n", "output": "0.0000000005\n0.5026372490\n0.000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 elephant decided to visit his...
[{"type": "stdin_stdout", "input": "6972384\n", "output": "1394477\n"}, {"type": "stdin_stdout", "input": "5118712\n", "output": "1023743\n"}, {"type": "stdin_stdout", "input": "1000000\n", "output": "200000\n"}, {"type": "stdin_stdout", "input": "1925720\n", "output": "385144\n"}, {"type": "stdin_stdout", "input": "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\nPolycarp is a big lover of killi...
[{"type": "stdin_stdout", "input": "50\njcg\nvle\njopb\nepdb\nnkef\nfv\nxj\nufe\nfuy\noqta\ngbc\nyuz\nec\nyji\nkuux\ncwm\ntq\nnno\nhp\nzry\nxxpp\ntjvo\ngyz\nkwo\nvwqz\nyaqc\njnj\nwoav\nqcv\ndcu\ngc\nhovn\nop\nevy\ndc\ntrpu\nyb\nuzfa\npca\noq\nnhxy\nsiqu\nde\nhphy\nc\nwovu\nf\nbvv\ndsik\nlwyg\n", "output": "lwyg\ndsik\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\nAyush is a cashier at the shoppi...
[{"type": "stdin_stdout", "input": "10 1 100\n1 55 67 75 40 86 24 84 82 26 81 23 70 79 51 54 21 78 31 98 68 93 66 88 99 65 20 52 35 85 16 12 94 100 59 56 18 33 47 46 71 8 38 57 2 92 3 95 6 4 87 22 48 80 15 29 11 45 72 76 44 60 91 90 39 74 41 36 13 27 53 83 32 10 30 63 89 64 49 17 9 97 69 14 50 77 37 96 10 42 28 34 61 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\nMike wants to prepare for IMO bu...
[{"type": "stdin_stdout", "input": "9 6\n-44 -29\n-11 85\n11 84\n-63 1\n75 89\n-37 61\n14 73\n78 88\n-22 -18\n", "output": " 0\n"}, {"type": "stdin_stdout", "input": "2 2\n-93 -22\n12 72\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\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\nVasiliy spent his vacation in a ...
[{"type": "stdin_stdout", "input": "718167999978848233 1000000000000000000 1000000000000000000\n", "output": "281832000021151766\n"}, {"type": "stdin_stdout", "input": "338654687020656675 999999999999999999 1000000000000000000\n", "output": "661345312979343324\n"}, {"type": "stdin_stdout", "input": "643704740517968615 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOf course you have heard the fam...
[{"type": "stdin_stdout", "input": "15\n1 30 1409523818\n12 13 463027806\n9 14 846985104\n20 21 770345346\n17 22 514758030\n2 15 438137019\n18 19 331182033\n16 29 613043570\n10 19 765879041\n6 7 960155075\n13 27 323764310\n24 25 724736351\n4 9 107208241\n3 8 992951987\n23 28 125300818\n", "output": "6581903942\n"}, {"t...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nk people want to split n candies...
[{"type": "stdin_stdout", "input": "1815995848677761959 576460752303423488 202657637814241276 1000\n", "output": "202657637814241276\n"}, {"type": "stdin_stdout", "input": "576460752303423488 576460752303423488 351082447248993993 1000\n", "output": "351082447248993993\n"}, {"type": "stdin_stdout", "input": "57646075230...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nView Russian Translation\n\nA wi...
[{"type": "stdin_stdout", "input": "10\n705 14 10\n19 9950 3597 154 23871 1241 4973 19902 76 620 39805 308 2 7 17\n89106 68592 25244 2303 148289 23315 98081 57627 61203 18311\n347 15 4\n28 3253 58562 3811 236 13 950 58 15244 2 118 60977 267 7458 9\n14460 68371 99081 52092 51087 77895 83406 16776 35842 96786\n790 22 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\nOmar loves problem solving very ...
[{"type": "stdin_stdout", "input": "39 525\n23810 349 3784 3087 911 29520 10451 7776 5854 28101 1740 316 20538 6629 1129 26286 5114 55 44537 4716 21656 147 6685 93 17953 224 9726 32279 2447 591 345 18588 24193 9492 34469 12618 2596 19 29534", "output": "10\n2707 23810 24193 26286 28101 29520 29534 32279 34469 202285220...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\"Not every love story has a hap...
[{"type": "stdin_stdout", "input": "1\n159\n\nAKMQDT", "output": "159\n"}, {"type": "stdin_stdout", "input": "1\n115\n\nTDRKMA", "output": "115\n"}, {"type": "stdin_stdout", "input": "1\n135\n\nTDQMKA", "output": "135\n"}, {"type": "stdin_stdout", "input": "1\n195\n\nAKMQDT", "output": "195\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\nFor a positive integer X, let f(...
[{"type": "stdin_stdout", "input": "11001000", "output": "1020696029789074\n"}, {"type": "stdin_stdout", "input": "11000000", "output": "1020504841032058\n"}, {"type": "stdin_stdout", "input": "11001001", "output": "1020696117797082\n"}, {"type": "stdin_stdout", "input": "11001101", "output": "1020713851493884\n"}, {"t...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFind the price of a product befo...
[{"type": "stdin_stdout", "input": "134 106", "output": "-1\n"}, {"type": "stdin_stdout", "input": "134 157", "output": "-1\n"}, {"type": "stdin_stdout", "input": "10 12", "output": "125\n"}, {"type": "stdin_stdout", "input": "10 13", "output": "130\n"}, {"type": "stdin_stdout", "input": "12 15", "output": "150\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\nTakahashi has N cards. The i-th ...
[{"type": "stdin_stdout", "input": "5\n1 2 3 3 5", "output": "5\n2\n1\n1\n0\n"}, {"type": "stdin_stdout", "input": "5\n2 2 3 3 5", "output": "5\n2\n1\n0\n0\n"}, {"type": "stdin_stdout", "input": "5\n4 2 2 4 4", "output": "5\n2\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "5\n4 4 5 4 4", "output": "5\n1\n0\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\nTakahashi has a lot of peculiar ...
[{"type": "stdin_stdout", "input": "4 123456789\nAABA", "output": "BABA\n"}, {"type": "stdin_stdout", "input": "4 110986646\nAABB", "output": "BABA\n"}, {"type": "stdin_stdout", "input": "4 123456789\nAAAA", "output": "BABA\n"}, {"type": "stdin_stdout", "input": "4 110986646\nBABA", "output": "BABA\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 data that records the a...
[{"type": "stdin_stdout", "input": "3783.6109384455353\n1821.5992049377405\n649.3237125101873\n2008.8147615323267\n1214.1371939030753", "output": "3134.28722594\n"}, {"type": "stdin_stdout", "input": "3784.5476877206565\n1821.5992049377405\n649.3237125101873\n2008.8147615323267\n1214.1371939030753", "output": "3135.223...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTetris is a game in which fallin...
[{"type": "stdin_stdout", "input": "4\n2 4 1\n1 3 1\n2 2 4\n2 3 5\n1\n1 5 1\n7\n2 2 2\n1 1 1\n2 1 3\n1 4 1\n1 1 1\n2 5 5\n1 4 2\n0", "output": "12\n0\n13\n"}, {"type": "stdin_stdout", "input": "4\n2 4 1\n1 3 1\n2 2 4\n2 3 5\n1\n1 5 1\n7\n2 2 2\n1 1 1\n2 0 3\n1 4 1\n1 1 1\n2 5 5\n1 4 2\n0", "output": "12\n0\n12\n"}, {"t...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nComputer graphics uses polygon m...
[{"type": "stdin_stdout", "input": "6\n3 3 1\n1 2 4\n1 4 3\n-1 3 4\n5 -1 1\n2 3 1", "output": "0\n"}, {"type": "stdin_stdout", "input": "6\n3 3 1\n1 2 4\n1 4 3\n-1 4 4\n10 0 1\n2 3 1", "output": "0\n"}, {"type": "stdin_stdout", "input": "6\n3 1 1\n2 0 4\n0 4 1\n-1 4 4\n9 -1 2\n2 3 1", "output": "0\n"}, {"type": "stdin_...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nproblem\n\nThe IOI country consi...
[{"type": "stdin_stdout", "input": "6 6\n400 2\n200 1\n600 3\n1000 1\n300 5\n700 4\n1 2\n2 3\n3 6\n4 6\n1 5\n2 4", "output": "700"}, {"type": "stdin_stdout", "input": "None", "output": "None"}, {"type": "stdin_stdout", "input": "enoN", "output": "0\n"}, {"type": "stdin_stdout", "input": "eooN", "output": "0\n"}, {"type...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs the proverb says,\n\n> \"Pati...
[{"type": "stdin_stdout", "input": "4\n1 4 5 2\n3 1 4 3\n5 4 2 2\n4 5 2 3\n1 1 3 5\n5 1 5 1\n4 10 3 2\n3 2 1 4\n1 4 5 3\n2 3 4 2\n1 2 1 2\n5 7 5 4\n2 1 2 1\n3 5 3 4\n3 3 5 4\n4 2 3 1\n2 5 3 1\n3 5 4 2\n1 0 4 1\n4 5 3 2", "output": "0\n18\n12\n2\n"}, {"type": "stdin_stdout", "input": "4\n1 4 5 2\n3 1 4 3\n5 4 2 2\n4 5 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 were lucky enough to get a m...
[{"type": "stdin_stdout", "input": "6\nBlizid\n0 0\n60 -1\n60 60\n0 60\n0 50\n50 50\n50 10\n0 10\n-1\nBlizid\n0 10\n10 10\n10 50\n0 50\n-1\nWindom\n10 10\n50 10\n40 20\n20 20\n20 40\n10 50\n-1\nAccent\n50 10\n50 50\n35 50\n35 25\n-1\nPilot\n35 25\n35 50\n19 50\n-1\nBlizid\n20 20\n40 20\n20 40\n-1\n4\nA12345678901234567...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 I Starting a Scenic Rail...
[{"type": "stdin_stdout", "input": "4\n1 3\n1 11\n10 2\n3 12", "output": "4 2\n"}, {"type": "stdin_stdout", "input": "4\n2 1\n1 11\n10 2\n16 3", "output": "2 0\n"}, {"type": "stdin_stdout", "input": "4\n1 3\n1 11\n10 2\n4 12", "output": "4 2\n"}, {"type": "stdin_stdout", "input": "4\n2 2\n1 11\n10 1\n3 10", "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\n3D Printing\n\nWe are designing ...
[{"type": "stdin_stdout", "input": "1 1 100\n100 100 100\n6 4 10\n100 100 100\n106 102 102\n112 110 104\n104 116 102\n100 114 104\n92 107 100\n10 1 10\n-100 101 100\n-108 102 120\n-116 103 100\n-124 100 100\n-132 99 100\n-92 98 100\n-84 100 140\n-76 103 100\n-68 146 100\n-60 101 100\n10 4 10\n100 100 100\n108 101 100\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 customer telephone support c...
[{"type": "stdin_stdout", "input": "3 300\n100 46 150\n100 50 150\n101 50 148\n3 300\n110 50 150\n100 50 150\n200 50 150\n9 18\n5 1 1\n3 1 1\n3 1 1\n4 100 1\n5 100 1\n5 100 1\n10 5 5\n10 5 5\n2 7 1000\n10 18\n1 2 6\n2 3 1\n3 4 5\n4 5 6\n5 6 7\n6 7 8\n7 8 9\n12 9 10\n9 10 11\n18 11 12\n0 0", "output": "2\n3\n5\n10\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\nProblem Statement\n\nCircles Isl...
[{"type": "stdin_stdout", "input": "2\n0 8\n10 8\n2\n0 7\n10 7\n0", "output": "12.489995996796796\n9.899494936611665"}, {"type": "stdin_stdout", "input": "2\n0 8\n10 10\n2\n0 14\n10 14\n0", "output": "14.664242\n24.157244\n"}, {"type": "stdin_stdout", "input": "2\n0 8\n10 8\n2\n0 14\n10 14\n0", "output": "12.489996\n24...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMy futon\n\nYou bought N futons ...
[{"type": "stdin_stdout", "input": "1 1\n5\n5\n1 1\n5\n4\n1 1\n20\n5\n4 0\n2 4 5 9\n8\n4 3\n3 5 2 1\n10 4 7\n10 5\n2 3 4 2 2\n2 1 5 7 9\n2 5\n1 10\n2 5 2 6 2\n0 0", "output": "0\n1\n5\n0\n1\n0\n12\n"}, {"type": "stdin_stdout", "input": "1 1\n1\n3\n1 1\n5\n2\n1 1\n20\n10\n8 1\n2 4 2 2\n5\n4 3\n3 2 2 1\n10 4 1\n5 5\n2 2 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDivide and rule\n\nTaro, Hanako,...
[{"type": "stdin_stdout", "input": "6 7\n1 2\n1 4\n2 3\n2 5\n3 4\n4 5\n4 6\n2 1\n1 2\n3 3\n1 2\n2 3\n2 3\n4 3\n1 2\n2 3\n3 4\n5 4\n1 2\n2 3\n3 4\n4 5\n0 0", "output": "2\n1\n2\n0\n1\n1\n1\n1\n1\n1\n"}, {"type": "stdin_stdout", "input": "6 7\n1 2\n1 4\n2 3\n2 6\n3 4\n4 5\n4 6\n2 1\n1 2\n3 3\n1 2\n2 3\n2 3\n4 3\n1 2\n2 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 reads a wo...
[{"type": "stdin_stdout", "input": "computer\nNurtures computer scientists and highly-skilled computer engineers\nwho will create and exploit \"knowledge\" for the enw era.\nProvides an outstanding computer environment.\nEND_OF_TEXT", "output": "3\n"}, {"type": "stdin_stdout", "input": "comquter\nNurtures computer scie...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOur Chef is catering for a big c...
[{"type": "stdin_stdout", "input": "4\n38\n13\n31\n2", "output": "17\n12\n30\n1\n"}, {"type": "stdin_stdout", "input": "4\n38\n13\n16\n2", "output": "17\n12\n0\n1\n"}, {"type": "stdin_stdout", "input": "4\n131\n14\n1\n4", "output": "130\n5\n0\n0\n"}, {"type": "stdin_stdout", "input": "4\n19\n13\n16\n2", "output": "18\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a tree (an undirec...
[{"type": "stdin_stdout", "input": "3 1000000000\n3 2\n2 1\n", "output": "1000000000.0000000000\n"}, {"type": "stdin_stdout", "input": "2 1000000000\n2 1\n", "output": "1000000000.0000000000\n"}, {"type": "stdin_stdout", "input": "6 1\n2 1\n2 3\n2 5\n5 4\n5 6\n", "output": "0.5000000000\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\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\nYou are given n integers. You ne...
[{"type": "stdin_stdout", "input": "15\n6 7 11 8 13 11 4 20 17 12 9 15 18 13 18\n", "output": "15\n3 5\n18 13 20 12 7 \n6 18 11 17 9 \n8 4 13 11 15 \n"}, {"type": "stdin_stdout", "input": "15\n6 7 11 8 13 11 4 20 17 12 9 15 18 13 9\n", "output": "15\n3 5\n13 11 20 15 7 \n6 13 9 18 12 \n8 4 11 9 17 \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 monsters standing in...
[{"type": "stdin_stdout", "input": "6 2 3 3\n7 10 50 12 1 8\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "6 2 3 2\n7 10 50 12 1 8\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "6 2 3 2\n5 10 50 12 1 8\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "6 2 2 2\n5 10 50 12 1 8\n", "output": "6\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA subway scheme, classic for all...
[{"type": "stdin_stdout", "input": "10\n10 2\n10 5\n9 5\n3 9\n4 7\n3 1\n7 2\n10 6\n7 8\n1 4\n", "output": "0 0 0 0 0 1 0 1 0 0\n"}, {"type": "stdin_stdout", "input": "10\n10 7\n1 5\n2 1\n4 1\n1 10\n3 1\n9 7\n1 8\n7 6\n7 1\n", "output": "0 1 1 1 1 1 0 1 1 0 "}, {"type": "stdin_stdout", "input": "10\n8 2\n10 5\n9 5\n3 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\nYou have integer n. Calculate ho...
[{"type": "stdin_stdout", "input": "1\n1000000000\n", "output": "1000000000\n"}, {"type": "stdin_stdout", "input": "1\n1111011001\n", "output": "1111011001\n"}, {"type": "stdin_stdout", "input": "1\n1011011001\n", "output": "1011011001\n"}, {"type": "stdin_stdout", "input": "1\n1011001001\n", "output": "1011001001\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\nPolygon is not only the best pla...
[{"type": "stdin_stdout", "input": "5\n4\n0110\n0011\n0000\n0000\n2\n10\n01\n2\n00\n00\n4\n0101\n1111\n0101\n0111\n4\n0100\n1111\n0101\n0111\n", "output": "YES\nNO\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "5\n4\n0010\n0111\n0000\n0000\n2\n10\n01\n2\n00\n00\n4\n0101\n1111\n0101\n0111\n4\n0100\n1100\n0101\n0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet a and b be some non-negative...
[{"type": "stdin_stdout", "input": "2 3\n14\n2 4\n2 1\n1 1\n", "output": "15\n12\n12\n"}, {"type": "stdin_stdout", "input": "2 3\n14\n2 4\n2 1\n2 0\n", "output": "15\n12\n11\n"}, {"type": "stdin_stdout", "input": "2 3\n11\n2 8\n2 2\n2 0\n", "output": "19\n13\n11\n"}, {"type": "stdin_stdout", "input": "2 3\n11\n2 8\n2 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA famous gang of pirates, Sea Do...
[{"type": "stdin_stdout", "input": "1000010000 3\n44431 10822\n45250 1096927361\n264372930 1\n", "output": "-1"}, {"type": "stdin_stdout", "input": "1000010001 3\n44431 10822\n45250 1096927361\n264372930 1\n", "output": "-1"}, {"type": "stdin_stdout", "input": "1000000000 3\n30490 19232\n45250 999980767\n264372930 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 is a famous olympiad, whic...
[{"type": "stdin_stdout", "input": "2\n1 2 2 1\n4 8 12 4\n", "output": "3\n16\n"}, {"type": "stdin_stdout", "input": "2\n1 2 3 1\n4 8 12 4\n", "output": "4\n16\n"}, {"type": "stdin_stdout", "input": "2\n1 2 2 1\n4 8 9 2\n", "output": "3\n12\n"}, {"type": "stdin_stdout", "input": "2\n1 2 2 1\n4 8 9 4\n", "output": "3\n1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPetya loves lucky numbers very m...
[{"type": "stdin_stdout", "input": "100000 77777\n", "output": "177777\n"}, {"type": "stdin_stdout", "input": "150234 77777\n", "output": "177777\n"}, {"type": "stdin_stdout", "input": "77777 77777\n", "output": "177777\n"}, {"type": "stdin_stdout", "input": "47774 47774\n", "output": "147774\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\nYou have r red and b blue beans....
[{"type": "stdin_stdout", "input": "10\n1000000000 1 1000000000\n1000000000 1 1000000000\n1000000000 1 1000000000\n1000000000 1 1000000000\n1000000000 1 1000000000\n1000000000 1 1000000000\n1000000000 1 1000000000\n1000000000 1 1000000000\n1000000000 1 1000000000\n1000000000 1 1000000000\n", "output": "YES\nYES\nYES\nY...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAquaMoon and Cirno are playing a...
[{"type": "stdin_stdout", "input": "4\n25\n0 0 0 0 0 8 1 0 9 0 8 8 0 0 11 0 0 0 9 3 10 4 10 4 0\n2 0 0 1 10 0 10 6 0 4 0 2 0 3 11 1 2 11 0 7 6 0 0 9 0\n25\n0 0 6 0 6 2 0 0 4 1 0 0 8 1 0 9 6 6 7 0 5 4 3 0 6\n8 0 0 2 0 9 0 6 5 0 4 9 9 0 0 3 0 6 0 6 7 0 0 0 0\n25\n4 0 7 0 5 0 0 0 0 0 5 2 1 5 5 9 7 0 0 0 0 0 0 2 1\n5 0 0 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\n\"The Chamber of Secrets has bee...
[{"type": "stdin_stdout", "input": "20 20\n..................#.\n.#.............#....\n....................\n....................\n....#...........#...\n....................\n......#......#......\n....................\n........#...#.......\n....................\n.........#...#......\n....................\n................
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHamming distance between strings...
[{"type": "stdin_stdout", "input": "5728 5729 5750\n5631 5768\n9209\n", "output": "10344\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 stones on the table ...
[{"type": "stdin_stdout", "input": "50\nRBGBGGRRGGRGGBGBGRRBGGBGBRRBBGBBGBBBGBBRBBRBRBRGRG\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "50\nRBGGBGGRBGRBBBGBBGRBBBGGGRBBBGBBBGRGGBGGBRBGBGRRGG\n", "output": "17\n"}, {"type": "stdin_stdout", "input": "50\nGRBGGRBRGRBGGBBBBBGGGBBBBRBRGBRRBRGBBBRBBRRGBGGGRB\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\nRobot Bender decided to make Fra...
[{"type": "stdin_stdout", "input": "4 4\n-8423 7689\n6902 7689\n6902 2402\n-8423 2402\n20612 20612 91529 35617\n", "output": "YES\n1 -1 2 -1 \n"}, {"type": "stdin_stdout", "input": "4 4\n-8423 7689\n6902 7689\n6902 2402\n-8423 2402\n20612 20612 123030 35617\n", "output": "YES\n1 -1 2 -1 "}, {"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\nSereja and his friends went to a...
[{"type": "stdin_stdout", "input": "50\n507 31\n31 250\n414 763\n169 304\n901 9\n592 610\n763 414\n656 789\n411 422\n360 468\n625 504\n538 201\n549 619\n484 797\n596 282\n42 310\n603 656\n351 623\n292 293\n837 180\n375 658\n21 192\n597 729\n22 512\n349 635\n200 56\n669 647\n485 887\n282 939\n735 808\n54 417\n1000 310\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\nIahub likes trees very much. Rec...
[{"type": "stdin_stdout", "input": "10 10\n418 45 865 869 745 901 177 773 854 462\n4 8\n1 4\n3 6\n1 5\n1 10\n5 9\n1 2\n4 7\n1 3\n2 2\n1 6 246\n1 4 296\n1 2 378\n1 8 648\n2 6\n1 5 288\n1 6 981\n1 2 868\n2 7\n", "output": "45\n1147\n-119\n"}, {"type": "stdin_stdout", "input": "10 10\n418 31 865 869 745 901 177 773 854 46...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 takes part in the Berland...
[{"type": "stdin_stdout", "input": "70092.4982 95833.7741\n1000\n", "output": "70092.4982000000 25741.2759000000\n18609.9464000000 70092.4982000000\n7131.3295000000 0.0000000000\n70092.4982000000 32872.6054000000\n11478.6169000001 70092.4982000000\n14262.6590000000 0.0000000000\n70092.4982000000 40003.9348999999\n4347....
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nQuite recently a creative studen...
[{"type": "stdin_stdout", "input": "100 50 50\n", "output": "661237556\n"}, {"type": "stdin_stdout", "input": "100 100 1\n", "output": "988185646\n"}, {"type": "stdin_stdout", "input": "90 100 30\n", "output": "697322870\n"}, {"type": "stdin_stdout", "input": "100 13 11\n", "output": "883875774\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\nDreamoon loves summing up someth...
[{"type": "stdin_stdout", "input": "10000000 10000000\n", "output": "425362313\n"}, {"type": "stdin_stdout", "input": "10000000 11383836\n", "output": "113242098\n"}, {"type": "stdin_stdout", "input": "10000100 10000000\n", "output": "778965806\n"}, {"type": "stdin_stdout", "input": "12520154 17573427\n", "output": "52...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 have invented a ...
[{"type": "stdin_stdout", "input": "337\n000000000000000000000000000000000000001000000000000000000000000000000001000000000000100000000010010000000000000000000000000000000000000000000000000000000010000000000100001000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarpus got an internship in ...
[{"type": "stdin_stdout", "input": "10 3 30000\n00:06:54\n00:42:06\n03:49:45\n04:38:35\n05:33:30\n05:51:46\n10:46:34\n14:34:59\n14:40:06\n14:53:13\n", "output": "6\n1\n2\n3\n3\n3\n3\n4\n5\n6\n6\n"}, {"type": "stdin_stdout", "input": "10 3 30000\n00:06:54\n00:42:06\n03:49:45\n04:38:35\n05:33:30\n05:51:46\n10:46:34\n14: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\nOne day Squidward, Spongebob and...
[{"type": "stdin_stdout", "input": "101\n1 50 170 269 214 153 132 234 181 188 180 225 226 200 197 122 181 168 160 220 223 160 235 94 257 145 199 235 102 146 119 60 109 134 209 260 210 191 180 271 236 195 155 169 166 143 106 102 208 137 278 269 156 251 198 165 111 198 151 213 256 121 276 163 179 285 104 99 139 122 188 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": "188883 353252\n", "output": "4803878\n"}, {"type": "stdin_stdout", "input": "188883 240204\n", "output": "1479377\n"}, {"type": "stdin_stdout", "input": "443 390308\n", "output": "10631342\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\nLittle Artem found a grasshopper...
[{"type": "stdin_stdout", "input": "10\n>>>>>>>>>>\n1 1 1 1 1 1 1 1 1 100\n", "output": "FINITE\n"}, {"type": "stdin_stdout", "input": "10\n>>>>>>>>><\n1 1 1 1 1 1 1 1 1 5\n", "output": "INFINITE\n"}, {"type": "stdin_stdout", "input": "10\n>>>>>>>>><\n1 1 1 1 1 1 1 1 1 1\n", "output": "INFINITE\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\nLittle Artem is fond of dancing....
[{"type": "stdin_stdout", "input": "364 57\n1 -101\n1 110\n1 -76\n1 329\n2\n2\n2\n1 -191\n1 97\n1 189\n1 305\n1 -313\n1 312\n1 -148\n2\n1 -104\n1 85\n1 -55\n1 -79\n1 230\n1 -94\n1 58\n1 -72\n2\n2\n2\n1 -104\n1 -351\n1 23\n2\n1 215\n2\n2\n2\n1 58\n1 -237\n2\n2\n2\n1 198\n2\n1 83\n2\n1 -205\n2\n2\n2\n2\n1 -110\n2\n2\n2\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\nZS the Coder is playing a game. ...
[{"type": "stdin_stdout", "input": "6723\n", "output": "2\n17\n46\n97\n176\n289\n442\n641\n892\n1201\n1574\n2017\n2536\n3137\n3826\n4609\n5492\n6481\n7582\n8801\n10144\n11617\n13226\n14977\n16876\n18929\n21142\n23521\n26072\n28801\n31714\n34817\n38116\n41617\n45326\n49249\n53392\n57761\n62362\n67201\n72284\n77617\n8320...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's call a non-empty sequence ...
[{"type": "stdin_stdout", "input": "100\n881 479 355 759 257 497 690 598 275 446 439 787 257 326 584 713 322 5 253 781 434 307 164 154 241 381 38 942 680 906 240 11 431 478 628 959 346 74 493 964 455 746 950 41 585 549 892 687 264 41 487 676 63 453 861 980 477 901 80 907 285 506 619 748 773 743 56 925 651 685 845 313 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\nYou already know that Valery's f...
[{"type": "stdin_stdout", "input": "20 20 2\nbaaaaaaaaaaaaaaaaaaa\nbfffffffacfffffffffa\nbgggggggaccgggggggga\nbhhhhhhhaccchhhhhhha\nbiiiiiiiacccciiiiiia\nbjjjjjjjacccccjjjjja\nbkkkkkkkacccccckkkka\nblllllllacccccccllla\nbbbbbbbbSccccccccmma\nbddddddddddcccccccna\nbodddddddcccccccccca\nbppddddddddTaaaaaaaa\nbqqqddddddd...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string s consist...
[{"type": "stdin_stdout", "input": "65\n11001000110001001011011110111100000000101001001010101111000100010\n", "output": "48\n"}, {"type": "stdin_stdout", "input": "65\n11001000110101001011011110111100000000101001001010101111000100010\n", "output": "56\n"}, {"type": "stdin_stdout", "input": "65\n110010011101010010110111...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 were n groups of students ...
[{"type": "stdin_stdout", "input": "247\n2 2 1 2 1 2 2 2 2 2 2 1 1 2 2 1 2 1 1 1 2 1 1 1 1 2 1 1 2 2 1 2 1 1 1 2 2 2 1 1 2 1 1 2 1 1 1 2 1 2 1 2 2 1 1 2 1 2 2 1 2 1 2 1 1 2 1 1 1 2 2 1 1 2 2 1 1 2 1 1 1 2 2 2 2 1 2 2 1 2 2 2 1 2 2 2 2 1 1 1 1 1 1 1 1 1 2 1 2 2 1 2 1 2 2 2 1 2 2 2 1 1 2 2 1 1 1 2 1 1 1 1 2 2 1 2 2 1 1 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n walruses standing in...
[{"type": "stdin_stdout", "input": "15\n18 6 33 21 14 20 13 9 18 20 28 13 19 25 21\n", "output": "10 -1 11 8 6 6 0 -1 2 2 3 -1 -1 0 -1 "}, {"type": "stdin_stdout", "input": "15\n18 6 33 21 14 20 20 9 18 20 28 13 19 25 21\n", "output": "10 -1 11 8 6 6 5 -1 2 2 3 -1 -1 0 -1 "}, {"type": "stdin_stdout", "input": "15\n18 6...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAllen and Bessie are playing a s...
[{"type": "stdin_stdout", "input": "2 2\n0 1 2 3\n2 5\n0 4\n", "output": "1.5000000000\n2.2500000000\n3.2500000000\n"}, {"type": "stdin_stdout", "input": "2 2\n0 1 2 3\n2 3\n1 11\n", "output": "1.5\n1.75\n4.25\n"}, {"type": "stdin_stdout", "input": "2 2\n0 1 2 2\n2 3\n1 4\n", "output": "1.25\n1.5\n2.25\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\nAniruddha and Andrew are playing...
[{"type": "stdin_stdout", "input": "2\n2\n-1 1\n2\n1 2\n\nSAMOLE", "output": "Aniruddha\nAniruddha\n"}, {"type": "stdin_stdout", "input": "2\n2\n-1 2\n2\n1 2\n\nSAMOLE", "output": "Aniruddha\nAniruddha\n"}, {"type": "stdin_stdout", "input": "2\n2\n-1 2\n2\n1 4\n\nRAMOLE", "output": "Aniruddha\nAniruddha\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\nView Russian Translation\n\nIn t...
[{"type": "stdin_stdout", "input": "47 1\n1 4 13\n-1 2 0\n\nSMAMPE", "output": "3 13\n"}, {"type": "stdin_stdout", "input": "210 1\n1 3 14\n2 2 6\n\nRAMPLE", "output": "2 14\n"}, {"type": "stdin_stdout", "input": "11 1\n1 2 17\n1 2 -2\n\nTAMPLE", "output": "1 17\n"}, {"type": "stdin_stdout", "input": "27 1\n1 6 11\n1 2...
code_stdio