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\nYou are given a sequence a1, a2,... | [{"type": "stdin_stdout", "input": "100\n39 77 67 25 81 26 50 11 73 95 86 16 90 33 14 79 12 100 68 64 60 27 41 15 34 24 3 61 83 47 57 65 99 43 40 21 94 72 82 85 23 71 76 32 10 17 30 18 44 59 35 89 6 63 7 69 62 70 4 29 92 87 31 48 36 28 45 97 93 98 56 38 58 80 8 1 74 91 53 55 54 51 96 5 42 52 9 22 78 88 75 13 66 2 37 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\nRecently Ivan noticed an array a... | [{"type": "stdin_stdout", "input": "50 20\n1 44 48 43\n1 15 24 9\n2 39 44 25\n1 36 48 35\n1 4 30 27\n1 31 44 15\n2 19 38 22\n2 18 43 24\n1 25 35 10\n2 38 43 5\n2 10 22 21\n2 5 19 30\n1 17 35 26\n1 17 31 10\n2 9 21 1\n2 29 34 10\n2 25 44 21\n2 13 33 13\n2 34 38 9\n2 23 43 4\n", "output": "-1\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\nDuring the winter holidays, the ... | [{"type": "stdin_stdout", "input": "1000000000 1000000000\n1000000000 1000000000 1000000000\n", "output": "5000000000\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000\n1000100000 1000000000 1000000000\n", "output": "5000200000\n"}, {"type": "stdin_stdout", "input": "1000000000 1010000000\n1000100000 100000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNian is a monster which lives de... | [{"type": "stdin_stdout", "input": "24 24\n299931317 581208095 975349898 832722683 817690798 482251493 336949323 145902930 573001018 802990442 898055771 253410043 150981561 225791789 53290960 405421751 723296526 565432511 256399554 374970926 22699716 104391316 121063780 149329252\n-295118728 -830122321 -294539299 -9059... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPikachu had an array with him. H... | [{"type": "stdin_stdout", "input": "930971393 177624874\n", "output": "332\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 177624875 177624875 177624875 177624875 177624875 177624875 177624875 177624875 177624875 177624875 177624875 177624875 177624875 177624875 177624875 177624875 177624875 177624875 177624... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 collection of wo... | [{"type": "stdin_stdout", "input": "4\nzebsb\n1 r\n2 uogh\n5 taguisj\n\nSMMBOG", "output": "zruogtaguisj\n"}, {"type": "stdin_stdout", "input": "4\nyebtb\n1 r\n2 hogu\n5 tbguisi\n\nSMMBOH", "output": "yrhogtbguisi\n"}, {"type": "stdin_stdout", "input": "4\nasbez\n6 r\n3 ungi\n4 jgiusau\n\nSMMOAG", "output": "asbujgiusa... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRoy's friends has been spying on... | [{"type": "stdin_stdout", "input": "100\ngrwctfse\nuiufoftt\nr\ni\nnreyfhlov\niqklvul\nfhz\npaxeo\nlnadrfvgk\ngszgwr\nkczwqcb\nvjtuuud\nnz\nufywxt\nmbvmbnd\nykqyqvxn\naf\nuzoz\nyjjt\nlwuo\nntxlb\nma\ngzpbfgwm\nihy\nyephwnhlh\nptkgk\ntrq\nfdyfqvr\nckvd\nclhrdtcd\nfozzjkfds\ngfpm\neqkzlwlasg\nfrjjsyf\nmyziq\nimuyhvpiun\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\nGiven a string, find the length ... | [{"type": "stdin_stdout", "input": "15\nbswdkimmongrpuirmtyzlenpuphbakkdcigpsvbgijaydirsbprothfpymrawd\nzljofermpamnf\nexzvroratgyixaecdfnovtvmhkmvxurdtqam\nrmcamkzmocrwrgrmbgtluokofpkwrwcjlelzqkohofdglwsocobxclnkcxguukffrqghcu\ntatznqtcshdrkrfwtcenwoudhmkrpehigbjutcwnmbfysmumoybnoyswkcpbjwlpzuluzh\nljpjbbfprdtgrrzpbdg... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 string of length 6 consisting ... | [{"type": "stdin_stdout", "input": "sjppvv", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "coffee", "output": "Yes"}, {"type": "stdin_stdout", "input": "sippuu", "output": "Yes"}, {"type": "stdin_stdout", "input": "cofgee", "output": "No\n"}, {"type": "stdin_stdout", "input": "uuppis", "output": "No\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\nThere are K blue balls and N-K r... | [{"type": "stdin_stdout", "input": "300 27", "output": "274\n972426\n102082793\n328873421\n615196510\n24430690\n273712439\n600435969\n563935644\n888588929\n654428054\n74494182\n338218805\n98085192\n435847368\n844223382\n705536554\n49767749\n177382729\n162791487\n789150629\n878637769\n365777831\n411668372\n514585465\n76... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 one biscuit and zero J... | [{"type": "stdin_stdout", "input": "314159265 35897932 384626433", "output": "48518828981938099"}, {"type": "stdin_stdout", "input": "407766107 9307229 14836778", "output": "1101648954500241\n"}, {"type": "stdin_stdout", "input": "407766107 9307229 25447105", "output": "3215538450316794\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\nThere are N candles placed on a ... | [{"type": "stdin_stdout", "input": "8 4\n-14 -7 -4 -11 1 2 3 4", "output": "4\n"}, {"type": "stdin_stdout", "input": "8 4\n-14 -7 -4 -11 1 2 3 8", "output": "8\n"}, {"type": "stdin_stdout", "input": "8 5\n-14 -7 -1 -11 1 2 3 4", "output": "5\n"}, {"type": "stdin_stdout", "input": "8 4\n-14 -7 -1 -11 1 1 3 8", "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 Republic of AtCoder, Snuke Ch... | [{"type": "stdin_stdout", "input": "123456 234567", "output": "857617983"}, {"type": "stdin_stdout", "input": "29001 234567", "output": "246712986\n"}, {"type": "stdin_stdout", "input": "29001 137176", "output": "790285595\n"}, {"type": "stdin_stdout", "input": "18209 234567", "output": "750285457\n"}, {"type": "stdin_... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a circle with a circumf... | [{"type": "stdin_stdout", "input": "4 20 18\n7 2\n9 1\n12 1\n18 1", "output": "10\n16\n7\n9\n"}, {"type": "stdin_stdout", "input": "4 20 18\n3 2\n9 1\n12 1\n18 1", "output": "10\n16\n5\n7\n"}, {"type": "stdin_stdout", "input": "4 20 18\n3 2\n9 1\n12 1\n18 2", "output": "5\n7\n10\n0\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 is a grid with H rows and ... | [{"type": "stdin_stdout", "input": "15 10\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake snake snake snake snake snake\nsnake snake snake snake snake sna... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n<image>\n\n\nThis figure shows r... | [{"type": "stdin_stdout", "input": "1\n6\n-1\n13\n10\n0\n0\n0", "output": "10\n13\n-1\n"}, {"type": "stdin_stdout", "input": "1\n20\n0\n20\n11\n0\n0\n1", "output": "20\n11\n20\n"}, {"type": "stdin_stdout", "input": "1\n38\n0\n20\n11\n0\n0\n1", "output": "38\n11\n20\n"}, {"type": "stdin_stdout", "input": "1\n10\n0\n20\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a set of cards with pos... | [{"type": "stdin_stdout", "input": "3\n2 21\n0 48\n-1 12", "output": "-1152\n"}, {"type": "stdin_stdout", "input": "3\n4 21\n0 48\n-1 12", "output": "-2304\n"}, {"type": "stdin_stdout", "input": "3\n4 21\n0 28\n-1 12", "output": "-1344\n"}, {"type": "stdin_stdout", "input": "3\n6 93\n1 -14\n1 -1", "output": "-7728\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\nAt Akabe High School, a programm... | [{"type": "stdin_stdout", "input": "5 8\n5\n10\n17\n1\n3\nADD 1\nADD 3\nCHEDK -1\nCHECK 1\nCHEBJ -1\nCHFCK -1\nCHECK 4\nCHECK 8", "output": "NA\n4\nNA\nNA\n0\n0\n"}, {"type": "stdin_stdout", "input": "5 8\n5\n10\n13\n1\n3\nADD 1\nADD 5\nCHECK 0\nCHECK 1\nCHEBJ 0\nCHFCK 0\nCHECK 0\nCHECK 5", "output": "NA\nNA\nNA\nNA\nN... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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\nTaro bought 10 books.... | [{"type": "stdin_stdout", "input": "9850\n1050\n800\n420\n380\n600\n1164\n2400\n3134\n980\n0", "output": "-1078\n"}, {"type": "stdin_stdout", "input": "9850\n1050\n800\n420\n380\n600\n1164\n2400\n3265\n980\n0", "output": "-1209\n"}, {"type": "stdin_stdout", "input": "9850\n1050\n800\n481\n380\n600\n1164\n2400\n3265\n98... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHaruna is a high school student.... | [{"type": "stdin_stdout", "input": "1 2\n11 0\n0 0", "output": "yes\nyes\n"}, {"type": "stdin_stdout", "input": "2 1\n10 0\n0 0", "output": "yes\nyes\n"}, {"type": "stdin_stdout", "input": "1 4\n11 0\n0 0", "output": "yes\nyes\n"}, {"type": "stdin_stdout", "input": "2 -1\n8 0\n0 0", "output": "yes\nyes\n"}, {"type": "s... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDescription\n\nIn 200X, the myst... | [{"type": "stdin_stdout", "input": "3\n0 1 0 1 0 0 0 -1 0 1 0 -1 0\n1 0 0 0 0 0 1 0 0 0 0 0 2\n0 1 1 0 1 1 1 0 1 0 0 5 5\n3 1 1 1 0 1 0 0 1 0 3 -1 1\n1 1 2 7 5 10 20 50 100\n7H 6H 2H 5H 3H\n9S 9C 9H 8H 8D\nKS KH QH JD TS\n10\n1 1 1 1 1 1 1 1 1 0 1 1 1\n0 1 1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 2 1 1 1 1 1 1 1 0\n1 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\nExample\n\nInput\n\n3\n0 2 7\n2 ... | [{"type": "stdin_stdout", "input": "3\n0 3 10\n1 0 4\n19 11 0", "output": "15\n"}, {"type": "stdin_stdout", "input": "3\n0 6 13\n4 0 3\n24 12 0", "output": "20\n"}, {"type": "stdin_stdout", "input": "3\n0 12 13\n6 0 6\n27 8 0", "output": "25\n"}, {"type": "stdin_stdout", "input": "3\n0 12 18\n6 0 6\n27 8 0", "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\nEscape\n\nAn undirected graph wi... | [{"type": "stdin_stdout", "input": "6 10\n0 3 3 4 10 12\n1 3\n2 6\n3 4\n1 1\n4 5\n5 6", "output": "32\n"}, {"type": "stdin_stdout", "input": "6 10\n0 0 3 6 10 12\n1 3\n1 1\n6 4\n1 1\n6 5\n5 6", "output": "31\n"}, {"type": "stdin_stdout", "input": "6 10\n0 3 3 5 10 12\n1 3\n2 6\n3 4\n1 1\n4 5\n5 6", "output": "33\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\nMr. Endo wanted to write the cod... | [{"type": "stdin_stdout", "input": "8 -1\n7 1\n3 0\n1 6\n0 5\n3 0\n10 7\n2 13\n8 2\n12 4", "output": "-1\n"}, {"type": "stdin_stdout", "input": "8 -1\n7 1\n3 0\n2 6\n0 5\n3 0\n10 7\n2 13\n8 2\n12 4", "output": "-1\n"}, {"type": "stdin_stdout", "input": "8 -1\n7 1\n3 0\n2 6\n0 5\n3 0\n10 4\n2 13\n8 2\n12 4", "output": "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem\n\nGPA is an abbreviatio... | [{"type": "stdin_stdout", "input": "3\n1.2162360718264462\n2.9346880694304285\n3.9759367558439593", "output": "0\n3\n6\n"}, {"type": "stdin_stdout", "input": "3\n1.3676423535538285\n2.5451927881659007\n3.4551403734048662", "output": "0\n3\n6\n"}, {"type": "stdin_stdout", "input": "3\n2.2132650658019095\n2.5451927881659... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are two standard ways to r... | [{"type": "stdin_stdout", "input": "4\n1 1 0 4\n2 1 1\n-1 -1\n4 1 2", "output": "0 0 0 1\n1 0 0 0\n0 0 0 0\n0 1 0 0\n"}, {"type": "stdin_stdout", "input": "4\n1 2 2 4\n2 1 4\n3 -1\n4 1 3", "output": "0 1 0 1\n0 0 0 1\n0 0 0 0\n0 0 1 0\n"}, {"type": "stdin_stdout", "input": "4\n1 2 1 4\n2 1 4\n1 -1\n4 1 3", "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\nSince Sonya is interested in rob... | [{"type": "stdin_stdout", "input": "15\n1 4 6 1 2 7 2 1 1 10 4 15 2 7 5\n", "output": "45\n"}, {"type": "stdin_stdout", "input": "15\n1 4 6 1 2 7 2 1 1 10 4 8 2 7 5\n", "output": "45\n"}, {"type": "stdin_stdout", "input": "15\n1 4 3 1 2 7 2 1 1 10 4 4 2 7 5\n", "output": "36\n"}, {"type": "stdin_stdout", "input": "15\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 n rectangles on a ... | [{"type": "stdin_stdout", "input": "3\n-1000000000 -1000000000 -999999999 -999999999\n-1000000000 -1000000000 1000000000 1000000000\n-1000000000 -1000000000 -999999999 -999999999\n", "output": "-1000000000 -1000000000\n"}, {"type": "stdin_stdout", "input": "3\n-1000000000 -1000000000 -999999999 -999999999\n-1000000000 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 travelling throu... | [{"type": "stdin_stdout", "input": "8\n100 200\n660 973 461 774\n844 449 645 648\n770 319 770 319\n494 325 693 126\n934 913 933 714\n207 945 206 845\n527 264 427 264\n1595 189 787 209\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "8\n100 200\n660 973 461 774\n844 252 645 648\n770 319 770 319\n494 325 693 126\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 working on a new ope... | [{"type": "stdin_stdout", "input": "32\n.\n..\n...\n....\n.....\n......\n.......\n........\n0\n00\n000\n0000\n00000\n000000\n0000000\n00000000\nz\nzz\nzzz\nzzzz\nzzzzz\nzzzzzz\nzzzzzzz\nzzzzzzzz\n9\n99\n999\n9999\n99999\n999999\n9999999\n99999999\n32\n.\n..\n...\n....\n.....\n......\n.......\n........\n0\n00\n000\n0000... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVova's family is building the Gr... | [{"type": "stdin_stdout", "input": "20\n10 5 2 3 5 7 7 9 4 9 9 4 9 7 7 5 3 2 5 10\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "14\n7 7 7 4 3 3 4 5 4 4 5 7 7 7\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "14\n7 7 7 4 3 3 4 5 4 8 5 7 7 7\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\nEvery superhero has been given a... | [{"type": "stdin_stdout", "input": "9 10770 5887448\n3054 105616 81667 103207 41139 64840 76118 11566 22469\n", "output": "116386.0\n"}, {"type": "stdin_stdout", "input": "9 10770 5887448\n3054 105616 81667 103207 41139 64840 22254 11566 22469\n", "output": "116386.0\n"}, {"type": "stdin_stdout", "input": "9 48096 5475... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 written some permutati... | [{"type": "stdin_stdout", "input": "10\n4\n2 4 4 5\n4\n2 -1 4 -1\n4\n5 5 5 5\n4\n2 3 4 5\n4\n2 3 4 5\n4\n-1 3 4 5\n4\n-1 3 5 5\n4\n3 3 5 5\n4\n3 4 5 5\n4\n5 4 4 5\n", "output": "1 3 2 4 \n1 2 3 4 \n4 3 2 1 \n1 2 3 4 \n1 2 3 4 \n1 2 3 4 \n1 2 4 3 \n2 1 4 3 \n-1\n4 2 1 3 \n"}, {"type": "stdin_stdout", "input": "10\n4\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 fighting with Zmei Goryn... | [{"type": "stdin_stdout", "input": "5\n4 807989196\n770312657 78181451\n624192034 690910298\n754831733 354913874\n519577171 400120478\n4 491297333\n546432637 76258441\n312107971 75446008\n767483254 958677299\n84044330 577526244\n2 177840791\n197738084 143071228\n23274563 597315796\n7 610054060\n858529462 646280969\n644... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 lives on the coordinate... | [{"type": "stdin_stdout", "input": "9\n4 17 0 0\n0 6 0 0\n5 0 7 3\n52 2 20 010\n-11 20 -40 0\n2 2 0 0\n-2 0 1 4\n-1 4 0 2\n0 4 -10 0\n", "output": "13\n6\n4\n30\n31\n0\n0\n2\n4\n"}, {"type": "stdin_stdout", "input": "9\n1 10 7 1\n3 3 1 0\n8 2 10 4\n10 2 10 100\n-10 20 -17 2\n-3 1 0 0\n-3 1 2 0\n2 3 0 3\n-1 1 -2 2\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 simple weighted ... | [{"type": "stdin_stdout", "input": "15 15 23\n13 11 12\n11 14 12\n2 15 5\n4 10 8\n10 2 4\n10 7 5\n3 10 1\n5 6 11\n1 13 8\n9 15 4\n4 2 9\n11 15 1\n11 12 14\n10 8 12\n3 6 11\n", "output": "3682\n"}, {"type": "stdin_stdout", "input": "15 15 23\n13 10 12\n11 14 12\n2 15 5\n4 10 5\n8 2 4\n10 7 5\n3 10 1\n5 6 11\n1 13 15\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\nThere are n + 2 towns located on... | [{"type": "stdin_stdout", "input": "200000\n", "output": "\n202370013\n"}, {"type": "stdin_stdout", "input": "199998\n", "output": "801261687\n"}, {"type": "stdin_stdout", "input": "199999\n", "output": "503231359\n"}, {"type": "stdin_stdout", "input": "103835\n", "output": "497577175\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\nYou have a statistic of price ch... | [{"type": "stdin_stdout", "input": "2\n4 1\n20100 1 202 525\n3 101\n1 0 1\n", "output": "32197\n0\n"}, {"type": "stdin_stdout", "input": "2\n4 1\n20100 1 182 525\n3 101\n1 0 1\n", "output": "32217\n0\n"}, {"type": "stdin_stdout", "input": "2\n4 1\n33029 1 202 525\n3 101\n1 0 1\n", "output": "19268\n0\n"}, {"type": "std... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAlexey is travelling on a train.... | [{"type": "stdin_stdout", "input": "2\n2\n2 4\n10 12\n0 2\n5\n1 4\n7 8\n9 10\n13 15\n19 20\n1 2 3 4 5\n", "output": "\n12\n32\n"}, {"type": "stdin_stdout", "input": "2\n2\n2 3\n10 12\n0 2\n5\n1 4\n7 8\n9 10\n13 15\n19 20\n1 2 3 4 5\n", "output": "12\n32\n"}, {"type": "stdin_stdout", "input": "2\n2\n2 3\n10 12\n0 2\n5\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\"Contestant who earns a score e... | [{"type": "stdin_stdout", "input": "50 44\n100 100 99 97 95 91 91 84 83 83 79 71 70 69 69 62 61 60 59 59 58 102 58 55 55 54 52 48 47 45 44 44 38 36 38 31 28 28 25 25 24 24 24 22 17 15 14 13 12 4\n", "output": "44\n"}, {"type": "stdin_stdout", "input": "50 44\n100 100 99 97 95 91 91 84 83 83 79 71 70 69 69 62 61 60 59 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\nIn the popular spreadsheets syst... | [{"type": "stdin_stdout", "input": "10\nR50C12\nR23C47\nY96\nR44C13\nR19C21\nR95C73\nBK12\nR51C74\nAY34\nR63C25\n", "output": "L50\nAU23\nR96C25\nM44\nU19\nBU95\nR12C63\nBV51\nR34C51\nY63\n"}, {"type": "stdin_stdout", "input": "10\nR50C12\nR23C47\nY96\nR44C13\nR19C21\nR95C73\nBK12\nR51C74\nAY34\nR62C25\n", "output": "L... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 bracket sequence is a string, ... | [{"type": "stdin_stdout", "input": "[()][([[]])][[[]()]][()[]]()()([[][]][[]][](()))[[[(())]]][]()(([([])(([[[]]()])(()))]((())))([()]([()[[[]([][[[[][(())([[]()])]]][[(())]([])]()][[](())]()[])]()[][]]([[]])[]])[(()[()((()[][()]))][])[]()()([]())](()[][][])()()[]()))[]()[]\n", "output": "61\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\nIt's a beautiful April day and W... | [{"type": "stdin_stdout", "input": "285642 492030 560100 388288 354938 20867\n", "output": "216690.214383517276\n"}, {"type": "stdin_stdout", "input": "111724 287004 931554 512877 139642 23002\n", "output": "257255.653204436792"}, {"type": "stdin_stdout", "input": "246310 320553 585881 278070 443362 23788\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\nGreg has a weighed directed grap... | [{"type": "stdin_stdout", "input": "9\n0 85236 27579 82251 69479 24737 87917 15149 52311\n59640 0 74687 34711 3685 30121 4961 7552 83399\n33376 68733 0 81357 18042 74297 15466 29476 5865\n7493 5601 3321 0 20263 55901 45756 55361 87633\n26751 17161 76681 40376 0 39745 50717 56887 90055\n18885 76353 47089 43601 21561 0 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\nEmail address in Berland is a st... | [{"type": "stdin_stdout", "input": "c@ir@xf@ap@fk@sp@wm@ec@qw@vg@by@iu@tr@wu@pv@lj@dd@tc@qj@ok@hm@bs@ul@ez@cg@ht@xf@ag@tr@hz@ap@tx@ly@dg@hu@nd@uv@il@ii@cn@nc@nb@cy@kp@dk@xa@da@ta@yr@yv@qg@db@je@wz@rn@yh@xi@mj@kc@uj@yu@cf@ps@ao@fo@le@d\n", "output": "c@i,r@x,f@a,p@f,k@s,p@w,m@e,c@q,w@v,g@b,y@i,u@t,r@w,u@p,v@l,j@d,d@t,c@... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMad scientist Mike is busy carry... | [{"type": "stdin_stdout", "input": "1000000 1000000 1000000\n", "output": "500000 500000 500000\n"}, {"type": "stdin_stdout", "input": "602752 645534 784262\n", "output": "232012 413522 370740\n"}, {"type": "stdin_stdout", "input": "688348 726472 442198\n", "output": "486311 240161 202037\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 research center Q has develo... | [{"type": "stdin_stdout", "input": "100 1 100\n59\n37\n53\n72\n37\n15\n8\n93\n92\n74\n11\n11\n68\n16\n92\n40\n76\n20\n10\n86\n76\n5\n9\n95\n5\n81\n44\n57\n10\n24\n22\n2\n57\n6\n26\n67\n48\n95\n34\n97\n55\n33\n70\n66\n51\n70\n74\n65\n35\n85\n37\n9\n27\n43\n65\n6\n5\n57\n54\n27\n22\n41\n8\n29\n10\n50\n9\n68\n78\n9\n92\n3... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDevu is a renowned classical sin... | [{"type": "stdin_stdout", "input": "100 6000\n41 31 23 17 24 78 26 96 93 48 46 2 49 33 35 9 73 100 34 48 83 36 33 69 43 24 3 74 8 81 27 33 94 38 77 9 76 90 62 90 21 67 22 22 12 2 17 27 102 18 72 85 59 65 71 38 90 75 74 66 60 47 58 50 90 95 75 10 5 100 97 29 83 88 65 26 93 90 22 98 36 55 70 38 50 92 88 72 99 96 25 14 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\nLittle beaver is a beginner prog... | [{"type": "stdin_stdout", "input": "11 18 8\n4744 4993 1340 4982 4982 1437 2765 2200 6975 4989 10703\n", "output": "1358\n"}, {"type": "stdin_stdout", "input": "11 18 8\n4744 4993 7957 4982 4982 1437 2765 2200 6975 4989 10703\n", "output": "1455\n"}, {"type": "stdin_stdout", "input": "11 18 8\n4996 4993 4988 4982 4982 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 a consi... | [{"type": "stdin_stdout", "input": "12\n12 4 37 11 28 30 64 43 22 102 70 226\n", "output": "38\n"}, {"type": "stdin_stdout", "input": "12\n12 4 37 11 28 30 35 43 22 102 70 226\n", "output": "33\n"}, {"type": "stdin_stdout", "input": "12\n6 4 19 11 28 30 35 43 22 102 70 117\n", "output": "47\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\nBerland, 2016. The exchange rate... | [{"type": "stdin_stdout", "input": "4314752277691991627730686134692292422155753465948025897701703862445837045929984759093775762579123919\n", "output": "9314752277691991627730686134692292422155753465948025897701703862445837045929984759093775762579123914\n"}, {"type": "stdin_stdout", "input": "354515198058487122724043653... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nArthur has bought a beautiful bi... | [{"type": "stdin_stdout", "input": "30\n20 27 26 17 29 9 25 13 6 21 15 1 14 22 26 2 15 18 20 23 27 9 15 29 11 2 19 23 14 12\n133 199 22 151 9 134 196 119 197 189 117 84 156 6 61 195 98 197 145 75 142 85 187 24 159 3 60 138 156 161\n", "output": "2804\n"}, {"type": "stdin_stdout", "input": "30\n20 27 26 17 29 9 25 13 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\nCity X consists of n vertical an... | [{"type": "stdin_stdout", "input": "9\n4 5\n2 3\n8 3\n5 6\n9 3\n4 4\n5 4\n4 7\n1 7\n8 4\n1 4\n1 5\n5 7\n7 8\n7 1\n9 9\n8 7\n7 5\n3 7\n6 6\n7 3\n5 2\n3 6\n7 4\n9 6\n5 8\n9 7\n6 3\n7 9\n1 2\n1 1\n6 2\n5 3\n7 2\n1 6\n4 1\n6 1\n8 9\n2 2\n3 9\n2 9\n7 7\n2 8\n9 4\n2 5\n8 6\n3 4\n2 1\n2 7\n6 5\n9 1\n3 3\n3 8\n5 5\n4 3\n3 1\n1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n pictures delivered f... | [{"type": "stdin_stdout", "input": "100\n9 9 49 55 14 8 55 58 35 67 3 6 106 169 41 49 15 60 18 66 3 26 97 47 43 88 71 98 12 34 48 17 134 53 8 24 69 49 12 23 77 12 21 88 66 9 29 13 61 69 54 77 41 20 4 65 37 74 7 6 24 210 55 72 89 4 78 27 29 82 13 83 18 4 32 69 89 91 66 13 92 54 38 5 26 56 17 98 29 4 17 39 29 181 3 67 85... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n100 years have passed since the ... | [{"type": "stdin_stdout", "input": "68 -9959\n-3666\n-3501\n9169\n5724\n1478\n-643\n-3039\n-5537\n-4295\n-1856\n-6720\n6827\n-39\n-9509\n-7005\n1942\n-5173\n-4564\n2390\n4604\n-6098\n-9847\n-9708\n2382\n7421\n8716\n9718\n9895\n-4553\n-8275\n4771\n1538\n-8131\n9912\n-4334\n-3702\n7035\n-106\n-1298\n-6190\n1321\n332\n767... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 Sasha has recently be... | [{"type": "stdin_stdout", "input": "10 3\n-20\n-63\n-64\n45\n-84\n-13\n79\n-31\n70\n-100\n", "output": "-20\n45\n45\n45\n79\n79\n79\n70\n"}, {"type": "stdin_stdout", "input": "10 3\n-20\n-52\n-64\n45\n-139\n-13\n79\n-31\n89\n-100\n", "output": "-20\n45\n45\n45\n79\n79\n89\n89"}, {"type": "stdin_stdout", "input": "10 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\nVanya is managed to enter his fa... | [{"type": "stdin_stdout", "input": "20 5\nvSyC787KlIL8kZ2Uv5sw\nWKWOP\n7i8J3E8EByIq\nNW2VyGweL\nmyR2sRNu\nmXusPP0\nf4jgGxra\n4wHRzRhOCpEt\npPz9kybGb\nOtSpePCRoG5nkjZ2VxRy\nwHYsSttWbJkg\nKBOP9\nQfiOiFyHPPsw3GHo8J8\nxB8\nqCpehZEeEhdq\niOLjICK6\nQ91\nHmCsfMGTFKoFFnv238c\nJKjhg\ngkEUh\nKBOP9\n", "output": "3 11\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\nMahmoud has n line segments, the... | [{"type": "stdin_stdout", "input": "40\n740553458 532562042 138583675 75471987 487348843 476240280 972115023 103690894 546736371 1412788259 35356828 819948191 138721993 24257926 761587264 767176616 608310208 78275645 386063134 227581756 672567198 177797611 87579917 941781518 274774331 843623616 981221615 630282032 1188... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHaiku is a genre of Japanese tra... | [{"type": "stdin_stdout", "input": "aaaaaccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\naaaaaaaccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\naaaaaccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nStudents went into a class to wr... | [{"type": "stdin_stdout", "input": "22 111\n", "output": "YES\n1325 2017 8 2351 2152 1579 2251 2072 1773 1195 1308 1215 324 1208 1633 1064 12 2073 2428 1217 1700 918 1085 1651 475 2312 77 1616 1071 2423 673 848 901 1414 236 1533 494 192 168 1404 812 213 823 2238 1334 2236 1774 568 828 1838 358 1331 461 893 1439 1169 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\nA classroom in a school has six ... | [{"type": "stdin_stdout", "input": "..-**-..\n..-**-..\n..-..-..\n..-..-..\n..-..-..\n..-..-..\n", "output": "P.-**-..\n..-**-..\n..-..-..\n..-..-..\n..-..-..\n..-..-..\n"}, {"type": "stdin_stdout", "input": "**-**-**\n**-**-**\n..-**-.*\n**-**-**\n..-..-..\n..-**-..\n", "output": "**-**-**\n**-**-**\nP.-**-.*\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\nLet's call a string adorable if ... | [{"type": "stdin_stdout", "input": "aaaaaaaabbbbbcder\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "abaaaaaabbbbbcder\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "abaaaaaabbbbbcdes\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "aaaaaaabbbbbbcder\n", "output": "NO"}, {"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\nMr Keks is a typical white-colla... | [{"type": "stdin_stdout", "input": "30 4\n893642632982367 772277951746295 510759449350295 826812150840579 1060893142351815 525992742241552 154832018679993 645715002371268 27232975419720 475004229372388 200177708355593 810661468479466 49618609534806 301608930846726 97042172725806 441637617418914 594900693592862 62651070... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSometimes inventing a story for ... | [{"type": "stdin_stdout", "input": "100\n9 657681137\n9 459211231\n9 421854149\n10 919145723\n9 201797513\n6 105479273\n7 119609519\n8 336121607\n9 93853663\n10 260929637\n9 974056219\n10 551709247\n10 607613777\n9 689940947\n9 14567611\n10 81152371\n9 502271117\n10 496195387\n10 796995161\n9 556351291\n10 691502167\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\nRoss and Rachel are on a date. R... | [{"type": "stdin_stdout", "input": "5 3 9 5\nbaryonyx 5 1 14\nairbboj -1 3 8\npviarptor 9 5 1\ntsondom 11 17 3\nminmi 7 4 5\n9 7 1\n1 2 3\n5 16 13\n3 2 3\n7 4 4\n\nSAMPLE", "output": "You cant fool me :P\nYou cant fool me :P\nYou cant fool me :P\nYou cant fool me :P\nYou cant fool me :P\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\nRecently Ram got to know about a... | [{"type": "stdin_stdout", "input": "5\n5 5\n1 1 1 1 1\n4 0\n1 1 1 1\n3 1\n8 10 8\n6 11\n100 262 300 341 500 1100\n2 4\n2 5\n\nSAMPLE", "output": "5\n0\n10\n2603\n7\n"}, {"type": "stdin_stdout", "input": "5\n5 5\n1 1 1 1 1\n4 0\n1 1 1 1\n3 1\n8 10 8\n6 11\n100 262 300 608 500 1100\n2 4\n2 5\n\nSAMPLE", "output": "5\n0\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an two integers i ... | [{"type": "stdin_stdout", "input": "117 1000000000100\n\nT@MPLE", "output": "500000000100499999998264\n"}, {"type": "stdin_stdout", "input": "117 1000000001100\n\nT@MPLE", "output": "500000001100500000598764\n"}, {"type": "stdin_stdout", "input": "117 1001000001100\n\nT@MPLE", "output": "501000501101600500598764\n"}, {... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle PandeyG is a curious stud... | [{"type": "stdin_stdout", "input": "100\n273457900\n426795959\n566201490\n178331926\n758516183\n324609619\n697289003\n473088422\n560067111\n678996275\n511809062\n485788833\n821690097\n72858722\n487771337\n655455479\n1360847206\n240111601\n850089979\n474130333\n53486217\n295773355\n240831554\n423513160\n943606966\n54387... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 are integers a,b,c and d. ... | [{"type": "stdin_stdout", "input": "-104263787 -2 -1413615786 -1", "output": "147388935211341582\n"}, {"type": "stdin_stdout", "input": "-104263787 -2 -1511060856 -1", "output": "157548927234021672\n"}, {"type": "stdin_stdout", "input": "-145189730 -2 -1511060856 -1", "output": "219390517696208880\n"}, {"type": "stdin_... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Kingdom of Takahashi has N t... | [{"type": "stdin_stdout", "input": "6 1007784494318310970\n6 5 2 5 3 2", "output": "3\n"}, {"type": "stdin_stdout", "input": "6 1122048832909353099\n6 4 1 1 3 2", "output": "4\n"}, {"type": "stdin_stdout", "input": "6 2190427306125562200\n6 4 1 1 3 2", "output": "1\n"}, {"type": "stdin_stdout", "input": "6 219042730612... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 string S of length N c... | [{"type": "stdin_stdout", "input": "33\nABCCABCBABCCABACBCBBABCBCBCBCABDB", "output": "4\n"}, {"type": "stdin_stdout", "input": "33\nBDBACBCBCBCBABBCBCABACCBABCBACCBA", "output": "1\n"}, {"type": "stdin_stdout", "input": "33\nABCCABCBABCCABACBCBBABCBCBDBCABCB", "output": "5\n"}, {"type": "stdin_stdout", "input": "33\nB... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 directed graph with N... | [{"type": "stdin_stdout", "input": "4 5 10\n2 2 2\n1 4 -1\n3 4 0\n1 4 101\n3 3 100", "output": "91\n"}, {"type": "stdin_stdout", "input": "4 5 10\n2 2 2\n1 4 0\n3 4 0\n1 4 111\n3 3 100", "output": "101\n"}, {"type": "stdin_stdout", "input": "4 5 10\n1 4 3\n2 3 1\n2 2 1\n2 1 100\n1 4 110", "output": "100\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\nOn the Planet AtCoder, there are... | [{"type": "stdin_stdout", "input": "C", "output": "G\n"}, {"type": "stdin_stdout", "input": "T", "output": "A\n"}, {"type": "stdin_stdout", "input": "C", "output": "G\n"}, {"type": "stdin_stdout", "input": "T", "output": "A\n"}, {"type": "stdin_stdout", "input": "G", "output": "C"}, {"type": "stdin_stdout", "input": "A... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 integer N. Dete... | [{"type": "stdin_stdout", "input": "3", "output": "Yes\n3\n2 1 2\n2 3 1\n2 2 3"}, {"type": "stdin_stdout", "input": "1", "output": "Yes\n2\n1 1\n1 1\n"}, {"type": "stdin_stdout", "input": "-122", "output": "No\n"}, {"type": "stdin_stdout", "input": "-16", "output": "No\n"}, {"type": "stdin_stdout", "input": "-10", "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\nSitting in a station waiting roo... | [{"type": "stdin_stdout", "input": "2364", "output": "2+3+6-4=7\n"}, {"type": "stdin_stdout", "input": "1114", "output": "1+1+1+4=7\n"}, {"type": "stdin_stdout", "input": "2005", "output": "2+0+0+5=7\n"}, {"type": "stdin_stdout", "input": "1455", "output": "1-4+5+5=7\n"}, {"type": "stdin_stdout", "input": "1152", "outp... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are taking a computer-based ... | [{"type": "stdin_stdout", "input": "3\n-101\n-1\n-1", "output": "-103\n"}, {"type": "stdin_stdout", "input": "3\n-109\n-1\n-1", "output": "-111\n"}, {"type": "stdin_stdout", "input": "3\n-156\n-1\n-1", "output": "-158\n"}, {"type": "stdin_stdout", "input": "3\n-166\n-1\n-1", "output": "-168\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 given a string S consist... | [{"type": "stdin_stdout", "input": "dreameraser", "output": "YES"}, {"type": "stdin_stdout", "input": "resaremaerd", "output": "NO\n"}, {"type": "stdin_stdout", "input": "ersaremaerd", "output": "NO\n"}, {"type": "stdin_stdout", "input": "ersaremadrd", "output": "NO\n"}, {"type": "stdin_stdout", "input": "ersarfmadrd",... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBooks are indexed. Write a progr... | [{"type": "stdin_stdout", "input": "ntzsd 22\neevn 1\nnutrodnctioi -1\nse_z 1\nstyle 32\ntndmucod 2\nstyld 10\nmuee -2", "output": "eevn\n1\nmuee\n-2\nntzsd\n22\nnutrodnctioi\n-1\nse_z\n1\nstyld\n10\nstyle\n32\ntndmucod\n2\n"}, {"type": "stdin_stdout", "input": "ntzsd 10\neevn 1\nnutrodnctioi -1\nse_z 1\nstyle 32\ntndm... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFood contains three nutrients ca... | [{"type": "stdin_stdout", "input": "4\n1 7 14 47\n2 5 35 55\n3 6 3 59\n4 6 5 15\n10 15 50 110\n2\n1 8 10 116\n-1 4 18 33\n10 10 50 300\n0", "output": "NA\nNA\n"}, {"type": "stdin_stdout", "input": "4\n1 7 14 47\n2 5 35 55\n3 6 3 59\n4 6 5 15\n10 15 50 110\n2\n1 8 10 116\n0 4 18 33\n10 10 50 300\n0", "output": "NA\nNA\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are two cameras which obse... | [{"type": "stdin_stdout", "input": "4 5\n20 35 110 70\n15 30 40 84 113\n3 2\n10 20 30\n81 60\n0 1\n100\n1 1\n10\n83\n0 0", "output": "30\n30\n100\n73\n"}, {"type": "stdin_stdout", "input": "4 5\n20 60 110 70\n15 30 40 84 113\n3 2\n10 20 30\n42 60\n0 1\n100\n1 1\n10\n83\n0 0", "output": "26\n18\n100\n73\n"}, {"type": "s... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDo you know the famous series of... | [{"type": "stdin_stdout", "input": "48 3 3\ngAY4I4wA\ngIIgIIgg\nw4IAYAg4\ng\ng\nw\n153 3 3\nkkkkkkkkkkkkkkkkkkkkkkkkkg\nSSSSSSSSSSSSSSSSSSSSSSSSSQ\nJJJJJJJJJJJJJJJJJJJJJJJJJI\ng\nQ\nJ\n1 1 2\nA\nA\nA\n384 3 2\nABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\nBCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrs... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nG, a college student living in a... | [{"type": "stdin_stdout", "input": "5 8 3\n#.......\n#.####2#\n#.#.3..#\n######.#\n.1Sabcde", "output": "-1\n"}, {"type": "stdin_stdout", "input": "5 8 3\n.......#\n#.####2#\n#.#.3..#\n#.######\n.1Sabcde", "output": "14\n"}, {"type": "stdin_stdout", "input": "5 8 2\n.......#\n#.#\"##2#\n#..3.#.#\n#.######\n.1Sabcde", "... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 story of a world somew... | [{"type": "stdin_stdout", "input": "3 3\n3 4 1 1\n2 1 5\n2 3 3\n3 6\n3 2 5 1\n2 1 5\n2 3 3\n0 0", "output": "Yes\nYes\n"}, {"type": "stdin_stdout", "input": "3 6\n3 8 1 1\n2 2 6\n2 2 3\n3 3\n3 2 5 1\n2 1 11\n2 3 3\n0 0", "output": "Yes\nNo\n"}, {"type": "stdin_stdout", "input": "3 2\n3 11 1 1\n2 2 8\n2 2 3\n3 5\n3 4 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\nAt the school where the twins Am... | [{"type": "stdin_stdout", "input": "4\n1 2\n3 1\n4 1\n2 1\n3\n10 4\n1 2\n1 2\n1\n1000 1000\n10\n5 62\n10 68\n15 132\n20 73\n25 75\n30 77\n35 79\n40 82\n45 100\n815 283\n6\n106 21\n53 55\n118 77\n19 13\n83 42\n2 1\n0", "output": "15\n24\n3000\n2072\n590\n"}, {"type": "stdin_stdout", "input": "4\n1 2\n3 1\n4 1\n2 2\n3\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\nD: Rescue a Postal Worker\n\nsto... | [{"type": "stdin_stdout", "input": "8 6 1 1\n1 3 5\n1 1 2\n2 3 1\n3 5 4\n3 4 2\n4 5 3\n3 6", "output": "Cannot deliver\n"}, {"type": "stdin_stdout", "input": "8 6 1 1\n1 3 4\n1 1 2\n2 3 1\n3 5 4\n3 4 2\n4 5 3\n3 6", "output": "Cannot deliver\n"}, {"type": "stdin_stdout", "input": "5 6 1 1\n2 3 5\n1 1 2\n2 3 1\n3 5 4\n3... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nproblem\n\nThe point $ P $ is pl... | [{"type": "stdin_stdout", "input": "UDDTLSD\n15", "output": "7\n"}, {"type": "stdin_stdout", "input": "DSLTDDU\n12", "output": "7\n"}, {"type": "stdin_stdout", "input": "UDDTMSD\n15", "output": "7\n"}, {"type": "stdin_stdout", "input": "DSLTDDU\n10", "output": "7\n"}, {"type": "stdin_stdout", "input": "UDETMSD\n15", "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\nSet\n\nGiven the sequence a_1, a... | [{"type": "stdin_stdout", "input": "6\n-4 -3 1 -1 27 -1", "output": "5\n"}, {"type": "stdin_stdout", "input": "6\n-1 0 63 -1 3 -1", "output": "4\n"}, {"type": "stdin_stdout", "input": "6\n-2 -1 25 -2 4 0", "output": "5\n"}, {"type": "stdin_stdout", "input": "6\n-1 -1 25 -2 4 0", "output": "5\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\nThere is a sequence $A = a_0, a_... | [{"type": "stdin_stdout", "input": "5 17\n0 0 2 5\n0 1 0 2\n1 0 2\n0 1 3\n0 1 4 3\n1 0 1", "output": "5\n?\n-2\n-2\n-2\n-2\n-2\n-2\n-2\n-2\n-2\n-2\n-2\n-2\n"}, {"type": "stdin_stdout", "input": "5 17\n0 0 2 5\n0 2 3 5\n1 0 1\n1 0 0\n0 1 3 4\n1 0 4", "output": "?\n0\n?\n?\n?\n?\n?\n?\n?\n?\n?\n?\n?\n?\n"}, {"type": "std... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMultiplication of Big Integers I... | [{"type": "stdin_stdout", "input": "-15 87", "output": "-1305\n"}, {"type": "stdin_stdout", "input": "-81 -15", "output": "1215\n"}, {"type": "stdin_stdout", "input": "-1 -111", "output": "111\n"}, {"type": "stdin_stdout", "input": "-23 -15", "output": "345\n"}, {"type": "stdin_stdout", "input": "-46 -15", "output": "6... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLeonid is developing new program... | [{"type": "stdin_stdout", "input": "2\n1000 2**3*3**1\n100000 4**2*2**11", "output": "24\n32768\n"}, {"type": "stdin_stdout", "input": "2\n1001 2**3*2**1\n100000 4**2*2**11", "output": "16\n32768\n"}, {"type": "stdin_stdout", "input": "2\n1000 2**4*3**1\n111000 4**2*2**11", "output": "48\n32768\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\nSome programming contest problem... | [{"type": "stdin_stdout", "input": "4\n-2 1 2 4\n5\n-1 3 0 3 0\n1\n1\n0", "output": "not ambiguous\nnot ambiguous\nambiguous\n"}, {"type": "stdin_stdout", "input": "4\n-1 4 2 4\n5\n0 3 4 3 0\n1\n1\n0", "output": "not ambiguous\nnot ambiguous\nambiguous\n"}, {"type": "stdin_stdout", "input": "4\n-1 4 2 1\n5\n0 3 4 3 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\nMaxim wants to buy some games at... | [{"type": "stdin_stdout", "input": "6 4\n4 8 15 16 23 42\n1000 1000 1000 1000\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "6 4\n4 8 15 16 23 42\n1000 1000 1000 1010\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "6 4\n4 8 17 16 23 42\n1000 1000 1000 1010\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\nAt a break Vanya came to the cla... | [{"type": "stdin_stdout", "input": "20 30\n30095551 418501267 319405832 181290086 651729244 244371014 1160853882 491522284 582219539 1510068105 512276151 438340777 293617992 759003208 759003208 1 1043646272 1073741823 1431280338 1073741823\n", "output": "210\n"}, {"type": "stdin_stdout", "input": "20 30\n30095551 41850... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMakoto has a big blackboard with... | [{"type": "stdin_stdout", "input": "1000000000000000 10000\n", "output": "215514159\n"}, {"type": "stdin_stdout", "input": "1000000000001000 10000\n", "output": "150774797\n"}, {"type": "stdin_stdout", "input": "1172768550854780 8998\n", "output": "789402181\n"}, {"type": "stdin_stdout", "input": "1292761461062695 8123... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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": "100 10000\n93 99 95 105 94 108 104 104 102 112 106 82 114 104 88 107 105 104 93 96 103 109 105 82 107 95 83 93 120 115 96 104 96 86 87 102 103 108 97 84 108 117 109 107 80 87 102 107 88 97 96 101 101 114 106 103 99 101 105 102 85 94 98 101 115 100 91 92 108 105 94 110 91 89 119 119 9... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n[Thanos sort](https://codegolf.s... | [{"type": "stdin_stdout", "input": "16\n12 17 18 51 49 54 107 59 68 74 88 91 98 100 66 49\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "16\n12 17 18 51 52 54 56 59 68 74 88 91 98 100 66 49\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "16\n12 17 18 51 49 54 56 59 68 74 88 91 98 100 66 49\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\nThe only difference between easy... | [{"type": "stdin_stdout", "input": "78 36\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0\n1 52\n2 6\n9 43\n10 52\n4 63\n9 35\n10 67\n9 17\n3 43\n4 38\n1 27\n9 44\n6 74\n7 3\n8 18\n1 52\n1 68\n5 51\n5 2\n11 50\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\nHeidi found out that the Daleks ... | [{"type": "stdin_stdout", "input": "10 26\n9 5 277429172\n10 8 789225932\n5 2 992601916\n9 8 277294258\n8 6 245446241\n9 2 378979732\n7 1 895407000\n10 6 699661758\n1 9 865851152\n2 8 397672809\n7 10 756200111\n8 3 431547893\n5 6 465205287\n7 4 957301499\n3 4 308491540\n3 7 258504473\n10 5 282875145\n1 8 262659451\n5 4... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an array a consist... | [{"type": "stdin_stdout", "input": "6\n10000100623 10000100623 10000100623 10000100623 10000100623 10000100623\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "5\n153965681607 99999999977 99999999977 99999999977 99999999977\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n153965681607 99999999977 999... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate 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 n be a positive integer. Let... | [{"type": "stdin_stdout", "input": "7\n2\n1 1 0\nRR\n2\n2 0 0\nSS\n2\n2 0 0\nRR\n3\n1 2 0\nRRR\n3\n2 1 0\nRRR\n1\n1 0 0\nP\n1\n1 0 0\nS\n", "output": "YES\nPR\nYES\nRR\nNO\nYES\nPPR\nNO\nNO\nYES\nR\n"}, {"type": "stdin_stdout", "input": "7\n2\n1 1 0\nRR\n2\n2 0 0\nSS\n2\n2 0 1\nRR\n3\n1 2 0\nRRR\n3\n2 1 0\nRRR\n1\n1 0 ... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.