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\nGildong has bought a famous painting software cfpaint. The working screen of cfpaint is square-shaped consist...
[{"input": "9 9\nBWBBWWWXW\nBWAWWWWWW\nWBWBBBBBB\nWWBBBWWWB\nWWBWBXBWW\nWBWWBBWWB\nWWWBWBWBW\nBBWBBBWWW\nWBWBBWWWW\n", "output": "18\n"}, {"input": "9 9\nBWBBWWWXW\nBWAWWWWWW\nWBWBBBBBB\nWWBBBWWWB\nWWBWBXBWW\nWBWWBBWWB\nWWWBWBWBW\nWWWBBBWBB\nWBWBBWWWW\n", "output": "18\n"}, {"input": "9 4\nBWBBWWWWW\nWWBWBWWWW\nWBWBBBB...
code_stdio
[ { "content": "You are an expert Python programmer. 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 positive integer N.\nFind the minimum positive integer divisible by both 2 and N.\n\n-----Con...
[{"input": "15607691432", "output": "15607691432\n"}, {"input": "1000000000\n", "output": "1000000000\n"}, {"input": "8325199727", "output": "16650399454\n"}, {"input": "999999999\n", "output": "1999999998\n"}, {"input": "1604548808", "output": "1604548808\n"}, {"input": "1558666763", "output": "3117333526\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 a string $s$. You can build new string $p$ from $s$ using the following operation no more than ...
[{"input": "1\nbbbaaaaabbabaabbbbaabbbbabbaabbaababbbbbbababbababbbaaaaaaabaababbbaababbbbababbbabbbbbabaabbaaaabaa\nbbbababbaabbbbbaabaaabaababaaaabaabbbabbababaaabba\n", "output": "YES\n"}, {"input": "1\nbbbaaaaabbabaabbbbaabbbbabbaabbaababbbbbbababbababbbaaaaaaabaababbbaababbbbababbbabbbbbabaabbaaaabaa\nbbbababbaabb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nVadim is really keen on travelling. Recently he heard about kayaking activity near his town and became very e...
[{"input": "50\n297 787 34 268 439 629 600 398 425 833 721 908 830 636 64 509 420 647 499 675 427 599 396 119 798 742 577 355 22 847 389 574 766 453 196 772 225 261 106 844 726 975 173 992 874 89 775 616 678 52 69 591 181 573 258 381 665 301 589 379 362 146 790 842 765 100 229 916 938 97 340 793 758 177 736 396 247 562...
code_stdio
[ { "content": "You are an expert Python programmer. 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 deck consisting of N cards. Each card has an integer written on it. The integer on the i-th card fr...
[{"input": "1 1 1\n1010000000", "output": "1009999999\n"}, {"input": "1 1 1\n1010100000", "output": "1010099999\n"}, {"input": "3 100 100\n10 1001 000", "output": "1001\n"}, {"input": "3 100 1001\n10 100 100", "output": "901\n"}, {"input": "3 100 100\n10 0001 000", "output": "100\n"}, {"input": "3 011 100\n6 1000 000",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSkyscraper \"MinatoHarukas\"\n\nMr. Port plans to start a new business renting one or more floors of the new ...
[{"input": "15\n27\n3\n5\n14453855\n142729211\n251672118\n560550970\n979553853\n999999999\n0", "output": "1 5\n2 6\n1 2\n2 2\n111119 130\n801761 178\n11923 13484\n4003866 140\n7523 37374\n163837 5994\n"}, {"input": "15\n16\n3\n3\n9699690\n237086004\n847288609\n900660121\n987698769\n999999999\n0", "output": "1 5\n16 1\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThis is the simple version of Fastest Code series. If you need some challenges, please try the [Performance v...
[{"input": "[-3, -2, -2, -1, 0, 1, 2, 3, 4]\n4", "output": "[[-2, -2]]", "fn_name": "find_a_b"}, {"input": "[-3, -2, -2, -1, 0, 1, 2, 3, 4]\n0", "output": "[[-3, 0]]", "fn_name": "find_a_b"}, {"input": "[-3, -2, -1, 0, 1, 2, 3, 4]\n4", "output": "[[1, 4]]", "fn_name": "find_a_b"}, {"input": "[1, 2, 3, 4, 5, 6]\n15", "o...
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\nWrite a function called `LCS` that accepts two sequences and returns the longest subsequence common to the pa...
[{"input": "\"finaltest\"\n\"zzzfinallyzzz\"", "output": "[\"final\"]", "fn_name": "lcs"}, {"input": "\"anothertest\"\n\"notatest\"", "output": "[\"nottest\"]", "fn_name": "lcs"}, {"input": "\"132535365\"\n\"123456789\"", "output": "[\"12356\"]", "fn_name": "lcs"}, {"input": "\"abcdef\"\n\"abc\"", "output": "[\"abc\"]"...
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\nBimokh is Mashmokh's boss. For the following n days he decided to pay to his workers in a new way. At the beg...
[{"input": "10 1 100000000\n999999999 1634812359 999999999 999999999 129546129 999999999 999999999 999999999 1815265208 999999999\n", "output": "99999999 34812359 99999999 99999999 29546129 99999999 99999999 99999999 15265208 99999999\n"}, {"input": "10 1 100000000\n999999999 999999999 999999999 1957501121 999999999 99...
code_stdio
[ { "content": "You are an expert Python programmer. 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 map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupi...
[{"input": "100 5000\n", "output": "YES\nLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLS\nSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSL\nLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSLSL...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nStellar history 2005.11.5. You are about to engage an enemy spacecraft as the captain of the UAZ Advance spac...
[{"input": "-10 6 6\n20 2 5\n1 10 0\n-1 10 10\n0 0 10", "output": "MISS\n"}, {"input": "-10 6 6\n20 2 5\n0 10 0\n-1 10 10\n0 0 10", "output": "MISS\n"}, {"input": "-10 6 6\n20 2 5\n0 10 0\n-1 10 14\n0 0 10", "output": "MISS\n"}, {"input": "-10 6 6\n10 2 6\n0 10 0\n0 10 10\n0 0 10", "output": "MISS\n"}, {"input": "-10 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\nArcady is a copywriter. His today's task is to type up an already well-designed story using his favorite text...
[{"input": "thun-thun-thunder, thunder, thunder\nthunder, thun-, thunder\nthun-thun-thunder, thunder\nthunder, feel the thunder\nlightning then the thunder\nthunder, feel the thunder\nlightning then the thunder\nthunder, thunder\n", "output": "183\n"}, {"input": "thun-thun-thunder, thunder, thunder\nthunder, thun-, thu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nHaiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in thi...
[{"input": "37 4 2 3\n", "output": "863912418\n"}, {"input": "40 5 7 5\n", "output": "562805100\n"}, {"input": "15 10 2 3", "output": "138603924\n"}, {"input": "37 4 3 3", "output": "180978943\n"}, {"input": "37 3 3 3", "output": "632821729\n"}, {"input": "15 5 2 3", "output": "179274801\n"}, {"input": "37 7 2 3", "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\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\nFrom these N items, we will s...
[{"input": "100 100\n1000 999 998 997 996 995 994 993 992 991 990 989 988 987 986 985 984 983 982 981 980 979 978 977 976 975 974 973 972 971 970 969 968 967 966 965 964 963 962 961 960 959 958 957 956 955 954 953 952 951 950 949 948 947 946 945 944 943 942 941 940 939 938 937 936 935 934 933 932 931 930 929 928 927 92...
code_stdio
[ { "content": "You are an expert Python programmer. 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 method that takes a string as an argument and groups the number of time each character appears in the...
[{"input": "\"France is also bacon\"", "output": "[{\"3\": [\"a\"], \"2\": [\"c\", \"n\", \"o\", \"s\"], \"1\": [\"b\", \"e\", \"f\", \"i\", \"l\", \"r\"]}]", "fn_name": "get_char_count"}, {"input": "\"Get me the bacon!\"", "output": "[{\"3\": [\"e\"], \"2\": [\"t\"], \"1\": [\"a\", \"b\", \"c\", \"g\", \"h\", \"m\", \...
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 are N integers a_1, a_2, ..., a_N not less than 1. The values of a_1, a_2, ..., a_N are not known, but ...
[{"input": "1 1431379180228", "output": "1431379180228\n"}, {"input": "1 1472895801034", "output": "1472895801034\n"}, {"input": "1 1365467213485", "output": "1365467213485\n"}, {"input": "1 2203800626104", "output": "2203800626104\n"}, {"input": "1 972439611840", "output": "972439611840\n"}, {"input": "1 534720932937"...
code_stdio
[ { "content": "You are an expert Python programmer. 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 bracket sequence $s$ of length $n$, where $n$ is even (divisible by two). The string $s$ cons...
[{"input": "4\n2\n)(\n4\n()()\n8\n())()()(\n10\n)))((((())\n", "output": "1\n0\n1\n3\n"}, {"input": "4\n2\n)(\n4\n)()(\n8\n())()()(\n10\n)))((((())\n", "output": "1\n1\n1\n3\n"}, {"input": "4\n2\n)(\n4\n()()\n8\n())()()(\n10\n())((()())\n", "output": "1\n0\n1\n1\n"}, {"input": "4\n2\n)(\n4\n()()\n8\n()()())(\n10\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 items, numbered 1, 2, \\ldots, N. For each i (1 \\leq i \\leq N), Item i has a weight of w_i and ...
[{"input": "6 15\n6 5\n14 6\n6 12\n4 20\n3 16\n1 4", "output": "52\n"}, {"input": "5 31\n4 0\n0 33\n9 6\n16 20\n4 9\n-1 4", "output": "68\n"}, {"input": "6 16\n7 0\n0 11\n9 6\n8 20\n3 10\n1 4", "output": "45\n"}, {"input": "5 31\n4 0\n0 11\n9 6\n16 20\n4 9\n0 4", "output": "46\n"}, {"input": "5 31\n4 0\n0 22\n9 6\n16 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\nArthur and Alexander are number busters. Today they've got a competition. \n\nArthur took a group of four int...
[{"input": "200000000 794 1000 117 2000000000\n", "output": "2038505096\n"}, {"input": "200000000 794 1000 117 2000000000\n", "output": "2038505096\n"}, {"input": "20000000 280 1000 25 2000000000\n", "output": "2030769231\n"}, {"input": "20000000 280 1000 25 2000000000\n", "output": "2030769231\n"}, {"input": "13597422...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDuff is in love with lovely numbers! A positive integer x is called lovely if and only if there is no such po...
[{"input": "817634153013\n", "output": "817634153013\n"}, {"input": "734337660466\n", "output": "734337660466\n"}, {"input": "808453785117\n", "output": "808453785117\n"}, {"input": "294809951965\n", "output": "294809951965\n"}, {"input": "822722434952\n", "output": "205680608738\n"}, {"input": "699511759613\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\nAshish has an array a of consisting of 2n positive integers. He wants to compress a into an array b of size n...
[{"input": "10\n9\n8 8 2 6 2 7 4 1 6 5 2 4 8 3 2 3 6 8\n6\n1 8 8 2 2 7 6 7 8 9 1 7\n5\n4 2 9 6 8 7 7 5 7 4\n9\n4 10 7 7 8 5 4 9 6 5 1 1 7 6 3 3 1 10\n4\n8 8 2 2 9 7 4 8\n3\n5 2 8 2 4 2\n9\n5 8 8 10 7 3 10 8 7 9 4 2 5 9 10 4 6 1\n5\n8 1 4 1 6 6 2 2 5 10\n10\n6 5 5 3 9 10 4 8 5 1 4 7 10 4 2 2 7 8 7 3\n8\n3 8 5 5 9 3 10 7...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n# Story\n\nWell, here I am stuck in another traffic jam.\n\n\n*Damn all those courteous people!*\n\nCars are ...
[{"input": "\"abcdefghijklmnopqrstuvwX\"\n[\"AAA\", \"BBB\", \"CCC\", \"DDD\", \"EEE\", \"FFF\", \"GGG\", \"HHH\", \"III\", \"JJJ\", \"KKK\", \"LLL\", \"MMM\", \"NNN\", \"OOO\", \"PPP\", \"QQQ\", \"RRR\", \"SSS\", \"TTT\", \"UUU\", \"VVV\", \"WWW\"]", "output": "[\"aAbABAcBCBdCDCeDEDfEFEgFGFhGHGiHIHjIJIkJKJlKLKmLMLnMNM...
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 an array $a$ of length $n$, which initially is a permutation of numbers from $1$ to $n$. In one...
[{"input": "4\n3\n1 2 3\n4\n3 1 2 4\n3\n2 3 1\n6\n2 4 12 1 3 10\n", "output": "YES\nYES\nNO\nYES\n"}, {"input": "4\n3\n1 2 3\n4\n3 1 2 4\n3\n2 3 1\n6\n2 4 19 1 3 10\n", "output": "YES\nYES\nNO\nYES\n"}, {"input": "4\n3\n1 2 3\n4\n3 1 2 4\n3\n2 3 1\n6\n2 4 12 1 3 5\n", "output": "YES\nYES\nNO\nYES\n"}, {"input": "4\n3\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 palindrome is a word, phrase, number, or other sequence of characters which reads the same backward as forw...
[{"input": "\"ACCDDCCA\"", "output": "[\"Not valid\"]", "fn_name": "palindrome"}, {"input": "\"1551\"", "output": "[\"Not valid\"]", "fn_name": "palindrome"}, {"input": "-4505", "output": "[\"Not valid\"]", "fn_name": "palindrome"}, {"input": "141221001", "output": "[5]", "fn_name": "palindrome"}, {"input": "13598", "o...
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\nTwo circles A, B are given on a two-dimensional plane. The coordinate of the center and radius of circle A is...
[{"input": "4\n2 -3 3 -1 3 1\n0 0 9 3 13 2\n-1 -1 10 10 10 5\n-1 0 707 1000 1100 479", "output": "3\n4\n11\n4\n"}, {"input": "4\n0 -3 3 -2 3 2\n0 1 8 3 13 4\n-1 0 9 10 10 5\n-1 0 707 1000 1110 329", "output": "4\n12\n8\n3\n"}, {"input": "4\n2 -3 3 -1 3 2\n0 0 9 3 13 2\n-1 -1 9 10 10 5\n-1 0 707 1000 1100 479", "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\nLittle Petya very much likes arrays consisting of n integers, where each of them is in the range from 1 to 10...
[{"input": "25\n1 1 1 2 2 2 1 2 1 2 2 2 2 2 1 2 2 2 1 2 2 2 2 1 2\n", "output": "1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 "}, {"input": "4\n1011110011 158379 10597860 181988389\n", "output": "1 158379 10597860 181988389\n"}, {"input": "4\n1011110011 158379 10597860 218725134\n", "output": "1 158379 10597860 21...
code_stdio
[ { "content": "You are an expert Python programmer. 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 the word heuristics. It's a relatively simple approach that usually works, although there is no guar...
[{"input": "4 1 3 4\nyskwcnt 16\nakzakr 7\ntsnukk 12\nfnmyi 13\nakzakr\n4 1 3 8\nakzakr 7\ntsnukk 4\nfnmyi 13\nyskwcnt 16\nakzakr\n4 2 2 1\nakzakr 4\ntsnukk 6\nyskwcnt 12\nfnmyi 12\nakzakr\nfnmyi\n5 2 3 28\nknmmdk 6\nskrkyk 14\ntmemm 14\nakmhmr 15\nmksyk 25\nknmmdk\nskrkyk\n5 2 3 11\ntmemm 12\nskrkyk 18\nknmmdk 21\nmks...
code_stdio
[ { "content": "You are an expert Python programmer. 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 3AM and you get the dreaded call from a customer: the program your company sold them is hanging. You eve...
[{"input": "111", "output": "[103]", "fn_name": "wrap_mystery"}, {"input": "122", "output": "[122]", "fn_name": "wrap_mystery"}, {"input": "125", "output": "[132]", "fn_name": "wrap_mystery"}, {"input": "135", "output": "[129]", "fn_name": "wrap_mystery"}, {"input": "139", "output": "[100]", "fn_name": "wrap_mystery"},...
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 finally woke up after this crazy dream and decided to walk around to clear your head. Outside you saw you...
[{"input": "6\n1 1\n1\n1\n1\n5 2\n1 2 2 1 1\n1 2 2 1 1\n1 2\n3 3\n2 2 2\n2 2 2\n2 3 2\n10 5\n7 3 2 1 7 9 4 2 7 9\n9 9 2 1 4 9 4 2 3 9\n9 9 7 4 3\n5 2\n1 2 2 1 1\n1 2 2 1 1\n3 3\n6 4\n3 4 2 4 1 2\n2 3 1 3 1 1\n2 2 3 4\n", "output": "\nYES\n1\nYES\n2 2\nYES\n1 1 1\nYES\n2 1 9 5 9\nNO\nNO\n"}, {"input": "6\n1 1\n1\n1\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\nSugoroku\n\nproblem\n\nJOI is playing sugoroku alone. There are N squares in a straight line in this sugoroku...
[{"input": "10 5\n-1\n1\n10\n6\n-2\n9\n1\n8\n-3\n0\n0\n0\n10\n1\n5\n10 10\n0\n-1\n-1\n10\n4\n-3\n-2\n1\n0\n0\n3\n6\n0\n0\n6\n3\n5\n4\n1\n6\n0 0", "output": "3\n1\n"}, {"input": "10 5\n-1\n1\n10\n9\n-2\n7\n1\n8\n-3\n0\n2\n1\n6\n1\n5\n10 10\n0\n-1\n-1\n3\n4\n-5\n1\n1\n-10\n0\n2\n5\n2\n5\n2\n5\n3\n2\n6\n6\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\nDefine a function that takes in two non-negative integers `$a$` and `$b$` and returns the last decimal digit ...
[{"input": "3715290469715693021198967285016729344580685479654510946723\n68819615221552997273737174557165657483427362207517952651", "output": "[7]", "fn_name": "last_digit"}, {"input": "38710248912497124917933333333284108412048102948908149081409204712406\n226628148126342643123641923461846128214626", "output": "[6]", "fn...
code_functional
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPolycarp calls an array dense if the greater of any two adjacent elements is not more than twice bigger than ...
[{"input": "6\n4\n4 2 10 1\n2\n1 3\n2\n12 1\n3\n1 4 2\n5\n1 2 3 4 3\n12\n4 27 25 50 30 20 34 46 42 16 15 21\n", "output": "5\n1\n3\n1\n0\n3\n"}, {"input": "6\n4\n4 2 10 1\n2\n1 6\n2\n6 1\n3\n1 7 2\n5\n1 1 2 6 1\n12\n3 58 25 17 43 21 20 46 42 11 30 16\n", "output": "5\n2\n2\n3\n3\n10\n"}, {"input": "6\n4\n4 2 10 1\n2\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\nSnuke loves flags.\n\nSnuke is placing N flags on a line.\n\nThe i-th flag can be placed at either coordinate...
[{"input": "22\n93 6440\n78 6647\n1028 11\n8306 9689\n798 99\n801 521\n188 206\n6079 971\n4559 209\n50 94\n92 6270\n5403 560\n803 83\n1855 99\n42 504\n75 484\n629 11\n92 122\n3359 37\n28 16\n648 14\n11 269", "output": "17\n"}, {"input": "22\n93 6440\n78 6647\n889 11\n8306 9689\n1104 135\n801 521\n188 257\n6079 971\n455...
code_stdio
[ { "content": "You are an expert Python programmer. 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 loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representat...
[{"input": "485 9554485\n7759121368632736852539182753173468028218114958118158732302477551670775608015153610483175626465946144780731573954182900412248382710280376491925985206156109890139333293746203940442347501294009600230166311978044218247083102712257326301109220002496805123344816427514286225153139924306380089284878322...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMalek has recently found a treasure map. While he was looking for a treasure he found a locked door. There wa...
[{"input": "(#))(#(#)((((#(##((#(#((((#(##((((((#((()(()(())((()#((((#((()((((#(((((#(##)(##()((((()())(((((#(((\n", "output": "-1\n"}, {"input": "#(#(#((##((()))(((#)(#()#(((()()(()#(##(((()(((()))#(((((()(((((((()#((#((()(#(((()(()##(()(((()((#(\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\nThe Smart Beaver from ABBYY began to develop a new educational game for children. The rules of the game are f...
[{"input": "120\n242 524 420 973 816 432 247 666 134 849 145 366 608 930 613 315 863 628 97 109 65 704 741 314 736 17 872 971 559 648 223 771 171 327 782 837 303 393 292 339 730 834 794 868 540 251 789 893 23 305 116 220 699 863 580 992 861 393 98 253 544 171 336 207 348 496 316 285 286 727 613 616 304 811 592 916 91 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\nYou are given a string S of length N consisting of lowercase English letters, and an integer K. Print the str...
[{"input": "9\nedtbiuaon\n-2", "output": "******a**\n"}, {"input": "9\neducation\n4", "output": "***c*****\n"}, {"input": "9\nedubation\n4", "output": "***b*****\n"}, {"input": "9\nedubation\n6", "output": "*****t***\n"}, {"input": "9\nedubation\n8", "output": "*******o*\n"}, {"input": "9\nedubatinn\n8", "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\nSnuke is having another barbeque party.\n\nThis time, he will make one serving of Skewer Meal.\n\nHe has a st...
[{"input": "3\n11 3\n2 2\n0 2", "output": "12951\n"}, {"input": "3\n12 2\n2 3\n2 0", "output": "11783\n"}, {"input": "3\n12 2\n2 3\n1 0", "output": "11753\n"}, {"input": "3\n3 1\n0 4\n7 9", "output": "262332\n"}, {"input": "3\n11 3\n2 1\n0 2", "output": "6758\n"}, {"input": "3\n12 2\n2 1\n2 1", "output": "1375\n"}, {"i...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nLittle boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to ...
[{"input": "50\n", "output": "50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 "}, {"input": "50\n", "output": "50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 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\nSasha is a very happy guy, that's why he is always on the move. There are $n$ cities in the country where Sas...
[{"input": "84 15\n", "output": "2429 \n"}, {"input": "100 100\n", "output": "99 \n"}, {"input": "100 98\n", "output": "100 \n"}, {"input": "100 97\n", "output": "102 \n"}, {"input": "100 3\n", "output": "4755 \n"}, {"input": "100 1\n", "output": "4950 \n"}, {"input": "91 14\n", "output": "3016 \n"}, {"input": "100 43\...
code_stdio
[ { "content": "You are an expert Python programmer. 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 string $t_1t_2 \\dots t_k$ is good if each letter of this string belongs to at least one palindrome of le...
[{"input": "7\nAAABABB\n", "output": "15\n"}, {"input": "7\nBBABAAA\n", "output": "15\n"}, {"input": "7\nBAAAABB\n", "output": "12\n"}, {"input": "7\nABABAAB\n", "output": "14\n"}, {"input": "7\nBBAAABA\n", "output": "13\n"}, {"input": "7\nBAAAAAB\n", "output": "11\n"}, {"input": "7\nAAAAAAA\n", "output": "21\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\nFor given two lines s1 and s2, print \"2\" if they are parallel, \"1\" if they are orthogonal, or \"0\" other...
[{"input": "3\n-1 -1 10 1 2 0 2 2\n0 5 6 -1 0 -1 0 22\n-2 -1 1 1 0 -1 2 2", "output": "0\n0\n0\n"}, {"input": "3\n-1 -1 10 1 2 0 2 2\n0 5 6 -1 0 -1 0 22\n-2 -1 1 1 1 -1 2 2", "output": "0\n0\n0\n"}, {"input": "3\n-1 -1 10 1 2 0 2 4\n0 5 6 -1 0 -1 0 22\n-2 -1 1 1 1 -1 2 2", "output": "0\n0\n0\n"}, {"input": "3\n-1 -1 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\nYou are given some text $t$ and a set of $n$ strings $s_1, s_2, \\dots, s_n$.\n\nIn one step, you can choose ...
[{"input": "5\naaaaa\n3\naaa\naaa\na\nabbaa\n4\nab\nbaa\nabb\na\nabcdefg\n10\na\nb\nc\nd\ne\nf\ng\nh\ni\nj\nabcdefghijklmnop\n4\nabcdefg\nefghijklmo\nijklmnop\nhijklmnop\nababababbababba\n5\na\nabba\nb\nbb\naa\n", "output": "2\n1 1\n1 3\n2\n3 1\n2 3\n7\n1 1\n2 2\n3 3\n4 4\n5 5\n6 6\n7 7\n2\n1 1\n4 8\n9\n1 1\n3 2\n1 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\nTwo players, A and B, play the game using cards with numbers from 0 to 9. First, the two arrange the given n ...
[{"input": "3\n13 1\n1 4\n1 4\n3\n20 1\n6 7\n1 1\n3\n15 1\n5 5\n1 8\n0", "output": "14 10\n22 14\n21 14\n"}, {"input": "3\n13 1\n1 4\n1 4\n3\n20 1\n6 8\n1 1\n3\n15 1\n5 5\n1 8\n0", "output": "14 10\n22 15\n21 14\n"}, {"input": "3\n13 1\n1 4\n0 4\n3\n20 1\n6 15\n1 1\n3\n15 1\n5 5\n1 8\n0", "output": "14 9\n22 22\n21 14\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nAt the end of a busy day, The Chef and his assistants play a game together. The game is not just for fun but ...
[{"input": "1\n9 3 3\n-1 23\n1 1\n-1 -1", "output": "19\n"}, {"input": "1\n0 2 3\n5 37\n6 -1\n-1 49", "output": "46\n"}, {"input": "1\n9 3 3\n0 16\n1 1\n-1 -1", "output": "13\n"}, {"input": "1\n4 4 3\n2 0\n0 14\n-1 10", "output": "-1\n"}, {"input": "1\n0 1 3\n0 24\n1 0\n-1 -1", "output": "23\n"}, {"input": "1\n0 1 3\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\nRecently, Chef got obsessed with piano. He is a just a rookie in this stuff and can not move his fingers from...
[{"input": "2 \nTSTT\n35\nRTTSSTT\n-4", "output": "12390\n0\n"}, {"input": "2 \nTSTT\n33\nRTTSSTT\n-6", "output": "11004\n0\n"}, {"input": "2 \nTSTT\n43\nSTSTTUR\n-1", "output": "18761\n0\n"}, {"input": "2 \nTSSS\n10\nSSTTRTT\n-14", "output": "1380\n0\n"}, {"input": "2 \nTTTS\n41\nTTSSTTR\n-6", "output": "17045\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\nKaran's company makes software that provides different features based on the version of operating system of t...
[{"input": "\"4.3.3\"\n\"4.3.3.1\"", "output": "[false]", "fn_name": "compare_versions"}, {"input": "\"10.4.9\"\n\"104.9\"", "output": "[false]", "fn_name": "compare_versions"}, {"input": "\"10.4\"\n\"10.4.8\"", "output": "[false]", "fn_name": "compare_versions"}, {"input": "\"10.4.9\"\n\"10.5\"", "output": "[false]", ...
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\nI am a pipe tie craftsman. As long as you get the joints and pipes that connect the pipes, you can connect an...
[{"input": "3\n0 1 1\n3 3\n4\n4 1 2 3\n1 1 1\n5\n1 1 3 4 5\n3 12 2 2\n0", "output": "10\n40\n104\n"}, {"input": "3\n0 1 1\n3 3\n4\n3 1 5 3\n1 1 1\n5\n2 4 6 4 5\n0 3 2 1\n0", "output": "10\n48\n105\n"}, {"input": "3\n0 1 1\n3 3\n4\n3 1 5 3\n1 1 1\n5\n4 4 3 4 5\n0 3 2 1\n0", "output": "10\n48\n100\n"}, {"input": "3\n-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\nThe Smart Beaver from ABBYY came up with another splendid problem for the ABBYY Cup participants! This time t...
[{"input": "21000\nSWISS OT LAHNCU NEW SERIES OF MONEY MARKET PEPAR\nZURICH, April 9 - The Svirs Federal tndmnrevoG lliw launch\na ndw series fo three mhnto mondx market setatificrec totallhng\nauornd 150 mln iwSss fraocs, dht National Bank said.\nSubscriptions close lirpA 14 and paynent date hs April 16.84368194671728...
code_stdio
[ { "content": "You are an expert Python programmer. 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 main server of Gomble company received a log of one top-secret process, the name of which can't be reveal...
[{"input": "14\n[12:07 p.m.]: mamaa\n[12:36 a.m.]: amaamppa\n[01:31 a.m.]: pmpp\n[05:47 a.m.]: paapappapaaampm\n[12:07 a.m.]: ppamammm\n[01:03 a.m.]: aapapmpampamamaaa\n[07:55 a.m.]: mpappmmapmpa\n[02:49 a.m.]: papmppppmpamppa\n[03:12 a.m.]: aaaaaaamam\n[04:40 a.m.]: paap\n[01:13 a.m.]: ap\n[03:22 a.m.]: mpmppmmapmmpp\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMagic The Gathering is a collectible card game that features wizards battling against each other with spells ...
[{"input": "[[1, 3], [3, 5], [4, 6], [5, 2]]\n[[2, 4], [6, 1], [4, 4], [3, 7], [3, 1]]", "output": "[{\"player1\": [[1, 3], [4, 6]], \"player2\": [[2, 4], [3, 7], [3, 1]]}]", "fn_name": "battle"}, {"input": "[[2, 3], [1, 4]]\n[[3, 3], [4, 1]]", "output": "[{\"player1\": [], \"player2\": [[3, 3]]}]", "fn_name": "battle"...
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\nA median in an array with the length of n is an element which occupies position number <image> after we sort ...
[{"input": "100 813\n285 143 378 188 972 950 222 557 170 755 470 164 1433 553 146 820 842 62 496 1893 746 944 677 828 465 577 791 277 303 218 561 653 925 692 871 424 626 795 813 343 418 280 123 364 496 447 435 452 645 36 311 315 830 289 450 675 23 212 421 661 7 217 468 877 172 141 475 409 178 71 936 1584 761 889 417 31...
code_stdio
[ { "content": "You are an expert Python programmer. 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 kingdom of Lazyland is the home to $n$ idlers. These idlers are incredibly lazy and create many problems ...
[{"input": "18 12\n6 3 6 6 6 6 6 6 6 12 1 3 6 6 10 6 6 6\n47 4 41 56 75 24 29 10 100 112 53 48 79 30 87 135 60 87\n", "output": "185\n"}, {"input": "18 12\n6 3 6 6 6 6 6 6 6 12 1 3 6 6 10 6 6 6\n47 4 41 56 75 24 29 10 100 112 53 48 79 30 87 135 10 87\n", "output": "148\n"}, {"input": "18 12\n6 6 6 6 6 6 6 6 6 12 1 6 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\nMany years ago, Roman numbers were defined by only `4` digits: `I, V, X, L`, which represented `1, 5, 10, 50`...
[{"input": "10000000", "output": "[489999753]", "fn_name": "solve"}, {"input": "10", "output": "[244]", "fn_name": "solve"}, {"input": "2", "output": "[10]", "fn_name": "solve"}, {"input": "3", "output": "[20]", "fn_name": "solve"}, {"input": "4", "output": "[35]", "fn_name": "solve"}, {"input": "5", "output": "[56]", ...
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 signed up for a new website which holds programming competitions.\nHe worried that he might forget his ...
[{"input": "atcoderbeginnercontest\natcoderregularcontest\n", "output": "aattccooddeerrbreeggiunlnaerrccoonntteesstt\n"}, {"input": "atcoderbeeinnercontgst\natcoderregularcontest", "output": "aattccooddeerrbreeegiunlnaerrccoonnttegsstt\n"}, {"input": "atcoderbeeinnercontgst\natcoaerreguldrcontest", "output": "aattccood...
code_stdio
[ { "content": "You are an expert Python programmer. 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 tree with N vertices numbered 1 to N, and N-1 edges numbered 1 to N-1.\nEdge i connects Vertex a_i...
[{"input": "10104\n5741 6080\n3408 7811\n5930 5446\n2841 6030\n7143 6678\n5930 3686\n3091 5609\n9185 6802\n8673 6440\n593 5930\n4271 5808\n3292 3568\n2712 5673\n10008 5082\n421 4874\n5930 7228\n5005 6587\n2254 9793\n8397 7976\n8682 4699\n8396 5930\n7253 1069\n1980 6577\n8066 4032\n2303 3724\n3700 6900\n2973 8487\n5004 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 __Hamming weight__ of a string is the number of symbols that are different from the zero-symbol of the al...
[{"input": "2048", "output": "[1]", "fn_name": "hamming_weight"}, {"input": "10", "output": "[2]", "fn_name": "hamming_weight"}, {"input": "21", "output": "[3]", "fn_name": "hamming_weight"}, {"input": "0", "output": "[0]", "fn_name": "hamming_weight"}, {"input": "1", "output": "[1]", "fn_name": "hamming_weight"}, {"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\n# Task\nLet's define a `parameter` of number `n` as the least common multiple (LCM) of the sum of its digits ...
[{"input": "999999999", "output": "[387420489]", "fn_name": "parameter"}, {"input": "123456789", "output": "[362880]", "fn_name": "parameter"}, {"input": "1234", "output": "[120]", "fn_name": "parameter"}, {"input": "239", "output": "[378]", "fn_name": "parameter"}, {"input": "344", "output": "[528]", "fn_name": "param...
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\nNaming multiple files can be a pain sometimes.\n\n#### Task:\n\nYour job here is to create a function that wi...
[{"input": "\"<file> number <index_no>\"\n5\n0", "output": "[[\"<file> number 0\", \"<file> number 1\", \"<file> number 2\", \"<file> number 3\", \"<file> number 4\"]]", "fn_name": "name_file"}, {"input": "\"<file_no> number <index_no>\"\n2\n-1", "output": "[[\"<file_no> number -1\", \"<file_no> number 0\"]]", "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\nTraining is indispensable for achieving good results at ICPC. Rabbit wants to win at ICPC, so he decided to p...
[{"input": "3\n10 40\n15 40\n20 30", "output": "110\n"}, {"input": "3\n10 40\n15 40\n40 30", "output": "120\n"}, {"input": "3\n10 40\n15 40\n20 32", "output": "112\n"}, {"input": "3\n10 36\n15 40\n20 32", "output": "108\n"}, {"input": "3\n10 40\n15 62\n40 30", "output": "142\n"}, {"input": "3\n10 36\n15 40\n20 50", "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\nBessie has way too many friends because she is everyone's favorite cow! Her new friend Rabbit is trying to ho...
[{"input": "1\n19 1000000000\n15 8 22 12 10 16 2 17 14 7 20 23 9 18 3 19 21 11 1\n", "output": "43478261\n"}, {"input": "1\n19 1000000000\n15 8 22 12 10 16 2 17 14 7 20 23 9 18 3 19 21 11 1\n", "output": "43478261\n"}, {"input": "1\n19 1000000000\n15 8 22 12 10 16 2 17 14 7 20 23 9 14 3 19 21 11 1\n", "output": "434782...
code_stdio
[ { "content": "You are an expert Python programmer. 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\"What are your shoe sizes?\"\n\nSuddenly, the doctor asked me when I met him for the first time.\n\n\"It's 2...
[{"input": "27.100228165013633\n158.95452966627283\n-0.21569613349567962", "output": "NA\nNA\n"}, {"input": "27.432484603703674\n158.95452966627283\n-0.21569613349567962", "output": "NA\nNA\n"}, {"input": "27.932276079901406\n158.95452966627283\n-0.21569613349567962", "output": "NA\nNA\n"}, {"input": "27.93227607990140...
code_stdio
[ { "content": "You are an expert Python programmer. 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 Consider the following algorithm for constructing 26 strings S(1) .. S(26):\n```\nS(1) = \"a\";\nFor...
[{"input": "12", "output": "[\"c\"]", "fn_name": "abacaba"}, {"input": "16", "output": "[\"e\"]", "fn_name": "abacaba"}, {"input": "1", "output": "[\"a\"]", "fn_name": "abacaba"}, {"input": "2", "output": "[\"b\"]", "fn_name": "abacaba"}, {"input": "3", "output": "[\"a\"]", "fn_name": "abacaba"}, {"input": "4", "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\nSlime and his $n$ friends are at a party. Slime has designed a game for his friends to play.\n\nAt the beginn...
[{"input": "100\n4364 698 1003 1128 1513 39 4339 969 7452 3415 1154 1635 6649 136 1442 50 834 1680 107 978 983 3176 4017 1692 1113 1504 1118 396 1975 2053 2366 3022 3007 167 610 4649 14659 2331 4565 318 7232 204 7131 6122 2885 5748 1998 3833 6799 4219 8454 8698 4964 1736 1554 1665 2425 4227 1967 534 2719 80 2865 652 19...
code_stdio
[ { "content": "You are an expert Python programmer. 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 an integer K and integers a_1,\\dots, a_K. Determine whether a sequence P satisfying below exists. ...
[{"input": "3\n2 4 4", "output": "2 3 1 2 3 2 3 1 2 3 \n"}, {"input": "4\n3 2 3 2", "output": "1 2 3 4 1 3 1 2 4 3"}, {"input": "3\n2 2 4", "output": "3 1 2 3 3 1 2 3 \n"}, {"input": "5\n1 1 1 1 2", "output": "5 1 2 3 4 5 \n"}, {"input": "3\n2 4 3", "output": "2 1 3 2 2 3 1 2 3"}, {"input": "5\n1 1 1 1 1", "output": "1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nПоликарп мечтает стать программистом и фанатеет от степеней двойки. Среди двух чисел ему больше нравится то, ...
[{"input": "100\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100\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 certainly can tell which is the larger number between 2^(10) and 2^(15).\n\nBut what about, say, 2^(10) a...
[{"input": "[1024, 97]\n[1024, 81]", "output": "[-1]", "fn_name": "compare_powers"}, {"input": "[34, 98]\n[51, 67]", "output": "[-1]", "fn_name": "compare_powers"}, {"input": "[2, 100]\n[2, 150]", "output": "[1]", "fn_name": "compare_powers"}, {"input": "[2, 100]\n[3, 100]", "output": "[1]", "fn_name": "compare_powers"...
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\nZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (p...
[{"input": "7816\n", "output": "2\n17\n46\n97\n176\n289\n442\n641\n892\n1201\n1574\n2017\n2536\n3137\n3826\n4609\n5492\n6481\n7582\n8801\n10144\n11617\n13226\n14977\n16876\n18929\n21142\n23521\n26072\n28801\n31714\n34817\n38116\n41617\n45326\n49249\n53392\n57761\n62362\n67201\n72284\n77617\n83206\n89057\n95176\n101569\...
code_stdio
[ { "content": "You are an expert Python programmer. 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<image>\n\nFor given three points p0, p1, p2, print\n\n\nCOUNTER_CLOCKWISE\n\n\nif p0, p1, p2 make a counterc...
[{"input": "0 -1 1 -1\n3\n0 0\n0 1\n3 0", "output": "COUNTER_CLOCKWISE\nCOUNTER_CLOCKWISE\nCOUNTER_CLOCKWISE\n"}, {"input": "-1 -1 2 -3\n3\n-2 0\n-1 -1\n0 1", "output": "COUNTER_CLOCKWISE\nON_SEGMENT\nCOUNTER_CLOCKWISE\n"}, {"input": "0 -1 2 -1\n3\n-1 -1\n0 1\n3 1", "output": "ONLINE_BACK\nCOUNTER_CLOCKWISE\nCOUNTER_CL...
code_stdio
[ { "content": "You are an expert Python programmer. 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 loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representat...
[{"input": "544958\n", "output": "4477777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777...
code_stdio
[ { "content": "You are an expert Python programmer. 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 children, numbered 1, 2, \\ldots, N.\n\nThey have decided to share K candies among themselves. He...
[{"input": "4 100000\n101000 100000 100000 100000", "output": "665683269\n"}, {"input": "4 101000\n101000 100000 100100 101000", "output": "744244119\n"}, {"input": "4 110000\n101000 100000 100000 100000", "output": "741473440\n"}, {"input": "4 100100\n101000 100000 100100 101000", "output": "185684912\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\nDr. A of the Aizu Institute of Biological Research discovered a mysterious insect on a certain southern islan...
[{"input": "rbgrg\nbbbrbgr\nrbg\nrgbbrgrb\nrrgbgrggb\nggrgbrbggr\nrrrrr\nbgbr\n0", "output": "5\n7\n1\n6\nNA\n11\n0\n4\n"}, {"input": "grgbr\nrbbgbbr\nbgr\nbgbrrgbr\nbggrgbgrr\ngggbrggrbr\nrrrrr\nbgbr\n0", "output": "5\n7\n1\n9\nNA\n11\n0\n4\n"}, {"input": "grgbr\nrbbgbbr\nbrg\nrbggrbbr\nrrgbgrggb\ngbgrgrbggr\nrrrrr\nb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nThere are N camels numbered 1 through N.\nThe weight of Camel i is w_i.\nYou will arrange the camels in a lin...
[{"input": "8 5522\n35082527 79227267 44206285 89187090 61610002 29064205 89153995 36160269\n45347010 90255563\n70343288 95278607\n12732707 94045934\n45923577 89378293\n93771951 94507897\n93868604 89747889\n91718882 93526246\n64458862 90336799\n91324861 90667826\n62335106 95645278\n84387911 93916051\n47178161 99301170\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nRead problems statements in Mandarin Chinese and Russian as well. \n\nAfter IOI Ilya decided to make a busine...
[{"input": "4\n1111\n1000\n1000\n1000", "output": "6\n"}, {"input": "4\n0111\n1100\n0000\n1001", "output": "2\n"}, {"input": "4\n1111\n1010\n1000\n1010", "output": "4\n"}, {"input": "4\n0011\n0000\n0000\n1001", "output": "0\n"}, {"input": "4\n1111\n1100\n0000\n1001", "output": "2\n"}, {"input": "4\n0110\n1000\n0000\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\nPetr stands in line of n people, but he doesn't know exactly which position he occupies. He can say that ther...
[{"input": "100 81 58\n", "output": "19\n"}, {"input": "100 81 54\n", "output": "19\n"}, {"input": "100 81 91\n", "output": "19"}, {"input": "100 11 88\n", "output": "89"}, {"input": "59 12 33\n", "output": "34\n"}, {"input": "49 19 37\n", "output": "30\n"}, {"input": "90 76 37\n", "output": "14\n"}, {"input": "58 23 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\nWe have a sequence of N \\times K integers: X=(X_0,X_1,\\cdots,X_{N \\times K-1}). Its elements are represent...
[{"input": "11 97\n0 1 8 2 5 4 2 6 2 3 5", "output": "0 1 8 6 2 3 5\n"}, {"input": "11 47\n0 1 0 3 10 5 1 36 2 2 0", "output": "10 5 1 36 0\n"}, {"input": "11 101\n0 2 4 1 5 4 4 6 0 3 5", "output": "2 4 6 0 3 5\n"}, {"input": "11 77\n0 1 0 3 10 3 1 20 4 2 0", "output": "1 20 4 2 0\n"}, {"input": "11 97\n0 0 0 3 5 8 5 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\nTakahashi will take part in an eating contest. Teams of N members will compete in this contest, and Takahashi...
[{"input": "11 14\n3 1 4 1 0 9 0 20 1 2 10\n15 6 7 26 3 2 3 8 4 8 2", "output": "20\n"}, {"input": "11 14\n3 1 4 1 0 9 0 20 1 2 10\n15 6 7 26 3 4 3 8 4 8 2", "output": "22\n"}, {"input": "11 14\n3 1 4 1 2 9 2 11 1 3 10\n15 9 7 26 3 2 3 8 4 8 2", "output": "16\n"}, {"input": "11 14\n3 1 4 1 2 9 2 11 5 3 10\n8 9 7 26 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\nYou are given two integers $n$ and $m$ ($m < n$). Consider a convex regular polygon of $n$ vertices. Recall t...
[{"input": "2\n69 120\n11 9\n", "output": "NO\nNO\n"}, {"input": "2\n34 230\n4 15\n", "output": "NO\nNO\n"}, {"input": "2\n34 230\n4 27\n", "output": "NO\nNO\n"}, {"input": "2\n11 101\n13 4\n", "output": "NO\nNO\n"}, {"input": "2\n55 230\n4 27\n", "output": "NO\nNO\n"}, {"input": "2\n11 101\n13 6\n", "output": "NO\nNO\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nArkady decided to buy roses for his girlfriend.\n\nA flower shop has white, orange and red roses, and the tot...
[{"input": "30 15\n7926 577 5009 7237 4395 3239 8994 4429 8126 2925 139 320 4442 3397 1292 2800 9505 6043 5946 8058 4031 6871 4689 1977 73 440 5320 5290 4707 387\nOOWOWWORRWOWORWRRRRWORROOWWROW\n", "output": "91633\n"}, {"input": "30 15\n7926 577 5009 7237 4395 3239 8994 4429 8126 2925 139 320 4442 3397 1292 2800 9505 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 integers $a$ and $b$. Moreover, you are given a sequence $s_0, s_1, \\dots, s_{n}$. All val...
[{"input": "904132655 827386249 118827660 334\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 one-dimensional Japanese crossword can be represented as a binary string of length x. An encoding of this c...
[{"input": "10 1\n5 78 3 87 4 9 5 8 9 1235\n", "output": "NO\n"}, {"input": "10 1\n5 78 3 87 4 9 5 8 9 1235\n", "output": "NO\n"}, {"input": "10 1\n5 24 3 87 4 9 5 8 9 1235\n", "output": "NO\n"}, {"input": "10 1\n5 24 3 0 4 9 5 8 9 1235\n", "output": "NO\n"}, {"input": "10 0\n5 24 3 0 4 9 5 8 9 1235\n", "output": "NO\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 undirected unweighted graph with N vertices and M edges that contains neither self-loops nor...
[{"input": "8 28\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n2 3\n2 4\n2 5\n2 6\n2 7\n2 8\n3 4\n3 5\n3 6\n3 7\n3 8\n4 5\n4 6\n4 7\n4 8\n5 6\n5 7\n5 8\n6 7\n6 8\n7 8\n", "output": "5040\n"}, {"input": "8 27\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n2 3\n2 4\n2 5\n2 6\n2 7\n3 4\n3 5\n3 6\n3 7\n3 8\n4 5\n4 6\n4 7\n4 8\n5 6\n5 7\n5 8\n6...
code_stdio
[ { "content": "You are an expert Python programmer. 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\nmmemewwemeww\n\n\nOutput\n\nCat### Format: Read the inputs from stdin solve the problem a...
[{"input": "mmemwweemeww", "output": "Rabbit\n"}, {"input": "wwemeewwmemm", "output": "Rabbit\n"}, {"input": "mmemwweeneww", "output": "Rabbit\n"}, {"input": "mnemwweeneww", "output": "Rabbit\n"}, {"input": "wweneewwmenm", "output": "Rabbit\n"}, {"input": "wwmneewwmene", "output": "Rabbit\n"}, {"input": "xwmneewwmene",...
code_stdio
[ { "content": "You are an expert Python programmer. 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 coins labeled from 1 to n. Initially, coin c_i is on position i and is facing upwards ((c_1, c_2,...
[{"input": "4\n2 3 4 1\n", "output": "5\n1 2\n2 3\n2 4\n1 3\n1 2\n"}, {"input": "4\n2 1 4 3\n", "output": "4\n1 3\n1 4\n3 2\n3 1\n"}, {"input": "3\n2 3 1\n", "output": "4\n1 2\n2 3\n1 3\n1 2\n"}, {"input": "3\n3 1 2\n", "output": "4\n1 3\n3 2\n1 2\n1 3\n"}, {"input": "3\n2 1 3\n", "output": "\n3\n1 3\n3 2\n3 1\n"}, {"i...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nDevu has an array A consisting of N positive integers. He would like to perform following operation on array....
[{"input": "2 4\n1 18\n1\n2\n5\n4", "output": "Yes\nYes\nYes\nYes\n"}, {"input": "2 4\n1 3\n1\n2\n3\n3", "output": "Yes\nYes\nYes\nYes\n"}, {"input": "2 4\n2 18\n1\n2\n5\n4", "output": "No\nYes\nYes\nYes\n"}, {"input": "2 4\n8 0\n0\n2\n18\n0", "output": "Yes\nYes\nNo\nYes\n"}, {"input": "2 4\n1 3\n1\n2\n3\n10", "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\nproblem\n\nJOI, who has been suffering from his winter vacation homework every time, decided to do his homewo...
[{"input": "20\n10\n346\n6\n2", "output": "-153\n"}, {"input": "20\n10\n346\n4\n8", "output": "-24\n"}, {"input": "20\n25\n47\n6\n1", "output": "-27\n"}, {"input": "20\n4\n125\n1\n3", "output": "-22\n"}, {"input": "20\n28\n84\n1\n1", "output": "-64\n"}, {"input": "20\n13\n86\n8\n1", "output": "-66\n"}, {"input": "20\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\nYou've come to your favorite store Infinitesco to buy some ice tea.\n\nThe store sells ice tea in bottles of ...
[{"input": "12345678 87654321 12345678 87654321\n226515686", "output": "2796489721305108\n"}, {"input": "12345678 87654321 12873114 87654321\n226515686", "output": "2915962248666204\n"}, {"input": "12345678 87654321 12345678 87654321\n123456789", "output": "1524157763907942"}, {"input": "1103255 87654321 12873114 87654...
code_stdio
[ { "content": "You are an expert Python programmer. 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 Physical education teacher at SESC is a sort of mathematician too. His most favorite topic in mathematics...
[{"input": "100\n246 485 -940 -186 -841 -98 711 429 -154 164 -244 -111 886 -447 22 480 224 -132 927 812 -243 -152 -843 403 -320 -346 -407 827 645 -903 -172 540 -359 498 270 18 374 -52 -983 -164 -707 -242 -159 -825 -889 661 -629 212 849 -891 -622 810 957 897 -110 -293 -257 822 690 369 -914 212 -338 -928 -862 525 -179 46...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nPeter can see a clock in the mirror from the place he sits in the office.\nWhen he saw the clock shows 12:22\...
[{"input": "\"06:35\"", "output": "[\"05:25\"]", "fn_name": "what_is_the_time"}, {"input": "\"11:59\"", "output": "[\"12:01\"]", "fn_name": "what_is_the_time"}, {"input": "\"12:02\"", "output": "[\"11:58\"]", "fn_name": "what_is_the_time"}, {"input": "\"04:00\"", "output": "[\"08:00\"]", "fn_name": "what_is_the_time"},...
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\nOlga came to visit the twins Anna and Maria and saw that they have many cookies. The cookies are distributed ...
[{"input": "99\n99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 100 99 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 an integer N, find the base -2 representation of N.\nHere, S is the base -2 representation of N when th...
[{"input": "-1000000000\n", "output": "11000101101001010100101000000000\n"}, {"input": "-790013317\n", "output": "11010001001111101010111110001111\n"}, {"input": "1000000000\n", "output": "1001100111011111101111000000000\n"}, {"input": "586260100\n", "output": "1100111001101101110001110000100\n"}, {"input": "-192321079...
code_stdio
[ { "content": "You are an expert Python programmer. 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 Vasya has received a young builder’s kit. The kit consists of several wooden bars, the lengths of all ...
[{"input": "123\n112 277 170 247 252 115 157 293 256 143 196 90 12 164 164 42 8 223 167 109 175 232 239 111 148 51 9 254 93 32 268 162 231 91 47 162 161 191 195 145 247 292 129 199 230 94 144 217 18 205 176 20 143 198 121 243 211 262 230 277 195 255 108 290 220 275 158 2 286 200 60 267 278 207 123 150 123 116 131 13 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\nTreeland is a country in which there are n towns connected by n - 1 two-way road such that it's possible to g...
[{"input": "35 15\n6 12 32 18 11 10 29 9 30 27 31 14 8 24 28 25 19 15 21 3 4 1 33 22 23 17 16 13 7 2\n1 2\n20 3\n1 4\n20 5\n20 6\n1 7\n13 8\n4 9\n1 10\n1 11\n1 12\n1 13\n18 14\n10 15\n1 16\n16 17\n1 18\n1 19\n1 20\n20 21\n1 22\n27 23\n25 24\n1 25\n20 26\n20 27\n18 28\n4 29\n13 30\n4 31\n1 32\n20 33\n1 34\n4 35\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\nPushok the dog has been chasing Imp for a few hours already. $48$ \n\nFortunately, Imp knows that Pushok is a...
[{"input": "100\nh\nshh\nh\nhs\nshh\nhh\nh\nssh\nhss\nh\nhh\nh\nh\nh\nh\nh\nh\nh\nh\nh\nhh\nh\nh\nh\nh\nhhh\nh\nh\nhhh\nsh\nhh\nhs\nh\nh\nshs\nh\nh\nh\nshh\nhs\nhs\nh\nh\nh\nhhh\nh\nhhs\nhh\nh\nssh\nh\nh\nhh\nsh\nh\nhss\nh\nhh\nsh\nhh\nhh\nhhh\nhs\nh\nh\nh\nshs\nhs\nshs\nsh\nh\nh\nhs\nh\nh\nh\nh\nsh\nssh\nh\nh\nhh\nhhh...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMonocarp is playing a computer game. He's going to kill $n$ monsters, the $i$-th of them has $h_i$ health.\n\...
[{"input": "1\n43\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\n", "output": "22\n"}, {"input": "1\n30\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\n", "output": "15\n"}, {"input": "3\n4\n1 2 1 2\n3\n2 4 2\n5\n1 2 3 4 5\n", "output": "3\n3\n5\n"}, {"input": "1\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nIn another Kata I came across a weird `sort` function to implement. We had to sort characters as usual ( 'A' ...
[{"input": "[\"0\", \"9\", \"8\", \"1\", \"7\", \"2\", \"6\", \"3\", \"5\", \"4\"]", "output": "[[\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"]]", "fn_name": "unusual_sort"}, {"input": "[\"c\", \"b\", \"a\", \"9\", \"5\", \"0\", \"X\", \"Y\", \"Z\"]", "output": "[[\"X\", \"Y\", \"Z\", \"a\", \"b...
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\nNick has n bottles of soda left after his birthday. Each bottle is described by two values: remaining amount ...
[{"input": "90\n4 2 21 69 53 39 2 2 8 58 7 5 2 82 7 9 13 10 2 44 1 7 2 1 50 42 36 17 14 46 19 1 50 20 51 46 9 59 73 61 76 4 19 22 1 43 53 2 5 5 32 7 5 42 30 14 32 6 6 15 20 24 13 8 5 19 9 9 7 20 7 2 55 36 5 33 64 20 22 22 9 30 67 38 68 2 13 19 2 9\n48 4 39 85 69 70 11 42 65 77 61 6 60 84 67 15 99 12 2 84 51 17 10 3 50 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nMike is the president of country What-The-Fatherland. There are n bears living in this country besides Mike. ...
[{"input": "20\n452405440 586588704 509061481 392584366 16115810 148658854 66743034 290624691 677780684 519361360 208050516 401554301 954478790 989443769 387546138 832279893 1081316002 80960260 846049648 588066499\n", "output": "1081316002 954478790 452405440 392584366 387546138 387546138 208050516 208050516 208050516 ...
code_stdio
[ { "content": "You are an expert Python programmer. 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 gotten interested in programming contests in TCMCF+++ rules. On the contest n problems were suggest...
[{"input": "100\n-93 -100 -99 -100 -99 -100 -99 -99 -99 -100 -99 -99 -100 -98 -98 -100 -99 -100 -95 -100 -100 -99 -98 -100 -96 -99 -99 -100 -97 -98 -100 -98 -98 -93 -100 -100 -99 -100 -100 -98 -100 -98 -100 -98 -97 -99 -98 -99 -99 -99 -100 -100 -100 -100 -98 -93 -100 -100 -97 -100 -100 -100 -98 -126 -100 -95 -98 -99 -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\nAdilbek's house is located on a street which can be represented as the OX axis. This street is really dark, s...
[{"input": "20 16 16\n1 2 3 4 5 6 8 9 10 11 13 14 15 16 18 19\n2 1 1 1 1 1 3 3 2 2 1 3 3 3 3 2\n", "output": "3\n"}, {"input": "20 16 16\n1 2 3 4 5 6 8 9 10 11 13 14 15 16 18 19\n2 1 1 1 1 1 3 3 2 2 1 3 3 3 3 2\n", "output": "3\n"}, {"input": "20 16 16\n1 2 3 4 5 6 8 9 10 11 13 14 15 16 18 19\n2 1 1 1 1 1 3 1 2 2 1 3 3...
code_stdio