messages
listlengths
1
1
ground_truth
stringlengths
156
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\nAnatoly lives in the university dorm as many other students do. As you know, cockroaches are also living ther...
[{"input": "166\nrbbbbbbbbbbbbrbrrbbrbbbrbbbbbbbbbbrbbbbbbrbbbrbbbbbrbbbbbbbrbbbbbbbrbbrbbbbbbbbrbbbbbbbbbbbbbbrrbbbrbbbbbbbbbbbbbbrbrbbbbbbbbbbbrbbbbbbbbbbbbbbrbbbbbbbbbbbbbbbbbbbbbb\n", "output": "70\n"}, {"input": "166\nrbbbbbbbbbbbbrbrrbbrbbbrbbbbbbbbbbrbbbbbbrbbbrbbbbbrbbbbbbbrbbbbbbbrbbrbbbbbbbbrbbbbbbbbbbbbbbrrb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWe have a tree with N vertices. The vertices are numbered 0 through N - 1, and the i-th edge (0 ≤ i < N - 1) ...
[{"input": "10\n2 8\n6 0\n4 1\n7 6\n2 3\n8 6\n6 9\n2 4\n5 8", "output": "3"}, {"input": "5\n0 1\n0 2\n1 3\n3 4", "output": "1"}, {"input": "5\n0 1\n0 2\n0 3\n3 4", "output": "2"}, {"input": "2\n0 18", "output": "1"}, {"input": "2\n0 12", "output": "1"}, {"input": "2\n0 17", "output": "1"}, {"input": "2\n1 17", "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\nYou are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored...
[{"input": "0\n00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou can print your name on a billboard ad. Find out how much it will cost you. Each letter has a default pric...
[{"input": "\"Jeong-Ho Aristotelis\"", "output": "[600]", "fn_name": "billboard"}, {"input": "\"Abishai Charalampos\"", "output": "[570]", "fn_name": "billboard"}, {"input": "\"Zoroaster Donnchadh\"", "output": "[570]", "fn_name": "billboard"}, {"input": "\"Hjalmar Liupold\"\n40", "output": "[600]", "fn_name": "billboa...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n# Task\n John is new to spreadsheets. He is well aware of rows and columns, but he is not comfortable with sp...
[{"input": "\"AA48\"", "output": "[\"R48C27\"]", "fn_name": "spreadsheet"}, {"input": "\"BK12\"", "output": "[\"R12C63\"]", "fn_name": "spreadsheet"}, {"input": "\"R12C63\"", "output": "[\"BK12\"]", "fn_name": "spreadsheet"}, {"input": "\"R31C78\"", "output": "[\"BZ31\"]", "fn_name": "spreadsheet"}, {"input": "\"BZ31\"...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe north country is conquered by the great shogun-sama (which means king). Recently many beautiful dice whic...
[{"input": "1 2\n10 8\n0 0\n0 1\n3 3\n1 3 5\n2 13 1\n1 0 2\n0 0\n0 2\n3 3\n1 2 4\n4 8 10\n1 1 2\n0 0\n1 2\n2 2\n1 2\n5 4\n1 0\n0 1\n2 3\n1 2 3\n5 5 6\n0 0\n1 2\n0 0", "output": "24\n14\n30\n11\n21\n"}, {"input": "1 2\n10 8\n0 0\n0 1\n3 3\n1 3 5\n2 13 1\n1 0 2\n0 0\n0 2\n3 3\n1 2 4\n4 8 10\n1 1 2\n0 0\n1 2\n2 2\n1 2\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\nPetya is having a party soon, and he has decided to invite his $n$ friends.\n\nHe wants to make invitations i...
[{"input": "100000000 1\n", "output": "1500000000\n"}, {"input": "100000000 1\n", "output": "1500000000\n"}, {"input": "100000010 1\n", "output": "1500000150\n"}, {"input": "100010010 1\n", "output": "1500150150\n"}, {"input": "103616972 10575\n", "output": "146976\n"}, {"input": "100000000 3\n", "output": "500000001\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\nYour program fails again. This time it gets \"Wrong answer on test 233\".\n\nThis is the harder version of th...
[{"input": "100 100\n82 51 14 14 37 17 78 92 64 15 8 86 89 8 87 77 30 15 15 12 100 25 161 47 21 78 20 63 13 49 41 36 41 79 16 87 87 69 3 76 80 60 100 49 70 59 72 8 38 71 45 148 71 14 76 54 81 4 59 46 39 29 92 3 49 22 53 99 118 52 74 31 92 43 70 23 44 9 82 47 7 40 12 9 3 55 37 85 46 22 84 52 98 41 11 47 40 17 62 91\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\nBad news came to Mike's village, some thieves stole a bunch of chocolates from the local factory! Horrible! \...
[{"input": "1000000000000000\n", "output": "4949100894494448\n"}, {"input": "1000000000000000\n", "output": "4949100894494448\n"}, {"input": "999999999999997\n", "output": "4949100894494440\n"}, {"input": "999999999999996\n", "output": "4949100894494432\n"}, {"input": "999999999999995\n", "output": "4949100894494424\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\nYou are given an array $a$ of length $n$. The array is called 3SUM-closed if for all distinct indices $i$, $j...
[{"input": "4\n3\n-1 0 1\n5\n1 -2 -2 1 -3\n6\n0 0 0 0 0 0\n4\n-1 2 -3 4\n", "output": "YES\nNO\nYES\nNO\n"}, {"input": "1\n3\n0 65536 65536\n", "output": "NO\n"}, {"input": "1\n4\n-3 -1 1 1\n", "output": "YES\n"}, {"input": "1\n4\n3 -3 -3 9\n", "output": "YES\n"}, {"input": "1\n4\n-1 -4 2 3\n", "output": "NO\n"}, {"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\nYou throw a ball vertically upwards with an initial speed `v (in km per hour)`. The height `h` of the ball at...
[{"input": "136", "output": "[39]", "fn_name": "max_ball"}, {"input": "127", "output": "[36]", "fn_name": "max_ball"}, {"input": "137", "output": "[39]", "fn_name": "max_ball"}, {"input": "37", "output": "[10]", "fn_name": "max_ball"}, {"input": "45", "output": "[13]", "fn_name": "max_ball"}, {"input": "99", "output": ...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nNauuo is a girl who loves playing cards.\n\nOne day she was playing cards but found that the cards were mixed...
[{"input": "20\n15 10 6 0 0 11 19 17 0 0 0 0 0 1 14 0 3 4 0 12\n20 7 0 0 0 0 0 0 5 8 2 16 18 0 0 13 9 0 0 0\n", "output": "30\n"}, {"input": "20\n0 0 0 0 5 6 7 8 0 0 11 12 13 14 15 16 17 18 0 0\n20 9 19 0 0 0 0 0 0 10 0 0 0 0 0 0 1 2 3 4\n", "output": "37\n"}, {"input": "19\n0 0 0 0 0 0 0 0 0 18 17 16 15 14 13 12 11 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\nSnuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of th...
[{"input": "13 -10 2", "output": "133\n"}, {"input": "125 -2 0", "output": "247\n"}, {"input": "109 0 1", "output": "108\n"}, {"input": "109 0 2", "output": "215\n"}, {"input": "19 -7 -2", "output": "86\n"}, {"input": "48 -1 2", "output": "139\n"}, {"input": "69 -1 2", "output": "202\n"}, {"input": "36 -1 2", "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\nAs we know, DZY loves playing games. One day DZY decided to play with a n × m matrix. To be more precise, he ...
[{"input": "10 10 50 80\n529 349 889 455 946 983 312 179 590 907\n436 940 407 1064 26 963 181 789 461 437\n367 505 888 521 449 741 900 994 342 629\n605 374 112 829 212 329 295 416 181 435\n661 647 676 144 436 629 660 282 545 470\n392 555 351 969 102 178 588 578 696 592\n837 115 669 760 324 680 584 822 909 75\n575 89 56...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolo, the Penguin, likes numbers. He says that the goodness of a number is itself multiplied by the number of...
[{"input": "1\n13 393", "output": "227157\n"}, {"input": "1\n15 149", "output": "28365\n"}, {"input": "1\n15 260", "output": "96630\n"}, {"input": "1\n13 260", "output": "96684\n"}, {"input": "1\n13 130", "output": "20439\n"}, {"input": "1\n1 345", "output": "174060\n"}, {"input": "1\n2 345", "output": "174059\n"}, {"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\nThere are $n$ people sitting in a circle, numbered from $1$ to $n$ in the order in which they are seated. Tha...
[{"input": "735134400\n", "output": "1 367567202 735134403 1102701604 1470268805 1837836006 2205403207 2572970408 2940537609 3308104810 3675672011 4043239212 4410806413 4778373614 5145940815 5513508016 5881075217 6248642418 6983776820 7351344021 7718911222 8454045624 8821612825 9189180026 9556747227 9924314428 10659448...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLittle Tanya decided to present her dad a postcard on his Birthday. She has already created a message — strin...
[{"input": "DpiNBmCRFWxpdbfGOzvvOcemjructoAdEwegTvbVbfWWRPGyEAxGdDRWVlqNyGWMWHMrHAIZpyxvgaflrsVZhhZRouvpxrKXFZam\nwwPLFtNfPtJXvMLuHjKfYyaRhreNSWSzOvDpqHCGcqllACNPGHxReeFUCmAqIKXYytsSQwIxJzNiiUtgebVuwRmWpRALLyKAzyDPvgIGxALSaeeTIqm\n", "output": "66 12\n"}, {"input": "DpiNBmCRFWxpdbfGOzvvOcemjructoAdEwegTvbVbfWWRPGyEAxGd...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThis is related to my other Kata about cats and dogs.\n\n# Kata Task\n\nI have a cat and a dog which I got as...
[{"input": "56\n64", "output": "[[10, 10]]", "fn_name": "owned_cat_and_dog"}, {"input": "15\n15", "output": "[[1, 1]]", "fn_name": "owned_cat_and_dog"}, {"input": "18\n21", "output": "[[1, 1]]", "fn_name": "owned_cat_and_dog"}, {"input": "19\n17", "output": "[[1, 1]]", "fn_name": "owned_cat_and_dog"}, {"input": "24\n24...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIt is Borya's eleventh birthday, and he has got a great present: n cards with numbers. The i-th card has the ...
[{"input": "4\n2\n1 1\n3\n2 31 12\n3\n21646 67 98\n9\n1 2 3 14 4 11 7 8 9\n", "output": "2\n0\n1\n36288\n"}, {"input": "4\n2\n1 1\n3\n1 31 12\n3\n12345 67 84\n9\n1 2 3 4 5 1 7 8 16\n", "output": "2\n2\n2\n36288\n"}, {"input": "4\n2\n1 1\n3\n1 20 12\n3\n32697 67 98\n9\n1 2 3 4 13 6 7 8 6\n", "output": "2\n2\n0\n31104\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\nRoma works in a company that sells TVs. Now he has to prepare a report for the last year.\n\nRoma has got a l...
[{"input": "78 13\n-9961 -9922 -9817 -9813 -9521 -9368 -9361 -9207 -9153 -9124 -9008 -8981 -8951 -8911 -8551 -8479 -8245 -8216 -7988 -7841 -7748 -7741 -7734 -7101 -6846 -6804 -6651 -6526 -6519 -6463 -6297 -6148 -6090 -5845 -5209 -5201 -5161 -5061 -4537 -4529 -4433 -4370 -4266 -4189 -4125 -3945 -3843 -3777 -3751 -3476 -...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n-----Problem Statement-----\nChef studies combinatorics. He tries to group objects by their rang (a positive ...
[{"input": "4\n1 1 2 -1\n1\n3 1 0 0\n5\n0 1 1 0\n12\n1 4 1 7\n12", "output": "3\n342\n187771\n636400412\n"}, {"input": "4\n1 2 2 -1\n1\n3 1 0 0\n5\n0 1 1 0\n12\n1 4 1 7\n12", "output": "4\n342\n187771\n636400412\n"}, {"input": "4\n1 1 2 -1\n1\n5 1 0 0\n5\n0 1 2 0\n6\n1 4 0 7\n12", "output": "3\n1100\n2618\n549147970\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\nGiven are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the...
[{"input": "96 1", "output": "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\n"}, {"input": "10 40", "output": "10101010101010101010101010101010101010101010101010101010101010101010101010101010\n"}, {"input": "80 1", "output": "1111111111111111111111111111111111111111111...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA TV program called \"Saizo\" is popular in a certain country. In this program, participants challenge field ...
[{"input": "5\n5\n10 101 5 50 390\n2\n20 101\n2\n100 30\n3\n22 86 50\n7\n123 82 678 1617 272 971 1573", "output": "340 96\n81 0\n0 70\n64 36\n939 1345\n"}, {"input": "5\n5\n10 101 5 50 390\n2\n20 101\n2\n100 30\n3\n22 86 50\n7\n123 82 678 1617 106 971 1573", "output": "340 96\n81 0\n0 70\n64 36\n939 1511\n"}, {"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\nIt's now 260 AD. Shapur, being extremely smart, became the King of Persia. He is now called Shapur, His majes...
[{"input": "17 17\n00000000000000000000000000000000000000000000000000000000000000000000000000000\n", "output": "0\n"}, {"input": "34 17\n00000000000000000000000000000000000000000000000000000000000000000000000000000\n", "output": "0\n"}, {"input": "4 2\n112233030100132210003330\n", "output": "101101011110011000100000111...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWe have a board with H horizontal rows and W vertical columns of squares. There is a bishop at the top-left s...
[{"input": "1001000000 1000000000", "output": "500500000000000000\n"}, {"input": "1001000000 1100000000", "output": "550550000000000000\n"}, {"input": "1001000010 1100000000", "output": "550550005500000000\n"}, {"input": "1001000010 1100100000", "output": "550600055500500000\n"}, {"input": "1001000011 1100100000", "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\nThe goal of 8 Queens Problem is to put eight queens on a chess-board such that none of them threatens any of ...
[{"input": "2\n1 4\n5 3", "output": "..Q.....\n....Q...\n.Q......\n.......Q\n.....Q..\n...Q....\n......Q.\nQ.......\n"}, {"input": "2\n0 4\n5 3", "output": "....Q...\n.Q......\n.....Q..\nQ.......\n......Q.\n...Q....\n.......Q\n..Q.....\n"}, {"input": "2\n0 4\n5 2", "output": "....Q...\n.Q......\n...Q....\n.....Q..\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\n## Task\n\nFind the sum of the first `n` elements in the Recamán Sequence.\n\nInput range:\n\n```python\n1000...
[{"input": "10000", "output": "[82590002]", "fn_name": "rec"}, {"input": "1000", "output": "[837722]", "fn_name": "rec"}, {"input": "200", "output": "[36190]", "fn_name": "rec"}, {"input": "100", "output": "[7496]", "fn_name": "rec"}, {"input": "5", "output": "[12]", "fn_name": "rec"}, {"input": "0", "output": "[0]", "...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSnuke has N integers: 1,2,\\ldots,N. He will choose K of them and give those to Takahashi.\n\nHow many ways a...
[{"input": "1 -159", "output": "161\n"}, {"input": "119 -1", "output": "121\n"}, {"input": "2 -107", "output": "110\n"}, {"input": "0 -159", "output": "160\n"}, {"input": "112 -1", "output": "114\n"}, {"input": "0 -103", "output": "104\n"}, {"input": "112 -2", "output": "115\n"}, {"input": "-1 -29", "output": "29\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\nSasha grew up and went to first grade. To celebrate this event her mother bought her a multiplication table $...
[{"input": "10\n0 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 0 1 1 1 1 1 1 1 1\n1000000000 1 0 1 1 1 1 1 1 1\n1000000000 1 1 0 1 1 1 1 1 1\n1000000000 1 1 1 0 1 1 1 1 1\n1000000000 1 1 1 1 0 1 1 1 1\n1000000000 1 1 1 1 1 0 1 1 1\n1000000000 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\nYou are given a program that consists of $n$ instructions. Initially a single variable $x$ is assigned to $0$...
[{"input": "2\n8 4\n-+--+--+\n1 8\n2 8\n2 5\n1 1\n4 10\n+-++\n1 1\n1 2\n2 2\n1 3\n2 3\n3 3\n1 4\n2 4\n3 4\n4 4\n", "output": "\n1\n2\n4\n4\n3\n3\n4\n2\n3\n2\n1\n2\n2\n2\n"}, {"input": "2\n8 4\n-+--+--+\n1 8\n2 8\n2 5\n1 1\n4 10\n+-++\n1 1\n1 2\n2 2\n1 3\n2 3\n3 3\n1 4\n2 4\n3 4\n4 4\n", "output": "1\n2\n4\n4\n3\n3\n4\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\nDevelopers often face with regular expression patterns. A pattern is usually defined as a string consisting o...
[{"input": "100\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\n?b\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\nb?\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\nFedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:(1^{n} + 2^{n} ...
[{"input": "124356983594583453458888889\n", "output": "0\n"}, {"input": "124356983594583453458888889\n", "output": "0\n"}, {"input": "1134974\n", "output": "0\n"}, {"input": "1236642\n", "output": "0\n"}, {"input": "1068905\n", "output": "0\n"}, {"input": "1528132\n", "output": "4\n"}, {"input": "1580332\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\nKuroni is very angry at the other setters for using him as a theme! As a punishment, he forced them to solve ...
[{"input": "10\n648137704891 648137704891 648137704891 648137704891 648137704891 648137704891 648137704891 648137704891 648137704891 724560300002\n", "output": "2\n"}, {"input": "5\n169999847 169999847 169999847 300469729580 169999847\n", "output": "3\n"}, {"input": "5\n8082488 169999847 169999847 300469729580 16999984...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou have multiset of n strings of the same length, consisting of lowercase English letters. We will say that ...
[{"input": "3 20\naaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaa\n127368 467778 376749 367872 201445 632491 733098 177711 678142 3202 840006 769776 381139 365553 457474 206005 99000 226191 795686 589632\n785172 213443 482364 357721 191016 596022 882906 601573 917829 966436 129825 285602 706196 722082 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSonya decided to organize an exhibition of flowers. Since the girl likes only roses and lilies, she decided t...
[{"input": "1582 10\n587 646\n1148 843\n326 875\n439 485\n465 521\n330 387\n405 480\n477 115\n572 376\n715 771\n", "output": "01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLong ago, when Petya was a schoolboy, he was very much interested in the Petr# language grammar. During one l...
[{"input": "bgphoaomnjcjhgkgbflfclbjmkbfonpbmkdomjmkahaoclcbijdjlllnpfkbilgiiidbabgojbbfmliemhicaanadbaahagmfdldbbklelkihlcbkhchlikhefeeafbhkabfdlhnnjnlimbhneafcfeapcbeifgcnaijdnkjpikedmdbhahhgcijddfmamdiaapaeimdhfblpkedamifbbdndmmljmdcffcpmanndeeclnpnkdoieiahchdnkdmfnbocnimclgckdcbp\npcbeifgcnaijdnkjpikedmdbhahhgcijdd...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLet's denote a m-free matrix as a binary (that is, consisting of only 1's and 0's) matrix such that every squ...
[{"input": "3\n21\n0\n1\n", "output": "5 2\n1 1\n-1\n"}, {"input": "3\n21\n0\n1\n", "output": "5 2\n1 1\n-1\n"}, {"input": "1\n297540\n", "output": "546 22\n"}, {"input": "1\n297540\n", "output": "546 22\n"}, {"input": "1\n1015463691\n", "output": "-1\n"}, {"input": "1\n420441920\n", "output": "-1\n"}, {"input": "1\n42...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn Aizuwakamatsu City, there is a first city called \"Tokaichi\" on January 10th every year. This Tokaichi ha...
[{"input": "1593 4311\n4321 2155\n1256 11201\n5310 1455\n2152 5421\n1928 3386\n4528 1578\n1234 4321\n3330 3109\n2739 2199\n0 0", "output": "C 12457\nD 6439\n"}, {"input": "1593 4311\n4321 2155\n1256 12219\n5310 1455\n2152 5421\n1549 3288\n4528 3719\n1234 4321\n3330 2166\n2759 2199\n0 0", "output": "C 13475\nB 8247\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\nVasya wants to climb up a stair of certain amount of steps (Input parameter 1). There are 2 simple rules that...
[{"input": "10000\n10", "output": "[5000]", "fn_name": "numberOfSteps"}, {"input": "10000\n2", "output": "[5000]", "fn_name": "numberOfSteps"}, {"input": "10000\n3", "output": "[5001]", "fn_name": "numberOfSteps"}, {"input": "9999\n10", "output": "[5000]", "fn_name": "numberOfSteps"}, {"input": "9999\n3", "output": "[5...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPatrick has just finished writing a message to his sweetheart Stacey when he noticed that the message didn't ...
[{"input": "MMVESdOCALHJCTBTUWWQRGUUVTTTABKKAAdIINAdKLRLLVLODHDXDPMcQfUhPNHFBJSDRGsHZNORSCPNvKOOIuZnZAmTPUCoPNlR\n", "output": "13\n"}, {"input": "MMbJIBhgFXPVpdQHLkWJkAHFIfJSpITTCRzRCzvRPRYECCheOknfINZWuKATDBOrEVKTcWXiYPjtzQMGUSGPNTMCUrvYCSWQHqAi\n", "output": "27\n"}, {"input": "mnAkOBuKxaiJwXhKnlcCvjxYXGXDoIqfUYkiLr...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are N people (with different names) and K clubs. For each club you know the list of members (so you hav...
[{"input": "119107271329329921", "output": "-1\n"}, {"input": "33213408621377322", "output": "-1\n"}, {"input": "26939847318901699", "output": "-1\n"}, {"input": "12809773843701327", "output": "-1\n"}, {"input": "15368855316243065", "output": "-1\n"}, {"input": "123456789123456789", "output": "-1"}, {"input": "54520540...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMike received an array $a$ of length $n$ as a birthday present and decided to test how pretty it is.\n\nAn ar...
[{"input": "2\n5 5\n1 2 3 4 5\n1\n5\n9\n12\n6\n5 5\n6 1 3 2 3\n1\n2\n3\n15\n11\n", "output": "Yes\nYes\nYes\nNo\nYes\nYes\nYes\nYes\nYes\nNo\n"}, {"input": "2\n5 5\n1 2 3 4 5\n1\n5\n3\n12\n6\n5 5\n6 1 3 2 3\n1\n2\n3\n15\n11\n", "output": "Yes\nYes\nYes\nNo\nYes\nYes\nYes\nYes\nYes\nNo\n"}, {"input": "2\n5 5\n1 2 3 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\nGiven is a connected undirected graph with N vertices and M edges. The vertices are numbered 1 to N, and the ...
[{"input": "6\n010111\n101001\n010100\n101000\n100000\n010000", "output": "-1\n"}, {"input": "6\n010110\n101001\n010100\n101000\n100100\n010000", "output": "-1\n"}, {"input": "6\n010110\n001001\n010100\n101000\n100100\n010000", "output": "-1\n"}, {"input": "6\n010110\n001001\n010100\n101000\n000100\n010000", "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\nYou like playing chess tournaments online.\n\nIn your last tournament you played $n$ games. For the sake of t...
[{"input": "8\n5 2\nWLWLL\n6 5\nLLLWWL\n7 4\nLWLWLWL\n15 5\nWWWLLLWWWLLLWWW\n40 38\nLLWLWLWWWLWLLWLWWWLWLLWLLWLLLLWLLWWWLWWL\n1 0\nL\n1 0\nL\n6 0\nWLLWLW\n", "output": "7\n11\n13\n26\n79\n0\n0\n3\n"}, {"input": "8\n5 2\nWLWLL\n6 5\nLLLWWL\n7 4\nLWLWLWL\n15 2\nWWWLLLWWWLLLWWW\n40 38\nLLWLWLWWWLWLLWLWWWLWLLWLLWLLLLWLLWWW...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVasya commutes by train every day. There are n train stations in the city, and at the i-th station it's possi...
[{"input": "10\n2 10 8 7 8 8 10 9 10\n", "output": "63\n"}, {"input": "10\n2 10 8 7 8 8 10 9 10\n", "output": "63\n"}, {"input": "10\n2 10 8 7 8 9 10 9 10\n", "output": "62\n"}, {"input": "10\n3 10 8 7 8 9 10 9 10\n", "output": "61\n"}, {"input": "10\n2 10 8 6 8 8 10 9 10\n", "output": "66\n"}, {"input": "9\n2 9 7 6 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\nAfter many years of research, Ikta has acquired the ability to predict the future! The time and money he spen...
[{"input": "3 3 10\n18 1 13\n15 3 3\n5 10 0", "output": "100\n"}, {"input": "3 3 10\n10 14 13\n14 2 6\n5 4 1", "output": "28\n"}, {"input": "3 3 10\n18 4 13\n15 3 3\n5 11 1", "output": "34\n"}, {"input": "3 3 10\n18 4 13\n15 5 3\n5 11 1", "output": "24\n"}, {"input": "3 3 18\n10 14 13\n14 3 3\n5 4 1", "output": "29\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\nProgrammer Vasya is studying a new programming language &K*. The &K* language resembles the languages of the ...
[{"input": "10\ntypedef &void**** youdyfpinzk\ntypeof &youdyfpinzk***\ntypedef &&&&youdyfpinzk****** nfbsgpjzhxzskmxc\ntypeof nfbsgpjzhxzskmxc***\ntypedef &&&void*** puerqioirikxej\ntypeof &puerqioirikxej********\ntypedef &puerqioirikxej******** xzgzsamjdufuyxz\ntypeof &xzgzsamjdufuyxz******\ntypedef &&&&xzgzsamjdufuyx...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W.\nIf we consider th...
[{"input": "-1 -1 100", "output": "102\n"}, {"input": "-1 -1 101", "output": "103\n"}, {"input": "-1 -1 111", "output": "113\n"}, {"input": "0 -116 -1", "output": "115\n"}, {"input": "-2 -1 111", "output": "114\n"}, {"input": "2 -160 -1", "output": "157\n"}, {"input": "0 -155 -1", "output": "154\n"}, {"input": "0 -191 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAdam Ivan is working as a system administrator at Soy Group, Inc. He is now facing at a big trouble: a number...
[{"input": "4 2\n1 1 3\n-1 2 -1\n5 2\n0 3 1\n1 0 0\n0 0", "output": "2\n1\n"}, {"input": "4 2\n0 1 3\n-1 2 -1\n5 2\n0 3 1\n1 0 0\n0 0", "output": "2\n1\n"}, {"input": "4 2\n0 1 3\n-1 2 -1\n6 2\n0 3 1\n1 0 0\n0 0", "output": "2\n1\n"}, {"input": "3 2\n0 1 3\n-1 2 -1\n6 2\n0 3 1\n1 0 0\n0 0", "output": "2\n1\n"}, {"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\nStudent Valera is an undergraduate student at the University. His end of term exams are approaching and he is...
[{"input": "1\n1001000000 999999999\n", "output": "999999999\n"}, {"input": "1\n1101010000 523461264\n", "output": "523461264\n"}, {"input": "1\n1101000000 193606579\n", "output": "193606579\n"}, {"input": "1\n1101000000 142743309\n", "output": "142743309\n"}, {"input": "1\n1101000000 121903142\n", "output": "121903142...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nConsider a football tournament where n teams participate. Each team has two football kits: for home games, an...
[{"input": "30\n25 8\n25 4\n21 9\n25 1\n7 16\n23 21\n22 17\n27 29\n7 29\n20 3\n13 23\n7 13\n16 18\n25 14\n13 17\n28 15\n10 23\n25 18\n2 3\n23 13\n30 8\n13 15\n20 15\n11 29\n10 23\n5 16\n4 14\n4 30\n7 20\n11 1\n", "output": "29 29\n31 27\n29 29\n29 29\n30 28\n30 28\n29 29\n29 29\n29 29\n29 29\n31 27\n32 26\n29 29\n29 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\nПрошло много лет, и на вечеринке снова встретились n друзей. С момента последней встречи техника шагнула дале...
[{"input": "42\n13 62\n114 242\n265 839\n756 349\n298 476\n533 704\n348 277\n554 573\n654 112\n429 836\n574 766\n909 415\n163 891\n532 983\n873 457\n719 117\n1 302\n170 634\n166 585\n721 231\n208 609\n128 246\n845 726\n604 119\n859 110\n568 515\n656 913\n113 166\n794 566\n834 860\n983 596\n545 819\n167 9\n960 73\n260 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\nWe want to find the numbers higher or equal than 1000 that the sum of every four consecutives digits cannot b...
[{"input": "3000\n7", "output": "[[141, 1600, 220756]]", "fn_name": "max_sumDig"}, {"input": "5000\n6", "output": "[[122, 2010, 244875]]", "fn_name": "max_sumDig"}, {"input": "5000\n7", "output": "[[196, 2110, 413306]]", "fn_name": "max_sumDig"}, {"input": "5000\n8", "output": "[[296, 2200, 649951]]", "fn_name": "max_s...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given n segments on a number line, numbered from 1 to n. The i-th segments covers all integer points ...
[{"input": "45 100\n86 90 344\n67 71 63\n84 87 423\n96 98 297\n85 86 144\n75 80 489\n24 25 17\n75 78 363\n1 3 349\n17 19 146\n35 38 39\n90 93 236\n34 35 463\n59 64 259\n97 100 185\n71 75 214\n80 84 124\n63 67 324\n85 88 204\n47 51 420\n22 24 38\n30 34 41\n94 96 42\n3 6 312\n51 56 440\n84 85 337\n10 14 3\n30 31 390\n46 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAnother programming contest is over. You got hold of the contest's final results table. The table has the fol...
[{"input": "50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 50\n50 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\nA guy named Vasya attends the final grade of a high school. One day Vasya decided to watch a match of his fav...
[{"input": "44\n52 -54 -29\n-82 -5 -94\n-54 43 43\n91 16 71\n7 80 -91\n3 15 29\n-99 -6 -77\n-3 -77 -64\n73 67 34\n25 -10 -18\n-29 91 63\n-72 86 -16\n-68 85 -81\n-3 36 44\n-74 -14 -80\n34 -96 -97\n-76 -78 -33\n-24 44 -58\n98 12 77\n95 -63 -6\n-51 3 -90\n-92 -10 72\n7 3 -68\n57 -53 71\n29 57 -48\n35 -60 10\n79 -70 -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\nGiven a string consisting of only numbers from 0 to 9, consider the operation of creating a new string from t...
[{"input": "5\n28\n14\n1\n0", "output": "11131221121113122118\n311311222113111231131112132112311321322112111312211312111322212311322113212221\n"}, {"input": "5\n23\n14\n1\n0", "output": "11131221121113122113\n311311222113111231131112132112311321322112111312211312111322212311322113212221\n"}, {"input": "5\n19\n11\n0\n0"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAfter the lessons n groups of schoolchildren went outside and decided to visit Polycarpus to celebrate his bi...
[{"input": "78\n2 2 2 2 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 3 2 2 2 2 2 2 2 1 1 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2\n", "output": "39\n"}, {"input": "78\n2 2 2 2 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4 2 2 2 2 2 1 2 2 3 2 2 2 2 2 2 2 1 1 2 2 2 2 2 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\nSuppose you have two points $p = (x_p, y_p)$ and $q = (x_q, y_q)$. Let's denote the Manhattan distance betwee...
[{"input": "3\n4\n2 4 1 3\n5\n6 9 1 18 12\n2\n13 37\n", "output": "10\n13\n3\n"}, {"input": "3\n4\n2 4 1 3\n5\n6 9 2 18 12\n2\n13 37\n", "output": "10\n13\n3\n"}, {"input": "3\n4\n2 4 1 3\n5\n0 9 2 18 12\n2\n13 37\n", "output": "10\n13\n3\n"}, {"input": "3\n4\n2 4 1 3\n5\n0 9 2 18 12\n2\n20 37\n", "output": "10\n13\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\nGag\n\nSegtree has $ N $ of \"gags\", each with a value of $ V_i $.\n\nSegtree decided to publish all the gag...
[{"input": "1\n114525", "output": "114524\n"}, {"input": "1\n105905", "output": "105904\n"}, {"input": "1\n196252", "output": "196251\n"}, {"input": "1\n127413", "output": "127412\n"}, {"input": "1\n318416", "output": "318415\n"}, {"input": "1\n26794", "output": "26793\n"}, {"input": "1\n22977", "output": "22976\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\nYour task is to write a program which reads a sequence of integers and prints mode values of the sequence. Th...
[{"input": "5\n11\n3\n5\n8\n10\n11\n8\n29\n1\n3\n2", "output": "3\n5\n8\n11\n"}, {"input": "5\n11\n4\n10\n4\n-1\n20\n8\n20\n2\n8\n0", "output": "4\n8\n20\n"}, {"input": "5\n11\n2\n11\n1\n-2\n20\n8\n22\n2\n6\n1", "output": "1\n2\n11\n"}, {"input": "5\n11\n1\n5\n8\n0\n11\n8\n51\n1\n3\n2", "output": "1\n5\n8\n11\n"}, {"in...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWrite a function `consonantCount`, `consonant_count` or `ConsonantCount` that takes a string of English-langu...
[{"input": "\"h^$&^#$&^elLo world\"", "output": "[7]", "fn_name": "consonant_count"}, {"input": "\"helLo world\"", "output": "[7]", "fn_name": "consonant_count"}, {"input": "\"0123456789\"", "output": "[0]", "fn_name": "consonant_count"}, {"input": "\"012345_Cb\"", "output": "[2]", "fn_name": "consonant_count"}, {"inpu...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nB: Ebi-chan and Integer Sequences-\n\nproblem\n\nEbi-chan likes sequences. I especially like arithmetic progr...
[{"input": "2 36", "output": "1369\n"}, {"input": "11 54", "output": "305\n"}, {"input": "2 52", "output": "2809\n"}, {"input": "10 54", "output": "337\n"}, {"input": "2 58", "output": "3481\n"}, {"input": "2 39", "output": "1600\n"}, {"input": "2 13", "output": "196\n"}, {"input": "2 10", "output": "121\n"}, {"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\nVasya's house is situated in a forest, and there is a mushroom glade near it. The glade consists of two rows,...
[{"input": "6\n4 1 11 9 3 11\n12 32 19 12 19 11\n", "output": "1035\n"}, {"input": "6\n4 1 11 6 3 11\n12 32 19 12 19 11\n", "output": "1026\n"}, {"input": "6\n4 1 11 6 3 18\n12 32 19 12 19 11\n", "output": "1061\n"}, {"input": "6\n4 1 12 9 3 11\n12 20 19 12 19 11\n", "output": "917\n"}, {"input": "6\n4 1 12 9 3 11\n12 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n# Task\n An `amazon` (also known as a queen+knight compound) is an imaginary chess piece that can move like a...
[{"input": "\"e5\"\n\"f6\"", "output": "[[12, 10, 0, 33]]", "fn_name": "amazon_check_mate"}, {"input": "\"a1\"\n\"g5\"", "output": "[[0, 29, 1, 29]]", "fn_name": "amazon_check_mate"}, {"input": "\"a3\"\n\"e4\"", "output": "[[1, 32, 1, 23]]", "fn_name": "amazon_check_mate"}, {"input": "\"f3\"\n\"f2\"", "output": "[[6, 1...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRoy and Biv have a set of n points on the infinite number line.\n\nEach point has one of 3 colors: red, green...
[{"input": "4\n1 G\n123123 R\n987987987 B\n1000000000 G\n", "output": "1012135134\n"}, {"input": "4\n1 G\n123123 R\n987987987 B\n1000000100 G\n", "output": "1012135334\n"}, {"input": "4\n2 G\n123123 R\n987987987 B\n1000000000 G\n", "output": "1012135132\n"}, {"input": "4\n1 G\n123123 R\n179925707 B\n1000000100 G\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\nPerhaps many have heard that the World Biathlon Championship has finished. Although our hero Valera was not p...
[{"input": "15\n17 5\n-19 5\n-8 3\n27 2\n45 3\n36 2\n-32 2\n49 1\n-3 2\n-41 2\n-35 1\n-46 1\n-29 1\n33 1\n0 1\n50\n24 -4\n41 3\n37 3\n9 2\n38 -4\n-30 2\n-41 -5\n-9 -5\n-33 3\n0 2\n-20 -3\n-49 -4\n34 1\n-38 -2\n17 -1\n-33 3\n-17 4\n16 3\n-49 2\n-3 -4\n-9 2\n35 3\n37 -5\n0 0\n-46 -5\n48 1\n-22 -4\n-29 -5\n-41 4\n-11 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\nSnuke is going to open a contest named \"AtCoder s Contest\".\nHere, s is a string of length 1 or greater, wh...
[{"input": "AtCoder Beginner Contest\n", "output": "ABC\n"}, {"input": "AtCoder Befinner Contest", "output": "ABC\n"}, {"input": "AtCoder sennifeB Cpntest", "output": "AsC\n"}, {"input": "AtCoder rennigeB Contest", "output": "ArC\n"}, {"input": "AtCoder Aeifnnes Cpnsest", "output": "AAC\n"}, {"input": "AtCoder fBfinnes...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMonocarp has got two strings $s$ and $t$ having equal length. Both strings consist of lowercase Latin letters...
[{"input": "101\nbabbbbabbbbaabbbbbbbabbbababababbbbbbbbabaababbababbaaabbababbbbbbbbbaabbbababbbbbabbbbbabbbaabbbaabb\nbbabbbbbbabbbbbbbbbbbabbbbbbbbbbabbabbbbbbbbbbbabbababbbabbabbbbbbbbbbbbbaabbbabbbbabbabbbbababbbbbab\n", "output": "20\n2 7\n12 13\n21 25\n27 29\n31 40\n42 43\n45 50\n54 55\n58 70\n71 77\n83 89\n93 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\nSimple enough this one - you will be given an array. The values in the array will either be numbers or string...
[{"input": "[\"Hackathon\", \"Katathon\", \"Code\", \"CodeWars\", \"Laptop\", \"Macbook\", \"JavaScript\", 1, 5, 2]", "output": "[[1, 2, 5, \"Code\", \"CodeWars\", \"Hackathon\", \"JavaScript\", \"Katathon\", \"Laptop\", \"Macbook\"]]", "fn_name": "db_sort"}, {"input": "[82, 18, 72, 1, 11, 12, 12, 12, 12, 115, 667, 12,...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe new £5 notes have been recently released in the UK and they've certainly became a sensation! Even those o...
[{"input": "5300\n[1190, 1010, 1045, 55, 10, 19, 55]", "output": "[383]", "fn_name": "get_new_notes"}, {"input": "10000\n[1800, 500, 1200, 655, 150]", "output": "[1139]", "fn_name": "get_new_notes"}, {"input": "3600\n[1800, 350, 460, 500, 15]", "output": "[95]", "fn_name": "get_new_notes"}, {"input": "2300\n[590, 1500,...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPermutation p is an ordered set of integers p1, p2, ..., pn, consisting of n distinct positive integers not l...
[{"input": "18247 939\n", "output": "1 940 2 939 3 938 4 937 5 936 6 935 7 934 8 933 9 932 10 931 11 930 12 929 13 928 14 927 15 926 16 925 17 924 18 923 19 922 20 921 21 920 22 919 23 918 24 917 25 916 26 915 27 914 28 913 29 912 30 911 31 910 32 909 33 908 34 907 35 906 36 905 37 904 38 903 39 902 40 901 41 900 42 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\nWho's interested in football?\nRayne Wooney has been one of the top players for his football club for the las...
[{"input": "3\n4\n3 7 1 4 2 4\n5\n7 4 3 3 1\n5\n4 3 2 2 0", "output": "4\nUNFIT\nUNFIT\n"}, {"input": "3\n6\n1 1 -1 4 2 4\n5\n4 4 3 2 1\n5\n4 3 1 2 3", "output": "5\nUNFIT\n2\n"}, {"input": "3\n6\n1 1 -1 4 2 1\n5\n4 4 3 2 1\n5\n4 0 1 2 3", "output": "5\nUNFIT\n3\n"}, {"input": "3\n6\n3 7 1 4 2 4\n5\n5 4 3 2 1\n5\n4 3 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe only difference between easy and hard versions is constraints.\n\nIvan plays a computer game that contain...
[{"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\n1 72\n1 37\n8 64\n10 30\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMike has a sequence A = [a1, a2, ..., an] of length n. He considers the sequence B = [b1, b2, ..., bn] beauti...
[{"input": "9\n57 30 28 81 88 32 3 42 25\n", "output": "YES\n8\n"}, {"input": "9\n57 12 28 81 88 32 3 42 25\n", "output": "YES\n8\n"}, {"input": "9\n57 12 29 81 88 32 3 42 37\n", "output": "YES\n7\n"}, {"input": "9\n57 12 28 81 88 32 3 42 37\n", "output": "YES\n8\n"}, {"input": "9\n57 2 29 81 88 32 3 42 37\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\nPeter is a person with erratic sleep habits. He goes to sleep at twelve o'lock every midnight. He gets up jus...
[{"input": "2\n-1 23\n3\n1 1\n1 1\n3 -1\n0", "output": "0\n"}, {"input": "2\n1 23\n3\n2 1\n10 1\n3 1\n0", "output": "3\n"}, {"input": "2\n-1 23\n3\n1 1\n2 0\n5 2\n0", "output": "2\n"}, {"input": "2\n-1 13\n3\n1 2\n2 1\n3 1\n0", "output": "2\n"}, {"input": "2\n-1 13\n3\n2 2\n2 1\n3 1\n0", "output": "2\n"}, {"input": "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\nFox Ciel has a robot on a 2D plane. Initially it is located in (0, 0). Fox Ciel code a command to it. The com...
[{"input": "-1000000000 -1000000000\nDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDL\n", "output": "Yes\n"}, {"input": "1000000000 1000000000\nRURURURURURURURURURURURURURURURURURURURURURURURURURURURURURURURURURURURURURURURURURURURURURURURURURU\n", "output": "Yes\n"},...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given an expression of the form $a{+}b$, where $a$ and $b$ are integers from $0$ to $9$. You have to ...
[{"input": "100\n0+0\n0+1\n0+2\n0+3\n0+4\n0+5\n0+6\n0+7\n0+8\n0+9\n1+0\n1+1\n1+2\n1+3\n1+4\n1+5\n1+6\n1+7\n1+8\n1+9\n2+0\n2+1\n2+2\n2+3\n2+4\n2+5\n2+6\n2+7\n2+8\n2+9\n3+0\n3+1\n3+2\n3+3\n3+4\n3+5\n3+6\n3+7\n3+8\n3+9\n4+0\n4+1\n4+2\n4+3\n4+4\n4+5\n4+6\n4+7\n4+8\n4+9\n5+0\n5+1\n5+2\n5+3\n5+4\n5+5\n5+6\n5+7\n5+8\n5+9\n6+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\nLeha decided to move to a quiet town Vičkopolis, because he was tired by living in Bankopolis. Upon arrival h...
[{"input": "10\n877105545 939360757 849826701 845946140 733167691 265756841 967305000 1281921930 921301848 971203310\n", "output": "490950129\n"}, {"input": "10\n877105545 939360757 849826701 845946140 803128820 926787996 967305000 904694971 921301848 971203310\n", "output": "861364152\n"}, {"input": "10\n877105545 939...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nA marine themed rival site to Codewars has started. Codwars is advertising their website all over the interne...
[{"input": "\"https://this.is.an.unneccesarily.long.subdomain.codewars.com/katas.are.really.fun.codwars.com/\"", "output": "[false]", "fn_name": "find_codwars"}, {"input": "\"https://this.is.an.unneccesarily.long.subdomain.codwars.comp/katas.are.really.fun.codwars.com/\"", "output": "[false]", "fn_name": "find_codwars"...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAs we all know Barney's job is \"PLEASE\" and he has not much to do at work. That's why he started playing \"...
[{"input": "12\n254904759290707697 475737283258450340 533306428548398547 442127134828578937 779740159015946254 272877594683860919 93000149670491971 632184275887310175 498293278222136720 551099726729989816 149940343283925029 989425634209891686\n", "output": "461895893/385687671\n"}, {"input": "12\n254904759290707697 475...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given string $s$ of length $n$ consisting of 0-s and 1-s. You build an infinite string $t$ as a conca...
[{"input": "1\n439 -6100238\n100011110101001111000100101001001100010100010101001011100000110000000010011011111100010011100100000010011000110100111010100100100101101101100111100001010000010110000111011100000001110111100111110011110001001001100010110101100101011111010110010110101111001011000111010000101110100011010101101...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nNauuo is a girl who loves writing comments.\n\nOne day, she posted a comment on Codeforces, wondering whether...
[{"input": "000 100 100\n", "output": "?\n"}, {"input": "100 100 100\n", "output": "?"}, {"input": "100 100 100\n", "output": "?"}, {"input": "101 0 100\n", "output": "+\n"}, {"input": "25 24 100\n", "output": "?\n"}, {"input": "123 29 43\n", "output": "+\n"}, {"input": "100 110 0\n", "output": "-\n"}, {"input": "60 11...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven two arrays, the purpose of this Kata is to check if these two arrays are the same. \"The same\" in this...
[{"input": "[[2, 5], [3, 5], [6, 2]]\n[[2, 6], [5, 3], [2, 5]]", "output": "[true]", "fn_name": "same"}, {"input": "[[2, 5], [3, 5], [6, 2]]\n[[3, 5], [6, 2], [5, 2]]", "output": "[true]", "fn_name": "same"}, {"input": "[[2, 3], [3, 4]]\n[[4, 3], [2, 4]]", "output": "[false]", "fn_name": "same"}, {"input": "[[2, 5], [3...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe construction of subway in Bertown is almost finished! The President of Berland will visit this city soon ...
[{"input": "100\n98 52 63 2 18 96 31 58 84 40 41 45 66 100 46 71 26 48 81 20 73 91 68 76 13 93 17 29 64 95 79 21 55 75 19 85 54 51 89 78 15 87 43 59 36 1 90 35 65 56 62 28 86 5 82 49 3 99 33 9 92 32 74 69 27 22 77 16 44 94 34 6 57 70 23 12 61 25 8 11 67 47 83 88 10 14 30 7 97 60 42 37 24 38 53 50 4 80 72 39\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\nBessie is out grazing on the farm, which consists of $n$ fields connected by $m$ bidirectional roads. She is ...
[{"input": "42 41 20\n8 34 12 13 38 3 9 10 18 16 2 26 24 17 32 21 4 27 15 39\n1 35\n35 8\n1 31\n31 34\n1 40\n40 12\n1 30\n30 13\n1 33\n33 38\n1 37\n37 3\n1 22\n22 9\n1 20\n20 10\n1 25\n25 18\n1 14\n14 16\n1 42\n42 7\n7 2\n42 11\n11 26\n42 29\n29 24\n42 36\n36 17\n42 41\n41 32\n42 23\n23 21\n42 28\n28 4\n42 5\n5 27\n42 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere is a game that uses numbers called \"Fizz Buzz\". In this game, multiple players count the numbers one ...
[{"input": "5 7\n1\n-1\nFizz\n2\nzuzB\n5\n2\n16 5\n1\n4\n5\n7\n8\n0 0", "output": "3\n1 6 7 8 9 10 11 12 13 14 15 16\n"}, {"input": "14 7\n1\n0\nzzFi\n4\nBuzz\n11\n1\n3 5\n-1\n3\n8\n4\n3\n0 0", "output": "1 4 5 8 9 10 11 12 13 14\n3\n"}, {"input": "14 7\n1\n0\nzzFi\n4\nAuzz\n11\n1\n3 5\n-1\n3\n8\n4\n3\n0 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\nChouti was doing a competitive programming competition. However, after having all the problems accepted, he g...
[{"input": "1000000000\n", "output": "1\n"}, {"input": "1000000000\n", "output": "1\n"}, {"input": "1236540828\n", "output": "1\n"}, {"input": "1102703100\n", "output": "1\n"}, {"input": "1266106036\n", "output": "1\n"}, {"input": "1000000010\n", "output": "1\n"}, {"input": "1709258177\n", "output": "1\n"}, {"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\nIt is said that a legendary treasure left by Mr. Yao is sleeping somewhere in Hachioji long ago. The treasure...
[{"input": "4\n1 1\n2 0 -1\n2 4 2\n3 2 16 10\n0", "output": "-1\n"}, {"input": "4\n1 1\n2 0 0\n2 4 2\n3 2 16 10\n0", "output": "-1\n"}, {"input": "4\n1 1\n2 0 -1\n2 4 2\n3 2 16 2\n0", "output": "-1\n"}, {"input": "4\n1 1\n2 -1 3\n2 1 2\n3 3 4 10\n0", "output": "-1\n"}, {"input": "4\n1 1\n2 -1 3\n2 2 2\n3 3 4 10\n0", "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\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the follow...
[{"input": "8\n1 1 1 1 1 0 4 1", "output": "10\n10\n10\n10\n10\n15\n15\n10\n"}, {"input": "8\n1 1 0 1 1 1 6 1", "output": "10\n10\n15\n10\n10\n10\n15\n10\n"}, {"input": "8\n1 1 1 3 1 0 4 1", "output": "6\n6\n6\n10\n6\n10\n10\n6\n"}, {"input": "8\n1 1 1 3 1 0 3 1", "output": "7\n7\n7\n10\n7\n11\n10\n7\n"}, {"input": "8\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWe have an integer sequence of length N: A_0,A_1,\\cdots,A_{N-1}.\n\nFind the following sum (\\mathrm{lcm}(a,...
[{"input": "10\n356822 296174 484500 710640 610703 888250 259161 609120 592348 713644", "output": "963903348\n"}, {"input": "10\n356822 296174 484500 710640 231537 888250 259161 609120 592348 713644", "output": "669101188\n"}, {"input": "10\n356822 296174 484500 710640 231537 888250 100152 609120 592348 713644", "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\nYou're given a string of lower-case Latin letters. Your task is to find the length of its longest substring t...
[{"input": "ipsrjylhpkjvlzncfixipstwcicxqygqcfrawpzzvckoveyqhathglblhpkjvlzncfixipfajaqobtzvthmhgbuawowoknirclxg\n", "output": "15\n"}, {"input": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbffffffffffffffffffffffgffffffffffffff\n", "output": "61\n"}, {"input": "bbbbbbbbbbbbbbbbbbabbbbbbbbbbbbbbbbbbb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRead problems statements in Mandarin Chinese and Russian as well. \n\nGiven an array of N numbers, a pair of ...
[{"input": "3\n3 0\n3 5 0\n4 3\n13 10 11 12\n5 3\n3 2 5 17 15", "output": "0\n46\n40\n"}, {"input": "3\n3 0\n3 5 0\n4 3\n13 10 11 12\n5 3\n3 2 2 17 15", "output": "0\n46\n37\n"}, {"input": "3\n3 0\n3 5 0\n4 3\n19 10 11 12\n5 3\n3 2 2 17 15", "output": "0\n23\n37\n"}, {"input": "3\n3 3\n7 5 8\n4 5\n8 13 13 12\n5 6\n7 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\nImplement a function which behaves like the 'uniq -c' command in UNIX. \n\nIt takes as input a sequence and r...
[{"input": "[\"a\", \"a\", \"b\", \"b\", \"c\", \"a\", \"b\", \"c\"]", "output": "[[[\"a\", 2], [\"b\", 2], [\"c\", 1], [\"a\", 1], [\"b\", 1], [\"c\", 1]]]", "fn_name": "uniq_c"}, {"input": "[\"a\", \"a\", \"a\", \"b\", \"b\", \"b\", \"c\", \"c\", \"c\"]", "output": "[[[\"a\", 3], [\"b\", 3], [\"c\", 3]]]", "fn_name":...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAn expedition group flew from planet ACM-1 to Earth in order to study the bipedal species (its representative...
[{"input": "1050034174 1181487066\n", "output": "544888754\n"}, {"input": "880162386 1131317357\n", "output": "508228391\n"}, {"input": "1511923181 994962872\n", "output": "797030938\n"}, {"input": "596386879 1071021379\n", "output": "555054884\n"}, {"input": "94821338 1131317357\n", "output": "1003908236\n"}, {"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\n# Task\n\nYour task is to sort the characters in a string according to the following rules:\n```\n- Rule1: En...
[{"input": "\" MkWD{RB=//k-^ J@,xH Vfi uAz+$ kV _[ }a!}%pSBwn !kKB (b q PQF +}wS .kfU r wFNEs#NsR UVMdG\"", "output": "[\" AaBB{Bb=//D-^ d@,Ef FfF GHi+$ Jk _[ }k!}%kkKkM !MnN (N p PqQ +}Rr .RSS s suUUV#VVW wwwxz\"]", "fn_name": "sort_string"}, {"input": "\"-c--b--a-\"", "output": "[\"-a--b--c-\"]", "fn_name": "sort...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAll space-time unified dimension sugoroku tournament. You are representing the Earth in the 21st century in t...
[{"input": "12\n0\n-1\n7\n0\n2\n-1\n-1\n3\n-10\n-2\n1\n0", "output": "1\n"}, {"input": "12\n0\n-1\n7\n0\n2\n0\n-1\n3\n-10\n-2\n1\n0", "output": "1\n"}, {"input": "12\n0\n-1\n7\n0\n2\n0\n-2\n3\n-10\n-2\n1\n0", "output": "1\n"}, {"input": "12\n0\n-1\n7\n0\n1\n0\n-2\n3\n-10\n-2\n1\n0", "output": "1\n"}, {"input": "12\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\n# Task\n\n**_Given_** a **_Divisor and a Bound_** , *Find the largest integer N* , Such That , \n\n# Conditio...
[{"input": "37\n200", "output": "[185]", "fn_name": "max_multiple"}, {"input": "10\n50", "output": "[50]", "fn_name": "max_multiple"}, {"input": "7\n100", "output": "[98]", "fn_name": "max_multiple"}, {"input": "7\n17", "output": "[14]", "fn_name": "max_multiple"}, {"input": "3\n10", "output": "[9]", "fn_name": "max_mu...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolycarp is flying in the airplane. Finally, it is his favorite time — the lunchtime. The BerAvia company ste...
[{"input": "5\n\n3 3\n1 1 1\n0 0\n0 1\n\n3 3\n1 1 1\n1 0\n2 1\n\n3 3\n1 1 1\n1 0\n0 1\n\n3 3\n1 1 1\n0 0\n1 0\n\n3 3\n1 1 1\n0 0\n1 1\n", "output": "YYY\nYYN\nYYY\nYYY\nYYY\n"}, {"input": "5\n\n3 3\n1 1 1\n0 0\n0 1\n\n3 3\n1 1 1\n1 0\n2 1\n\n3 3\n1 1 1\n1 0\n0 1\n\n3 3\n1 1 1\n0 0\n1 0\n\n3 3\n1 1 1\n0 0\n1 1\n", "outp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nToday's morning was exceptionally snowy. Meshanya decided to go outside and noticed a huge snowball rolling d...
[{"input": "71 100\n56 44\n12 85\n", "output": "5053\n"}, {"input": "46 100\n36 81\n99 28\n", "output": "4961\n"}, {"input": "29 100\n30 51\n28 92\n", "output": "5021\n"}, {"input": "93 80\n13 49\n100 21\n", "output": "3220\n"}, {"input": "46 100\n36 81\n97 28\n", "output": "4963\n"}, {"input": "29 100\n30 51\n46 92\n"...
code_stdio