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\nRecall that the sequence $b$ is a a subsequence of the sequence $a$ if $b$ can be derived from $a$ by removin... | [{"input": "10\n10\n-1 5 10 2 -8 -7 -6 5 -3 -1\n10\n2 2 1 4 5 6 12 3 9 10\n1\n6\n1\n-7\n11\n5 -4 1 2 3 -5 -7 -10 -2 1 12\n4\n-4 -5 -6 1\n7\n1 2 6 1 2 -6 -2\n5\n-1 -5 4 -2 -9\n1\n9\n3\n1 -1 1\n", "output": "7\n12\n6\n-7\n14\n-3\n4\n1\n9\n1\n"}, {"input": "10\n10\n-1 5 17 3 -8 -7 -6 5 -3 -1\n10\n2 2 1 4 5 6 7 8 9 10\n1\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 set of $n$ segments on the axis $Ox$, each segment has integer endpoints between $1$ and $m$ ... | [{"input": "100 100\n1 2\n1 3\n1 3\n2 3\n1 1\n1 2\n1 1\n1 2\n1 3\n1 2\n1 2\n1 5\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 2\n1 1\n1 1\n1 2\n2 2\n1 1\n1 5\n1 4\n1 1\n2 2\n2 9\n1 1\n1 5\n2 3\n2 3\n1 5\n1 2\n2 2\n2 2\n1 2\n1 2\n3 4\n1 5\n1 1\n1 1\n1 1\n1 1\n2 2\n1 3\n1 2\n1 2\n1 2\n1 1\n2 2\n1 4\n1 3\n1 1\n1 2\n1 1\n2 3\n1 2\n2 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\nThere are N cubes stacked vertically on a desk.\nYou are given a string S of length N. The color of the i-th ... | [{"input": "01010111100110000101010100010010110001111001111111010001100000111101101001110001001011101100101100001011001110011101011111101010001011110010011000010001001001110100100111000010011010101100110000001011110110110010001001111001011001010110010001100101011001000010101010101100001011101101011101000010101100011000... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 boy Petya loves stairs very much. But he is bored from simple going up and down them β he loves jumpin... | [{"input": "500 50\n72 474 467 241 442 437 336 234 410 120 438 164 405 177 142 114 27 20 445 235 46 176 88 488 242 391 28 414 145 92 206 334 152 343 367 254 100 243 155 348 148 450 461 483 97 34 471 69 416 362\n", "output": "NO\n"}, {"input": "500 50\n72 474 467 241 442 437 336 234 410 120 438 164 405 177 142 114 27 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\nHiking club \"Up the hill\" just returned from a walk. Now they are trying to remember which hills they've ju... | [{"input": "700\n399\n", "output": "400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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've got a string $S$ consisting of $n$ lowercase English letters from your friend. It turned out that this... | [{"input": "49 3\nabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab\n", "output": "Yes\n"}, {"input": "49 3\nbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab\n", "output": "Yes\n"}, {"input": "7 -475391\nqohshra\n", "output": "Yes\n"}, {"input": "5 -50593786\nzsbyd\n", "output": "Yes\n"}, {"input": "5 -34021632\ntinzq... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 three distinct integers $a$, $b$, and $c$, find the medium number between all of them.\n\nThe medium nu... | [{"input": "69\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2 3\n1 2... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn the good old days, the Internet was free from fears and terrorism. People did not have to worry about any ... | [{"input": "2 5\npermit 192168?? ?12??34?\ndeny 19216899 012243?5\n19216711 11233340 HiIamACracker\n19216891 01234345 Hello\n19216899 01234345 HiIamAlsoACracker\n19216809 11200340 World\n00000000 99999999 TheEndOfTheWorld\n1 2\npermit 12345678 23456789\n19216891 01234345 Hello\n12345678 23456789 Hello\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\nAs technologies develop, manufacturers are making the process of unlocking a phone as user-friendly as possib... | [{"input": "bn\n100\ndf\nyb\nze\nml\nyr\nof\nnw\nfm\ndw\nlv\nzr\nhu\nzt\nlw\nld\nmo\nxz\ntp\nmr\nou\nme\npx\nvp\nes\nxi\nnr\nbx\nqc\ngm\njs\nkn\ntw\nrq\nkz\nuc\nvc\nqr\nab\nna\nro\nya\nqy\ngu\nvk\nqk\ngs\nyq\nop\nhw\nrj\neo\nlz\nbh\nkr\nkb\nma\nrd\nza\nuf\nhq\nmc\nmn\nti\nwn\nsh\nax\nsi\nnd\ntz\ndu\nfj\nkl\nws\now\nnf\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 plays \"Game 23\". Initially he has a number $n$ and his goal is to transform it to $m$. In one move... | [{"input": "289777775 341477104\n", "output": "-1\n"}, {"input": "100000000 100000001\n", "output": "-1\n"}, {"input": "289777775 341477104\n", "output": "-1\n"}, {"input": "100000000 100000001\n", "output": "-1\n"}, {"input": "139999978 419999934\n", "output": "1\n"}, {"input": "300000007 300000007\n", "output": "0\n"... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThe year of 2012 is coming...\n\nAccording to an ancient choradrican legend in this very year, in 2012, Diabl... | [{"input": "22\nCleo likes Snowy\nCleo likes Troll\nChapay likes Dracul\nSnowy likes Troll\nDracul likes Chapay\nDracul likes Snowy\nChapay likes Cleo\nSnowy likes Chapay\nDracul likes Troll\nAnka likes Hexadecimal\nSnowy likes Anka\nHexadecimal likes Cleo\nHexadecimal likes Troll\nDracul likes Anka\nCleo likes Hexadec... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSpecial Agent Smart Beaver works in a secret research department of ABBYY. He's been working there for a long... | [{"input": "1023456789??????????????????????????????????????ABCDIFGHIJ\n", "output": "362880000000000000000000000000000000000000000"}, {"input": "?GJ??\n", "output": "81000\n"}, {"input": "BA?C?\n", "output": "64800\n"}, {"input": "HG?JI\n", "output": "45360\n"}, {"input": "GH???\n", "output": "81000\n"}, {"input": "?C... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nTakahashi throws N dice, each having K sides with all integers from 1 to K. The dice are NOT pairwise disting... | [{"input": "2000 3\n", "output": "337087647\n337087647\n337085647\n337085647\n337083647\n337083647\n337081647\n337081647\n337079647\n337079647\n337077647\n337077647\n337075647\n337075647\n337073647\n337073647\n337071647\n337071647\n337069647\n337069647\n337067647\n337067647\n337065647\n337065647\n337063647\n337063647\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\nAre you fond of collecting some kind of stuff? Mike is crazy about collecting stamps. He is an active member ... | [{"input": "5\n13 1 1 1 -1", "output": "YES\n"}, {"input": "5\n13 0 1 1 -1", "output": "NO\n"}, {"input": "5\n0 3 -1 0 -1", "output": "NO\n"}, {"input": "5\n0 4 -1 0 -1", "output": "NO\n"}, {"input": "5\n-2 0 3 -1 1", "output": "NO\n"}, {"input": "5\n-3 0 3 -1 1", "output": "NO\n"}, {"input": "5\n13 0 1 1 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\nGleb ordered pizza home. When the courier delivered the pizza, he was very upset, because several pieces of s... | [{"input": "10 2\n11\n1 1 0\n2 2 3\n3 3 0\n6 4 0\n5 5 0\n6 6 0\n7 7 4\n8 8 7\n9 18 3\n10 10 100\n9 0 1\n", "output": "2\n"}, {"input": "10 2\n11\n1 1 0\n2 2 3\n3 3 0\n6 4 0\n5 5 0\n6 6 0\n7 7 8\n8 8 7\n9 18 3\n10 10 100\n9 0 1\n", "output": "2\n"}, {"input": "10 2\n11\n1 1 0\n2 2 3\n3 4 0\n6 4 0\n5 5 0\n6 12 0\n7 7 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\nExample\n\nInput\n\nanagram\ngrandmother\n\n\nOutput\n\n4### Format: Read the inputs from stdin solve the pro... | [{"input": "anagram\ngrandmosher", "output": "4\n"}, {"input": "anbgram\ngrandmosher", "output": "3\n"}, {"input": "anbfram\ngrandmosher", "output": "2\n"}, {"input": "narfamb\nreoahmodsrg", "output": "1\n"}, {"input": "nbgaqnb\ntohtheodscl", "output": "0\n"}, {"input": "anagram\ngrandlother", "output": "4\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\nToday is Devu's birthday. For celebrating the occasion, he bought n sweets from the nearby market. He has inv... | [{"input": "40\n37 15\n48 10\n16 5\n30 23\n32 20\n24 4\n46 19\n16 13\n1 1\n37 22\n44 29\n24 6\n27 10\n39 16\n28 13\n5 4\n31 22\n9 2\n30 26\n23 16\n16 12\n43 5\n29 1\n20 5\n40 12\n18 14\n22 15\n29 2\n3 2\n6 3\n45 28\n42 34\n43 32\n10 10\n12 8\n10 8\n4 1\n17 17\n16 7\n8 7\n", "output": "796297179\n361826943\n1330\n156078... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nINTERCAL is the oldest of esoteric programming languages. One of its many weird features is the method of cha... | [{"input": "aMCT]:0hDJ*Up5g_l:O&>>%gjQkZkb(mi&;\\7dL\"nWOGz/;,6h*@Q0R53MS2<}F~+Ms\\\"cF-lgF0>C&y7)72\\.T\"8*#VO=|^OtYs\n", "output": "122\n212\n240\n152\n112\n94\n80\n246\n244\n208\n254\n170\n156\n98\n198\n236\n196\n218\n106\n142\n232\n0\n216\n190\n144\n204\n180\n124\n132\n144\n50\n94\n32\n50\n136\n162\n78\n198\n244\n2... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nBackground\nThere is a message that is circulating via public media that claims a reader can easily read a me... | [{"input": "\"you've gotta dance like there's nobody watching, love like you'll never be hurt, sing like there's nobody listening, and live like it's heaven on earth.\"", "output": "[\"you've gotta dacne like teehr's nbdooy wachintg, love like ylo'ul neevr be hrut, sing like teehr's nbdooy leiinnstg, and live like it'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\nVasya lives in a strange world. The year has n months and the i-th month has ai days. Vasya got a New Year pr... | [{"input": "103\n100\n68 38 41 54 37 11 35 26 43 97 70 3 13 11 64 83 3 95 17 16 4 13 22 27 64 20 95 38 40 87 6 17 95 67 31 24 85 33 98 24 89 101 66 38 42 5 95 18 95 13 103 85 72 73 68 93 22 59 48 59 72 46 5 41 54 32 48 69 3 76 2 26 102 44 39 58 55 85 40 16 81 78 92 63 25 97 83 2 54 16 20 63 19 8 84 34 1 22 43 93\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\nWrite a program which manipulates a disjoint set S = {S1, S2, . . . , Sk}.\n\nFirst of all, the program shoul... | [{"input": "5 12\n1 1 4\n1 2 3\n1 1 1\n1 3 4\n1 2 4\n1 2 2\n1 1 3\n1 1 4\n1 3 0\n0 0 4\n1 0 2\n1 3 0", "output": "0\n0\n1\n0\n0\n1\n0\n0\n0\n0\n0\n"}, {"input": "5 12\n1 1 4\n1 2 3\n1 1 1\n1 3 4\n1 2 4\n1 3 2\n1 1 3\n1 1 4\n1 3 0\n0 0 4\n1 0 3\n1 3 0", "output": "0\n0\n1\n0\n0\n0\n0\n0\n0\n0\n0\n"}, {"input": "5 12\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\nGreg is a beginner bodybuilder. Today the gym coach gave him the training plan. All it had was n integers a_1... | [{"input": "20\n25 50 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 24\n", "output": "biceps\n"}, {"input": "20\n25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 24\n", "output": "chest\n"}, {"input": "20\n25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 24\n", "output": "chest\n"}, {"input": "20\n... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nYou are given two positive integer numbers a and b. Permute (change order) of the digits of a to construct ma... | [{"input": "1000000000000000000\n1000000000000000000\n", "output": "1000000000000000000\n"}, {"input": "1000000000000000000\n1000000000000000000\n", "output": "1000000000000000000\n"}, {"input": "1000000000000000000\n1000000000100000000\n", "output": "1000000000000000000\n"}, {"input": "999999999999999999\n100000000000... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 Elephant was fond of inventing new games. After a lot of research, Little Elephant came to know that m... | [{"input": "1\n2\n1 2 2\n2 -2 1", "output": "1\n-1\n"}, {"input": "1\n2\n1 0 2\n1 -2 2", "output": "0\n-1\n"}, {"input": "1\n1\n1 -4 2\n-1 7 -1", "output": "-2\n"}, {"input": "1\n2\n2 -1 2\n2 8 1", "output": "-1\n4\n"}, {"input": "1\n2\n1 -1 1\n2 7 2", "output": "-1\n3\n"}, {"input": "1\n2\n2 0 1\n1 12 2", "output": "0... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVova plays a computer game known as Mages and Monsters. Vova's character is a mage. Though as he has just sta... | [{"input": "15 100\n1 8 8\n2 200 101\n2 10 99\n1 9 9\n2 10 99\n2 200 101\n1 14 4\n2 194 195\n2 194 194\n2 990 290\n1 2 999992\n2 6 256\n2 7 256\n2 2 999988\n2 2 252\n", "output": "NO\nNO\nYES\nNO\nNO\nYES\nNO\nNO\nYES\nYES\nYES\n"}, {"input": "15 100\n1 8 8\n2 200 101\n2 10 99\n1 9 9\n2 10 99\n2 200 101\n1 14 4\n2 194 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 certain type of steel is graded according to the following conditions.\n\n1. Hardness of the steel must be ... | [{"input": "3 \n127 1.5460478864469624 13440\n71 -1 8462\n1 -1 0", "output": "7\n10\n6\n"}, {"input": "3 \n127 1.5460478864469624 13440\n16 -1 14390\n1 -2 0", "output": "7\n8\n6\n"}, {"input": "3 \n127 2.9825462611697358 13440\n16 -2 14390\n1 -2 0", "output": "7\n8\n6\n"}, {"input": "3 \n127 3.3228384832989373 13440\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\nAshish has an array $a$ of size $n$.\n\nA subsequence of $a$ is defined as a sequence that can be obtained fr... | [{"input": "10 4\n91239 51189 50977 96098 56330 55725 6448 7351 60071 93359\n", "output": "50977\n"}, {"input": "10 4\n91239 51189 50977 96098 56330 55725 6448 7351 82063 93359\n", "output": "50977\n"}, {"input": "10 4\n30551 51189 50977 96098 56330 55725 6448 7351 82063 93359\n", "output": "30551\n"}, {"input": "10 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\nIn the school computer room there are n servers which are responsible for processing several computing tasks.... | [{"input": "10\n19999 19999 20000 20000 29860 20000 12103 20000 19999 17191\n", "output": "10536\n"}, {"input": "10\n19999 19999 20000 39539 29860 20000 12103 20000 19999 17191\n", "output": "25661\n"}, {"input": "10\n11328 19999 20000 39539 29860 20000 12103 20000 19999 17191\n", "output": "27395\n"}, {"input": "10\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\nA permutation of length n is an integer sequence such that each integer from 0 to (n - 1) appears exactly onc... | [{"input": "100\n99 5 40 32 4 31 38 57 94 47 26 16 89 72 9 80 55 86 78 90 42 41 46 74 56 97 21 48 66 27 93 85 88 59 64 95 10 45 12 22 84 60 8 98 62 51 14 65 39 30 11 71 92 19 76 43 87 54 15 53 37 6 25 18 96 35 13 91 2 3 0 23 1 7 49 75 81 33 50 52 63 44 69 36 17 61 24 20 68 34 73 29 70 83 58 79 82 28 77 67\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\nYou have N items that you want to put them into a knapsack. Item i has value vi and weight wi.\n\nYou want to... | [{"input": "4 3\n4 0\n5 2\n2 1\n13 1", "output": "22\n"}, {"input": "4 6\n4 0\n5 2\n2 1\n13 1", "output": "24\n"}, {"input": "4 5\n0 2\n5 2\n2 1\n8 3", "output": "13\n"}, {"input": "4 5\n4 2\n5 2\n2 0\n8 3", "output": "15\n"}, {"input": "4 7\n4 2\n5 2\n2 0\n8 3", "output": "19\n"}, {"input": "4 1\n4 4\n5 3\n1 0\n15 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\nYou are running through a rectangular field. This field can be represented as a matrix with 3 rows and m colu... | [{"input": "50 100\n3 24 49\n2 10 12\n1 87 92\n2 19 60\n2 53 79\n3 65 82\n3 10 46\n1 46 86\n2 55 84\n1 50 53\n3 80 81\n3 66 70\n2 35 52\n1 63 69\n2 65 87\n3 68 75\n1 33 42\n1 56 90\n3 73 93\n2 20 26\n2 42 80\n2 83 87\n3 99 99\n1 14 79\n2 94 97\n1 66 85\n1 7 73\n1 50 50\n2 16 40\n2 76 94\n1 71 98\n1 99 99\n1 61 87\n3 98... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nEugeny loves listening to music. He has n songs in his play list. We know that song number i has the duration... | [{"input": "10 10\n3 1\n2 7\n5 1\n7 2\n9 10\n9 5\n2 5\n4 8\n9 9\n1 9\n26 34 37 141 146 201 239 245 296 299\n", "output": "4\n4\n5\n6\n6\n8\n9\n9\n10\n10\n"}, {"input": "10 10\n3 1\n2 7\n5 1\n7 2\n9 10\n9 5\n2 5\n4 10\n9 15\n1 9\n26 34 37 141 146 201 239 245 296 299\n", "output": "4\n4\n5\n6\n6\n8\n9\n9\n9\n9\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\nI need to save some money to buy a gift. I think I can do something like that:\n\nFirst week (W0) I save noth... | [{"input": "4000", "output": "[32024004000]", "fn_name": "finance"}, {"input": "5000", "output": "[62537505000]", "fn_name": "finance"}, {"input": "2000", "output": "[4006002000]", "fn_name": "finance"}, {"input": "730", "output": "[195308580]", "fn_name": "finance"}, {"input": "999", "output": "[499999500]", "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\nSnuke built an online judge to hold a programming contest.\n\nWhen a program is submitted to the judge, the j... | [{"input": "ACABA", "output": "Yes\n"}, {"input": "ACBAA", "output": "Yes\n"}, {"input": "ACAAA", "output": "Yes\n"}, {"input": "AAACA", "output": "Yes\n"}, {"input": "AAAC@", "output": "Yes\n"}, {"input": "BAAC@", "output": "Yes\n"}, {"input": "B@AC@", "output": "Yes\n"}, {"input": "A@AC@", "output": "Yes\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\nToday Vasya visited a widely known site and learned that the continuation of his favourite game Codecraft II ... | [{"input": "September\n0\n", "output": "September\n"}, {"input": "November\n46\n", "output": "September\n"}, {"input": "December\n240\n", "output": "December\n"}, {"input": "December\n81\n", "output": "September\n"}, {"input": "February\n22\n", "output": "December\n"}, {"input": "September\n3\n", "output": "December\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\nFor a set $S$ of integers, perform a sequence of the following operations. Note that multiple elements can ha... | [{"input": "10\n0 1\n0 1\n0 2\n0 3\n2 2\n1 1\n0 2\n1 3\n0 4\n3 1 4", "output": "1\n2\n3\n4\n2\n4\n1\n5\n1\n1\n2\n3\n4\n"}, {"input": "10\n0 1\n0 1\n0 2\n0 3\n2 2\n1 1\n1 1\n1 3\n0 4\n3 1 4", "output": "1\n2\n3\n4\n2\n2\n1\n4\n1\n1\n3\n4\n"}, {"input": "10\n0 1\n0 1\n0 2\n0 -1\n2 2\n1 0\n1 2\n1 3\n0 4\n3 1 4", "output":... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nGiven is a string S of length N consisting of lowercase English letters.\nSnuke can do this operation any num... | [{"input": "90585\nfohfoxuvgjxpybcfoxmefomtzopbsprupidgsybejhphoymfoxxaobhdxbmfoxqioqjzehbmufpownifoxhwlrybqsqijgkdmbpfoxzlobcfoxfpdznrbcqqjqglhqgnuooojywfoxfsqesfoxagdfmfoxlzlhjxrfkwmrktsintfocipouajpsqucpoydkfogknyjffoxddeqsrdeupfownwreitzyflusfoxrhmoffoxqfoxsmyurkfotmlxhekuksfotxukcdfopfoxrcryuanwuxzxtayrlhmhfpmrqof... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nShe does her utmost to flawlessly carry out a person's last rites and preserve the world's balance of yin and... | [{"input": "6 7\n2 1\n2 3\n3 5\n1 2\n6 1\n5 6\n4 5\n3\n1 4\n5 1\n4 5\n", "output": "YES\n5\n1 2 3 5 4\n4\n5 3 2 1\n2\n4 5\n"}, {"input": "6 7\n2 1\n2 3\n3 5\n1 4\n6 1\n5 6\n4 5\n3\n1 4\n5 1\n4 5\n", "output": "YES\n2\n1 4\n4\n5 3 2 1\n5\n4 1 2 3 5\n"}, {"input": "6 7\n2 1\n2 3\n2 5\n1 4\n6 1\n5 6\n4 5\n3\n1 4\n5 1\n4 5... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMadoka decided to entrust the organization of a major computer game tournament \"OSU\"!\n\nIn this tournament... | [{"input": "100000 1000000000\n", "output": "607723520\n"}, {"input": "100000 53228\n", "output": "871774727\n"}, {"input": "11994 11995\n", "output": "685385528\n"}, {"input": "87532 32150\n", "output": "165162987\n"}, {"input": "99999 3123\n", "output": "575224395\n"}, {"input": "30 99999999\n", "output": "73741817\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 gems. The value of the i-th gem is V_i.\nYou will choose some of these gems, possibly all or none... | [{"input": "20\n50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50\n50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50\n", "output": "0\n"}, {"input": "20\n14 45 40 37 6 20 19 18 5 16 4 11 47 27 24 13 41 9 38 44\n43 50 46 40 29 47 45 46 45 33 12 35 48 44 31 20 42 40 47 48\n", "output": "0\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\nDo you know a story about the three musketeers? Anyway, you will learn about its origins now.\n\nRichelimakie... | [{"input": "987 50\n221 959\n221 553\n959 695\n553 959\n819 437\n371 295\n695 553\n959 347\n595 699\n652 628\n553 347\n868 589\n695 221\n282 714\n351 703\n104 665\n755 436\n556 511\n695 347\n221 347\n243 874\n695 847\n863 501\n583 145\n786 221\n38 286\n72 397\n808 658\n724 437\n911 548\n405 759\n681 316\n648 328\n327 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\nThere are $n$ models in the shop numbered from $1$ to $n$, with sizes $s_1, s_2, \\ldots, s_n$.\n\nOrac will ... | [{"input": "4\n23\n3198 4895 1585 3916 2650 5552 876 2731 1971 126 2152 6910 1096 4103 1074 2594 2897 3983 3830 3460 729 576 3281\n1\n0000000010\n2\n1 1\n100\n1 2 3 4 5 2 7 10 9 14 11 12 13 14 24 16 17 33 19 20 21 22 23 24 25 26 27 28 29 41 31 32 56 34 35 36 37 38 39 40 41 42 43 44 45 46 54 48 25 60 25 52 53 54 49 56 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\nPetya and Vasya are playing a game. Petya's got n non-transparent glasses, standing in a row. The glasses' po... | [{"input": "100 27 56\n58 18 50 41 33 37 14 87 77 73 61 53 15 8 70 68 45 96 54 78 39 120 51 60 80 12 93 99 20 92 17 79 4 13 62 91 69 29 49 36 98 34 90 35 84 64 38 83 28 89 165 94 9 16 26 48 10 57 23 75 27 88 44 21 72 76 30 43 32 2 71 24 100 1 31 99 42 40 47 55 86 85 66 5 52 43 95 74 11 19 7 82 6 25 56 63 65 59 46 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\nA permutation p of size n is the sequence p1, p2, ..., pn, consisting of n distinct integers, each of them is... | [{"input": "17877\n", "output": "2 17877 4 17875 6 17873 8 17871 10 17869 12 17867 14 17865 16 17863 18 17861 20 17859 22 17857 24 17855 26 17853 28 17851 30 17849 32 17847 34 17845 36 17843 38 17841 40 17839 42 17837 44 17835 46 17833 48 17831 50 17829 52 17827 54 17825 56 17823 58 17821 60 17819 62 17817 64 17815 66 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 $n$ students under your control and you have to compose exactly two teams consisting of some subset ... | [{"input": "4\n7\n4 2 4 1 4 3 4\n5\n2 1 5 4 3\n1\n1\n4\n1 1 1 3\n", "output": "3\n1\n0\n2\n"}, {"input": "4\n7\n4 2 4 1 4 3 4\n5\n2 1 5 1 3\n1\n1\n4\n1 1 1 3\n", "output": "3\n2\n0\n2\n"}, {"input": "4\n7\n4 2 4 1 4 3 4\n5\n2 1 2 1 3\n1\n1\n4\n1 1 1 1\n", "output": "3\n2\n0\n1\n"}, {"input": "4\n7\n4 2 4 1 4 3 4\n5\n2 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nNatsuki and her friends were taken to the space by an alien and made friends with a lot of aliens. During the... | [{"input": "23 4\n2 3\n3 1\n6 4\n5 2", "output": "1966080\n"}, {"input": "23 4\n2 3\n3 1\n6 6\n5 2", "output": "2621440\n"}, {"input": "24 4\n2 3\n3 2\n4 4\n5 2", "output": "6291456\n"}, {"input": "19 4\n2 2\n3 4\n4 3\n9 5", "output": "196608\n"}, {"input": "9 5\n1 2\n2 2\n3 5\n4 5\n5 1", "output": "112\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\nYou are given an array of $n$ integers $a_1$, $a_2$, ..., $a_n$, and a set $b$ of $k$ distinct integers from ... | [{"input": "100 2\n96 58 6 51 50 14 42 14 8 23 50 87 18 38 66 12 60 34 67 79 73 79 100 94 89 73 4 13 30 3 34 26 41 65 18 71 29 3 40 65 77 83 51 20 38 45 43 64 7 12 97 42 88 32 62 61 92 17 83 14 3 23 5 58 3 64 17 35 23 86 65 22 44 81 30 95 62 63 17 85 3 3 17 56 26 94 59 84 3 88 70 53 52 74 12 47 79 96 72 30\n4 21\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\nPavel cooks barbecue. There are n skewers, they lay on a brazier in a row, each on one of n positions. Pavel ... | [{"input": "100\n87 69 49 86 96 12 10 79 29 66 48 77 73 62 70 52 22 28 97 35 91 5 33 82 65 85 68 80 64 8 38 23 94 34 75 53 57 6 100 2 56 50 55 58 74 9 18 44 40 3 43 45 99 51 21 92 89 36 88 54 42 14 78 71 25 76 13 11 27 72 7 32 93 46 83 30 26 37 39 31 95 59 47 24 67 16 4 15 1 98 19 81 84 61 90 41 17 20 63 60\n1 1 1 0 1 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn order to celebrate Twice's 5th anniversary, Tzuyu and Sana decided to play a game.\n\nTzuyu gave Sana two ... | [{"input": "6\n6 12\n8 4\n90 1219\n55 14\n6484 2912\n2 1\n", "output": "10\n12\n1177\n57\n4660\n3\n"}, {"input": "6\n6 12\n13 4\n90 1219\n55 14\n6484 2912\n2 1\n", "output": "10\n9\n1177\n57\n4660\n3\n"}, {"input": "6\n6 12\n8 6\n90 1219\n55 14\n6484 2912\n2 1\n", "output": "10\n14\n1177\n57\n4660\n3\n"}, {"input": "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\nYou start with a value in dollar form, e.g. $5.00. You must convert this value to a string in which the value... | [{"input": "\"$-5843.21\"", "output": "[\"No negative numbers are allowed!\"]", "fn_name": "dollar_to_speech"}, {"input": "\"$-234.48\"", "output": "[\"No negative numbers are allowed!\"]", "fn_name": "dollar_to_speech"}, {"input": "\"$-45.32\"", "output": "[\"No negative numbers are allowed!\"]", "fn_name": "dollar_to... | 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 have $n$ barrels lined up in a row, numbered from left to right from one. Initially, the $i$-th barrel co... | [{"input": "2\n4 1\n19 5 2 5\n3 2\n0 0 1\n", "output": "24\n1\n"}, {"input": "2\n4 1\n5 16 5 5\n3 2\n0 0 1\n", "output": "21\n1\n"}, {"input": "2\n4 3\n10 1 1 2\n3 2\n0 1 1\n", "output": "14\n2\n"}, {"input": "2\n4 1\n5 16 5 5\n3 2\n0 0 2\n", "output": "21\n2\n"}, {"input": "2\n4 1\n5 11 5 5\n3 1\n1 0 1\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\nConsider an n Γ m grid. Initially all the cells of the grid are colored white. Lenny has painted some of the ... | [{"input": "50 2\nWW\nWW\nWW\nWW\nWW\nWW\nWW\nWW\nWW\nWW\nWW\nWW\nWW\nWW\nWW\nWB\nWB\nWB\nWB\nWB\nWB\nWB\nWB\nWB\nWB\nBB\nBB\nBB\nBB\nBB\nBB\nBB\nBB\nBB\nBB\nBB\nBB\nBB\nBB\nBB\nBW\nBW\nBW\nBW\nBW\nBW\nBW\nWW\nWW\nWW\n", "output": "NO\n"}, {"input": "50 2\nWW\nWW\nWW\nWW\nWW\nWW\nWW\nWW\nWW\nWW\nWW\nWW\nWW\nWW\nWW\nBW\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 implement a double linked list.\n\nWrite a program which performs the following operations:\n... | [{"input": "9\ninsert 19\ninsert 2\ninsert 2\ninsert 0\ndelete 3\ninsert 6\ndelete 5\ndeleteFirst\ndeleteLast", "output": "0 2 2\n"}, {"input": "9\ninsert 19\ninsert 3\ninsert 3\ninsert 0\ndelete 6\ninsert 6\ndeldte 5\ndeleteFirst\ndeleteLast", "output": "0 3 3\n"}, {"input": "9\ninsert 10\ninsert 2\ninsert 4\ninsert 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\nDecompose a number `num` into an array (tuple in Haskell, array of arrays `long[][]` in C# or Java) of the fo... | [{"input": "8328441", "output": "[[[22, 13, 10, 8, 7, 6, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], 50]]", "fn_name": "decompose"}, {"input": "9819938", "output": "[[[23, 12, 9, 8, 6, 6, 5, 4, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], 0]]", "fn_name": "decompose"}, {"input": "833... | 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\nGiven the number pledged for a year, current value and name of the month, return string that gives informatio... | [{"input": "100\n53\n\"July\"", "output": "[\"You are 1 ahead of schedule!\"]", "fn_name": "check_challenge"}, {"input": "12\n12\n\"September\"", "output": "[\"Challenge is completed.\"]", "fn_name": "check_challenge"}, {"input": "12\n5\n\"March\"", "output": "[\"You are 3 ahead of schedule!\"]", "fn_name": "check_chal... | 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 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\n7 50\n1 72\n1 37\n8 64\n10 30\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\nOne day Vitaly was going home late at night and wondering: how many people aren't sleeping at that moment? To... | [{"input": "100 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 0\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n0 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 0\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 0\n1 1\n1 1\n1 1\n1 1\n1... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are $n + 1$ cities, numbered from $0$ to $n$. $n$ roads connect these cities, the $i$-th road connects ... | [{"input": "2\n6\nLRRRLL\n3\nLRL\n", "output": "\n1 3 2 3 1 3 2\n1 4 1 4\n"}, {"input": "2\n6\nLRRRLL\n3\nLRL\n", "output": "1 3 2 3 1 3 2\n1 4 1 4\n"}, {"input": "2\n6\nLLRRRL\n3\nLRL\n", "output": "1 2 3 2 3 1 3\n1 4 1 4\n"}, {"input": "2\n6\nLLRRRL\n3\nRLL\n", "output": "1 2 3 2 3 1 3\n3 1 3 2\n"}, {"input": "2\n6\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\nIt's been a tough week at work and you are stuggling to get out of bed in the morning.\n\nWhile waiting at th... | [{"input": "\"23:57\"", "output": "[358]", "fn_name": "bus_timer"}, {"input": "\"00:00\"", "output": "[355]", "fn_name": "bus_timer"}, {"input": "\"10:00\"", "output": "[10]", "fn_name": "bus_timer"}, {"input": "\"10:45\"", "output": "[10]", "fn_name": "bus_timer"}, {"input": "\"05:10\"", "output": "[45]", "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\n## Your Job\n\n Find the sum of all multiples of `n` below `m` \n \n \n## Keep in Mind\n\n * `n` and `m` ... | [{"input": "123\n4567", "output": "[86469]", "fn_name": "sum_mul"}, {"input": "4\n-7", "output": "[\"INVALID\"]", "fn_name": "sum_mul"}, {"input": "-7\n4", "output": "[\"INVALID\"]", "fn_name": "sum_mul"}, {"input": "0\n2", "output": "[\"INVALID\"]", "fn_name": "sum_mul"}, {"input": "2\n0", "output": "[\"INVALID\"]", "... | 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 string S of length N consisting of lowercase English letters.\nWe will cut this string at one... | [{"input": "45\ntgxgdqkyjzhyputjjtllptdfxocrylqfqjynmfbfucbir\n", "output": "9\n"}, {"input": "45\ntgxgtqkyjfhyzutjjdllptdpxrbrylqfqjynmfbfucbio", "output": "10\n"}, {"input": "45\nbnxgtqkykfhyzutjjdllptdpxrtrylqfqjygmfbftcbio", "output": "11\n"}, {"input": "45\nblxhtqkyjehxzutkjdmlpidpurtrzlbfribgmhqfzcyto", "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\n\"The Chamber of Secrets has been opened again\" β this news has spread all around Hogwarts and some of the s... | [{"input": "20 20\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\nCat Noku has obtained a map of the night sky. On this map, he found a constellation with n stars numbered fro... | [{"input": "10\n25280705 121178189\n219147240 -570920213\n-829849659 923854124\n18428128 -781819137\n-876779400 528386329\n-780997681 387686853\n-101900553 749998368\n58277314 355353788\n732128908 336416193\n840698381 600685123\n", "output": "5 3 6\n"}, {"input": "10\n25280705 121178189\n219147240 -570920213\n-82984965... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 sequence of k numbers: d_0,d_1,...,d_{k - 1}.\nProcess the following q queries in order:\n - The i-... | [{"input": "7 3\n27 18 28 18 28 46 1000000000\n1000000000 1 7\n1000000000 2 10\n1000000000 3 12\n", "output": "224489796\n214285714\n559523809\n"}, {"input": "7 3\n27 18 15 18 28 73 1000000000\n1000000010 1 13\n1000000000 2 10\n1000010000 2 12", "output": "615384622\n300000000\n678578214\n"}, {"input": "7 3\n27 18 15 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\nChef is the new king of the country Chefland. As first and most important responsibility he wants to reconstr... | [{"input": "2\n2\n12 10\n4\n3 10 21 13", "output": "120\n132\n"}, {"input": "2\n2\n5 10\n4\n19 10 11 13", "output": "50\n430\n"}, {"input": "2\n2\n5 10\n4\n17 10 11 13", "output": "50\n410\n"}, {"input": "2\n2\n6 10\n4\n17 10 11 13", "output": "60\n410\n"}, {"input": "2\n2\n2 10\n4\n17 10 11 13", "output": "20\n410\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\nMany modern text editors automatically check the spelling of the user's text. Some editors even suggest how t... | [{"input": "aabbccddaabbccddaabbccddaabbccddaaxaabbccbdaabbccddaabbccddaabbccddaaxyaabbccddaabbccddaabbccddaabbccddaaxyzaabbccddaabbccddaabbccddaabbccddaaxyzqaabbccddaadbccddaabbccddaabbccddaaqwertyaabbccddaabbccddaabbccddaabbccddaa\n", "output": "aabccdaabccdaabccdaabccdaaxaabccbdaabccdaabccdaabccdaaxyaabccdaabccdaabc... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMisha and Grisha are funny boys, so they like to use new underground. The underground has n stations connecte... | [{"input": "5 20\n5 5 1 4\n1 4 3\n2 4 1\n1 5 5\n5 1 4\n5 1 5\n1 5 5\n5 4 4\n2 3 3\n4 4 1\n1 4 1\n4 5 4\n1 4 5\n4 1 5\n2 4 2\n4 3 3\n2 5 5\n1 5 4\n3 3 4\n5 5 1\n3 4 1\n", "output": "3\n3\n3\n2\n3\n3\n2\n3\n2\n2\n2\n2\n2\n3\n3\n2\n2\n3\n3\n3\n"}, {"input": "5 20\n4 1 1 4\n2 2 5\n3 2 5\n2 3 4\n4 2 5\n4 1 2\n5 3 1\n2 1 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\nA cheetah and a cheater are going to play the game of Nim. In this game they use N piles of stones. Initially... | [{"input": "3\n101\n100\n100", "output": "-1\n"}, {"input": "3\n011\n100\n100", "output": "-1\n"}, {"input": "3\n100\n110\n100", "output": "-1\n"}, {"input": "3\n010\n100\n100", "output": "-1\n"}, {"input": "3\n011\n100\n101", "output": "-1\n"}, {"input": "3\n100\n110\n110", "output": "-1\n"}, {"input": "3\n100\n110\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 20XX, the Aizu Chuo Road, which has a total distance of 58km and 6 sections from Atsushiokanomachi, Kitaka... | [{"input": "2\n17 24\n4\n17 45\n2\n17 25\n7\n-1 35\n0", "output": "250\n1500\n"}, {"input": "2\n13 25\n6\n17 14\n4\n17 25\n7\n1 10\n0", "output": "1150\n1300\n"}, {"input": "2\n17 25\n4\n17 45\n4\n17 19\n7\n19 35\n0", "output": "250\n1300\n"}, {"input": "2\n17 24\n4\n17 45\n4\n17 25\n7\n-1 35\n0", "output": "250\n1300\... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nNate U. Smith runs a railroad company in a metropolitan area. In addition to his railroad company, there are ... | [{"input": "2\n-10 1 10 1\n4\n-6 2 -2 -2 1 1\n-6 -2 -2 2 1 0\n12 2 1 -2 0 0\n11 -2 2 2 1 1\n8 12 -7 -3\n8\n4 -5 4 -2 1 2\n4 -2 4 9 1 0\n6 9 6 14 1 1\n-5 6 7 6 0 0\n1 0 1 10 0 0\n-5 0 -5 10 0 1\n-7 -1 7 0 0 1\n-1 -1 -1 -3 0 1", "output": "2\n3\n"}, {"input": "2\n-10 2 10 1\n4\n-6 2 -2 -2 1 1\n-6 -2 -2 2 1 0\n12 2 1 -2 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\nThere is Kannon-do in the mountain behind Ichiro's house. There are 30 steps from the foot to this Kannon-do,... | [{"input": "1\n1\n30\n27\n0", "output": "1\n1\n14740\n2369\n"}, {"input": "1\n17\n28\n27\n0", "output": "1\n6\n4357\n2369\n"}, {"input": "1\n1\n30\n25\n0", "output": "1\n1\n14740\n701\n"}, {"input": "1\n17\n28\n24\n0", "output": "1\n6\n4357\n381\n"}, {"input": "1\n18\n20\n25\n0", "output": "1\n10\n34\n701\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\nProblem\n\nThere is a grid of $ R \\ times C $ squares with $ (0, 0) $ in the upper left and $ (R-1, C-1) $ i... | [{"input": "421 435 361 230 182 16", "output": "196 792283366\n"}, {"input": "421 547 377 188 235 13", "output": "156 501147202\n"}, {"input": "421 435 196 169 388 12", "output": "46 766230083\n"}, {"input": "421 435 196 169 388 10", "output": "44 669339083\n"}, {"input": "421 435 320 169 135 9", "output": "146 6610838... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 the guys fried the radio station facilities, the school principal gave them tasks as a punishment. Dustin'... | [{"input": "10 10\nittmcs 112.147.123.173\njkt 228.40.73.178\nfwckqtz 88.28.31.198\nkal 224.226.34.213\nnacuyokm 49.57.13.44\nfouynv 243.18.250.17\ns 45.248.83.247\ne 75.69.23.169\nauwoqlch 100.44.219.187\nlkldjq 46.123.169.140\ngjcylatwzi 46.123.169.140;\ndxfi 88.28.31.198;\ngv 46.123.169.140;\nety 88.28.31.198;\notbm... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSome number of people (this number is even) have stood in a circle. The people stand in the circle evenly. Th... | [{"input": "7\n6 4 4\n2 3 0\n0 4 10\n5 3 4\n1 3 2\n4 5 12\n4 3 2\n", "output": "-1\n-1\n-1\n-1\n4\n-1\n-1\n"}, {"input": "7\n6 2 4\n2 3 0\n2 4 10\n5 3 4\n1 3 2\n2 5 8\n4 3 2\n", "output": "8\n-1\n-1\n-1\n4\n-1\n-1\n"}, {"input": "7\n6 2 4\n2 3 1\n2 4 10\n5 3 4\n1 3 2\n2 5 4\n4 3 2\n", "output": "8\n-1\n-1\n-1\n4\n1\n-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\nR3D3 spent some time on an internship in MDCS. After earning enough money, he decided to go on a holiday some... | [{"input": "100000000 100000000 100000000\n", "output": "266578227200000000\n"}, {"input": "100000000 100000000 100000000\n", "output": "266578227200000000\n"}, {"input": "100000000 100000010 100000000\n", "output": "266578239852872360\n"}, {"input": "100000000 50000000 100000000\n", "output": "191720992950000000\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 two strings $s$ and $t$, both consisting of exactly $k$ lowercase Latin letters, $s$ is lexicog... | [{"input": "12\nlylfekzszgqx\noewrpuflwlir\n", "output": "nbqykcppkvzu\n"}, {"input": "12\nlylfekzszgqx\noewrpuflwril\n", "output": "nbqykcppkyzr\n"}, {"input": "12\nlylfekzszgqx\noewrpuflwlir\n", "output": "nbqykcppkvzu"}, {"input": "10\nzzzzzzzzzx\nzzzzzzzzzz\n", "output": "zzzzzzzzzy\n"}, {"input": "10\nzyzzzzzzzx\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 an integer array $a_1, a_2, \\dots, a_n$ good if $a_i \\neq i$ for each $i$.\n\nLet $F(a)$ be the ... | [{"input": "10\n20000 -431912570 597469643\n20000 -13928452 414987414\n20000 -472808872 367983694\n20000 -84913058 517394906\n20000 -514402152 597357115\n20000 -720971736 526102810\n20000 -416160739 748291750\n20000 -665939649 743938438\n20000 -80741314 634025883\n20000 -824743396 138091345\n", "output": "248035877\n91... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 text consisting of n lines. Each line contains some space-separated words, consisting of lowe... | [{"input": "4\n13 11 15 15\nto be or not to be that is the question\nwhether tis nobler in the mind to suffer\nthe slings and arrows of outrageous fortune\nor to take arms against a sea of troubles\n", "output": "YES\n"}, {"input": "4\n13 11 15 15\nto be or not to be that is the question\nwhether tis nobler in the mind... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The flavor of Apple i is L+i-1, which can ... | [{"input": "100 -100\n", "output": "-5049\n"}, {"input": "100 100\n", "output": "14850\n"}, {"input": "30 -50\n", "output": "-1044\n"}, {"input": "82 -82\n", "output": "-3402\n"}, {"input": "65 -64\n", "output": "-2080\n"}, {"input": "18 -124", "output": "-1972\n"}, {"input": "33 -124", "output": "-3472\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# altERnaTIng cAsE <=> ALTerNAtiNG CaSe\n\nDefine `String.prototype.toAlternatingCase` (or a similar function... | [{"input": "\"String.prototype.toAlternatingCase\"", "output": "[\"sTRING.PROTOTYPE.TOaLTERNATINGcASE\"]", "fn_name": "to_alternating_case"}, {"input": "\"hello world\"", "output": "[\"HELLO WORLD\"]", "fn_name": "to_alternating_case"}, {"input": "\"HELLO WORLD\"", "output": "[\"hello world\"]", "fn_name": "to_alternat... | 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 goal of this Kata is to reduce the passed integer to a single digit (if not already) by converting the nu... | [{"input": "9889345778311094737448", "output": "[2]", "fn_name": "single_digit"}, {"input": "10000000000", "output": "[3]", "fn_name": "single_digit"}, {"input": "1234444123", "output": "[1]", "fn_name": "single_digit"}, {"input": "565656565", "output": "[3]", "fn_name": "single_digit"}, {"input": "234234235", "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\nPasha has recently bought a new phone jPager and started adding his friends' phone numbers there. Each phone ... | [{"input": "100 1\n5 3 1 5 6 2 4 8 3 3 1 1 2 8 2 3 8 2 5 2 6 2 3 5 2 1 2 1 2 8 4 3 3 5 1 4 2 2 2 5 8 2 2 6 2 9 3 4 1 8 1 5 5 6 6 2 2 7 3 3 4 2 4 1 2 6 6 4 9 4 3 2 3 8 2 3 1 4 1 4 1 3 5 3 5 5 2 3 4 1 1 8 1 5 6 9 4 2 5 1\n6 0 4 5 3 1 0 7 5 3 5 4 5 4 0 2 1 6 2 2 4 3 1 9 5 9 2 2 6 8 6 5 9 6 4 9 9 7 5 4 5 6 0 3 2 0 8 0 3 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\nIn this problem, a date is written as Y-M-D. For example, 2019-11-30 means November 30, 2019.\n\nIntegers M_1... | [{"input": "11 17\n11 122", "output": "0\n"}, {"input": "11 11\n11 101", "output": "0\n"}, {"input": "11 17\n11 17", "output": "0\n"}, {"input": "11 16\n11 28", "output": "0\n"}, {"input": "11 24\n11 28", "output": "0\n"}, {"input": "11 16\n11 31", "output": "0\n"}, {"input": "11 16\n11 46", "output": "0\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 $n$ students standing in a circle in some order. The index of the $i$-th student is $p_i$. It is gu... | [{"input": "5\n4\n1 2 3 4\n3\n1 3 2\n5\n1 2 3 5 4\n1\n1\n5\n3 2 1 5 4\n", "output": "YES\nYES\nNO\nYES\nYES\n"}, {"input": "5\n4\n1 2 3 4\n3\n1 3 2\n5\n1 2 3 5 4\n1\n1\n5\n3 2 1 5 4\n", "output": "YES\nYES\nNO\nYES\nYES\n"}, {"input": "1\n12\n12 2 14 5 6 15 4 12 20 21 1 2\n", "output": "NO\n"}, {"input": "1\n12\n12 2 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\nMemory is performing a walk on the two-dimensional plane, starting at the origin. He is given a string s with... | [{"input": "RDDLLDLUUUDDRDRURLUUURLLDDLRLUURRLLRRLDRLLUDRLRULLDLRRLRLRLRUDUUDLULURLLDUURULURLLRRRURRRDRUUDLDRLRDRLRRDDLDLDLLUDRUDRLLLLDRDUULRUURRDLULLULDUDULRURRDDDLLUDRLUDDLDDDRRDDDULLLLDLDRLRRLRRDDRLULURRUDRDUUUULDURUDRDLDDUDUDRRURDULRRUDRLRRDLUURURDLDRLRDUDDDLDDDURURLUULRDUUULRURUDUDRRUDULLLUUUDRLLDRRDDLRUDRDRDLLRUR... | code_stdio |
[
{
"content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIgor has fallen in love with Tanya. Now Igor wants to show his feelings and write a number on the fence oppos... | [{"input": "62800\n867 936 2 888 474 530 287 1101 220\n", "output": "33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 have a lot of friends. Every friend is very small.\nI often go out with my friends. Put some friends in you... | [{"input": "6 50\n10\n30\n13\n18\n12\n16", "output": "15\n"}, {"input": "6 37\n6\n16\n13\n18\n12\n16", "output": "10\n"}, {"input": "6 50\n6\n16\n13\n18\n12\n16", "output": "12\n"}, {"input": "6 37\n5\n16\n13\n18\n26\n33", "output": "5\n"}, {"input": "6 37\n6\n16\n13\n18\n26\n16", "output": "7\n"}, {"input": "6 50\n6\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 basketball competition is held where the number of players in a team does not have a maximum or minimum lim... | [{"input": "8 1000\n13 14 15 15 15 15 15 16\n", "output": "0\n"}, {"input": "8 155\n13 13 11 16 18 16 19 16\n", "output": "0\n"}, {"input": "8 300\n13 14 15 15 15 15 15 16\n", "output": "0\n"}, {"input": "8 12\n13 14 15 15 15 15 15 16\n", "output": "8\n"}, {"input": "8 12\n12 12 10 14 12 11 15 11\n", "output": "5\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\nChef wrote some text on a piece of paper and now he wants to know how many holes are in the text. What is a h... | [{"input": "2\nFEHCEDOC\nDRINKEATCODE", "output": "2\n5\n"}, {"input": "2\nFEHCEEOC\nDRINKEATCODE", "output": "1\n5\n"}, {"input": "2\nCOEECHFE\nDRJNKEATBODE", "output": "1\n7\n"}, {"input": "2\nEFJEFCOB\nDRJNKEAUBODE", "output": "3\n7\n"}, {"input": "2\nEJDEFCOB\nDQJNKEATBODE", "output": "4\n7\n"}, {"input": "2\nEJDEF... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 end of the school year is near and Ms. Manana, the teacher, will soon have to say goodbye to a yet anothe... | [{"input": "50 50\n374 573 323 744 190 806 485 247 628 336 491 606 702 321 991 678 337 579 86 240 993 208 668 686 855 205 363 177 719 249 896 919 782 434 59 647 787 996 286 216 636 212 546 903 958 559 544 126 608 993\n", "output": "937\n"}, {"input": "50 50\n374 573 323 744 190 806 485 247 628 336 491 606 702 321 991 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\nIn the year 2xxx, an expedition team landing on a planet found strange objects made by an ancient species liv... | [{"input": "3\n95 20 180 18\n125 20 185 18\n40 26 195 10\n1\n6 5 5 4\n2\n5 5 5 4\n5 10 5 2\n2\n5 5 11 6\n0 7 5 3\n16\n2338 3465 29034 1351\n1571 14389 25019 842\n1706 8015 21355 1155\n1899 4359 33815 888\n2160 10364 20511 2353\n333 8835 6587 63\n2598 3176 23679 618\n1613 14217 8003 1505\n3140 4754 25986 929\n2707 9945 ... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 a lot of things which could be cutΒ β trees, paper, \"the rope\". In this problem you are going to c... | [{"input": "100 30\n100 99 100 99 99 100 100 99 100 99 99 100 100 100 99 99 99 100 99 99 99 99 100 99 99 100 100 99 100 99 99 99 100 99 100 100 99 100 100 100 100 100 99 99 100 99 99 100 99 100 99 99 100 100 99 100 99 99 100 99 100 100 100 100 99 99 99 100 99 100 99 100 100 100 99 100 100 100 99 100 99 99 100 100 100 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\nAre you going to Scarborough Fair?\n\nParsley, sage, rosemary and thyme.\n\nRemember me to one who lives ther... | [{"input": "67 39\nacbcbccccbabaabcabcaaaaaaccbcbbcbaaaacbbcccbcbabbcacccbbabbabbabaac\n4 36 a b\n25 38 a a\n3 44 b c\n35 57 b a\n4 8 a c\n20 67 c a\n30 66 b b\n27 40 a a\n2 56 a b\n10 47 c a\n22 65 c b\n29 42 a b\n1 46 c b\n57 64 b c\n20 29 b a\n14 51 c a\n12 55 b b\n20 20 a c\n2 57 c a\n22 60 c b\n16 51 c c\n31 64 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\nYou will be given an integer a and a string s consisting of lowercase English letters as input.\nWrite a prog... | [{"input": "4999\nzzzzzzzzzz\n", "output": "zzzzzzzzzz\n"}, {"input": "4998\nrainbow\n", "output": "rainbow\n"}, {"input": "3201\npurple\n", "output": "purple\n"}, {"input": "3200\npink\n", "output": "pink\n"}, {"input": "2999\nwhite\n", "output": "red\n"}, {"input": "3199\npink\n", "output": "red\n"}, {"input": "3200\... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 secret organization AiZu AnalyticS has launched a top-secret investigation. There are N people targeted, ... | [{"input": "100\n3 -1 100 3\n-1\n2 4 3", "output": "1\n"}, {"input": "100\n3 0 001 4\n-2\n2 10 3", "output": "2\n"}, {"input": "100\n3 0 001 4\n-3\n2 10 3", "output": "2\n"}, {"input": "100\n3 -1 100 3\n-1\n2 6 3", "output": "1\n"}, {"input": "100\n3 -1 100 3\n-1\n2 3 3", "output": "0\n"}, {"input": "100\n3 -1 000 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\nWrite a program which manipulates a sequence A = {a1, a2, . . . , an} with the following operations:\n\n* add... | [{"input": "4 5\n0 1 1\n0 2 10\n1 2 3\n1 1 2\n1 1 3", "output": "10\n11\n11\n"}, {"input": "4 5\n1 1 1\n1 4 3\n0 3 3\n1 1 2\n1 2 3", "output": "0\n0\n0\n3\n"}, {"input": "4 5\n0 1 1\n1 2 3\n1 2 3\n1 1 2\n1 2 2", "output": "0\n0\n1\n0\n"}, {"input": "4 5\n0 1 0\n1 2 2\n1 1 2\n1 1 0\n1 4 2", "output": "0\n0\n0\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**An [isogram](https://en.wikipedia.org/wiki/Isogram)** (also known as a \"nonpattern word\") is a logologica... | [{"input": "\"Hjelmqvist-Gryb-Zock-Pfund-Wax\"", "output": "[true]", "fn_name": "is_isogram"}, {"input": "\"Emily Jung Schwartzkopf\"", "output": "[true]", "fn_name": "is_isogram"}, {"input": "\"thumbscrew-japingly\"", "output": "[true]", "fn_name": "is_isogram"}, {"input": "\"subdermatoglyphic\"", "output": "[true]", ... | 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 square field of size $n \\times n$ in which two cells are marked. These cells can be in the same r... | [{"input": "6\n4\n..*.\n....\n*...\n....\n2\n*.\n.*\n2\n.*\n.*\n3\n*.*\n...\n...\n5\n.....\n..*..\n.....\n.*...\n.....\n4\n....\n....\n*...\n*...\n", "output": "\n*.*.\n....\n*.*.\n....\n**\n**\n**\n**\n*.*\n*.*\n...\n.....\n.**..\n.....\n.**..\n.....\n....\n....\n**..\n**..\n"}, {"input": "6\n4\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\nIt is known that fleas in Berland can jump only vertically and horizontally, and the length of the jump is al... | [{"input": "402841 635488 1119470\n", "output": "256000621408\n"}, {"input": "303307 400683 1450639\n", "output": "121529958681\n"}, {"input": "458717 400683 1450639\n", "output": "183800103711\n"}, {"input": "458717 255447 1450639\n", "output": "117177881499\n"}, {"input": "726292 261665 1483264\n", "output": "1900451... | code_stdio |
[
{
"content": "You are an expert Python programmer. 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 numbers of all offices in the new building of the Tax Office of IT City will have lucky numbers.\n\nLucky... | [{"input": "55\n", "output": "72057594037927934\n"}, {"input": "54\n", "output": "36028797018963966\n"}, {"input": "54\n", "output": "36028797018963966"}, {"input": "55\n", "output": "72057594037927934"}, {"input": "49\n", "output": "1125899906842622\n"}, {"input": "49\n", "output": "1125899906842622"}, {"input": "43\n... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.