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\nVasya participates in a ski race... | [{"type": "stdin_stdout", "input": "15 30\n9 3 32 1\n0 16 38 2\n1 8 50 2\n16 14 21 2\n5 18 68 3\n25 2 49 1\n17 6 52 2\n17 3 94 1\n1 25 40 2\n27 1 49 2\n29 1 31 3\n19 3 30 1\n20 4 17 3\n18 9 66 2\n8 20 78 3\n", "output": "30\n0\n"}, {"type": "stdin_stdout", "input": "15 30\n9 3 32 1\n0 16 38 2\n1 8 50 2\n16 14 21 2\n5 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou have a robot that can move a... | [{"type": "stdin_stdout", "input": "8\n3\n1 5\n3 0\n6 4\n3\n1 5\n2 4\n10 -5\n5\n2 -5\n3 1\n4 1\n5 1\n6 1\n4\n3 3\n5 -3\n9 2\n12 0\n8\n1 1\n2 -6\n7 2\n8 3\n12 -9\n14 2\n18 -1\n23 9\n5\n1 -4\n4 -7\n6 -1\n7 -3\n8 -7\n2\n1 2\n2 -2\n6\n3 10\n5 5\n8 0\n12 -4\n14 -7\n19 -5\n", "output": "\n1\n2\n0\n2\n1\n1\n0\n2\n"}, {"type":... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n«Next please», — the princess ca... | [{"type": "stdin_stdout", "input": "110 29 15\n", "output": "1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 32769 32770 32771 32772 32773 32774 32775 32776 32777 32778 32779 32780 32781 32782 32783 32784 32785 32786 32787 32788 32789 32790 32791 32792 32793 32794 32795 32796 32797 1 1 1 1 1 1 1 1 1 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\nYou are given an array a consist... | [{"type": "stdin_stdout", "input": "4\n4\n11 13 11 11\n5\n1 4 4 4 4\n10\n3 3 3 3 10 3 3 3 3 3\n3\n20 20 10\n", "output": "\n2\n1\n5\n3\n"}, {"type": "stdin_stdout", "input": "4\n4\n11 20 11 11\n5\n1 4 4 4 4\n10\n3 3 3 3 10 3 3 3 3 3\n3\n20 20 10\n", "output": "2\n1\n5\n3\n"}, {"type": "stdin_stdout", "input": "4\n4\n11... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou've got another geometrical t... | [{"type": "stdin_stdout", "input": "3\n-1000000000 1000000000\n1000000000 0\n1000 -1000000000\n3\n1000 -999999999\n1000 0\n1001 0\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "6\n2 4\n4 2\n3 -1\n-1 -3\n-3 0\n-2 3\n12\n0 3\n0 2\n1 2\n2 3\n3 2\n1 1\n2 0\n0 -2\n0 0\n-1 -1\n-2 0\n-1 1\n", "output": "YES\n"}, {... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya works as a DJ in the best ... | [{"type": "stdin_stdout", "input": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n", "output": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nJohn Doe has an n × m table. Joh... | [{"type": "stdin_stdout", "input": "100 1000000000000000000 5000\n", "output": "824224847\n"}, {"type": "stdin_stdout", "input": "100 1000000000000000000 1221\n", "output": "43180268\n"}, {"type": "stdin_stdout", "input": "79 1000000000000000000 3107\n", "output": "631080535\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\nThe Little Elephant has an integ... | [{"type": "stdin_stdout", "input": "11100010010010000110101101101100111111001010001101101001001111010110010111001011010000001100110101000101111000001111101111110010000010101110011110101101010110001100011101111011100010011101100111110010111111100110101000000111101000000000110100100101111101000110101010101101001110001110... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Bitlandians are quite weird ... | [{"type": "stdin_stdout", "input": "1000000000000000000000000000000000000011111111000000000000\n0111111111100000000000111111111000000000000000111111110001\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1000000000000000000000000000000000000011111111000000000000\n0011111111100000000000111111111000000000000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 continued fraction of height n... | [{"type": "stdin_stdout", "input": "550736960584023286 3\n90\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 2 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\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "633468529243155234 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\nValera has got n domino pieces i... | [{"type": "stdin_stdout", "input": "100\n2 3\n2 4\n3 3\n1 4\n5 2\n5 4\n6 6\n3 4\n1 1\n4 2\n5 1\n5 5\n5 3\n3 6\n4 1\n1 6\n1 1\n3 2\n4 5\n6 1\n6 4\n1 1\n3 4\n3 3\n2 2\n1 1\n4 4\n6 4\n3 2\n5 2\n6 4\n3 2\n3 5\n4 4\n1 4\n5 2\n3 4\n1 4\n2 2\n5 6\n3 5\n6 1\n5 5\n1 6\n6 3\n1 4\n1 5\n5 5\n4 1\n3 2\n4 1\n5 5\n5 5\n1 5\n1 2\n6 4\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe employees of the F company h... | [{"type": "stdin_stdout", "input": "100 50\n11 28\n11 1\n98 58\n38 27\n24 27\n67 37\n90 48\n91 14\n43 29\n3 64\n24 6\n53 19\n97 65\n13 27\n75 53\n37 82\n69 75\n94 99\n1 26\n95 60\n45 27\n100 82\n71 49\n86 99\n74 58\n88 68\n39 63\n38 23\n22 39\n29 58\n62 83\n62 1\n61 58\n2 30\n41 48\n83 90\n1 17\n73 81\n23 53\n71 16\n43... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBizon the Champion isn't just at... | [{"type": "stdin_stdout", "input": "30\n1 4 5 3 9 7 8 4 5 9 2 3 4 2 3 4 5 5 6 8 1 2 9 4 3 7 2 6 5 4\n", "output": "26\n"}, {"type": "stdin_stdout", "input": "30\n1 4 5 3 9 7 8 4 5 1 2 3 4 2 3 4 5 5 6 8 1 2 9 4 3 7 2 6 5 4\n", "output": "25\n"}, {"type": "stdin_stdout", "input": "30\n1 4 5 3 9 7 8 3 5 1 2 3 4 2 3 4 5 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\nNowadays it is becoming increasi... | [{"type": "stdin_stdout", "input": "50 3 1\n30\n1 9\n2 1\n1 6\n1 5\n1 8\n1 1\n2 6\n1 7\n2 3\n2 8\n1 7\n2 4\n2 5\n2 11\n1 2\n2 15\n1 6\n1 3\n2 17\n1 9\n1 3\n2 18\n1 3\n2 23\n2 21\n1 8\n1 2\n2 27\n1 8\n2 29\n", "output": "0\n0\n9\n17\n28\n28\n0\n0\n0\n9\n15\n0\n6\n0\n11\n27\n"}, {"type": "stdin_stdout", "input": "50 3 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\nThe country has n cities and n -... | [{"type": "stdin_stdout", "input": "150\n1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 14 15 15 15 16 16 16 17 17 17 18 18 18 19 19 19 20 20 20 21 21 9 22 22 22 23 23 23 24 24 24 25 25 25 26 26 26 27 27 27 28 28 28 28 29 29 29 29 30 30 30 30 31 31 31 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\nThe country of Byalechinsk is ru... | [{"type": "stdin_stdout", "input": "100 1\n439 158 619 538 187 153 973 781 610 475 94 1829 449 531 220 51 788 118 189 501 54 434 465 902 280 635 688 214 737 327 682 690 683 519 261 923 254 388 529 659 662 276 376 735 976 664 521 285 42 147 187 259 407 977 879 465 522 17 550 701 114 921 577 265 668 812 232 267 135 371 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\nA team of furry rescue rangers w... | [{"type": "stdin_stdout", "input": "-10000 -10000 10000 10000\n1000 1000\n-454 -891\n-454 -891\n", "output": "17933348.203209478"}, {"type": "stdin_stdout", "input": "-10000 10000 10000 -10000\n1001 1000\n-891 454\n-891 454\n", "output": "26861.169046541258\n"}, {"type": "stdin_stdout", "input": "-10000 -10000 10010 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\nLesha plays the recently publish... | [{"type": "stdin_stdout", "input": "5 5 10 20 50\n0 0 0 0 0\n", "output": " 150\n 5 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\nMr. Santa asks all the great pro... | [{"type": "stdin_stdout", "input": "43857\n", "output": "5 \n 175440 175441 175442 175443 175444\n"}, {"type": "stdin_stdout", "input": "27438\n", "output": "5 \n 109760 109761 109762 109763 109764\n"}, {"type": "stdin_stdout", "input": "31693\n", "output": "5 \n 126785 126786 126787 126788 126789\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\nStepan has a very big positive i... | [{"type": "stdin_stdout", "input": "8460711003592660299377170851036141857177105821455679225940496548902563144980707248030407967017317182\n6886527\n", "output": "136104\n"}, {"type": "stdin_stdout", "input": "8460711003592660299377170851036141857177105821455679225940496548902563144980707248030407967017317182\n13315371\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\nPolycarp is a great fan of telev... | [{"type": "stdin_stdout", "input": "5\n15 18\n23 24\n23 28\n26 24\n15 19\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "5\n15 18\n23 24\n23 11\n26 24\n15 19\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "5\n15 18\n23 24\n23 28\n22 24\n15 19\n", "output": "NO\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\nPetya and Vasya arranged a game.... | [{"type": "stdin_stdout", "input": "92 69\n1 76\n1 14\n1 15\n0\n1 46\n1 80\n0\n0\n1 77\n0\n1 53\n1 81\n1 61\n1 40\n0\n1 20\n1 71\n1 24\n1 54\n1 82\n1 23\n0\n1 63\n1 25\n1 38\n1 68\n0\n1 65\n0\n1 76\n1 55\n1 87\n1 1\n1 37\n1 68\n1 30\n1 17\n1 19\n0\n1 16\n1 69\n0\n1 60\n1 86\n0\n1 44\n1 32\n1 10\n1 8\n0\n0\n0\n0\n0\n1 2... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a set of n element... | [{"type": "stdin_stdout", "input": "6 2\n2578 6301 8624 6020 8513 9486\n", "output": "4401332\n"}, {"type": "stdin_stdout", "input": "6 3\n4759 5555 7401 8003 2501 6345\n", "output": "7431260\n"}, {"type": "stdin_stdout", "input": "6 2\n2578 6301 8624 6020 7152 9486\n", "output": "4257066\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\nVasilisa the Wise from a far awa... | [{"type": "stdin_stdout", "input": "ROYGBV\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "BYOVRR\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "OVBRYG\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "RRYOGB\n", "output": "15\n"}, {"type": "stdin_stdout", "input": "VOBYGO\n", "output": "15... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVivek and Sita are in a relation... | [{"type": "stdin_stdout", "input": "13\n1\n7\n3\n2\n3\n4\n8\n4\n13\n14\n22\n6\n14", "output": "1024\n953349816\n466737221\n1024\n466737221\n466737221\n953349816\n466737221\n996023990\n996023990\n946217050\n904322927\n996023990\n"}, {"type": "stdin_stdout", "input": "13\n1\n7\n3\n2\n3\n4\n8\n4\n13\n14\n16\n6\n14", "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\nNew AtCoder City has an infinite... | [{"type": "stdin_stdout", "input": "8\n2 2 286017\n3 1 262355\n2 -2 213815\n1 -3 224435\n-2 -2 136860\n-3 -1 239338\n-2 1 217647\n-1 3 141903", "output": "2359062 1359398 868031 503198 278763 136860 0 0 0 "}, {"type": "stdin_stdout", "input": "8\n2 2 456035\n3 1 262355\n2 -2 213815\n1 -3 224435\n-2 -2 136860\n-3 -1 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\nConsider a grid with H rows and ... | [{"type": "stdin_stdout", "input": "5 5\n.#.#.\n.#.#\n.#.#.\n.#.#\n.#.#.", "output": "4"}, {"type": "stdin_stdout", "input": "3 13\n..##\n...\n.\n.", "output": "0\n"}, {"type": "stdin_stdout", "input": "3 13\n..##\n/..\n.\n.", "output": "0\n"}, {"type": "stdin_stdout", "input": "3 13\n..##\n/..\n-\n.", "output": "0\n"}... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N points in a two-dime... | [{"type": "stdin_stdout", "input": "20\n8 -10 R\n-4 -9 U\n9 6 D\n-3 -2 R\n0 12 D\n4 5 D\n10 -10 U\n-1 -8 U\n10 -6 D\n8 -5 U\n6 4 D\n-1 3 D\n19 9 R\n9 -4 R\n3 10 D\n1 9 U\n1 -6 U\n9 -8 R\n9 6 D\n7 -3 D", "output": "502.250000000000\n"}, {"type": "stdin_stdout", "input": "20\n8 -10 R\n-4 -9 U\n9 5 D\n-3 -2 R\n0 7 D\n4 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\nA programming competition site A... | [{"type": "stdin_stdout", "input": "2343", "output": "ARC\n"}, {"type": "stdin_stdout", "input": "4178", "output": "AGC\n"}, {"type": "stdin_stdout", "input": "-118", "output": "ABC\n"}, {"type": "stdin_stdout", "input": "-129", "output": "ABC\n"}, {"type": "stdin_stdout", "input": "1199", "output": "ABC"}, {"type": "s... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a rooted tree with... | [{"type": "stdin_stdout", "input": "5\n0 1 2 2\n2 4 0 1 3", "output": "5\n3\n4\n2\n2\n3\n"}, {"type": "stdin_stdout", "input": "5\n0 1 0 1\n2 4 0 1 3", "output": "5\n2\n4\n1\n3\n1\n"}, {"type": "stdin_stdout", "input": "5\n0 1 0 2\n2 4 0 1 3", "output": "5\n4\n4\n1\n3\n1\n"}, {"type": "stdin_stdout", "input": "5\n0 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\nLet us consider the following op... | [{"type": "stdin_stdout", "input": "AAAAABBBBAAABBBBAAAA\nBBBBAAABBBBBBAAAAABB\n10\n2 15 2 13\n2 13 6 16\n1 13 2 20\n4 20 3 20\n1 18 9 19\n2 14 1 11\n3 20 3 15\n6 16 1 19\n4 18 8 20\n7 20 3 14", "output": "YES\nYES\nYES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\n"}, {"type": "stdin_stdout", "input": "AAAAABBBBAAABBBBAAAA\nBBBBAAA... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 shown in the following figure... | [{"type": "stdin_stdout", "input": "2,5,3\n3,6,1\n3,4,2\n4,5,2\n3,6,3\n1,4,1", "output": "75\n5\n"}, {"type": "stdin_stdout", "input": "2,5,3\n1,6,3\n3,4,2\n4,5,2\n3,6,3\n2,4,1", "output": "73\n5\n"}, {"type": "stdin_stdout", "input": "2,5,3\n3,6,1\n2,4,2\n4,5,2\n3,6,3\n1,4,1", "output": "76\n5\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\n<image>\n\nMatryoshka is a woode... | [{"type": "stdin_stdout", "input": "6\n1 1\n1 3\n6 0\n8 6\n10 10\n14 14\n5\n2 2\n5 4\n6 6\n9 8\n15 10\n4\n1 1\n4 3\n1 5\n12 10\n3\n2 2\n7 4\n9 6\n4\n1 2\n4 3\n6 5\n14 0\n4\n10 10\n12 11\n18 15\n24 20\n0", "output": "7\n6\n7\n"}, {"type": "stdin_stdout", "input": "6\n1 1\n4 3\n6 0\n8 6\n20 10\n14 14\n5\n2 4\n5 4\n6 6\n9... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 programming contest will be he... | [{"type": "stdin_stdout", "input": "7\n-1 -1 19 1 0 4 -2", "output": "2\n"}, {"type": "stdin_stdout", "input": "7\n-1 -1 19 2 0 4 -2", "output": "2\n"}, {"type": "stdin_stdout", "input": "7\n-1 1 19 2 2 4 -1", "output": "2\n"}, {"type": "stdin_stdout", "input": "7\n-1 1 19 2 3 4 -1", "output": "3\n"}, {"type": "stdin_s... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a long-established seco... | [{"type": "stdin_stdout", "input": "7 7\n4 1\n13 2\n18 3\n64 3\n13 2\n16 10\n11 2", "output": "147\n"}, {"type": "stdin_stdout", "input": "7 7\n4 1\n13 2\n12 3\n48 3\n8 2\n16 10\n11 2", "output": "120\n"}, {"type": "stdin_stdout", "input": "7 5\n4 1\n13 3\n12 3\n48 3\n8 3\n16 10\n11 2", "output": "109\n"}, {"type": "st... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n wizards. They are nu... | [{"type": "stdin_stdout", "input": "3 11\n0\n3\n10\n0 0", "output": "1\n"}, {"type": "stdin_stdout", "input": "3 11\n0\n3\n18\n0 0", "output": "2\n"}, {"type": "stdin_stdout", "input": "3 11\n0\n3\n20\n0 0", "output": "2\n"}, {"type": "stdin_stdout", "input": "3 13\n1\n3\n10\n0 0", "output": "0\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\nExample\n\nInput\n\n201\n\n\nOut... | [{"type": "stdin_stdout", "input": "148", "output": "648\n"}, {"type": "stdin_stdout", "input": "106", "output": "605\n"}, {"type": "stdin_stdout", "input": "145", "output": "645\n"}, {"type": "stdin_stdout", "input": "225", "output": "725\n"}, {"type": "stdin_stdout", "input": "171", "output": "671\n"}, {"type": "stdi... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 want to make change for $ n ... | [{"type": "stdin_stdout", "input": "251195", "output": "10049\n"}, {"type": "stdin_stdout", "input": "467454", "output": "18702\n"}, {"type": "stdin_stdout", "input": "698278", "output": "27934\n"}, {"type": "stdin_stdout", "input": "323456", "output": "12940\n"}, {"type": "stdin_stdout", "input": "164898", "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\nLeha is playing a very interesti... | [{"type": "stdin_stdout", "input": "1\n16 -10", "output": "-326\n"}, {"type": "stdin_stdout", "input": "1\n32 -10", "output": "-662\n"}, {"type": "stdin_stdout", "input": "1\n23 -10", "output": "-473\n"}, {"type": "stdin_stdout", "input": "1\n23 -20", "output": "-923\n"}, {"type": "stdin_stdout", "input": "1\n17 -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\nYou are given n segments on a nu... | [{"type": "stdin_stdout", "input": "6\n2 4\n3 6\n2 6\n2 5\n1 4\n1 4\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "6\n2 4\n3 5\n2 5\n1 6\n2 4\n3 6\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "6\n1 5\n1 4\n1 6\n2 5\n2 6\n2 6\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "6\n6 6\n3 4\n3 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\nThe average miner Vaganych took ... | [{"type": "stdin_stdout", "input": "50\n515844718 503470143 928669067 209884122 322869098 241621928 844696197 105586164 552680307 968792756 135928721 842094825 298782438 829020472 791637138 285482545 811025527 428952878 887796419 11883658 546401594 6272027 100292274 308219869 372132044 955814846 644008184 521195760 919... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "125\n1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0\n", "output": "YES\n23\n120 1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given two n × m matrices... | [{"type": "stdin_stdout", "input": "20 1\n66723051\n192052119\n224590623\n285234278\n167627491\n337383819\n374082795\n457862809\n434684264\n480651568\n509016946\n108218500\n577998249\n647547233\n737914492\n753247062\n687137696\n799938346\n957366563\n986223900\n47472129\n101178650\n145468869\n145519928\n311820460\n20856... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 knows that if the sum o... | [{"type": "stdin_stdout", "input": "1000\n", "output": "1003\n"}, {"type": "stdin_stdout", "input": "997\n", "output": "1003\n"}, {"type": "stdin_stdout", "input": "999\n", "output": "1003\n"}, {"type": "stdin_stdout", "input": "432\n", "output": "435\n"}, {"type": "stdin_stdout", "input": "237\n", "output": "237\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\nGildong is playing a video game ... | [{"type": "stdin_stdout", "input": "1\n30 0 0\n-1 1 0 -1 1 0 0 0 0 0 0 -1 2 1 -1 -1 0 -1 0 0 0 1 1 -2 2 0 -1 2 0 -1 -2 -1 0 1 0 0 1 1 -1 1 0 0 1 1 0 0 1 0 0 0 0 1 0 -1 2 0 1 1 1 0 0 1 -1 0 1 -1 1 -1 -2 -1 0 0 0 0 -1 0 2 0 0 0 -1 -2 0 1 1 -1 1 1 0 1 -1 -1 -1 -4 -2 0 0\n", "output": "NO\n"}, {"type": "stdin_stdout", "inp... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis is the easier version of th... | [{"type": "stdin_stdout", "input": "5\n3 1 4 1 2\n15\n5 5\n5 4\n5 3\n5 2\n5 1\n4 4\n4 3\n4 2\n4 1\n3 3\n3 2\n3 1\n2 2\n2 1\n1 1\n", "output": "2\n1\n4\n1\n3\n2\n4\n1\n3\n2\n4\n3\n4\n3\n4\n"}, {"type": "stdin_stdout", "input": "5\n3 1 4 2 2\n15\n5 5\n5 4\n5 3\n5 2\n5 1\n4 4\n4 3\n4 2\n4 1\n3 3\n3 2\n3 1\n2 2\n2 1\n1 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\nThis is a hard version of the pr... | [{"type": "stdin_stdout", "input": "9\n5\n4 7 2 2 10\n5\n5 0 2 1 11\n5\n1 2 2 4 0\n2\n0 1\n3\n0 1 0\n4\n0 2 0 0\n4\n0 1 0 1\n4\n0 1 0 2\n20\n16 15 1 10 0 14 0 10 3 16 0 5 4 5 17 13 14 14 1 9\n", "output": "2\n3\n1\n0\n1\n1\n1\n1\n15\n"}, {"type": "stdin_stdout", "input": "9\n5\n4 7 2 2 10\n5\n5 0 2 1 7\n5\n1 2 2 4 0\n2... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an array a_1, a_2,... | [{"type": "stdin_stdout", "input": "4\n5 4 0\n1 5 4 3 2\n5 4 1\n1 5 7 3 2\n5 4 4\n10 20 30 40 78\n10 7 3\n4 6 12 2 9 12 14 4 10 9\n", "output": "15\n25\n178\n71\n"}, {"type": "stdin_stdout", "input": "4\n5 4 0\n1 5 4 3 2\n5 4 1\n1 5 7 3 2\n5 4 4\n10 20 30 40 50\n10 7 3\n4 6 8 2 9 12 14 4 10 9\n", "output": "15\n25\n150... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 points on a plane. T... | [{"type": "stdin_stdout", "input": "4\n7 1\n1 5 0 2 1 10 7\n1 3 6 7 2 5 4\n1 1\n1000000000\n1000001000\n5 10\n10 7 5 15 12\n38 199 192 219 1904\n10 10\n12 19 8 29 20 10 9 2 10 19\n12 4 0 17 1 15 7 18 14 3\n", "output": "4\n1\n5\n10\n"}, {"type": "stdin_stdout", "input": "4\n7 1\n1 5 0 2 1 10 7\n1 3 6 7 0 5 4\n1 1\n1000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNumbers 1, 2, 3, ... n (each int... | [{"type": "stdin_stdout", "input": "1\n275\n", "output": "2\n275 274\n275 273\n274 272\n273 271\n272 270\n271 269\n270 268\n269 267\n268 266\n267 265\n266 264\n265 263\n264 262\n263 261\n262 260\n261 259\n260 258\n259 257\n258 256\n257 255\n256 254\n255 253\n254 252\n253 251\n252 250\n251 249\n250 248\n249 247\n248 246... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGildong is playing with his dog,... | [{"type": "stdin_stdout", "input": "3\n3\n1 2\n1 3\n4\n1 2\n2 3\n3 4\n8\n1 2\n2 3\n3 4\n1 5\n5 6\n6 7\n5 8\n", "output": "\n2\n3\n3\n"}, {"type": "stdin_stdout", "input": "3\n3\n1 2\n2 3\n4\n1 2\n2 3\n3 4\n5\n1 2\n2 3\n3 4\n4 5\n3 6\n6 7\n5 13\n", "output": "2\n3\n4\n"}, {"type": "stdin_stdout", "input": "3\n3\n1 2\n2 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA palindrome is a string that re... | [{"type": "stdin_stdout", "input": "6\ncbabc\nab\nzza\nba\na\nnutforajaroftuna\n", "output": "\nYES\ncbabac\nYES\naab\nYES\nzaza\nYES\nbaa\nNO\nYES\nnutforajarofatuna\n"}, {"type": "stdin_stdout", "input": "6\ncbabc\nab\nzza\nba\na\nnutforajaroftuna\n", "output": "YES\ncbabca\nYES\naab\nYES\nzzaa\nYES\nbaa\nNO\nYES\nnu... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 widely known among some people... | [{"type": "stdin_stdout", "input": "10 10\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 1585 1564 3603 1095 1364 1029 3189 1331\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 1749\n0 3495 1540 641 1093 702 2249 983 1218 2108\n0 1397 1105 3119 1194 839 1286 2979 2941 1911\n0 1818 2264... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 expedition group flew from pl... | [{"type": "stdin_stdout", "input": "1050034174 1181487066\n", "output": "544888754\n"}, {"type": "stdin_stdout", "input": "880162386 1131317357\n", "output": "508228391\n"}, {"type": "stdin_stdout", "input": "1511923181 994962872\n", "output": "797030938\n"}, {"type": "stdin_stdout", "input": "596386879 1071021379\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 received as a gift a very cl... | [{"type": "stdin_stdout", "input": "1000 1000\n162 276\n", "output": "3351.9999999997744\n"}, {"type": "stdin_stdout", "input": "1000 1000\n153 276\n", "output": "3387.9999999997344\n"}, {"type": "stdin_stdout", "input": "1000 1000\n162 234\n", "output": "3351.999999903682\n"}, {"type": "stdin_stdout", "input": "663 90... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe polar bears are going fishin... | [{"type": "stdin_stdout", "input": "39 -1000000000 -1000000000 -999999997 -1000000000\nENEENWSWSSWESNSSEESNSESWSWNSWESNENWNWEE\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "51 -1000000000 -1000000000 -999999997 -1000000000\nENEENWSWSSWESNSSEESNSESWSWNSWESNENWNWEE\n", "output": "4\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\nValera loves to participate in c... | [{"type": "stdin_stdout", "input": "1000 1000 1 1000 1000000 1000000\n", "output": "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 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 R2 company has n employees w... | [{"type": "stdin_stdout", "input": "7 6 5\n0 1 0 1 1 1\n0 1 1 0 1 1\n1 0 1 1 1 0\n1 0 1 1 1 1\n1 1 1 1 1 0\n1 1 1 0 1 0\n1 0 1 0 0 0\n4 1\n2 6\n7 3\n7 1\n5 3\n", "output": "1 2 4 4 3 4 2 \n"}, {"type": "stdin_stdout", "input": "7 6 5\n0 1 0 1 1 1\n0 1 1 0 1 1\n1 0 1 1 1 0\n1 0 0 1 1 1\n1 1 1 1 1 0\n1 1 1 0 1 0\n1 0 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\nThe territory of Berland is repr... | [{"type": "stdin_stdout", "input": "101 100\n", "output": "0\n1 1\n2 1\n3 1\n4 1\n5 1\n6 1\n7 1\n8 1\n9 1\n10 1\n11 1\n12 1\n13 1\n14 1\n15 1\n16 1\n17 1\n18 1\n19 1\n20 1\n21 1\n22 1\n23 1\n24 1\n25 1\n26 1\n27 1\n28 1\n29 1\n30 1\n31 1\n32 1\n33 1\n34 1\n35 1\n36 1\n37 1\n38 1\n39 1\n40 1\n41 1\n42 1\n43 1\n44 1\n45 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nToastman came up with a very eas... | [{"type": "stdin_stdout", "input": "19\noxoxoxoxooxoooxxoox\nxxxxxxxxoxxoxoooooo\noxoxoxooxxxooxxxooo\nxxoxxxooxooxxxoxxox\noxoxooxxxooooxxoxox\nxxxoooxoxxoxxoxxxoo\noxooxxxoooooxxoooxo\nxxooxooxoxxoxxoxxoo\noxxxxooooxxxooooxxx\nooxooxoxxoxxoxooxoo\nxxxooooxxxooooxoxox\noooxoxooxxoxooxooxx\nxxoooxxxooooxxoooxo\nooxxxoo... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWhen Sasha was studying in the s... | [{"type": "stdin_stdout", "input": "ZUBQNDCHHKWNWRVSDSRRRTGZDDPNTVJFKTCNGWND\n", "output": "7.53208608\n"}, {"type": "stdin_stdout", "input": "DNWGNBTKNJVTNPDDZGTRRRSDSVRDFWKHHBWNQBUY\n", "output": "11.8106291\n"}, {"type": "stdin_stdout", "input": "DNWGNBTKNJVTNQDDZGTRRRSDSVRDFWKHHBWNQBUY\n", "output": "11.8106291\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\nGerald got a very curious hexago... | [{"type": "stdin_stdout", "input": "1000 1000 1000 1000 1000 1000\n", "output": "6000000\n"}, {"type": "stdin_stdout", "input": "718 466 729 470 714 481\n", "output": "2102808\n"}, {"type": "stdin_stdout", "input": "888 888 888 887 889 887\n", "output": "4729487\n"}, {"type": "stdin_stdout", "input": "677 303 685 288 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\nStudent Vladislav came to his pr... | [{"type": "stdin_stdout", "input": "10 15\n900000007 1\n900000002 1\n900000004 0\n900000002 1\n900000006 1\n900000000 1\n900000006 1\n900000008 1\n900000002 0\n1419868175 0\n900000002 0\n900000005 0\n900000001 0\n900000000 1\n900000008 1\n", "output": "1 8\n1 4\n2 5\n1 5\n1 6\n1 2\n1 7\n1 9\n2 4\n4 5\n3 4\n3 5\n2 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\nConsider the decimal presentatio... | [{"type": "stdin_stdout", "input": "1286 4\n1886373541983002858974907276497223649072414883083336663541044958378875954171855070620868427474284001\n4050983123791059817478363830631049287126338893626273758612677264947268375965600848751800494833017145\n", "output": "820371303\n"}, {"type": "stdin_stdout", "input": "516 4\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\nA tree is an undirected connecte... | [{"type": "stdin_stdout", "input": "15 1\n12 9\n13 7\n1 3\n10 4\n9 2\n2 15\n11 2\n2 14\n10 8\n6 12\n12 5\n8 7\n3 10\n10 2\n", "output": "336\n"}, {"type": "stdin_stdout", "input": "15 1\n12 9\n13 7\n1 3\n10 4\n9 2\n2 15\n11 4\n2 14\n10 8\n6 7\n12 5\n8 7\n3 10\n10 2\n", "output": "346\n"}, {"type": "stdin_stdout", "inpu... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSagheer is walking in the street... | [{"type": "stdin_stdout", "input": "1 0 0 1\n0 0 0 0\n0 0 -1 0\n0 -1 0 0\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "0 1 0 0\n0 0 0 -1\n0 0 0 1\n0 0 0 0\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1 1 0 1\n0 -1 0 0\n0 0 0 0\n0 0 0 0\n", "output": "YES\n"}, {"type": "stdin_stdout", "input":... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are times you recall a goo... | [{"type": "stdin_stdout", "input": "100 7\n0 1 1 1 0 5 6 6 8 8 9 11 12 11 8 0 0 14 6 16 7 21 15 23 15 24 0 0 0 28 0 29 26 27 19 1 0 21 37 32 40 30 37 34 39 38 34 38 0 0 41 24 45 47 0 33 46 26 31 0 21 57 57 18 63 63 20 59 65 56 68 0 30 55 55 0 70 43 59 49 59 79 66 74 0 11 65 0 80 63 0 84 73 49 73 81 0 86 76 20\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\nFor long time scientists study t... | [{"type": "stdin_stdout", "input": "127\n64 96 63 112 62 95 61 120 60 94 59 111 58 93 57 124 56 92 55 110 54 91 53 119 52 90 51 109 50 89 49 126 48 88 47 108 46 87 45 118 44 86 43 107 42 85 41 123 40 84 39 106 38 83 37 117 36 82 35 105 34 81 33 127 32 80 31 104 30 79 29 116 28 78 27 103 26 77 25 122 24 76 23 102 22 75 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 n by m grid. Each gr... | [{"type": "stdin_stdout", "input": "7 6\n69643 55071 5858 44695 62932 3239\n7289 67064 13616 56175 35174 13049\n90224 32314 88004 72464 30985 93260\n85104 29513 58719 49870 40702 91003\n23897 37609 51811 98033 32514 16572\n37067 55914 52235 67308 64574 59347\n80215 47399 10799 60300 99056 45747\n24554 43574 21601 81404... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nQuan_Lank loves awsome numbers. ... | [{"type": "stdin_stdout", "input": "34\n40047\n7747774\n1000000000000000000\n7\n4\n474404774\n4744000695826\n10000000004744744\n446486416781684178\n999999999\n7777\n87414417444\n111222333444555667\n1\n4700\n3794555488744477\n444444444444444444\n474447447774444774\n777777777777777\n34777745021000000\n963\n85547444885478... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 enthusiastically partici... | [{"type": "stdin_stdout", "input": "-1 -13 1 101101000\n\nS@FPLO", "output": "2022016341\n"}, {"type": "stdin_stdout", "input": "9 -1 -1 100000000\n\nNLPEAS", "output": "2000011459\n"}, {"type": "stdin_stdout", "input": "11 -1 0 100001000\n\nNLPEAS", "output": "2000034340\n"}, {"type": "stdin_stdout", "input": "11 -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\nYou are given a grid of N rows a... | [{"type": "stdin_stdout", "input": "7 0\n$/.\n.#-\n.//", "output": "0\n$/.\n.#-\n.//\n\n\n\n\n"}, {"type": "stdin_stdout", "input": "7 0\n$/.\n-#.\n.//", "output": "0\n$/.\n-#.\n.//\n\n\n\n\n"}, {"type": "stdin_stdout", "input": "7 0\n$//\n-#.\n.//", "output": "0\n$//\n-#.\n.//\n\n\n\n\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\nThere is a game that involves th... | [{"type": "stdin_stdout", "input": "8 14 18 1\nAC\nBC\nAB\nBC\nAC\nBC\nAB\nAB", "output": "Yes\nC\nC\nA\nC\nC\nC\nA\nB\n"}, {"type": "stdin_stdout", "input": "8 15 10 1\nAC\nBC\nAB\nBC\nAC\nBC\nAB\nAB", "output": "Yes\nC\nC\nB\nC\nC\nC\nB\nB\n"}, {"type": "stdin_stdout", "input": "8 14 18 1\nAC\nBC\nAB\nBC\nBC\nBC\nAB\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 come to a party as... | [{"type": "stdin_stdout", "input": "9 73\n67597 102019 5828 66249 138664 64141 11513 192153 16076", "output": "11787970\n"}, {"type": "stdin_stdout", "input": "9 73\n67597 52981 5828 66249 138664 64141 11513 192153 16076", "output": "10905286\n"}, {"type": "stdin_stdout", "input": "9 73\n67597 52981 5828 66249 138664 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\nWe have two distinct integers A ... | [{"type": "stdin_stdout", "input": "2563528379 13118121", "output": "1288323250\n"}, {"type": "stdin_stdout", "input": "899758294 99824435", "output": "IMPOSSIBLE\n"}, {"type": "stdin_stdout", "input": "1349313191 99824435", "output": "724568813\n"}, {"type": "stdin_stdout", "input": "2563528379 6197513", "output": "12... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Mr. X is away from home, he... | [{"type": "stdin_stdout", "input": "5 9\n25 8\n5 9\n4 10\n0000 1000\n6 1", "output": "5\n"}, {"type": "stdin_stdout", "input": "4 -1\n-1 0101\n-1 6\n1 1010\n-1 -2", "output": "-1\n"}, {"type": "stdin_stdout", "input": "5 9\n25 8\n5 9\n4 10\n0100 1000\n6 1", "output": "5\n"}, {"type": "stdin_stdout", "input": "-2 -4\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\nYou are given a grid with 2 rows... | [{"type": "stdin_stdout", "input": "spp\npps", "output": "YES\n"}, {"type": "stdin_stdout", "input": "pot\ntop", "output": "YES"}, {"type": "stdin_stdout", "input": "tbb\nbet", "output": "NO\n"}, {"type": "stdin_stdout", "input": "eye\nele", "output": "NO\n"}, {"type": "stdin_stdout", "input": "pos\ntop", "output": "NO... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKenus, the organizer of Internat... | [{"type": "stdin_stdout", "input": "10\n1 1\n2 2\n6 1100000000000000000\n9 3\n1 185979974422876752\n23847657 23458792534\n111111101 001111111\n5 14\n4 19\n9 10", "output": "1 1 1 4 4 460000013 3 2 1 121016941 35 37447 29 132 4 2 3 9 4 2 "}, {"type": "stdin_stdout", "input": "10\n1 1\n2 2\n6 1100000000000000000\n9 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\nOn the xy-plane, Snuke is going ... | [{"type": "stdin_stdout", "input": "12 -2 -11 0\n1\n-1 -14 2\n4 -1 -2\n-2 9 1", "output": "23.0867927612\n"}, {"type": "stdin_stdout", "input": "24 -2 -11 -1\n1\n-1 -7 2\n4 -1 -2\n-2 9 1", "output": "33.1570013577\n"}, {"type": "stdin_stdout", "input": "12 -2 -11 0\n1\n-1 -7 2\n4 -1 -2\n-2 9 1", "output": "22.134943892... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSig has built his own keyboard. ... | [{"type": "stdin_stdout", "input": "B010", "output": "010\n"}, {"type": "stdin_stdout", "input": "B110", "output": "110\n"}, {"type": "stdin_stdout", "input": "B011", "output": "011\n"}, {"type": "stdin_stdout", "input": "B101", "output": "101\n"}, {"type": "stdin_stdout", "input": "B111", "output": "111\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 is a rectangular maze with... | [{"type": "stdin_stdout", "input": "5 5\n.X.S.\n.X#..\n.XX##\n.#XG.\n..X..\n7 3\nSXX.XXG\nX.#.#X.\nXXX.XX#\n4 4\nS...\nX.X.\nGX..\n...X\n10 10\n..XXXXX.XX\n.X.#.#X.XX\nSX.#X.X..X\n#X.##.X.XX\n..XXXX#.XX\n##.##.##XX\n....X.YX#X\n.##X..#X#X\n....XX#..X\n...#XXG..X\n0 0", "output": "11\n10\n10\n33\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\nI have a plan to go on a school ... | [{"type": "stdin_stdout", "input": "4 6\n0 0 1 0 1 1\n2 2 0 1 0 0\n1 1 2 0 2 1\n1 0 1 -1 1 0\n4 6\n1 0 1 0 1 1\n0 1 -1 2 -1 0\n1 1 1 0 -1 0\n1 0 1 0 1 0\n0 0", "output": "1 3 5 2 6 4\n1 2 3 4 6 5\n"}, {"type": "stdin_stdout", "input": "4 6\n1 0 1 0 1 1\n2 2 0 1 0 0\n1 1 2 0 2 1\n1 0 1 -1 0 0\n4 6\n1 0 1 0 1 1\n0 1 -1 2... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nICPC Ranking\n\nYour mission in ... | [{"type": "stdin_stdout", "input": "300 19 8 5\n50 5 2 1\n70 5 2 0\n75 1 1 0\n100 3 1 0\n150 2 2 0\n240 5 5 7\n50 1 1 0\n60 2 2 0\n41 2 3 0\n90 1 3 0\n120 3 5 0\n196 4 1 0\n150 2 4 1\n180 3 5 4\n15 2 2 1\n20 2 2 1\n25 2 2 0\n60 1 1 0\n120 5 5 4\n15 5 4 1\n20 5 4 0\n40 1 1 0\n40 2 2 0\n120 2 3 4\n30 1 1 0\n40 2 1 0\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\nRecent improvements in informati... | [{"type": "stdin_stdout", "input": "3\nFUKUOKA\nOKAYAMA\nIGCUGAMAY\n3\nFUKUOKA\nFUYUKAMA\nOKAYAMA\n2\nBBCDE\nDDCDA\n4\nG@\nDEFG\nDDDE\nABCD\n2\nABCDE\nC\n14\nAAAAA\nBBBBB\nCCCCB\nDDDDD\nEEEED\nFFFFF\nGGGGG\nHHGHH\nIIIHI\nJJJJJ\nKKLKK\nLLLLL\nMMMMM\nNNNNN\n0", "output": "20\n19\n10\n10\n5\n68\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\nProblem statement\n\nReal variab... | [{"type": "stdin_stdout", "input": "2 1\n-1 0\n3 10", "output": "6.66666666667\n"}, {"type": "stdin_stdout", "input": "2 1\n-1 -3\n3 10", "output": "3.666667"}, {"type": "stdin_stdout", "input": "1 1\n3 2", "output": "0.666666666667\n"}, {"type": "stdin_stdout", "input": "1 2\n6 1", "output": "0.333333333333\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\nProblem Statement\n\nMr. Takatsu... | [{"type": "stdin_stdout", "input": "6\nZI?U -1\nLINFR 14\nKNGE -1\nLCL -1\n@S 2\nKFHD 15\nBSKA\nILIC\nPZRH\nEDLU\n1", "output": "0\n"}, {"type": "stdin_stdout", "input": "6\n[I?U -1\nLINFR 14\nKNGE -1\nLCL -1\n@S 2\nKFHD 15\nBSKA\nILIC\nPZRH\nEDLU\n1", "output": "0\n"}, {"type": "stdin_stdout", "input": "6\n[I?U -1\nRF... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nE: Jam\n\nproblem\n\nThere are N... | [{"type": "stdin_stdout", "input": "4 4 3\n3 12 1 6\n1 1 2 3\n10 1 9 5\n1 2 1\n2 3 1\n1 3 1\n1 4 1", "output": "20\n18\n13\n"}, {"type": "stdin_stdout", "input": "4 4 3\n3 12 1 6\n1 1 2 3\n10 1 9 5\n1 2 0\n2 3 1\n1 3 1\n1 4 1", "output": "22\n19\n15\n"}, {"type": "stdin_stdout", "input": "4 4 3\n3 12 1 6\n1 1 2 3\n10 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\nOranges on Cans\n\nsquare1001 Yo... | [{"type": "stdin_stdout", "input": "-17 16", "output": "-272\n"}, {"type": "stdin_stdout", "input": "-17 30", "output": "-510\n"}, {"type": "stdin_stdout", "input": "-17 44", "output": "-748\n"}, {"type": "stdin_stdout", "input": "-2 125", "output": "-250\n"}, {"type": "stdin_stdout", "input": "-1 111", "output": "-111... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 manipulate... | [{"type": "stdin_stdout", "input": "6 17\n0 0 6 1\n0 2 4 -2\n1 0 5\n1 0 2\n0 3 5 3\n1 3 4\n1 0 5", "output": "-1\n-1\n2\n-1\n-1\n-1\n-1\n-1\n-1\n-1\n-1\n-1\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "6 17\n0 0 6 1\n0 2 4 -2\n1 0 5\n1 0 1\n0 3 5 3\n1 3 4\n1 0 5", "output": "-1\n1\n2\n-1\n-1\n-1\n-1\n-1\n-1\n-1\n-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\nAfter a long and successful day ... | [{"type": "stdin_stdout", "input": "3\n17 3\n2 6 1\n6 2\n1 4\n8 2\n6 8", "output": "3 5 8 10 12 14 16\n4 7 9 11 13 15 17\n2 5\n3 6\n1 3 5\n2 4 7\n"}, {"type": "stdin_stdout", "input": "3\n17 3\n2 12 1\n6 2\n1 4\n8 2\n6 8", "output": "3 5 7 9 11 14 16\n4 6 8 10 13 15 17\n2 5\n3 6\n1 3 5\n2 4 7\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\nWrite a program to find the rema... | [{"type": "stdin_stdout", "input": "3 \n1 4\n111 1167\n12 36", "output": "1\n111\n12\n"}, {"type": "stdin_stdout", "input": "3 \n1 4\n111 1167\n20 36", "output": "1\n111\n20\n"}, {"type": "stdin_stdout", "input": "3 \n2 4\n111 1167\n20 65", "output": "2\n111\n20\n"}, {"type": "stdin_stdout", "input": "3 \n1 2\n100 200\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn this problem, you will be giv... | [{"type": "stdin_stdout", "input": "2\n1\n1 4\n3\n1 3\n3 2\n3 -4", "output": "4x^3\n3x^2 + 6x^1 + -12x^-5\n"}, {"type": "stdin_stdout", "input": "2\n1\n1 8\n3\n1 3\n3 2\n3 -4", "output": "8x^7\n3x^2 + 6x^1 + -12x^-5\n"}, {"type": "stdin_stdout", "input": "2\n1\n1 4\n3\n4 3\n3 2\n3 -1", "output": "4x^3\n12x^2 + 6x^1 + -... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlice and Bob are playing chess ... | [{"type": "stdin_stdout", "input": "1000\n114 372\n112 350\n113 352\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1000\n500 500\n498 504\n498 505\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1000\n114 350\n113 372\n113 352\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "1000\n600 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\nThe only difference between easy... | [{"type": "stdin_stdout", "input": "25 4 15\n172043124 384297369 650214870 426077944 587045971 576701397 865475689 261462255 763837593 285228401 629011531 611623799 456424430 820020943 166915939 903479811 357808031 561107351 177427070 14589838 994169358 1227795556 193684940 439658261 237500762\n", "output": "1051264450... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 frog is initially at position ... | [{"type": "stdin_stdout", "input": "997674659 11231 35496\n", "output": "497677363010575988\n"}, {"type": "stdin_stdout", "input": "881706694 5710 46369\n", "output": "388703347089502553\n"}, {"type": "stdin_stdout", "input": "952549276 31416 33000\n", "output": "1718466614644254\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 only difference between easy... | [{"type": "stdin_stdout", "input": "0111001100111111101000\n", "output": "0011001100000011101000\n"}, {"type": "stdin_stdout", "input": "0111011100111111101000\n", "output": "0001001100000011101000\n"}, {"type": "stdin_stdout", "input": "0111011100111101101000\n", "output": "0001001100001101101000\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 may have already known that ... | [{"type": "stdin_stdout", "input": "6\n0 1 1\n0 24 -1\n0 0 1\n0 0 2\n17 1 10\n4 4 1\n", "output": "0\n0\n0\n0\n1\n3\n"}, {"type": "stdin_stdout", "input": "6\n0 1 1\n0 24 -1\n0 0 1\n0 0 2\n17 1 10\n4 4 0\n", "output": "0\n0\n0\n0\n1\n2\n"}, {"type": "stdin_stdout", "input": "6\n0 1 2\n0 28 -1\n0 0 1\n0 0 4\n17 1 10\n4 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 in this world... | [{"type": "stdin_stdout", "input": "12 20\n1 3 1000000000\n3 2 1000000000\n1 4 1000000000\n4 2 1000000000\n1 5 1000000000\n5 2 1000000000\n1 6 1000000010\n6 2 1000000000\n1 7 1000000000\n7 2 1000000000\n1 8 1000000000\n8 4 1000000000\n1 9 1000000000\n9 2 1000000000\n1 10 1000000000\n10 2 1000000000\n1 11 1000000000\n11... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n There was once young lass ca... | [{"type": "stdin_stdout", "input": "502\n", "output": "2251\n"}, {"type": "stdin_stdout", "input": "202\n", "output": "2101\n"}, {"type": "stdin_stdout", "input": "446\n", "output": "2223\n"}, {"type": "stdin_stdout", "input": "949\n", "output": "1373\n"}, {"type": "stdin_stdout", "input": "718\n", "output": "2359\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 competitive eater, Alice is sc... | [{"type": "stdin_stdout", "input": "5\n5 4\n2 4\n5 1\n13 9\n1010000 14106652\n", "output": "10\n2\n1\n45\n510049495001\n"}, {"type": "stdin_stdout", "input": "5\n6 4\n3 2\n3 1\n13 7\n1010000 14106652\n", "output": "10\n3\n1\n28\n510049495001\n"}, {"type": "stdin_stdout", "input": "5\n5 4\n2 4\n5 1\n13 9\n1010000 129640... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.