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\nD: The Diversity of Prime Factor...
[{"type": "stdin_stdout", "input": "3\n2 3 11", "output": "3\n"}, {"type": "stdin_stdout", "input": "3\n2 2 11", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\n2 2 13", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\n2 3 17", "output": "3\n"}, {"type": "stdin_stdout", "input": "3\n2 2 15", "output": "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\nA prime number is a natural numb...
[{"type": "stdin_stdout", "input": "11\n13\n20\n9\n10\n11\n13\n33\n14\n16\n12\n17", "output": "4\n"}, {"type": "stdin_stdout", "input": "11\n25\n20\n9\n10\n11\n13\n33\n14\n16\n12\n17", "output": "3\n"}, {"type": "stdin_stdout", "input": "11\n7\n10\n9\n10\n11\n13\n17\n14\n15\n16\n17", "output": "5\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\nDraw a chessboard which has a he...
[{"type": "stdin_stdout", "input": "11 21\n10 0\n5 0\n2 4\n2 0\n0 0", "output": "#.#.#.#.#.#.#.#.#.#.#\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\nVasya has a sequence a consistin...
[{"type": "stdin_stdout", "input": "5\n1000000000000000000 352839520853234088 175235832528365792 753467583475385837 895062156280564685\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "4\n1 2 1 16\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "3\n10 7 14\n", "output": "2\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\nYou are playing a strange game w...
[{"type": "stdin_stdout", "input": "2\n6\n5 3 2 4 1 6\n1 2\n1 3\n1 4\n4 5\n4 6\n4\n1 3 4 5\n3\n3 5 2\n6\n5 3 2 4 1 6\n1 2\n1 3\n1 4\n4 5\n4 6\n3\n1 2 3\n3\n4 1 6\n", "output": "B 4\nA 4\nC -1\nB 2\nC 1\n"}, {"type": "stdin_stdout", "input": "2\n6\n5 3 2 8 1 6\n1 2\n1 3\n1 4\n4 5\n4 6\n4\n1 3 4 5\n3\n3 5 2\n6\n5 3 2 4 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\nHasan loves playing games and ha...
[{"type": "stdin_stdout", "input": "93 2364 1182\n", "output": "952630216\n"}, {"type": "stdin_stdout", "input": "83 2813 123\n", "output": "758958584\n"}, {"type": "stdin_stdout", "input": "100 5000 30\n", "output": "860412292\n"}, {"type": "stdin_stdout", "input": "45 2315 860\n", "output": "256332294\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\nPolycarp has an array a consisti...
[{"type": "stdin_stdout", "input": "2\n1000000 1000000\n", "output": "1000000\n"}, {"type": "stdin_stdout", "input": "2\n1000010 1001000\n", "output": "1000010\n"}, {"type": "stdin_stdout", "input": "2\n1000110 1001000\n", "output": "1000110\n"}, {"type": "stdin_stdout", "input": "2\n1000110 1000000\n", "output": "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\nYou are given a huge decimal num...
[{"type": "stdin_stdout", "input": "213 5 3\n111001111110111001101011111100010010011001000001111010110110011000100000101010111110010001111110001010011001101000000011111110101001101100100100110100000111111100010100011010010001011100111011000001110000111000101\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "213 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 string s β€” a sequence...
[{"type": "stdin_stdout", "input": "3\nDSAWWAW\nD\nWA\n", "output": "8\n2\n4\n"}, {"type": "stdin_stdout", "input": "3\nDSAWWAW\nD\nAW\n", "output": "8\n2\n4\n"}, {"type": "stdin_stdout", "input": "3\nWSAWDAW\nD\nAW\n", "output": "4\n2\n4\n"}, {"type": "stdin_stdout", "input": "3\nDAAWWSW\nD\nAW\n", "output": "6\n2\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\nThe football season has just end...
[{"type": "stdin_stdout", "input": "1000000000000 68088352351238212 100000 99999\n", "output": "680883461725 61788 319116476487\n"}, {"type": "stdin_stdout", "input": "1108577267933 48182461851369906 125899 19927\n", "output": "382707249106 95156 725869923671\n"}, {"type": "stdin_stdout", "input": "1252579684821 112616...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSo the Beautiful Regional Contes...
[{"type": "stdin_stdout", "input": "5\n12\n5 4 4 3 2 2 1 1 1 1 1 1\n4\n4 3 2 2\n1\n1000100\n20\n20 19 18 17 16 15 14 13 15 11 10 9 8 7 6 5 4 3 2 1\n32\n125 64 63 58 58 58 58 58 37 37 37 37 34 34 28 28 28 28 28 28 24 24 19 17 17 17 17 16 16 16 16 11\n", "output": "1 2 3\n0 0 0\n0 0 0\n1 2 7\n1 2 11\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\nToday, Osama gave Fadi an intege...
[{"type": "stdin_stdout", "input": "1000000000000\n", "output": "4096 244140625\n"}, {"type": "stdin_stdout", "input": "1000000010000\n", "output": "170000 5882353\n"}, {"type": "stdin_stdout", "input": "205078485761\n", "output": "185921 1103041\n"}, {"type": "stdin_stdout", "input": "873109054817\n", "output": "14596...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 was hiking a mountain, w...
[{"type": "stdin_stdout", "input": "14\n4 9\n3 7\n4 1\n3 2\n14 9\n7 6\n10 13\n8 7\n5 7\n7 10\n1 3\n12 3\n7 11\n20\n13 6 14 9 1\n6 4 3 7 9\n9 3 6 13 7\n6 11 11 5 9\n14 5 2 3 4\n13 12 4 2 7\n13 14 7 3 2\n9 5 13 13 6\n8 9 7 3 7\n14 10 11 12 7\n6 12 13 1 1\n8 13 8 10 8\n1 5 13 10 7\n1 4 13 2 6\n1 5 6 4 10\n6 9 11 8 5\n9 7 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLee tried so hard to make a good...
[{"type": "stdin_stdout", "input": "7\n2\n2\n6\n8\n5\n110\n1478999\n", "output": "0\n0\n24\n96\n12\n782548134\n793574295\n"}, {"type": "stdin_stdout", "input": "7\n3\n2\n5\n8\n5\n101\n2000000\n", "output": "4\n0\n12\n96\n12\n981997171\n804665184\n"}, {"type": "stdin_stdout", "input": "3\n1234567\n1268501\n1268499\n", "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA permutation of length n is an ...
[{"type": "stdin_stdout", "input": "583291\n", "output": "135712853\n"}, {"type": "stdin_stdout", "input": "652615\n", "output": "960319213\n"}, {"type": "stdin_stdout", "input": "482331\n", "output": "722928541\n"}, {"type": "stdin_stdout", "input": "336161\n", "output": "234634596\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\nConsider an infinite triangle ma...
[{"type": "stdin_stdout", "input": "4\n3\n1 4 2\n1 3 1\n2\n2 4\n2 3\n2\n1 1000000000\n1 1000000000\n4\n3 10 5 8\n2 5 2 4\n", "output": "\n0\n1\n999999999\n2\n"}, {"type": "stdin_stdout", "input": "4\n3\n1 10 2\n1 3 1\n2\n4 7\n2 2\n2\n1 1000000000\n1 1000000000\n4\n3 18 5 8\n2 4 2 4\n", "output": "3\n2\n999999999\n7\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\nOne day Polycarpus stopped by a ...
[{"type": "stdin_stdout", "input": "21 21\n42856481 2\n562905883 2\n942536731 2\n206667673 2\n451074408 2\n27 1\n29 1\n172761267 2\n23 1\n24 1\n106235116 2\n126463249 2\n29 1\n9 1\n83859496 2\n5 1\n25 1\n337838080 2\n109402491 2\n5 1\n24 1\n", "output": "3142600975.0\n1 13\n1 7\n1 6\n1 17\n1 21\n1 10\n1 9\n1 14\n1 20\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\nEverything got unclear to us in ...
[{"type": "stdin_stdout", "input": "abbabaaabaaabbbbabbbbbababababaaaabbabbbbabbbbbabbbbababbaaaaabbbabbbbabbbbbbabaabababaabbbabababbaz\nabaaabaabbbbaabbbbaabababbaabaabababbbaabbbaaabbabbabbbbbbbbaabbbbbabababbbbaaabaaaabbbbbbbbabababba\n", "output": "abaaabaabbbbaabbbbaabababbaabaabababbbaabbbaaabbabbabbbbbbbbaabbbb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTwo players play the following g...
[{"type": "stdin_stdout", "input": "5 5 46\n3 5 3 1\n2 1 2 0\n1 2 1 0\n4 1 0 1\n4 3 4 1\n0 4 5 4\n3 0 3 4\n3 2 0 2\n4 5 4 3\n4 1 3 1\n1 4 1 1\n1 1 2 1\n3 2 1 2\n3 2 3 4\n2 0 2 2\n1 0 1 2\n1 1 4 1\n0 4 3 4\n3 0 3 3\n3 1 3 4\n5 1 3 1\n3 0 3 5\n4 1 1 1\n2 5 2 3\n4 2 4 1\n1 3 1 5\n1 2 1 4\n4 2 4 1\n3 2 3 0\n0 4 3 4\n1 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\nTwo little greedy bears have fou...
[{"type": "stdin_stdout", "input": "1488496828 607500000\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "1183431925 540244525\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "1270836736 387420489\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "509607936 306110016\n", "output": "24\n"}, {"ty...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA monster is attacking the Cyber...
[{"type": "stdin_stdout", "input": "100 100 100\n100 100 100\n100 100 100\n", "output": "100"}, {"type": "stdin_stdout", "input": "50 100 51\n100 100 100\n1 100 100\n", "output": "1384"}, {"type": "stdin_stdout", "input": "100 100 1\n100 100 100\n1 100 100\n", "output": "1891"}, {"type": "stdin_stdout", "input": "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\nToday on a lecture about strings...
[{"type": "stdin_stdout", "input": "yhwepqwyhwepqwyhwepqweahnqtueahnqtueahnqtuyhwepqwyhwepqwyhwepqwyhwepqweahnqtueahnqtuyhwepqweahnqtueahnqtueahnqtueahnqtueahnqtueahnqtu\neahnqtueahnqtueahnqtuyhwepqweahnqtuyhwepqwyhwepqweahnqtuyhwepqweahnqtuyhwepqweahnqtueahnqtuyhwepqweahnqtueahnqtuyhwepqwyhwepqwyhwepqw\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\nIn the game Lizard Era: Beginnin...
[{"type": "stdin_stdout", "input": "25\n26668 10412 12658\n25216 11939 10247\n28514 22515 5833\n4955 19029 22405\n12552 6903 19634\n12315 1671 505\n20848 9175 6060\n12990 5827 16433\n9184 30621 25596\n31818 7826 11221\n18090 4476 30078\n30915 11014 16950\n3119 29529 21390\n775 4290 11723\n29679 14840 3566\n4491 29480 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\nEmily's birthday is next week an...
[{"type": "stdin_stdout", "input": "100 10\n7 4 5 5 10 10 5 8 5 7 4 5 4 6 8 8 2 6 3 3 10 7 10 8 6 2 7 3 9 7 7 2 4 5 2 4 9 5 10 1 10 3 10 4 1 3 4 2 6 9 9 10 10 6 2 5 6 1 9 10 4 10 3 4 10 5 5 4 10 4 5 3 7 10 2 7 3 6 9 6 1 6 5 2 4 6 6 4 4 1 5 1 6 6 6 8 8 6 2 6\n", "output": "4433\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\nThe HR manager was disappointed ...
[{"type": "stdin_stdout", "input": "2000000000000000000\n", "output": "25\n"}, {"type": "stdin_stdout", "input": "1000000000000000000\n", "output": "25\n"}, {"type": "stdin_stdout", "input": "1000001000000000000\n", "output": "25\n"}, {"type": "stdin_stdout", "input": "1440563777463828705\n", "output": "25\n"}, {"type"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a complete undirec...
[{"type": "stdin_stdout", "input": "10\n0 1 100 100 100 100 100 100 100 100\n1 0 1 100 100 100 100 100 100 100\n100 1 0 1 100 100 100 100 100 100\n100 100 1 0 1 100 100 100 100 100\n100 100 100 1 1 1 100 100 100 100\n100 100 100 100 1 0 1 100 100 100\n100 100 100 100 100 1 0 1 100 100\n100 100 100 100 100 100 1 0 1 100...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a functional graph...
[{"type": "stdin_stdout", "input": "20 10\n13 10 5 6 18 5 12 13 15 1 10 3 9 16 7 9 7 11 9 13\n2634 7980 171 3503 6601 9378 4618 8243 9343 1979 4172 7441 9722 9863 6041 4790 1737 7586 6461 228\n", "output": " 62163 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\nA substring of some string is ca...
[{"type": "stdin_stdout", "input": "76\namnctposz\nmnctpos\nos\nu\ne\nam\namnc\neamnctpo\nl\nx\nq\nposzq\neamnc\nctposzq\nctpos\nmnc\ntpos\namnctposzql\ntposzq\nmnctposz\nnctpos\nctposzql\namnctpos\nmnct\np\nux\nposzql\ntpo\nmnctposzql\nmnctp\neamnctpos\namnct\ntposzql\nposz\nz\nct\namnctpo\noszq\neamnct\ntposz\ns\nmn\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 points on...
[{"type": "stdin_stdout", "input": "bbbbbbbbaaaaaaaaaaaccccccaaaaaaaaaaaaaaccccccccaaaaaaaaabbbbbbccbbbaaaaaabccccccaaaacaaacccccccccccb\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbaaaaaaaaaaabbbbbbbbaaaaaaaaabbbbbaaaaaaaaaaabbbbbbaaabbbbaaabbbbbbaaa\n", "output": "12\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\nTwo friends are on the coordinat...
[{"type": "stdin_stdout", "input": "967\n102\n", "output": "187489\n"}, {"type": "stdin_stdout", "input": "967\n142\n", "output": "170569\n"}, {"type": "stdin_stdout", "input": "967\n282\n", "output": "117649\n"}, {"type": "stdin_stdout", "input": "944\n193\n", "output": "141376\n"}, {"type": "stdin_stdout", "input": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a chessboard of si...
[{"type": "stdin_stdout", "input": "100\n93 54 57 61 68 66 70 96 64 82 80 75 69 77 76 94 67 86 90 73 74 58 100 83 92 89 56 99 88 59 95 72 81 51 85 71 97 60 91 63 65 98 79 84 53 62 87 55 52 78\n", "output": "1225\n"}, {"type": "stdin_stdout", "input": "100\n42 54 57 61 68 66 70 96 64 82 80 75 69 77 76 94 67 86 90 73 74 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nChandan gave his son a cube wit...
[{"type": "stdin_stdout", "input": "100\n1\n309579963\n243055591\n5088942\n67447030\n103253146\n273252973\n650883927\n441154465\n321589935\n8534862\n78034215\n507899336\n10234960\n546375125\n406736745\n11895840\n13562012\n476857905\n14375130\n132265502\n34023480\n244909071\n48571656\n125529908\n3548150\n409554603\n1131...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLeonard has decided to quit livi...
[{"type": "stdin_stdout", "input": "1\n3 2\n1 -1\n2 -1\n0 1\n\nSAMPLE", "output": "2\n"}, {"type": "stdin_stdout", "input": "1\n2 3\n0 0\n2 -1\n0 1\n\nSANPLE", "output": "1\n"}, {"type": "stdin_stdout", "input": "1\n3 2\n1 2\n2 -1\n1 1\n\nSAMPLE", "output": "2\n"}, {"type": "stdin_stdout", "input": "1\n3 2\n1 0\n2 -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\nYou are given a square matrix of...
[{"type": "stdin_stdout", "input": "1\n7\n.......\n.*.....\n.......\n.......\n.......\n.......\n.......\n\nSAMPLE", "output": "4\n"}, {"type": "stdin_stdout", "input": "1\n7\n.......\n.*.....\n.......\n.......\n.......\n.......\n.......\n\nSAMQLE", "output": "4\n"}, {"type": "stdin_stdout", "input": "1\n5\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\nWe have N integers. The i-th num...
[{"type": "stdin_stdout", "input": "3\n17 10 15", "output": "setwise coprime\n"}, {"type": "stdin_stdout", "input": "3\n26 10 15", "output": "setwise coprime\n"}, {"type": "stdin_stdout", "input": "3\n7 10 31", "output": "pairwise coprime\n"}, {"type": "stdin_stdout", "input": "3\n7 19 4", "output": "pairwise coprime\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\nPrint the circumference of a cir...
[{"type": "stdin_stdout", "input": "73", "output": "458.67252742410977361942"}, {"type": "stdin_stdout", "input": "1", "output": "6.28318530717958623200"}, {"type": "stdin_stdout", "input": "-105", "output": "-659.734457254\n"}, {"type": "stdin_stdout", "input": "-143", "output": "-898.495498927\n"}, {"type": "stdin_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\nWe have a tree with N vertices. ...
[{"type": "stdin_stdout", "input": "9 6 1\n1 2\n2 3\n3 4\n4 5\n5 6\n4 7\n4 8\n8 9", "output": "4\n"}, {"type": "stdin_stdout", "input": "9 6 1\n1 2\n2 4\n3 4\n4 5\n5 6\n4 7\n4 8\n8 9", "output": "3\n"}, {"type": "stdin_stdout", "input": "9 6 1\n1 2\n2 3\n3 6\n4 5\n7 6\n4 7\n4 7\n8 9", "output": "5\n"}, {"type": "stdin_...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a sequence of leng...
[{"type": "stdin_stdout", "input": "3\n-1\n0\n13", "output": "13\n13\n0\n"}, {"type": "stdin_stdout", "input": "3\n-2\n0\n16", "output": "16\n16\n0\n"}, {"type": "stdin_stdout", "input": "3\n0\n1\n13", "output": "13\n13\n1\n"}, {"type": "stdin_stdout", "input": "3\n0\n1\n12", "output": "12\n12\n1\n"}, {"type": "stdin_s...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N cubes stacked vertic...
[{"type": "stdin_stdout", "input": "11011010001001", "output": "14\n"}, {"type": "stdin_stdout", "input": "11001010001001", "output": "12\n"}, {"type": "stdin_stdout", "input": "11001000001001", "output": "10\n"}, {"type": "stdin_stdout", "input": "11001000101001", "output": "12\n"}, {"type": "stdin_stdout", "input": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAn elementary school student Tak...
[{"type": "stdin_stdout", "input": "1977 001 1111", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1977 011 1111", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1977 011 1110", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1977 011 0110", "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\nTakahashi is locked within a bui...
[{"type": "stdin_stdout", "input": "11 12 2\n\n\n#$...\nS###\n##.#.\n.###", "output": "1\n"}, {"type": "stdin_stdout", "input": "11 12 2\n\n\n#$...\nS###\n##.#.\n.\"##", "output": "1\n"}, {"type": "stdin_stdout", "input": "11 12 2\n\n\n#$...\nS###\n.#.##\n.\"##", "output": "1\n"}, {"type": "stdin_stdout", "input": "7 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 string S consist...
[{"type": "stdin_stdout", "input": "qbdp", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "dqpb", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "dpqb", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "bpqd", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "bqpd", "output": "Yes\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\nSnuke is conducting an optical e...
[{"type": "stdin_stdout", "input": "1435 1", "output": "4302\n"}, {"type": "stdin_stdout", "input": "1556 2", "output": "4662\n"}, {"type": "stdin_stdout", "input": "457 3", "output": "1368\n"}, {"type": "stdin_stdout", "input": "371 4", "output": "1110\n"}, {"type": "stdin_stdout", "input": "702 4", "output": "2100\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\nOne day, Taro received a strange...
[{"type": "stdin_stdout", "input": "341143514535\n158\n143565553551655311343411652235654535651124615163\n551544654451431564\n4\n3411\n6363636363\n153414", "output": "naruto\nNA\ndo you wanna go to aizu?\nyes sure!\nNA\nna\n?????\nend\n"}, {"type": "stdin_stdout", "input": "341143514535\n158\n143565553551655311343411652...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\nYou are looking for a...
[{"type": "stdin_stdout", "input": "5\n8 5\n6 4\n4 3\n7 10\n0 10\n10\n10 5\n2 7\n9 7\n8 10\n10 2\n1 2\n8 1\n6 7\n6 0\n0 0\n5\n904207 809784\n845370 244806\n499091 59863\n638406 182509\n435076 362268\n10\n757559 866424\n114810 239537\n519926 989458\n461089 424480\n674361 448440\n81851 150384\n459107 795405\n299682 6700\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 sets of positive...
[{"type": "stdin_stdout", "input": "9 3 23\n10 3 22\n10 3 28\n16 10 107\n26 8 102\n20 10 105\n24 10 155\n3 4 3\n4 2 11\n0 0 0", "output": "1\n5\n0\n20\n32200\n5448\n10222\n0\n0\n"}, {"type": "stdin_stdout", "input": "9 3 23\n9 3 22\n10 3 28\n16 10 107\n26 8 102\n20 10 105\n24 10 155\n3 4 3\n4 2 11\n0 0 0", "output": "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\nDifferential pulse code modulati...
[{"type": "stdin_stdout", "input": "2 7\n-1\n2\n1\n0\n-1\n-4\n-4\n131\n137\n2 7\n4\n2\n1\n0\n-1\n-2\n-4\n124\n123\n10 7\n-4\n-2\n-1\n0\n1\n2\n7\n106\n84\n135\n134\n132\n128\n124\n122\n121\n122\n5 1\n61\n0\n-1\n0\n-1\n0\n4 1\n0\n255\n-1\n255\n0\n0 0", "output": "26\n0\n1684\n294308\n65283\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\n\nAOR Ika is studying t...
[{"type": "stdin_stdout", "input": "3\nnxx", "output": "2\n"}, {"type": "stdin_stdout", "input": "3\nnwx", "output": "3\n"}, {"type": "stdin_stdout", "input": "3\nxxo", "output": "1\n"}, {"type": "stdin_stdout", "input": "3\nxwn", "output": "3\n"}, {"type": "stdin_stdout", "input": "3\nowx", "output": "3\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\nFind the sum of the weights of e...
[{"type": "stdin_stdout", "input": "6 10 0\n0 2 14\n0 0 1\n0 3 5\n1 4 7\n2 1 6\n1 3 2\n4 1 3\n4 2 2\n1 3 10\n0 5 3", "output": "32\n"}, {"type": "stdin_stdout", "input": "6 10 0\n0 2 14\n0 0 1\n0 3 5\n1 4 7\n2 1 6\n1 3 2\n4 1 3\n4 2 2\n1 3 0\n0 5 3", "output": "30\n"}, {"type": "stdin_stdout", "input": "6 10 0\n0 2 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\nComputation of the date either p...
[{"type": "stdin_stdout", "input": "14 2 2012", "output": "Wednesday\n"}, {"type": "stdin_stdout", "input": "14 4 2012", "output": "Wednesday\n"}, {"type": "stdin_stdout", "input": "14 4 1177", "output": "Wednesday\n"}, {"type": "stdin_stdout", "input": "20 4 1177", "output": "Wednesday\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\nPolycarp has n coins, the value ...
[{"type": "stdin_stdout", "input": "1 10\n8\n1\n2\n3\n4\n5\n6\n7\n13\n17\n16\n", "output": "-1\n-1\n-1\n-1\n-1\n-1\n-1\n-1\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "1 10\n8\n1\n2\n3\n4\n5\n6\n7\n13\n9\n16\n", "output": "-1\n-1\n-1\n-1\n-1\n-1\n-1\n-1\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "1 10\n8\n1\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\nInteger factorisation is hard. T...
[{"type": "stdin_stdout", "input": "7\n23569587128941503608758705497896615341310167 19159186913861939168106155455634552943308781 39153944492809625164528354461072312867479663 55790232814800866674553713074623995505775167 69463531589589278075905483512846478425014803 59642761923423334795004049937608748448281703 38990994935...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGrigory has n magic stones, conv...
[{"type": "stdin_stdout", "input": "10\n62159435 282618243 791521863 214307200 976959598 590907019 166397456 708291256 85377387 569889619\n296371399 546807332 272720717 689420404 273026579 74510326 749070707 104458586 450770185 466655231\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "10\n589934963 440265648 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 string s of length n ...
[{"type": "stdin_stdout", "input": "14\n1\n>\n1\n>\n1\n>\n1\n>\n1\n>\n1\n>\n1\n>\n1\n>\n1\n>\n1\n>\n1\n>\n1\n>\n1\n>\n1\n<\n", "output": "0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n"}, {"type": "stdin_stdout", "input": "14\n1\n>\n1\n>\n1\n=\n1\n>\n1\n>\n1\n>\n1\n>\n1\n>\n1\n>\n1\n>\n1\n>\n1\n>\n1\n>\n1\n<\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\nYou are given a graph with 3 β‹… n...
[{"type": "stdin_stdout", "input": "1\n8 39\n1 2\n3 4\n5 6\n7 8\n1 9\n3 10\n3 11\n5 12\n5 13\n10 14\n7 15\n9 4\n10 2\n11 2\n12 1\n13 3\n14 2\n15 2\n9 4\n10 4\n11 4\n12 4\n13 4\n14 4\n15 4\n14 6\n10 6\n11 6\n12 6\n13 6\n14 6\n15 6\n9 8\n7 8\n11 8\n12 14\n13 8\n14 8\n15 8\n", "output": "IndSet\n9 11 12 13 15 16 17 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\nThere were n types of swords in ...
[{"type": "stdin_stdout", "input": "10\n100000000 200000000 300000000 20 500000000 600000000 700000000 800000000 900000000 1000000000\n", "output": "244999999 20\n"}, {"type": "stdin_stdout", "input": "10\n100000000 200000000 300000000 28 500000000 600000000 700000000 800000000 900000000 1000000000\n", "output": "12249...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYour friend Jeff Zebos has been ...
[{"type": "stdin_stdout", "input": "3\nAZAMON ALPPE\nAZOMAN ABABILAAAAAAAAAAA\nAPPLE ANAOAB\n", "output": "AAZMON\nAAOMZN\nAEPLP\n"}, {"type": "stdin_stdout", "input": "3\nAZANOM APPLE\nAAZMON ABABILAAAAAAAAAAA\nAPPLF ANANAB\n", "output": "AAZNOM\nAAMZON\nAFPLP\n"}, {"type": "stdin_stdout", "input": "3\nZAAMON APPLE\nA...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nEhab has an array a of length n....
[{"type": "stdin_stdout", "input": "4\n7\n6 6 12 8 6 6 6\n1\n2\n5\n4 5 9 2 7\n7\n1 2 7 1 6 20 2\n", "output": "3\n1\n5\n5\n"}, {"type": "stdin_stdout", "input": "4\n7\n6 6 12 8 6 5 6\n1\n2\n5\n4 5 9 2 7\n7\n1 2 7 1 6 20 2\n", "output": "4\n1\n5\n5\n"}, {"type": "stdin_stdout", "input": "4\n7\n6 6 8 8 6 6 6\n1\n2\n5\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\nHilbert's Hotel is a very unusua...
[{"type": "stdin_stdout", "input": "10\n3\n-14 -33 142\n16\n45 -84 35 85 69 -64 93 -70 0 -102 2 -52 -55 38 33 -98\n2\n5 0\n4\n-65 -113 5 6\n5\n82 -66 113 -81 -35\n5\n-125 107 -1 2 -10\n1\n25\n1\n-19\n1\n-8\n12\n32 41 43 -157 57 8 -86 111 -25 96 28 -44\n", "output": "NO\nNO\nNO\nNO\nNO\nNO\nYES\nYES\nYES\nNO\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\nPolycarp plays a well-known comp...
[{"type": "stdin_stdout", "input": "4\n4 4\n1000000000 0\n12 15\n8 7\n", "output": "2\n0\n9\n5\n"}, {"type": "stdin_stdout", "input": "4\n4 4\n1010000000 0\n12 15\n8 7\n", "output": "2\n0\n9\n5\n"}, {"type": "stdin_stdout", "input": "4\n4 4\n1000000000 0\n7 15\n8 7\n", "output": "2\n0\n7\n5\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\nUtkarsh is forced to play yet an...
[{"type": "stdin_stdout", "input": "5\n16 1\n3 2\n9 1\n65 19\n14195 55\n", "output": "Utkarsh\nUtkarsh\nUtkarsh\nUtkarsh\nUtkarsh\n"}, {"type": "stdin_stdout", "input": "5\n10 1\n3 2\n9 1\n65 19\n14195 55\n", "output": "Utkarsh\nUtkarsh\nUtkarsh\nUtkarsh\nUtkarsh\n"}, {"type": "stdin_stdout", "input": "5\n16 1\n4 2\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\nPolycarp often uses his smartpho...
[{"type": "stdin_stdout", "input": "5\n5 13\n6 4 2 2 2\n2 1 1 2 1\n1 3\n2\n1\n5 10\n2 3 10 2 3\n1 1 2 2 1\n4 10\n4 1 3 1\n1 2 1 2\n4 9\n2 2 1 2\n1 1 2 1\n", "output": "5\n-1\n2\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "5\n5 7\n6 4 2 2 2\n2 1 1 2 1\n1 3\n2\n1\n5 10\n2 3 10 2 3\n1 1 2 2 1\n4 10\n4 1 3 1\n1 2 1 2\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\nVasya is a CEO of a big construc...
[{"type": "stdin_stdout", "input": "20 101 100\n1 16 20 3 19 10 12 18 4 17 13 6 8 5 2 15 7 16 9 11\n69 53 101 100 41 38 63 84 96 21 57 100 13 43 90 86 7 20 87 88 59 49 80 82 40 18 9 1 2 67 12 15 83 79 16 22 56 35 60 102 85 28 65 8 6 46 39 25 48 65 47 98 37 27 45 12 72 44 52 75 26 31 14 47 81 95 70 34 97 11 34 73 51 89 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n armchairs, numbered ...
[{"type": "stdin_stdout", "input": "100\n1 1 0 1 1 0 0 0 0 1 0 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 0 1 1 0 0 1 1 1 0 0 0 1 0 0 1 0 1 1 0 1 0 0 1 0 0 1 1 0 0 1 0 0 1 1 0 1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 1 1 1 0 1 1 0 1 1 1 0 0 1 1 0 0 0 0 1\n", "output": "482\n"}, {"type": "stdin_stdout", "input": "100\n1 1 0 0 1 1 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\nSherlock Holmes and Dr. Watson p...
[{"type": "stdin_stdout", "input": "12\n8 42 23 20 39 5 23 86 26 65 93 82\n48 35 12 4 59 19 19 28 38 81 97 99\n93 24 31 44 97 50 44 99 50 7 10 64\n79 43 65 29 84 43 46 41 89 16 6 1\n34 90 33 1 7 12 46 84 67 30 1 58\n58 21 100 66 56 22 7 24 72 73 86 37\n2 17 85 6 2 73 85 44 43 79 34 65\n3 53 29 76 87 2 27 19 11 42 71 38...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Smart Beaver from ABBYY bega...
[{"type": "stdin_stdout", "input": "120\n242 524 420 973 816 432 247 666 134 849 145 366 608 930 613 315 863 628 97 109 65 704 741 314 736 17 872 971 559 648 223 771 171 327 782 837 303 393 292 339 730 834 794 868 540 251 789 893 23 305 116 220 699 863 580 992 861 393 98 253 544 171 336 207 348 496 316 285 286 727 613 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 foggy Stockholm morning, Kar...
[{"type": "stdin_stdout", "input": "15\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "8\n0 1\n1 0\n0 1\n1 1\n0 1\n1 0\n0 1\n1 0\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "8\n1 0\n1 0\n1 0\n0 1\n0 1\n1 1\n1 1\n0 1\n", "out...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDima got into number sequences. ...
[{"type": "stdin_stdout", "input": "8\n851991424 32517099 310793856 771296843 342626527 58796623 49544509 517126753\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "8\n851991424 32517099 310793856 440880219 342626527 58796623 49544509 517126753\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "8\n8519914...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMad scientist Mike has just fini...
[{"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\nDima and Inna love spending time...
[{"type": "stdin_stdout", "input": "5 5\n1 5 9403 40347\n1 3 13851 29314\n4 5 1315 561894\n3 5 2748 33090\n5 3 10717 32306\n", "output": "30945\n"}, {"type": "stdin_stdout", "input": "5 5\n1 5 9403 40347\n1 3 19888 29314\n4 5 1315 561894\n3 5 2748 33090\n5 3 10717 32306\n", "output": "30945"}, {"type": "stdin_stdout", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe blinds are known to consist ...
[{"type": "stdin_stdout", "input": "100 17\n20 61 7 74 87 84 87 35 64 7 36 5 72 20 62 29 29 58 67 51 50 45 82 20 76 79 39 21 5 39 94 13 65 11 3 21 26 2 15 56 20 75 49 27 64 48 51 96 32 80 57 10 57 48 36 83 51 25 45 65 24 22 3 92 45 52 52 58 15 90 23 43 56 88 46 50 72 70 60 47 91 68 40 24 16 44 82 90 17 17 51 71 25 94 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 Berland capital (as you very...
[{"type": "stdin_stdout", "input": "70 71\n56 50\n52 51\n6 5\n56 67\n29 17\n13 41\n39 10\n61 13\n3 22\n49 11\n2 20\n44 59\n30 4\n8 39\n37 26\n8 58\n21 57\n29 63\n69 24\n66 21\n44 55\n29 40\n44 37\n62 8\n53 64\n44 2\n15 28\n11 42\n67 53\n6 1\n52 14\n23 33\n59 16\n22 48\n2 34\n36 61\n61 32\n26 65\n56 49\n52 68\n6 25\n29 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 two friends. You want t...
[{"type": "stdin_stdout", "input": "500000000 500000000 29983 29989\n", "output": "1000000001\n"}, {"type": "stdin_stdout", "input": "500000000 500000000 29959 29983\n", "output": "1000000001\n"}, {"type": "stdin_stdout", "input": "500000000 336720481 29983 29989\n", "output": "836720481\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\nAmr loves Geometry. One day he c...
[{"type": "stdin_stdout", "input": "100000 -100000 -100000 100000 100000\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "100000 -100000 -100000 100000 100010\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "100000 -100000 -100000 100100 100010\n", "output": "2\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\nAndrewid the Android is a galaxy...
[{"type": "stdin_stdout", "input": "100 19\n6 62 72 83 91 94 97\n3 61 84 99\n1 63\n5 46 53 56 69 78\n5 41 43 49 74 89\n5 55 57 79 85 87\n3 47 59 98\n3 64 76 82\n3 48 66 75\n2 60 88\n2 67 77\n4 40 51 73 95\n41 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 44 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\nThe GCD table G of size n Γ— n fo...
[{"type": "stdin_stdout", "input": "5\n537163 537163 537163 537163 537163 537163 1074326 537163 537163 537163 515139317 1074326 537163 537163 537163 539311652 321760637 170817834 537163 537163 537163 537163 537163 537163 392666153\n", "output": "539311652 515139317 392666153 321760637 170817834 "}, {"type": "stdin_stdo...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nKevin Sun has just finished comp...
[{"type": "stdin_stdout", "input": "119 119 119 119 119\n10 10 10 10 10\n0 20\n", "output": "1310\n"}, {"type": "stdin_stdout", "input": "78 119 119 119 119\n10 10 10 10 10\n0 20\n", "output": "1310\n"}, {"type": "stdin_stdout", "input": "78 119 176 119 119\n10 10 10 10 10\n0 20\n", "output": "1310\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\nAndrew and Jerry are playing a g...
[{"type": "stdin_stdout", "input": "20\n12 37 81 56 61 2 26 27 59 69 24 7 71 76 45 54 89 17 95 20\n", "output": "0.1930989940\n"}, {"type": "stdin_stdout", "input": "20\n12 37 81 56 61 2 36 27 59 69 24 7 71 76 45 54 89 17 95 20\n", "output": "0.1903993293\n"}, {"type": "stdin_stdout", "input": "20\n12 37 81 56 61 2 36 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya's telephone contains n pho...
[{"type": "stdin_stdout", "input": "100 20 100 19121\nwwwwhhwhhwhhwhhhhhwwwhhhwwwhwwhwhhwwhhwwwhwwhwwwhwhwhwwhhhwhwhhwhwwhhwhwhwwwhwwwwhwhwwwwhwhhhwhwhwww\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100 20 100 19121\nwwwhwhwhhhwhwwwwhwhwwwwhwwwhwhwhhwwhwhhwhwhhhwwhwhwhwwwhwwhwwwhhwwhhwhwwhwwwhhhwwwhhhhhw...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya commutes by train every da...
[{"type": "stdin_stdout", "input": "10\n2 10 8 7 8 8 10 9 10\n", "output": "63\n"}, {"type": "stdin_stdout", "input": "10\n2 10 8 7 8 9 10 9 10\n", "output": "62\n"}, {"type": "stdin_stdout", "input": "10\n3 10 8 7 8 9 10 9 10\n", "output": "61\n"}, {"type": "stdin_stdout", "input": "10\n2 10 8 6 8 8 10 9 10\n", "outpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAnastasia loves going for a walk...
[{"type": "stdin_stdout", "input": "9 13\n132 166 200 62 168 51 185 192 118\n", "output": "51\n"}, {"type": "stdin_stdout", "input": "9 13\n132 166 200 62 168 58 185 192 118\n", "output": "52\n"}, {"type": "stdin_stdout", "input": "9 13\n132 166 200 62 168 58 106 192 118\n", "output": "49\n"}, {"type": "stdin_stdout", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe year of 2012 is coming...\n\...
[{"type": "stdin_stdout", "input": "22\nCleo likes Snowy\nCleo likes Troll\nChapay likes Dracul\nSnowy likes Troll\nDracul likes Chapay\nDracul likes Snowy\nChapay likes Cleo\nSnowy likes Chapay\nDracul likes Troll\nAnka likes Hexadecimal\nSnowy likes Anka\nHexadecimal likes Cleo\nHexadecimal likes Troll\nDracul likes ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTwo boys decided to compete in t...
[{"type": "stdin_stdout", "input": "1000 1000 1000 1000 1000\n", "output": "Friendship\n"}, {"type": "stdin_stdout", "input": "13 849 819 723 918\n", "output": "Friendship\n"}, {"type": "stdin_stdout", "input": "2 313 856 964 421\n", "output": "Friendship\n"}, {"type": "stdin_stdout", "input": "37 261 207 1 1000\n", "o...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProgrammer Vasya is studying a n...
[{"type": "stdin_stdout", "input": "10\ntypedef &void**** youdyfpinzk\ntypeof &youdyfpinzk***\ntypedef &&&&youdyfpinzk****** nfbsgpjzhxzskmxc\ntypeof nfbsgpjzhxzskmxc***\ntypedef &&&void*** puerqioirikxej\ntypeof &puerqioirikxej********\ntypedef &puerqioirikxej******** xzgzsamjdufuyxz\ntypeof &xzgzsamjdufuyxz******\nty...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's denote a function \n\n<ima...
[{"type": "stdin_stdout", "input": "100\n591 417 888 251 792 847 685 3 182 461 102 348 555 956 771 901 712 878 580 631 342 333 285 899 525 725 537 718 929 653 84 788 104 355 624 803 253 853 201 995 536 184 65 205 540 652 549 777 248 405 677 950 431 580 600 846 328 429 134 983 526 103 500 963 400 23 276 704 570 757 410 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHexadecimal likes drawing. She h...
[{"type": "stdin_stdout", "input": "50 21\n27 16\n42 35\n15 28\n46 17\n30 39\n47 18\n35 25\n26 24\n24 30\n28 41\n40 38\n11 21\n33 20\n43 10\n37 14\n1 43\n32 49\n49 6\n10 45\n21 50\n39 3\n", "output": "YES\n29\n1 2\n2 3\n4 5\n4 6\n5 7\n7 8\n8 9\n9 11\n12 13\n12 14\n13 15\n16 17\n18 19\n19 20\n22 23\n22 25\n23 26\n27 29\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nStrings can be efficiently store...
[{"type": "stdin_stdout", "input": "5\neu\neq\nbd\nbe\ndbp\n\nSAMQLE", "output": "10\n"}, {"type": "stdin_stdout", "input": "5\net\nqe\nbd\ndc\ndbp\n\nSAMQLE", "output": "11\n"}, {"type": "stdin_stdout", "input": "5\nte\nqe\nbd\ndb\np`d\n\nDAQMKS", "output": "12\n"}, {"type": "stdin_stdout", "input": "5\neu\nqe\nbd\nbd...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYesterday Oz heard a story about...
[{"type": "stdin_stdout", "input": "10\n75 995991040 245669642 566366239 458028006 823890903 945174886 530827147 711604994 720763988 183796976 748924885 868038355 870234651 273702889 972313979 607688156 495203509 981301128 72001489 8444522 970980434 30653173 738175457 455018413 940530064 537884091 418532701 982359437 7...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven is a positive integer N. H...
[{"type": "stdin_stdout", "input": "1000000", "output": "13969985"}, {"type": "stdin_stdout", "input": "214", "output": "1178\n"}, {"type": "stdin_stdout", "input": "257", "output": "1466\n"}, {"type": "stdin_stdout", "input": "197", "output": "1070\n"}, {"type": "stdin_stdout", "input": "101", "output": "482\n"}, {"ty...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe have caught N sardines. The d...
[{"type": "stdin_stdout", "input": "10\n2 0\n2 -1\n-1 -1\n1 20\n0 -1\n-18 -1\n1 -1\n1 1\n-5 -1\n4 0", "output": "399\n"}, {"type": "stdin_stdout", "input": "10\n2 0\n0 0\n-1 2\n-1 13\n-2 -26\n-11 -1\n2 -1\n0 1\n0 0\n0 4", "output": "161\n"}, {"type": "stdin_stdout", "input": "10\n2 -1\n0 0\n-1 2\n-1 13\n0 -26\n-16 -1\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N slimes standing on a...
[{"type": "stdin_stdout", "input": "12\n367101616 467388357 159541726 1477792495 1190847685 1723370727 668687333 270216579 135685914 125686970 1191846896 1765707086", "output": "469392584\n"}, {"type": "stdin_stdout", "input": "12\n367101616 467388357 127795962 1640220090 1190847685 1723370727 402149677 270216579 13568...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 string S of leng...
[{"type": "stdin_stdout", "input": "10 2\nbbbabbbaaa", "output": "aaaaaaaaaa\n"}, {"type": "stdin_stdout", "input": "10 3\nbbaabbbaab", "output": "aaaaaaaabb\n"}, {"type": "stdin_stdout", "input": "10 2\nbaabbbaabb", "output": "aaaabbbaab\n"}, {"type": "stdin_stdout", "input": "10 2\nbaabbaaabb", "output": "aaaaaabbbb\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 numbered 1 to...
[{"type": "stdin_stdout", "input": "4\nRBRR", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "4\nRRCR", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "4\nRRAR", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "4\nRARR", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "4\nRCRR", "output": "Yes...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are some coins in the xy-p...
[{"type": "stdin_stdout", "input": "13 27\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\n\"Pizza At\", a fast food chain,...
[{"type": "stdin_stdout", "input": "1143 3132 1087 90000 100000", "output": "217400000\n"}, {"type": "stdin_stdout", "input": "1500 2445 500 90000 100000", "output": "100000000\n"}, {"type": "stdin_stdout", "input": "1500 3132 752 90000 100000", "output": "150400000\n"}, {"type": "stdin_stdout", "input": "1500 3132 574...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSnuke has a string S consisting ...
[{"type": "stdin_stdout", "input": "bacaccbabab", "output": "YES\n"}, {"type": "stdin_stdout", "input": "bacaacbcbab", "output": "YES\n"}, {"type": "stdin_stdout", "input": "babcbcaacab", "output": "YES\n"}, {"type": "stdin_stdout", "input": "bababccacab", "output": "YES\n"}, {"type": "stdin_stdout", "input": "bacaccba...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIt is only six months until Chri...
[{"type": "stdin_stdout", "input": "8\n121 1 -1 -1 -3 3 0 1", "output": "124\n"}, {"type": "stdin_stdout", "input": "8\n0 -4 -1 21 -2 -15 4 2", "output": "36\n"}, {"type": "stdin_stdout", "input": "8\n0 -3 -1 27 -6 -18 4 2", "output": "45\n"}, {"type": "stdin_stdout", "input": "8\n-2 -1 0 1 3 -143 0 1", "output": "146\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 positive integer...
[{"type": "stdin_stdout", "input": "1000000001000000000", "output": "999867657\n"}, {"type": "stdin_stdout", "input": "1100000001000000000", "output": "355035671\n"}, {"type": "stdin_stdout", "input": "1100000001000010000", "output": "391646023\n"}, {"type": "stdin_stdout", "input": "1100000001001010000", "output": "10...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTaro went to a toy store to buy ...
[{"type": "stdin_stdout", "input": "1 2 0\n1\n1 2 1\n1\n1 2 101\n1 2 1\n1\n1 2 100\n2 2 1\n1 2\n1 2 100\n4 5 3\n1 2 3 4\n1 1 2\n2 2 100\n4 3 32\n0 0 0", "output": "0\n101\n100\n50\n22\n"}, {"type": "stdin_stdout", "input": "1 2 0\n1\n1 2 1\n1\n1 2 100\n1 2 1\n1\n1 2 100\n2 2 1\n1 2\n1 2 100\n4 5 3\n1 2 3 4\n1 1 2\n2 2 ...
code_stdio