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\nMahmoud and Ehab continue their adventures! As everybody in the evil land knows, Dr. Evil likes bipartite gra... | [{"input": "10\n7 6\n2 10\n7 1\n8 5\n9 3\n2 3\n8 7\n10 8\n10 4\n", "output": "15\n"}, {"input": "10\n7 6\n2 7\n4 1\n8 5\n9 4\n5 3\n8 7\n10 8\n10 4\n", "output": "16\n"}, {"input": "10\n2 6\n3 7\n8 4\n4 10\n6 9\n9 7\n3 10\n1 2\n5 8\n", "output": "16\n"}, {"input": "10\n7 6\n2 7\n4 1\n8 5\n9 4\n5 3\n8 7\n10 8\n10 4\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: A-Z Cat / A-Z Cat\n\nstory\n\nAizunyan is a second-year student who belongs to the programming contest clu... | [{"input": "AOZUNYANPERIPERO", "output": "AZ\n"}, {"input": "OREQIRMQEAYNUYOA", "output": "-1\n"}, {"input": "OREPIREPNAYNUZOA", "output": "AZ\n"}, {"input": "OREPIRNPEAYNUZOA", "output": "AZ\n"}, {"input": "OREQIRNPEAYNUZOA", "output": "AZ\n"}, {"input": "OREQIRMPEAYNUZOA", "output": "AZ\n"}, {"input": "AOZUNYAEPMRIQE... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRecently a dog was bought for Polycarp. The dog's name is Cormen. Now Polycarp has a lot of troubles. For exa... | [{"input": "100 500\n64 140 15 221 24 106 73 30 275 97 296 55 5 30 47 199 130 44 72 170 7 204 359 40 128 117 45 192 344 112 0 11 196 78 73 53 222 93 88 151 99 283 60 71 4 87 226 46 66 74 23 89 77 60 397 181 0 101 358 54 124 155 19 218 9 140 161 130 308 85 103 85 300 128 19 108 225 136 100 54 30 24 129 245 128 88 160 12... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are N participants in the CODE FESTIVAL 2016 Qualification contests. The participants are either studen... | [{"input": "12 14 3\ncaababaccaba", "output": "No\nYes\nYes\nYes\nYes\nYes\nYes\nNo\nNo\nYes\nYes\nYes\n"}, {"input": "12 14 3\nabaccababaac", "output": "Yes\nYes\nYes\nNo\nNo\nYes\nYes\nYes\nYes\nYes\nYes\nNo\n"}, {"input": "12 16 2\ncabbabaacaaa", "output": "No\nYes\nYes\nYes\nYes\nNo\nYes\nYes\nNo\nYes\nYes\nYes\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\nLet's call a positive integer $n$ ordinary if in the decimal notation all its digits are the same. For exampl... | [{"input": "6\n2\n2\n3\n8\n10\n100\n", "output": "2\n2\n3\n8\n9\n18\n"}, {"input": "6\n2\n2\n3\n4\n10\n100\n", "output": "2\n2\n3\n4\n9\n18\n"}, {"input": "6\n1\n2\n3\n4\n5\n100\n", "output": "\n1\n2\n3\n4\n5\n18\n"}, {"input": "6\n1\n2\n3\n4\n5\n100\n", "output": "1\n2\n3\n4\n5\n18\n"}, {"input": "6\n1\n2\n3\n4\n8\n10... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAppleman and Toastman play a game. Initially Appleman gives one group of n numbers to the Toastman, then they... | [{"input": "10\n1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000\n", "output": "64000000\n"}, {"input": "10\n171308 397870 724672 431255 228496 892002 542924 718337 888642 161821\n", "output": "40204082\n"}, {"input": "10\n888642 724672 724672 431255 431255 397870 397870 397870 397870 228... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMikhail walks on a 2D plane. He can go either up or right. You are given a sequence of Mikhail's moves. He th... | [{"input": "100\nUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU\n", "output": "100\n"}, {"input": "100\nUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU\n", "output": "100\n"}, {"input": "100\nRRURRUUUURURRRURRRRUR... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 the set of all nonnegative integers: ${0, 1, 2, \\dots}$. Given two integers $a$ and $b$ ($1 \\le a,... | [{"input": "4\n10 10\n1 10\n6 9\n7 3\n", "output": "Infinite\nFinite\nInfinite\nFinite\n"}, {"input": "4\n10 10\n1 10\n3 9\n7 3\n", "output": "Infinite\nFinite\nInfinite\nFinite\n"}, {"input": "4\n10 10\n1 10\n6 9\n7 3\n", "output": "Infinite\nFinite\nInfinite\nFinite\n"}, {"input": "4\n10 8\n1 10\n6 9\n7 3\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\nI love Fibonacci numbers in general, but I must admit I love some more than others. \n\nI would like for you ... | [{"input": "22", "output": "[10946]", "fn_name": "nth_fib"}, {"input": "23", "output": "[17711]", "fn_name": "nth_fib"}, {"input": "24", "output": "[28657]", "fn_name": "nth_fib"}, {"input": "25", "output": "[46368]", "fn_name": "nth_fib"}, {"input": "18", "output": "[1597]", "fn_name": "nth_fib"}, {"input": "19", "out... | 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\nTakahashi bought a piece of apple pie at ABC Confiserie. According to his memory, he paid N yen (the currency... | [{"input": "1101", "output": "1020\n"}, {"input": "1111", "output": "1029\n"}, {"input": "1100", "output": "1019\n"}, {"input": "1011", "output": "937\n"}, {"input": "239", "output": "222\n"}, {"input": "442", "output": "410\n"}, {"input": "452", "output": "419\n"}, {"input": "192", "output": "178\n"}, {"input": "322",... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nproblem\n\nGiven the squares of $ R * C $. Each square is either an empty square or a square with a hole. The... | [{"input": "3 5\n.....\n.#.#.\n.###.\n.#.#.\n.....", "output": "3\n"}, {"input": "3 1\n.....\n.#.#.\n.###.\n.#.#.\n.....", "output": "0\n"}, {"input": "2 5\n.....\n.#.#.\n.###.\n.#.#.\n.....", "output": "2\n"}, {"input": "4 2\n.....\n.#.#/\n.###.\n.#.#.\n.....", "output": "1\n"}, {"input": "0 1\n.....\n.#.#.\n.###.\n.#... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are n cities in the country where the Old Peykan lives. These cities are located on a straight line, we... | [{"input": "100 6\n15 20 32 8 29 10 33 15 9 26 28 21 34 7 41 23 9 17 16 15 14 29 25 31 24 26 13 18 19 40 9 16 36 32 39 11 4 31 37 28 32 40 7 18 45 21 15 45 6 15 27 22 27 41 28 7 22 43 25 40 6 7 32 31 36 14 5 27 31 28 23 9 13 14 7 25 28 33 40 22 44 9 29 26 41 30 16 15 31 42 13 40 36 44 17 29 32 29 38 13\n4 4 3 4 3 4 3 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\n# Task\nYou are a lifelong fan of your local football club, and proud to say you rarely miss a game. Even tho... | [{"input": "100\n[100, 100]", "output": "[2]", "fn_name": "penaltyShots"}, {"input": "10\n[10, 10]", "output": "[2]", "fn_name": "penaltyShots"}, {"input": "2\n[1, 2]", "output": "[3]", "fn_name": "penaltyShots"}, {"input": "5\n[5, 5]", "output": "[2]", "fn_name": "penaltyShots"}, {"input": "0\n[0, 0]", "output": "[6]"... | 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\nThere is a very secret base in Potatoland where potato mash is made according to a special recipe. The neighb... | [{"input": "...\nX.X\n...\n", "output": "YES\n"}, {"input": "X.X\n.X.\nX.X\n", "output": "YES\n"}, {"input": "...\nXXX\n...\n", "output": "YES\n"}, {"input": "X..\n.X.\n..X\n", "output": "YES\n"}, {"input": "XXX\nX.X\nXXX\n", "output": "YES\n"}, {"input": "...\n.X.\n...\n", "output": "YES\n"}, {"input": "XXX\n.X.\nXXX\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nNiwango has N cards, numbered 1,2,\\ldots,N. He will now arrange these cards in a row.\n\nNiwango wants to kn... | [{"input": "13\n4 3 4 0 12 4 11 5 4 11 13 13 12", "output": "1 2 4 3 5 6 7 8 9 10 13 11 12\n"}, {"input": "13\n4 3 2 0 12 4 8 10 4 11 13 13 12", "output": "1 2 4 3 5 6 7 9 8 11 12 10 13\n"}, {"input": "13\n2 3 2 0 12 4 8 10 4 11 13 13 12", "output": "1 3 4 2 5 6 7 9 8 11 12 10 13\n"}, {"input": "13\n4 3 4 0 12 3 11 5 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\nGiven are two sequences a=\\{a_0,\\ldots,a_{N-1}\\} and b=\\{b_0,\\ldots,b_{N-1}\\} of N non-negative integer... | [{"input": "5\n0 0 0 0 0\n2 2 2 2 2\n", "output": "0 2\n1 2\n2 2\n3 2\n4 2\n"}, {"input": "5\n0 0 0 0 0\n2 2 2 2 2", "output": "0 2\n1 2\n2 2\n3 2\n4 2"}, {"input": "6\n0 1 3 7 6 4\n1 5 4 6 2 3\n", "output": "2 2\n5 5\n"}, {"input": "6\n0 1 3 7 6 4\n1 5 4 6 2 3", "output": "2 2\n5 5"}, {"input": "6\n0 1 2 7 6 4\n1 5 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\nTheofanis has a riddle for you and if you manage to solve it, he will give you a Cypriot snack halloumi for f... | [{"input": "7\n1\n3\n20\n2\n110\n23\n4838829180358\n", "output": "0 1\n-2 3\n-19 20\n-1 2\n-109 110\n-22 23\n-4838829180357 4838829180358\n"}, {"input": "7\n1\n2\n12\n2\n101\n56\n3000000000000\n", "output": "0 1\n-1 2\n-11 12\n-1 2\n-100 101\n-55 56\n-2999999999999 3000000000000\n"}, {"input": "7\n1\n3\n32\n2\n110\n23\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nExample\n\nInput\n\n4\nDurett 7\nGayles 3\nFacenda 6\nDaughtery 0\n1\n+ Mccourtney 2\n\n\nOutput\n\nMccourtne... | [{"input": "4\nDurett 10\nGayles 4\nF`cenda 10\nyrethguaD 0\n1\n+ Mccourtney 1", "output": "Mccourtney is not working now.\nF`cenda is working hard now.\n"}, {"input": "4\nDurett 10\nGaxles 4\nFacenda 10\nyrethguaD 0\n1\n+ yentruoccM 2", "output": "yentruoccM is not working now.\nFacenda is working hard now.\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\nPetya has noticed that when he types using a keyboard, he often presses extra buttons and adds extra letters ... | [{"input": "qybldcgfhdhhhhhhhhhhopqkhuczzytzluiahwbqjltgafvvoecititchjwdoljiehubngmtjckqymldhoncgtqhxnqvoagnrmur\nqybldcgfhdhhhhhhhhhopqkhuczzytzluiahwbqjltgafvvoecititchjwdoljiehubngmtjckqymldhoncgtqhxnqvoagnrmur\n", "output": "10\n11 12 13 14 15 16 17 18 19 20 "}, {"input": "aaaaaaaaaaa\naaaaaaaaaa\n", "output": "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\nUjan has a lot of useless stuff in his drawers, a considerable part of which are his math notebooks: it is ti... | [{"input": "15 10\n2 3\n5 4\n5 12\n5 7\n3 8\n3 10\n11 12\n12 13\n13 14\n14 15\n", "output": "0\n"}, {"input": "15 10\n2 3\n6 4\n5 12\n5 7\n3 8\n3 10\n11 12\n12 13\n13 14\n14 15\n", "output": "0\n"}, {"input": "15 10\n2 3\n5 8\n5 6\n5 7\n3 8\n3 10\n11 12\n12 13\n13 14\n14 15\n", "output": "0\n"}, {"input": "15 10\n2 3\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\nOnce Bob needed to find the second order statistics of a sequence of integer numbers. Lets choose each number... | [{"input": "99\n10 -84 -100 -100 73 -64 -100 -94 33 -100 -100 -100 -100 71 64 24 7 -100 -32 -100 -100 77 -100 62 -12 55 45 -100 -100 -80 -100 -100 -100 -100 -100 -100 -100 -100 -100 -39 -48 -100 -34 47 -100 -100 -100 -100 -100 -77 -100 -100 -100 -100 -100 -100 -52 40 -55 -100 -44 -100 72 33 70 -100 -100 -78 -100 -3 100... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given two arrays $a$ and $b$, both of length $n$.\n\nYou can perform the following operation any numb... | [{"input": "1\n100\n77 18 18 20 58 11 45 18 21 15 44 87 77 65 94 83 68 73 43 84 75 100 66 39 63 44 60 16 100 4 83 53 37 11 95 71 38 57 66 31 40 60 36 37 92 79 30 55 46 25 54 45 85 38 29 82 60 11 11 69 30 1 53 100 62 61 17 75 99 9 31 8 100 53 57 8 11 26 95 72 50 77 90 88 80 84 53 50 23 3 78 27 76 82 4 7 36 13 63 100\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\nBerOilGasDiamondBank has branches in n cities, at that n is an even number. The bank management wants to publ... | [{"input": "58\nesgdfmf\nxfkluadj\nqhvh\njwhuyhm\nmgi\nysgc\nvhhenku\npb\ntr\nu\njyrpjnpd\nkluadjo\nopb\ncopb\ngcyhceo\nr\ndjo\nxfklu\neo\nadjo\nfkluadjo\nybe\nwljwh\nqhvhh\nrhgotp\nyhceo\nuyhm\nvdd\nyhm\nysgcyhc\nvddrhg\nril\nwljwhu\nx\nqh\nhceo\ntfcopb\nmgitfc\nvddrh\nmgitfco\nxf\nmgitf\ncyoybe\notp\no\nljwhuyhm\nysg... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 are constraints on $n$ and $k$.\n\nYou are messaging in on... | [{"input": "10 4\n2 3 3 1 1 4 1 2 3 3\n", "output": "4\n4 1 3 2\n"}, {"input": "10 4\n2 3 3 1 1 2 1 2 5 3\n", "output": "4\n5 1 3 2\n"}, {"input": "10 4\n2 3 3 2 1 4 1 2 3 3\n", "output": "4\n4 1 3 2\n"}, {"input": "10 4\n2 3 3 1 1 3 1 4 3 3\n", "output": "4\n4 1 3 2\n"}, {"input": "10 4\n2 3 3 2 2 3 1 4 3 3\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\nAndrewid the Android is a galaxy-known detective. Now he does not investigate any case and is eating chocolat... | [{"input": "20 10\n10 11 U\n12 9 U\n6 15 L\n17 4 U\n11 10 L\n7 14 L\n4 17 U\n2 19 L\n8 13 L\n14 7 U\n", "output": "11\n9\n6\n4\n1\n7\n2\n2\n8\n7\n"}, {"input": "20 10\n10 11 U\n12 9 U\n6 15 L\n17 4 U\n11 10 L\n7 14 L\n4 17 U\n2 19 L\n8 13 L\n14 7 U\n", "output": "11\n9\n6\n4\n1\n7\n2\n2\n8\n7\n"}, {"input": "10 10\n5 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\nAn extension of a complex number is called a quaternion. It is a convenient number that can be used to contro... | [{"input": "2\n2 0 2 1 89 0 26 7\n13 11 25 8 -1 3 0 -2\n0", "output": "119 -12 230 103\n-30 -22 21 -109\n"}, {"input": "2\n2 0 2 5 89 0 26 4\n7 11 25 8 -1 3 0 -2\n0", "output": "106 -122 230 453\n-24 -40 21 -97\n"}, {"input": "2\n2 0 2 5 89 0 26 4\n7 11 25 8 -1 3 1 -2\n0", "output": "106 -122 230 453\n-49 -48 28 -86\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 has recently finished writing a book. Now he faces the problem of giving it the title. Vasya wants the ... | [{"input": "26\nabcdefghijklmnopqrstuvwxyzfgvnsltvvohywvqhuhtydghtthgdythuhqvwyhovvtlsnvgfzyxwvutsrqponmlkjihgfedcba\n", "output": "abcdefghijklmnopqrstuvwxyzfgvnsltvvohywvqhuhtydghtthgdythuhqvwyhovvtlsnvgfzyxwvutsrqponmlkjihgfedcba\n"}, {"input": "26\nab?defg??j??mnopqrs?uv?x???u?vpd??s?s??s?t?v?vp?is?iqp??v??ush?s??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\nThere are N squares arranged in a row, numbered 1 to N from left to right. Takahashi will stack building bloc... | [{"input": "118261 6796 8504", "output": "331359071\n"}, {"input": "118261 3351 8683", "output": "422737594\n"}, {"input": "194739 3351 8683", "output": "984464655\n"}, {"input": "31415 14324 4472", "output": "527193753\n"}, {"input": "197694 6796 8504", "output": "116621440\n"}, {"input": "118261 6796 4795", "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\nThis contest is `CODEFESTIVAL`, which can be shortened to the string `CF` by deleting some characters.\n\nMr.... | [{"input": "CODDFESTIVAL", "output": "Yes\n"}, {"input": "EDOCLAVFTSEI", "output": "Yes\n"}, {"input": "ECOFLAVDTSEI", "output": "Yes\n"}, {"input": "DOECSDKSIVAF", "output": "Yes\n"}, {"input": "DOECRDKSIVAF", "output": "Yes\n"}, {"input": "DOFCRDKSIVAF", "output": "Yes\n"}, {"input": "DOFCQDKSIVAF", "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 a rebus of form ? + ? - ? + ? = n, consisting of only question marks, separated by arithmetic o... | [{"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\nVasilisa the Wise from a far away kingdom got a present from her friend Helga the Wise from a farther away ki... | [{"input": "BYOVRR\n", "output": "15\n"}, {"input": "OVBRYG\n", "output": "30\n"}, {"input": "RRYOGB\n", "output": "15\n"}, {"input": "VOBYGO\n", "output": "15\n"}, {"input": "GRBYVO\n", "output": "30\n"}, {"input": "YROVBG\n", "output": "30\n"}, {"input": "GYYBRO\n", "output": "15\n"}, {"input": "RYGOBG\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\nExample\n\nInput\n\n3\n0 2 7\n2 0 4\n5 8 0\n\n\nOutput\n\n11### Format: Read the inputs from stdin solve the ... | [{"input": "3\n0 3 10\n1 0 4\n19 11 0", "output": "15\n"}, {"input": "3\n0 6 13\n4 0 3\n24 12 0", "output": "20\n"}, {"input": "3\n0 12 13\n6 0 6\n27 8 0", "output": "25\n"}, {"input": "3\n0 12 18\n6 0 6\n27 8 0", "output": "30\n"}, {"input": "3\n0 3 10\n4 0 4\n19 11 0", "output": "17\n"}, {"input": "3\n0 3 10\n7 0 4\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 a string S of length 2N consisting of lowercase English letters.\n\nThere are 2^{2N} ways to co... | [{"input": "18\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "output": "9075135300"}, {"input": "18\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`aaaa", "output": "0\n"}, {"input": "18\naaaaaaaaaaaaaaaaaaaaaaabaaaaaaa`aaaa", "output": "0\n"}, {"input": "18\naaaaaaaaaaaaaaaaaaaaaaabbaaaaaa`aaaa", "output": "0\n"}, {"input": "18\naaaa`aaaa... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 Random Number\n\nE869120 You ran a campaign called \"Today's Random Numbers\" for N days. This is a p... | [{"input": "5\n15 -1 21 0 20", "output": "2\n"}, {"input": "5\n15 -1 21 0 22", "output": "2\n"}, {"input": "5\n-2 -1 -1 14 2", "output": "2\n"}, {"input": "5\n-2 -1 -1 21 2", "output": "2\n"}, {"input": "5\n-2 -1 -2 21 2", "output": "2\n"}, {"input": "5\n-2 -1 -2 35 2", "output": "2\n"}, {"input": "5\n-3 -1 -2 35 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\nCurrently Tiny is learning Computational Geometry. When trying to solve a problem called \"The Closest Pair O... | [{"input": "3119 2029631\n", "output": "0 0\n0 1\n0 2\n0 3\n0 4\n0 5\n0 6\n0 7\n0 8\n0 9\n0 10\n0 11\n0 12\n0 13\n0 14\n0 15\n0 16\n0 17\n0 18\n0 19\n0 20\n0 21\n0 22\n0 23\n0 24\n0 25\n0 26\n0 27\n0 28\n0 29\n0 30\n0 31\n0 32\n0 33\n0 34\n0 35\n0 36\n0 37\n0 38\n0 39\n0 40\n0 41\n0 42\n0 43\n0 44\n0 45\n0 46\n0 47\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\nTurbulent times are coming, so you decided to buy sugar in advance. There are $n$ shops around that sell suga... | [{"input": "1\n100 37\n29 33 45 64 95 33 45 76 86 5 52 16 27 24 80 5 44 19 96 8 77 67 21 17 22 56 28 3 84 27 39 12 60 35 75 6 68 71 81 5 76 85 73 54 8 4 58 4 22 5 11 51 72 31 67 93 38 94 96 22 73 34 33 84 21 60 89 88 30 21 44 57 5 16 11 65 20 68 68 41 25 78 43 96 61 10 40 98 55 35 19 79 21 4 62 41 63 2 80 44\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\nYou can not just take the file and send it. When Polycarp trying to send a file in the social network \"Codeh... | [{"input": "100\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n", "output": "98\n"}, {"input": "100\nuxxxxxlmexxxxxxxwnxxexxxxxcxxfydxxxxxxvmdxxxxxxisxxxxxxxxidkxxxpxxxxxxxxmnuxxxxjxxxqcxxwmxxxxxxxxmrx\n", "output": "41\n"}, {"input": "100\nxxxxxxxxxxxjtxxxxxxxxcx... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRecently a Golden Circle of Beetlovers was found in Byteland. It is a circle route going through $n \\cdot k$... | [{"input": "100000 100000\n50000 6424\n", "output": "1250000000 1250000000\n"}, {"input": "100000 101000\n50000 6424\n", "output": "39453125 1262500000\n"}, {"input": "98752 97209\n41218 39020\n", "output": "21427641 3199861056\n"}, {"input": "98752 97209\n41218 39020\n", "output": "21427641 3199861056\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\nSereja has an n × m rectangular table a, each cell of the table contains a zero or a number one. Sereja wants... | [{"input": "21 10 8\n1 1 1 0 0 1 1 1 1 1\n1 1 1 0 0 1 1 1 1 1\n1 1 1 0 0 1 1 1 1 1\n1 1 1 0 0 1 1 1 1 1\n1 1 1 0 0 1 1 1 1 1\n0 0 1 1 1 0 0 0 0 0\n0 0 0 1 1 0 0 0 0 0\n1 1 1 0 0 1 1 1 1 1\n0 0 0 1 1 0 0 0 0 0\n1 1 1 0 0 1 1 1 1 1\n1 1 1 0 0 1 1 1 1 1\n0 0 0 1 1 0 0 0 0 0\n1 0 1 0 0 1 1 1 1 1\n0 1 0 1 1 0 0 0 0 0\n0 0 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\nYou are given an array a consisting of n integers. We denote the subarray a[l..r] as the array [a_l, a_{l + 1... | [{"input": "100\n79 79 79 97 97 97 64 64 64 2 2 2 38 38 38 65 65 65 10 10 10 25 24 25 53 53 53 73 73 73 11 11 11 29 29 29 93 93 93 73 73 73 89 89 89 72 72 72 49 49 49 78 78 78 92 92 92 90 90 90 95 95 95 92 92 92 12 12 12 65 65 65 81 81 81 5 5 5 21 21 21 94 94 94 51 51 51 44 44 44 55 55 55 47 47 47 24 24 24 79\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\nAfter Fox Ciel won an onsite round of a programming contest, she took a bus to return to her castle. The fee ... | [{"input": "1481100 701689\n", "output": "Hanako\n"}, {"input": "1616877 635412\n", "output": "Hanako\n"}, {"input": "232743 679597\n", "output": "Hanako\n"}, {"input": "1000000 1000001\n", "output": "Ciel\n"}, {"input": "497151 208819\n", "output": "Hanako\n"}, {"input": "552196 895657\n", "output": "Hanako\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\nGiven two numbers (m and n) :\n\n- convert all numbers from m to n to binary\n- sum them as if they were in b... | [{"input": "100\n1000", "output": "[\"111111001111110110011011000101110101110\"]", "fn_name": "binary_pyramid"}, {"input": "1\n100", "output": "[\"10011101010010110000101010\"]", "fn_name": "binary_pyramid"}, {"input": "100\n100", "output": "[\"100001100100101000100\"]", "fn_name": "binary_pyramid"}, {"input": "21\n60"... | 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\nOn Bertown's main street n trees are growing, the tree number i has the height of ai meters (1 ≤ i ≤ n). By t... | [{"input": "10\n73905 73906 73907 85732 73909 73909 73908 73907 73906 73905\n", "output": "1\n"}, {"input": "10\n60718 99414 65042 65043 65044 38495 95782 65042 65041 65040\n", "output": "4\n"}, {"input": "10\n60718 99414 65042 89001 65044 38495 95782 65042 65041 65040\n", "output": "5\n"}, {"input": "10\n60718 99414 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\nWe start with a string s consisting only of the digits 1, 2, or 3. The length of s is denoted by |s|. For eac... | [{"input": "9\n1500\n1212\n1500\n1221\n1500\n122\n1500\n12121\n1500\n22\n1500\n1111112111111112\n1500\n1111111111221111111\n1500\n111111122\n1500\n11111121111121111111\n", "output": "1504\n1599\n1502\n1598\n1502\n1510\n1657\n1502\n1763\n"}, {"input": "9\n1676\n1212\n1500\n1221\n1500\n122\n1500\n12121\n1500\n22\n1500\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\nIn this task Anna and Maria play the following game. Initially they have a checkered piece of paper with a pa... | [{"input": "1000 1000 250\n", "output": "263321201\n"}, {"input": "580 1000 203\n", "output": "693824000\n"}, {"input": "1000 1000 20\n", "output": "155086097\n"}, {"input": "1000 1000 100\n", "output": "58573582\n"}, {"input": "1000 1000 39\n", "output": "227950512\n"}, {"input": "840 474 207\n", "output": "895622621\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 Define crossover operation over two equal-length strings A and B as follows:\n\n the result of that ... | [{"input": "[\"abc\", \"aaa\", \"aba\", \"bab\"]\n\"bbb\"", "output": "[2]", "fn_name": "strings_crossover"}, {"input": "[\"aacccc\", \"bbcccc\"]\n\"abdddd\"", "output": "[0]", "fn_name": "strings_crossover"}, {"input": "[\"a\", \"b\", \"c\", \"d\", \"e\"]\n\"c\"", "output": "[4]", "fn_name": "strings_crossover"}, {"in... | 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\nFor an integer n not less than 0, let us define f(n) as follows:\n - f(n) = 1 (if n < 2)\n - f(n) = n f(n-2) ... | [{"input": "1000000000000000000\n", "output": "124999999999999995\n"}, {"input": "999003990299500294\n", "output": "124875498787437525\n"}, {"input": "1000000000010000000", "output": "125000000001249993\n"}, {"input": "1000000000010001000", "output": "125000000001250117\n"}, {"input": "1010000000010001000", "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\nMatrix of given integers\n\n\na1,1 a1,2 ... a1, n\na2,1 a2,2 ... a2, n\n::\nan, 1 an, 2 ... an, n\n\n\nThen, ... | [{"input": "4\n1 3 -9 2\n2 7 -1 5\n-8 3 2 -1\n5 -1 -3 1", "output": "15\n"}, {"input": "4\n1 3 -9 0\n2 7 -1 5\n-8 3 2 -2\n3 -1 -3 1", "output": "14\n"}, {"input": "4\n1 3 -9 2\n2 4 -1 5\n-8 3 2 -1\n5 -1 -6 1", "output": "12\n"}, {"input": "4\n1 3 -9 2\n2 4 -1 5\n-8 3 0 -1\n5 -1 -6 1", "output": "10\n"}, {"input": "4\n1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOne day, Yuhao came across a problem about checking if some bracket sequences are correct bracket sequences.\... | [{"input": "30\n)(((())()())()(\n))(()()()(\n))()((\n)())(()\n())())((\n((((())\n(((()))(\n(())\n)()(((()(()\n((())))(\n)()()())((\n))))(()\n()(((()\n)()()(\n(())())\n(()()(())(\n)()((\n)(()(())))\n))))(())((\n)()(()(((((\n(()))((\n()())\n((()()()))\n()((((((((()\n)(()(\n)(((())(()\n)((((()(\n(((()()((\n())()(\n)))()()... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRng has a connected undirected graph with N vertices. Currently, there are M edges in the graph, and the i-th... | [{"input": "16 5\n1 2\n2 3\n3 3\n0 14\n0 6", "output": "115\n"}, {"input": "69 5\n1 2\n3 3\n1 3\n4 4\n5 8", "output": "2341\n"}, {"input": "71 5\n1 2\n3 3\n1 3\n4 4\n5 8", "output": "2480\n"}, {"input": "46 5\n1 2\n3 3\n1 3\n0 4\n5 8", "output": "1030\n"}, {"input": "15 5\n1 2\n2 3\n3 3\n0 5\n4 2", "output": "100\n"}, ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAlice likes snow a lot! Unfortunately, this year's winter is already over, and she can't expect to have any m... | [{"input": "13\n1 1 1 1 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "1 1 1 1 1 1 1 1 1 1 1 1 1 "}, {"input": "13\n1 1 1 1 1 1 1 1 1 2 1 1 1\n1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "1 1 1 1 1 1 1 1 1 1 2 1 1\n"}, {"input": "13\n1 1 1 1 1 1 1 1 1 2 1 2 1\n1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "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\nSquid loves painting vertices in graphs.\n\nThere is a simple undirected graph consisting of N vertices numbe... | [{"input": "14 10\n1 4\n9 12\n7 11\n2 10\n14 7\n14 3\n6 14\n8 14\n5 13\n8 1\n2\n8 7 4\n14 7 85\n6 1 6\n6 11 5\n10 3 1\n20 9 4\n10 2 12\n8 4 3", "output": "85\n0\n85\n85\n0\n85\n85\n85\n0\n0\n85\n0\n0\n85\n"}, {"input": "14 10\n1 4\n9 12\n7 11\n2 10\n14 7\n14 3\n6 14\n8 14\n5 13\n8 1\n3\n8 7 4\n14 7 85\n6 1 6\n6 11 5\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\nYour task is to write a program of a simple dictionary which implements the following instructions:\n\n* inse... | [{"input": "13\ninsert AAA\ninsert AAC\ninsert AGA\ninsert AGF\ninsert TTT\nfind AAA\nfind CCC\nfind CCC\ninsert CCC\nfind CCC\ninsert T\nfind TTT\nfind T", "output": "yes\nno\nno\nyes\nyes\nyes\n"}, {"input": "13\ninsert AAA\ninsert CAA\ninsert AGA\ninsert AGG\ninsert TTT\nfind AAA\nfind CCC\nfind CCC\ninsert CCC\nfin... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSmall, but very brave, mouse Brain was not accepted to summer school of young villains. He was upset and deci... | [{"input": "5 5\nW G B W G\nG B W G B\nB W G B W\nW G B W G\nG B W G B\n", "output": "#Black&White\n"}, {"input": "5 5\nW G B W G\nG B W G B\nB W G B W\nW G B W G\nG B W G B\n", "output": "#Black&White"}, {"input": "5 5\nW G B Y M\nG B Y M C\nB Y M C W\nY M C W G\nM C W G B\n", "output": "#Color\n"}, {"input": "5 5\nW ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 busses in Berland are equipped with a video surveillance system. The system records information about cha... | [{"input": "102 1\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "0\n"}, {"input": "102 1\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... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGive you N cards. Only one natural number is written on each card. However, the same number is never written.... | [{"input": "3 3\n9 3 10\n12\n6\n1", "output": "10\n4\n0\n"}, {"input": "3 3\n6 2 16\n20\n7\n2", "output": "16\n6\n0\n"}, {"input": "3 3\n2 1 21\n20\n12\n2", "output": "2\n9\n1\n"}, {"input": "3 3\n9 3 8\n12\n12\n2", "output": "9\n9\n1\n"}, {"input": "3 3\n9 5 8\n12\n11\n1", "output": "9\n9\n0\n"}, {"input": "3 3\n6 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\nProblem\n\nJennifer and Marian presented Carla with the string S.\nHowever, Carla is not happy to receive the... | [{"input": "5\naaabb\nxywyz", "output": "2\n"}, {"input": "5\naaacb\nxywyz", "output": "1\n"}, {"input": "5\nbcaaa\nxywyz", "output": "1\n"}, {"input": "5\nbcaaa\nxywyy", "output": "0\n"}, {"input": "5\nbcaba\nxywyy", "output": "1\n"}, {"input": "5\ncbaba\nxywyy", "output": "1\n"}, {"input": "5\ncbbba\nxywyy", "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\nRead problems statements in Mandarin Chinese and Russian. \n\nChef has a box full of infinite number of iden... | [{"input": "1\n4\n1 -1 2 2", "output": "2\n"}, {"input": "1\n4\n1 1 -1 4", "output": "2\n"}, {"input": "1\n4\n1 2 2 -1", "output": "2\n"}, {"input": "1\n4\n0 2 2 -1", "output": "2\n"}, {"input": "1\n4\n1 -1 2 3", "output": "3\n"}, {"input": "1\n4\n-1 2 0 4", "output": "3\n"}, {"input": "1\n4\n1 -1 1 5", "output": "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\nproblem\n\nYou have to play a darts game with the following rules.\n\nYou can throw up to four arrows towards... | [{"input": "4 67\n12\n28\n28\n11\n3 21\n10\n11\n3\n0 0", "output": "67\n21\n"}, {"input": "4 67\n12\n41\n28\n20\n3 21\n10\n11\n3\n0 0", "output": "65\n21\n"}, {"input": "4 102\n2\n39\n13\n11\n3 14\n5\n11\n4\n0 0", "output": "102\n14\n"}, {"input": "4 58\n12\n14\n28\n11\n3 21\n5\n11\n3\n0 0", "output": "56\n21\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\nThere are N mountains ranging from east to west, and an ocean to the west.\nAt the top of each mountain, ther... | [{"input": "20\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100\n", "output": "20\n"}, {"input": "20\n54 53 68 68 35 35 62 61 74 73 94 94 94 94 86 85 65 64 68 68\n", "output": "8\n"}, {"input": "20\n8 12 14 17 23 26 38 41 45 46 48 56 60 66 69 85 86 94 98 99\n", "output": "20\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\nCODE FESTIVAL 2016 is going to be held. For the occasion, Mr. Takahashi decided to make a signboard.\n\nHe in... | [{"input": "EDOC6102LAVITSEF", "output": "16\n"}, {"input": "1DO2LAVI6REGE0TC", "output": "15\n"}, {"input": "VT0EGER6ICAL2OD0", "output": "10\n"}, {"input": "VV1EFFR7ICAK2OD0", "output": "11\n"}, {"input": "VW1EFFR7ICAK3OD0", "output": "12\n"}, {"input": "107DFFRV3CALWODI", "output": "13\n"}, {"input": "D6OV>JT1DJEC20... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nn people came to a party. Then those, who had no friends among people at the party, left. Then those, who had... | [{"input": "1\n108\n", "output": "106\n"}, {"input": "1\n157\n", "output": "155\n"}, {"input": "1\n168\n", "output": "166\n"}, {"input": "1\n299\n", "output": "297\n"}, {"input": "1\n111\n", "output": "109\n"}, {"input": "1\n140\n", "output": "138\n"}, {"input": "1\n266\n", "output": "264\n"}, {"input": "1\n372\n", "ou... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAssume `\"#\"` is like a backspace in string. This means that string `\"a#bc#d\"` actually is `\"bd\"`\n\nYou... | [{"input": "\"831####jns###s#cas/*####-5##s##6+yqw87e##hfklsd-=-28##fds##\"", "output": "[\"6+yqw8hfklsd-=-f\"]", "fn_name": "clean_string"}, {"input": "\"####gfdsgf##hhs#dg####fjhsd###dbs########afns#######sdanfl##db#####s#a\"", "output": "[\"sa\"]", "fn_name": "clean_string"}, {"input": "\"gfh#jds###d#dsd####dasdaskh... | 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\nBear Limak wants to become the largest of bears, or at least to become larger than his brother Bob.\n\nRight ... | [{"input": "10 10\n", "output": "1\n"}, {"input": "10 10\n", "output": "1\n"}, {"input": "10 10\n", "output": "1\n"}, {"input": "11 12\n", "output": "1\n"}, {"input": "1 43\n", "output": "10\n"}, {"input": "11 15\n", "output": "1\n"}, {"input": "11 16\n", "output": "1\n"}, {"input": "15 15\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\nOne day Vasya heard a story: \"In the city of High Bertown a bus number 62 left from the bus station. It had ... | [{"input": "100000 100000\n", "output": "100000 199999\n"}, {"input": "100000 100001\n", "output": "100001 200000\n"}, {"input": "110000 100001\n", "output": "110000 210000\n"}, {"input": "127948 126156\n", "output": "127948 254103\n"}, {"input": "117241 111295\n", "output": "117241 228535\n"}, {"input": "120119 80236\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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. \n\nIn a far away dystopian world, the measure of ... | [{"input": "2\n5 2 10 1\n13 3 3 2", "output": "ALIVE AND KICKING\nALIVE AND KICKING\n"}, {"input": "2\n5 2 10 1\n25 3 3 2", "output": "ALIVE AND KICKING\nALIVE AND KICKING\n"}, {"input": "2\n5 2 10 1\n25 3 3 4", "output": "ALIVE AND KICKING\nALIVE AND KICKING\n"}, {"input": "2\n5 2 10 1\n15 3 3 4", "output": "ALIVE AND... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGildong's town has a train system that has $100$ trains that travel from the bottom end to the top end and $1... | [{"input": "3\n1 2\n1\n3 4\n3 2\n2 3 11\n2 1\n9 14\n2 12 16 28 42 57 59 86 99\n3 9 14 19 25 26 20 35 41 59 85 87 99 100\n", "output": "0\n1\n2\n"}, {"input": "3\n1 2\n1\n1 4\n3 2\n1 3 4\n2 4\n9 14\n2 14 16 28 33 57 59 92 99\n3 9 14 19 25 26 28 35 41 59 85 87 99 100\n", "output": "1\n1\n4\n"}, {"input": "3\n1 2\n1\n3 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\nThere are $n$ chips arranged in a circle, numbered from $1$ to $n$. \n\nInitially each chip has black or whit... | [{"input": "101 2\nBWBWBWWWBWBWBWWWBWWWBWWWBWBBBBBWBWBBBWBWBWWBBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWWWBWBWBWB\n", "output": "BBBWWWWWWWBWWWWWWWWWWWWWWBBBBBBBBBBBBBBWWWWBBBBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWWWWWWWBWBBB\n"}, {"input": "101 2\nBWBWBWBWWWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBWBBW... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nproblem\n\nMobiles are widely known as moving works of art. The IOI Japan Committee has decided to create mob... | [{"input": "1\n7 22 0 0\n4\n2 2 0 4\n1 3 0 0\n9 10 2 1\n3 2 0 0\n0", "output": "29\n190\n"}, {"input": "1\n7 11 0 0\n4\n2 2 0 4\n1 3 0 0\n3 8 2 1\n3 2 0 0\n0", "output": "18\n110\n"}, {"input": "1\n7 22 0 0\n4\n2 2 0 4\n1 3 0 0\n3 8 2 1\n3 2 0 0\n0", "output": "29\n110\n"}, {"input": "1\n6 10 0 0\n4\n3 5 0 4\n1 6 0 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\nReading books is one of Sasha's passions. Once while he was reading one book, he became acquainted with an un... | [{"input": "tttdddssstttssstttdddddddddttttttdddsssdddtttsssdddsssssstttddddddtttdddssstttsssttttttdddtttsssssstttssssssssstttsssssstttssstttdddddddddsssdddssssssdddssstttsssdddssstttdddttttttdddddddddsssssstttdddtttssssssdddddddddttttttdddtttsssdddssstttsssdddssssssdddsssdddddddddtttssstttsssssstttssssssssstttsssssstt... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 is currently at a car rental service, and he wants to reach cinema. The film he has bought a ticket for... | [{"input": "4 13 400 600\n13 30\n1 19\n1 160\n1 113\n58 73 15 319 194 362 128 157 336 162 77 90 96\n", "output": "1\n"}, {"input": "4 13 400 600\n13 30\n1 19\n1 160\n1 113\n58 73 15 319 194 362 128 157 336 162 77 90 96\n", "output": "1\n"}, {"input": "4 13 400 600\n13 30\n1 19\n1 160\n1 113\n58 73 15 319 194 362 200 15... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn Python, code blocks don't have explicit begin/end or curly braces to mark beginning and end of the block. ... | [{"input": "156\nf\ns\nf\ns\nf\ns\ns\ns\ns\nf\ns\ns\nf\nf\ns\nf\nf\nf\nf\ns\ns\ns\nf\ns\ns\nf\nf\nf\nf\nf\nf\ns\ns\ns\ns\nf\ns\nf\ns\nf\ns\nf\nf\nf\nf\ns\ns\nf\nf\ns\ns\ns\ns\nf\ns\nf\ns\nf\ns\nf\ns\ns\ns\nf\ns\ns\nf\ns\nf\nf\ns\ns\ns\nf\nf\nf\nf\ns\ns\nf\nf\nf\nf\nf\nf\nf\ns\nf\ns\ns\ns\nf\nf\ns\ns\ns\ns\ns\nf\nf\nf\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\nExample\n\nInput\n\n3\n3 0 1\n\n\nOutput\n\n2### Format: Read the inputs from stdin solve the problem and wri... | [{"input": "3\n152 -3 2", "output": "0\n"}, {"input": "3\n-1 -1 1", "output": "0\n"}, {"input": "3\n13 -2 3", "output": "0\n"}, {"input": "3\n25 -2 3", "output": "0\n"}, {"input": "3\n25 -2 4", "output": "0\n"}, {"input": "3\n25 -2 1", "output": "0\n"}, {"input": "3\n25 -3 1", "output": "0\n"}, {"input": "3\n33 -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 territory of Berland is represented by a rectangular field n × m in size. The king of Berland lives in th... | [{"input": "101 100\n", "output": "0\n1 1\n2 1\n3 1\n4 1\n5 1\n6 1\n7 1\n8 1\n9 1\n10 1\n11 1\n12 1\n13 1\n14 1\n15 1\n16 1\n17 1\n18 1\n19 1\n20 1\n21 1\n22 1\n23 1\n24 1\n25 1\n26 1\n27 1\n28 1\n29 1\n30 1\n31 1\n32 1\n33 1\n34 1\n35 1\n36 1\n37 1\n38 1\n39 1\n40 1\n41 1\n42 1\n43 1\n44 1\n45 1\n46 1\n47 1\n48 1\n49 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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: four tea\n\nproblem\n\nTea is indispensable for programming contests. Tea has the effect of relieving cons... | [{"input": "10\n1 2 10 2\n0 0 0 15", "output": "2\n"}, {"input": "10\n1 1 3 2\n0 2 3 16", "output": "2\n"}, {"input": "10\n0 1 3 2\n1 2 3 16", "output": "0\n"}, {"input": "10\n0 1 6 1\n0 0 1 50", "output": "1\n"}, {"input": "10\n1 1 6 2\n1 1 2 1", "output": "10\n"}, {"input": "10\n0 3 0 3\n0 2 0 2", "output": "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\n# Task\n\n**_Given_** a **_list of digits_**, *return the **_smallest number_** that could be formed from the... | [{"input": "[3, 6, 5, 5, 9, 8, 7, 6, 3, 5, 9]", "output": "[356789]", "fn_name": "min_value"}, {"input": "[1, 9, 1, 3, 7, 4, 6, 6, 7]", "output": "[134679]", "fn_name": "min_value"}, {"input": "[5, 6, 9, 9, 7, 6, 4]", "output": "[45679]", "fn_name": "min_value"}, {"input": "[6, 7, 8, 7, 6, 6]", "output": "[678]", "fn_n... | 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\nThere is a tree with N vertices numbered 1 through N. The i-th of the N-1 edges connects vertices a_i and b_i... | [{"input": "6\n2 1\n2 3\n3 4\n2 5\n5 6", "output": "Second\n"}, {"input": "6\n1 2\n2 3\n6 4\n1 5\n5 6", "output": "Second\n"}, {"input": "6\n1 2\n1 3\n2 4\n1 5\n5 6", "output": "Second\n"}, {"input": "6\n2 1\n2 3\n1 4\n2 5\n5 6", "output": "Second\n"}, {"input": "6\n1 1\n2 3\n1 4\n2 5\n5 6", "output": "Second\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\nProblem\n\nBeans are popular at Otsu University. N beans are lined up in a straight line. Each is numbered fr... | [{"input": "10\n4 5 1 21 9 000 12 17 0 6\n5\n2 3 20\n2 2 101\n8 9 9\n5 5 10\n0 9 20", "output": "1\n100\n3\n10\n1\n"}, {"input": "10\n4 5 0 42 9 000 12 9 0 6\n5\n0 2 20\n2 5 101\n8 9 9\n5 5 17\n0 1 20", "output": "15\n59\n3\n17\n15\n"}, {"input": "10\n4 5 0 42 9 000 12 9 0 6\n5\n0 2 20\n2 5 101\n8 9 14\n5 5 23\n0 9 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\nPresident of Berland has a very vast office-room, where, apart from him, work his subordinates. Each subordin... | [{"input": "24 11 N\n.NNNNNNNNNN\n.NNNNNNNNNN\n........RRR\n........RRR\n........RRR\n..MMMMMMRRR\n..MMMMMMRRR\n..MMMMMMRRR\n..MMMMMM...\n....XXXXXXX\n...........\n.....CCCCCC\n.....CCCCCC\n.HHHHHHHHHH\n..VVVVV....\n..VVVVV....\n..VVVVV....\n..VVVVV.I..\n..VVVVV.I..\n..VVVVV.I..\n..VVVVV.I..\n..VVVVV....\n..VVVVV....\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\nThere are N cards placed on a grid with H rows and W columns of squares.\n\nThe i-th card has an integer A_i ... | [{"input": "13 5 6\n1 3 36945\n4 6 19698\n4 6 73389\n3 6 3031\n3 1 4771\n1 4 4784\n2 1 36357\n2 -1 24830\n5 6 160809\n4 6 36941\n0 2 30739\n1 4 68417\n-1 5 78537", "output": "556519\n"}, {"input": "13 5 6\n1 3 36945\n4 6 19698\n4 6 73389\n3 6 3031\n3 1 4771\n1 4 4784\n2 1 36357\n2 -1 24830\n5 6 84109\n4 6 36941\n0 2 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\nYou are given two integer arrays a_0, a_1, ..., a_{N - 1} and b_0, b_1, ..., b_{M - 1}. Calculate the array c... | [{"input": "4 5\n1 4 3 2\n-1 0 43 8 2", "output": "998244352 998244349 40 178 163 118 22 4\n"}, {"input": "4 5\n2 2 3 4\n5 0 12 13 18", "output": "10 10 39 70 98 123 106 72\n"}, {"input": "4 5\n2 2 3 3\n5 1 12 13 18", "output": "10 12 41 68 101 111 93 54\n"}, {"input": "4 5\n1 2 3 5\n2 -1 23 8 30", "output": "2 3 27 61... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 hats. The i-th hat has an integer a_i written on it.\n\nThere are N camels standing in a circle. ... | [{"input": "4\n2 -5 -1 2", "output": "No\n"}, {"input": "4\n1 2 4 11", "output": "No\n"}, {"input": "4\n0 2 4 11", "output": "No\n"}, {"input": "4\n0 4 4 11", "output": "No\n"}, {"input": "4\n0 4 4 20", "output": "No\n"}, {"input": "4\n0 4 1 20", "output": "No\n"}, {"input": "4\n0 4 1 33", "output": "No\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\nThere are two types of burgers in your restaurant — hamburgers and chicken burgers! To assemble a hamburger y... | [{"input": "7\n2 1 1\n1 1\n100 101 100\n101 100\n2 101 110\n000 111\n010 3 1\n101 100\n010 77 14\n110 99\n010 001 3\n100 99\n362 51 11\n011 165\n", "output": "1\n5050\n111\n403\n550\n397\n2376\n"}, {"input": "7\n2 1 2\n1 1\n100 100 000\n101 110\n2 101 000\n011 110\n010 3 1\n101 100\n010 77 14\n110 126\n110 001 6\n100 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\nModern text editors usually show some information regarding the document being edited. For example, the numbe... | [{"input": "255\nT___J(M_XZJlr_lH___mqJA_p__kW)ko__F_M_Aro__ZA_G_M_P_____j_V(J_Jk_dkR_ta_lbIUhKFfo_y_DluW)IVFj_gouRfMhabn()_e___q_vo__QPEGBI_TpVVI_clPwwb_m_yL_cMVKgi___RJb_J_f____tPCyntLOr_s_x_N_SyqQw_zP_mycsW_o_c_o_Yzb_UVa_ATd(BYH_gl___Y__Uzok_Y_IA_XL_D__bkJ____e__K_quk)\n", "output": "10 25\n"}, {"input": "255\ngB(ZK... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 currency system in which there are notes of six denominations, namely, Rs. 1, Rs. 2, Rs. 5, Rs. 10... | [{"input": "3 \n1200\n1258\n242", "output": "12\n16\n7\n"}, {"input": "3 \n1200\n493\n380", "output": "12\n11\n7\n"}, {"input": "3 \n1200\n806\n380", "output": "12\n10\n7\n"}, {"input": "3 \n1200\n360\n242", "output": "12\n5\n7\n"}, {"input": "3 \n1200\n360\n255", "output": "12\n5\n4\n"}, {"input": "3 \n1200\n500\n392"... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 few years ago Sajjad left his school and register to another one due to security reasons. Now he wishes to ... | [{"input": "300997\n", "output": "150498\n"}, {"input": "273658\n", "output": "136828\n"}, {"input": "222057\n", "output": "111028\n"}, {"input": "456496\n", "output": "228247\n"}, {"input": "220343\n", "output": "110171\n"}, {"input": "100000\n", "output": "49999\n"}, {"input": "100000\n", "output": "49999\n"}, {"inpu... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nWith one die of 6 sides we will have six different possible results:``` 1, 2, 3, 4, 5, 6``` .\n\nWith 2 dice... | [{"input": "[3, 15, 8, 20]", "output": "[44]", "fn_name": "eq_dice"}, {"input": "[5, 6, 4]", "output": "[5]", "fn_name": "eq_dice"}, {"input": "[6, 6]", "output": "[3]", "fn_name": "eq_dice"}, {"input": "[3, 3]", "output": "[0]", "fn_name": "eq_dice"}, {"input": "[3, 6]", "output": "[0]", "fn_name": "eq_dice"}, {"input... | 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 a tetrahedron. Let's mark its vertices with letters A, B, C and D correspondingly.\n\n<image>\n... | [{"input": "10000000\n", "output": "192336614\n"}, {"input": "1000000\n", "output": "266233856\n"}, {"input": "4000000\n", "output": "882155933\n"}, {"input": "9999999\n", "output": "730778875\n"}, {"input": "9999998\n", "output": "576926295\n"}, {"input": "9000000\n", "output": "295060537\n"}, {"input": "1000010\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 of $n$ positive integers $a_1, a_2, \\ldots, a_n$. Your task is to calculate the numbe... | [{"input": "100\n23 39 85 46 97 72 41 70 37 18 8 40 33 61 12 79 51 78 61 66 85 97 78 14 70 47 100 40 15 40 61 52 19 30 14 91 82 56 10 6 68 24 97 61 31 78 18 45 88 6 37 38 51 86 37 42 58 30 79 56 50 14 61 18 13 20 57 3 93 15 24 74 32 21 71 93 2 66 25 75 75 10 86 82 30 31 6 49 15 33 100 35 1 96 87 83 29 21 41 22\n", "out... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe Little Elephant loves playing with arrays. He has array a, consisting of n positive integers, indexed fro... | [{"input": "6 6\n1 2 2 3 3 3\n1 2\n2 2\n1 3\n2 4\n4 6\n1 6\n", "output": "1\n0\n2\n1\n1\n3\n"}, {"input": "6 6\n1 2 2 3 3 3\n1 2\n2 2\n1 3\n2 4\n4 6\n1 3\n", "output": "1\n0\n2\n1\n1\n2\n"}, {"input": "6 6\n1 2 2 3 2 3\n1 2\n2 2\n1 3\n2 4\n4 6\n1 6\n", "output": "1\n0\n2\n1\n0\n1\n"}, {"input": "6 6\n1 2 2 3 3 3\n1 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\nYou have a playlist consisting of $n$ songs. The $i$-th song is characterized by two numbers $t_i$ and $b_i$ ... | [{"input": "10 1\n135600 59157\n2735 28902\n43406 39542\n24166 178402\n18565 14980\n69958 53925\n23473 81878\n89682 3949\n18757 31637\n35580 45873\n", "output": "8021689200\n"}, {"input": "10 1\n135600 59157\n2735 28902\n43406 39542\n24166 93361\n18565 14980\n69958 53925\n23473 81878\n89682 3949\n18757 31637\n31665 458... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nFilled with optimism, Hyunuk will host a conference about how great this new year will be!\n\nThe conference ... | [{"input": "4\n544431836 544432042 793496989 793497079\n544429970 544430041 793496343 793496350\n544432412 544432541 793497670 793498269\n544431029 544431033 793494552 793494859\n", "output": "YES\n"}, {"input": "4\n922033367 922033530 246113700 246113747\n922034178 922034457 246112224 246112584\n922032889 922035756 24... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nOn February 14 Denis decided to give Valentine to Nastya and did not come up with anything better than to dra... | [{"input": "5\n8 6\n1 2 4 1 2 7 1 2\n5 3\n3 2 3 2 1\n10 8\n7 4 7 6 2 3 0 1 -1 1\n15 10\n3 14 4 8 2 1 4 5 21 2 0 4 2 1 3\n7 5\n1 2 3 4 2 6 2\n", "output": "3 2\n2 2\n4 2\n4 1\n3 3\n"}, {"input": "5\n8 6\n1 2 4 1 2 7 1 2\n5 3\n3 2 3 2 1\n10 8\n7 4 7 6 2 3 0 1 -1 1\n15 10\n3 14 4 8 2 1 4 5 21 2 0 4 2 0 3\n7 5\n1 2 3 2 2 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\nKode Festival is an anual contest where the hardest stone in the world is determined. (Kode is a Japanese wor... | [{"input": "3\n2\n1\n-3\n4\n-1\n25\n110\n1014", "output": "872\n"}, {"input": "3\n2\n1\n-3\n4\n-1\n25\n111\n1014", "output": "871\n"}, {"input": "3\n2\n1\n-3\n4\n-2\n25\n111\n1014", "output": "870\n"}, {"input": "3\n2\n1\n-3\n4\n-3\n25\n111\n1014", "output": "869\n"}, {"input": "3\n2\n-1\n-3\n7\n-2\n25\n101\n309", "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\nJzzhu have n non-negative integers a1, a2, ..., an. We will call a sequence of indexes i1, i2, ..., ik (1 ≤ i... | [{"input": "55\n0 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 4 5 6 7 8 9 5 6 7 8 9 6 7 8 9 7 8 9 8 9 9\n", "output": "621247139\n"}, {"input": "55\n0 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 2 3 4 10 6 7 8 9 3 4 5 6 7 8 9 4 5 6 7 8 9 5 6 7 8 9 6 7 8 9 7 8 9 8 9 9\n", "output": "186945693"}, {"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\nOn an xy plane, in an area satisfying 0 ≤ x ≤ W, 0 ≤ y ≤ H, there is one house at each and every point where ... | [{"input": "1 1\n1\n-1\n-1\n3\n21\n1\n0", "output": "-1\n"}, {"input": "1 2\n1\n-1\n-1\n6\n21\n1\n0", "output": "-3\n"}, {"input": "1 2\n1\n-1\n-2\n0\n21\n1\n0", "output": "-5\n"}, {"input": "1 1\n0\n-1\n-6\n2\n21\n1\n2", "output": "-2\n"}, {"input": "1 2\n1\n-1\n-4\n0\n21\n2\n0", "output": "-9\n"}, {"input": "2 1\n2\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLittle girl Tanya is learning how to decrease a number by one, but she does it wrong with a number consisting... | [{"input": "1000000000 0\n", "output": "1000000000\n"}, {"input": "1559848638 5\n", "output": "1559848633\n"}, {"input": "1100000000 0\n", "output": "1100000000\n"}, {"input": "1086932676 10\n", "output": "108693264\n"}, {"input": "1000010000 0\n", "output": "1000010000\n"}, {"input": "1086932676 2\n", "output": "10869... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIllumination\n\nIlluminations are displayed in the corridors every year at the JOI High School Cultural Festi... | [{"input": "10\n0 4 2 -1 18 -6 -1 -1 4 5", "output": "10\n"}, {"input": "10\n0 4 2 -2 18 -6 -1 -1 4 5", "output": "10\n"}, {"input": "10\n0 4 2 -2 18 -2 -1 -1 4 5", "output": "10\n"}, {"input": "10\n0 4 2 -2 18 -2 -1 -1 5 5", "output": "10\n"}, {"input": "10\n0 4 2 -2 18 -4 -1 -1 5 5", "output": "10\n"}, {"input": "10\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nHamed has recently found a string t and suddenly became quite fond of it. He spent several days trying to fin... | [{"input": "vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\nvvvvvvvv\n", "output": "2728075\n"}, {"input": "vvvvwvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\nvvvvvvvv\n", "output": "1295664\n"}, {"input": "vnssnssnssnssnssnssnssnssnssnssnssnssnssnssnssnssn\nnssnssns\n", "output": "943392\n"}, {"input": "kpjmawawa... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nParsa has a humongous tree on $n$ vertices.\n\nOn each vertex $v$ he has written two integers $l_v$ and $r_v$... | [{"input": "3\n2\n2 10\n6 6\n1 2\n3\n1 3\n13 6\n7 15\n1 2\n2 3\n6\n10 14\n12 20\n21 19\n2 12\n10 17\n3 17\n3 2\n6 5\n1 5\n2 6\n4 6\n", "output": "4\n18\n48\n"}, {"input": "3\n2\n0 6\n3 13\n1 2\n3\n1 3\n10 6\n12 9\n1 2\n2 3\n6\n3 14\n9 20\n12 19\n1 12\n11 17\n3 17\n3 3\n6 5\n1 2\n2 6\n4 6\n", "output": "13\n11\n57\n"}, ... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.