messages listlengths 1 1 | ground_truth stringlengths 599 74M | id stringlengths 32 32 | dataset stringclasses 2 values |
|---|---|---|---|
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDreamoon loves summing up something for no reason. One day he obtains two integers a and b occasionally. He wants to calculate the sum of all nice integers. Positive integer x is called nice if $\\operatorname{mod}(x, b) ... | [{"input": "1 1\n", "output": "0\n", "type": "code"}, {"input": "2 2\n", "output": "8\n", "type": "code"}, {"input": "4 1\n", "output": "0\n", "type": "code"}, {"input": "4 2\n", "output": "24\n", "type": "code"}, {"input": "4 3\n", "output": "102\n", "type": "code"}, {"input": "4 4\n", "output": "264\n", "type": "code"}, {"input": "3 4\n", "output": "162\n", "type": "code"}, {"input": "2 4\n", "output": "84\n", "type": "code"}, {"input": "1 4\n", "output": "30\n", "type": "code"}, {"input": "1000 1000\n", "output": "247750000\n", "type": "code"}, {"input": "10000000 10000000\n", "output": "425362313\n", "type": "code"}, {"input": "10000000 9999999\n", "output": "930564389\n", "type": "code"}, {"input": "2 10000000\n", "output": "990423507\n", "type": "code"}, {"input": "10000000 2\n", "output": "19300000\n", "type": "code"}, {"input": "9999999 2\n", "output": "999300006\n", "type": "code"}, {"input": "9999999 9999999\n", "output": "957764103\n", "type": "code"}, {"input": "10000000 10000\n", "output": "723127969\n", "type": "code"}, {"input": "10000 10000000\n", "output": "372369289\n", "type": "code"}, {"input": "2 9999999\n", "output": "48573499\n", "type": "code"}, {"input": "123456 123456\n", "output": "417111819\n", "type": "code"}, {"input": "6407688 3000816\n", "output": "895399645\n", "type": "code"}, {"input": "9956532 1084240\n", "output": "554368769\n", "type": "code"}, {"input": "3505377 9167664\n", "output": "80435138\n", "type": "code"}, {"input": "7054221 7251088\n", "output": "7849970\n", "type": "code"}, {"input": "346169 367216\n", "output": "358144298\n", "type": "code"}, {"input": "3895014 8450640\n", "output": "627604019\n", "type": "code"}, {"input": "861392 6200826\n", "output": "180835815\n", "type": "code"}, {"input": "4410236 9316955\n", "output": "602743722\n", "type": "code"}, {"input": "2926377 2367675\n", "output": "395740917\n", "type": "code"}, {"input": "1507925 5483803\n", "output": "727607740\n", "type": "code"}, {"input": "9832578 8599931\n", "output": "428281878\n", "type": "code"}, {"input": "8348718 6683355\n", "output": "275994807\n", "type": "code"}, {"input": "1897562 4766779\n", "output": "148050609\n", "type": "code"}, {"input": "413703 2850203\n", "output": "76966774\n", "type": "code"}, {"input": "8995251 5966331\n", "output": "451718548\n", "type": "code"}, {"input": "7319903 9017051\n", "output": "975259203\n", "type": "code"}, {"input": "9253578 1799941\n", "output": "868664771\n", "type": "code"}, {"input": "7835126 9883365\n", "output": "119844544\n", "type": "code"}, {"input": "6351267 7966789\n", "output": "683811063\n", "type": "code"}, {"input": "9900111 1082917\n", "output": "539539383\n", "type": "code"}, {"input": "1 10000000\n", "output": "995024507\n", "type": "code"}, {"input": "123456 234567\n", "output": "93010021\n", "type": "code"}, {"input": "888888 888888\n", "output": "456888843\n", "type": "code"}, {"input": "1001 1500126\n", "output": "45074025\n", "type": "code"}, {"input": "9243243 432434\n", "output": "203891513\n", "type": "code"}, {"input": "3 10000000\n", "output": "986197007\n", "type": "code"}, {"input": "4108931 211273\n", "output": "142398939\n", "type": "code"}, {"input": "999999 92321\n", "output": "286549418\n", "type": "code"}, {"input": "999999 999999\n", "output": "691690639\n", "type": "code"}, {"input": "191919 123123\n", "output": "358196438\n", "type": "code"}, {"input": "999999 1000000\n", "output": "725921292\n", "type": "code"}, {"input": "31623 10000000\n", "output": "382702377\n", "type": "code"}, {"input": "1000023 1000043\n", "output": "175442768\n", "type": "code"}, {"input": "666666 666666\n", "output": "869302791\n", "type": "code"}, {"input": "7672285 753250\n", "output": "461773059\n", "type": "code"}, {"input": "1000000 1000000\n", "output": "249917764\n", "type": "code"}, {"input": "6340794 6874449\n", "output": "930977735\n", "type": "code"}, {"input": "9998486 9998486\n", "output": "988877388\n", "type": "code"}, {"input": "9999997 9999998\n", "output": "946983076\n", "type": "code"}] | 7b3a48823cd08358ca1e725ab940354c | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n\"QAQ\" is a word to denote an expression of crying. Imagine \"Q\" as eyes with tears and \"A\" as a mouth.\n\nNow Diamond has given Bort a string consisting of only uppercase English letters of length n. There is a great... | [{"input": "QAQAQYSYIOIWIN\n", "output": "4\n", "type": "code"}, {"input": "QAQQQZZYNOIWIN\n", "output": "3\n", "type": "code"}, {"input": "QA\n", "output": "0\n", "type": "code"}, {"input": "IAQVAQZLQBQVQFTQQQADAQJA\n", "output": "24\n", "type": "code"}, {"input": "QQAAQASGAYAAAAKAKAQIQEAQAIAAIAQQQQQ\n", "output": "378\n", "type": "code"}, {"input": "AMVFNFJIAVNQJWIVONQOAOOQSNQSONOASONAONQINAONAOIQONANOIQOANOQINAONOQINAONOXJCOIAQOAOQAQAQAQAQWWWAQQAQ\n", "output": "1077\n", "type": "code"}, {"input": "AAQQAXBQQBQQXBNQRJAQKQNAQNQVDQASAGGANQQQQTJFFQQQTQQA\n", "output": "568\n", "type": "code"}, {"input": "KAZXAVLPJQBQVQQQQQAPAQQGQTQVZQAAAOYA\n", "output": "70\n", "type": "code"}, {"input": "W\n", "output": "0\n", "type": "code"}, {"input": "DBA\n", "output": "0\n", "type": "code"}, {"input": "RQAWNACASAAKAGAAAAQ\n", "output": "10\n", "type": "code"}, {"input": "QJAWZAAOAAGIAAAAAOQATASQAEAAAAQFQQHPA\n", "output": "111\n", "type": "code"}, {"input": "QQKWQAQAAAAAAAAGAAVAQUEQQUMQMAQQQNQLAMAAAUAEAAEMAAA\n", "output": "411\n", "type": "code"}, {"input": "QQUMQAYAUAAGWAAAQSDAVAAQAAAASKQJJQQQQMAWAYYAAAAAAEAJAXWQQ\n", "output": "625\n", "type": "code"}, {"input": "QORZOYAQ\n", "output": "1\n", "type": "code"}, {"input": "QCQAQAGAWAQQQAQAVQAQQQQAQAQQQAQAAATQAAVAAAQQQQAAAUUQAQQNQQWQQWAQAAQQKQYAQAAQQQAAQRAQQQWBQQQQAPBAQGQA\n", "output": "13174\n", "type": "code"}, {"input": "QQAQQAKQFAQLQAAWAMQAZQAJQAAQQOACQQAAAYANAQAQQAQAAQQAOBQQJQAQAQAQQQAAAAABQQQAVNZAQQQQAMQQAFAAEAQAQHQT\n", "output": "10420\n", "type": "code"}, {"input": "AQEGQHQQKQAQQPQKAQQQAAAAQQQAQEQAAQAAQAQFSLAAQQAQOQQAVQAAAPQQAWAQAQAFQAXAQQQQTRLOQAQQJQNQXQQQQSQVDQQQ\n", "output": "12488\n", "type": "code"}, {"input": "QNQKQQQLASQBAVQQQQAAQQOQRJQQAQQQEQZUOANAADAAQQJAQAQARAAAQQQEQBHTQAAQAAAAQQMKQQQIAOJJQQAQAAADADQUQQQA\n", "output": "9114\n", "type": "code"}, {"input": "QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ\n", "output": "35937\n", "type": "code"}, {"input": "AMQQAAQAAQAAAAAAQQQBOAAANAAKQJCYQAE\n", "output": "254\n", "type": "code"}, {"input": "AYQBAEQGAQEOAKGIXLQJAIAKQAAAQPUAJAKAATFWQQAOQQQUFQYAQQMQHOKAAJXGFCARAQSATHAUQQAATQJJQDQRAANQQAE\n", "output": "2174\n", "type": "code"}, {"input": "AAQXAAQAYQAAAAGAQHVQYAGIVACADFAAQAAAAQZAAQMAKZAADQAQDAAQDAAAMQQOXYAQQQAKQBAAQQKAXQBJZDDLAAHQQ\n", "output": "2962\n", "type": "code"}, {"input": "AYQQYAVAMNIAUAAKBBQVACWKTQSAQZAAQAAASZJAWBCAALAARHACQAKQQAQAARPAQAAQAQAAZQUSHQAMFVFZQQQQSAQQXAA\n", "output": "2482\n", "type": "code"}, {"input": "LQMAQQARQAQBJQQQAGAAZQQXALQQAARQAQQQQAAQQAQQQAQQCAQQAQQAYQQQRAAZATQALYQQAAHHAAQHAAAAAAAAQQMAAQNAKQ\n", "output": "7768\n", "type": "code"}, {"input": "MAQQWAQOYQMAAAQAQPQZAOAAQAUAQNAAQAAAITQSAQAKAQKAQQWSQAAQQAGUCDQMQWKQUXKWQQAAQQAAQQZQDQQQAABXQUUXQOA\n", "output": "5422\n", "type": "code"}, {"input": "QTAAQDAQXAQQJQQQGAAAQQQQSBQZKAQQAQQQQEAQNUQBZCQLYQZQEQQAAQHQVAORKQVAQYQNASZQAARZAAGAAAAOQDCQ\n", "output": "3024\n", "type": "code"}, {"input": "QQWAQQGQQUZQQQLZAAQYQXQVAQFQUAQZUQZZQUKBHSHTQYLQAOQXAQQGAQQTQOAQARQADAJRAAQPQAQQUQAUAMAUVQAAAQQAWQ\n", "output": "4527\n", "type": "code"}, {"input": "QQAAQQAQVAQZQQQQAOEAQZPQIBQZACQQAFQQLAAQDATZQANHKYQQAQTAAFQRQAIQAJPWQAQTEIRXAEQQAYWAAAUKQQAQAQQQSQQH\n", "output": "6416\n", "type": "code"}, {"input": "AQQQQAQAAQQAQAQAAAAAAAAAQAQAAAAAQAQAQQQAQQQAAAQQQAAAAAAAQAAAAQQQQQQQAQQQQAQAAAQAAAAAQAQAAAAAQAQAAAA\n", "output": "14270\n", "type": "code"}, {"input": "AQQQQAQAAQQAQAQAAAAAAAAAQAQAAAAAQAQAQQQAQQQAAAQQQAAAAAAAQAAAAQQQQQQQAQQQQAQAAAQAAAAAQAQAAAAAQ\n", "output": "13136\n", "type": "code"}, {"input": "AQQQQAQAAQQAQAQAAAAAAAAAQAQAAAAAQAQAQQQAQQQAAAQQQAAAAAAAQAAAAQQQQQQQAQQQQAQAAAQAAAAAQAQAAAAAQAQAA\n", "output": "14270\n", "type": "code"}, {"input": "AQQQQAQAAQQAQAQAAAAAAAAAQAQAAAAAQAQAQQQAQQQAAAQQQAAAAAAAQAAAAQQQQQQQAQQQQAQAAAQAAAAAQAQAAAAAQQAA\n", "output": "14231\n", "type": "code"}, {"input": "QQQQQAQAAQQAQAQAAAAAAAAAQAQAAAAAQAQAQQQAQQQAAAQQQAAAAAAAQAAAAQQQQQQQAQQQQAQAAAQAAAAAQAQAAAAAQAQAA\n", "output": "15296\n", "type": "code"}, {"input": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ\n", "output": "0\n", "type": "code"}, {"input": "QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n", "output": "0\n", "type": "code"}, {"input": "QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ\n", "output": "0\n", "type": "code"}, {"input": "QAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQA\n", "output": "20825\n", "type": "code"}, {"input": "AQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQAQ\n", "output": "20825\n", "type": "code"}, {"input": "Q\n", "output": "0\n", "type": "code"}, {"input": "A\n", "output": "0\n", "type": "code"}, {"input": "FFF\n", "output": "0\n", "type": "code"}, {"input": "AAAAAA\n", "output": "0\n", "type": "code"}] | 3c03186a1602e6b4a3c8645e06f87671 | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nCodefortia is a small island country located somewhere in the West Pacific. It consists of $n$ settlements connected by $m$ bidirectional gravel roads. Curiously enough, the beliefs of the inhabitants require the time nee... | [{"input": "5 5 20 25\n1 2 25\n2 3 25\n3 4 20\n4 5 20\n5 1 20\n", "output": "0 25 60 40 20\n", "type": "code"}, {"input": "6 7 13 22\n1 2 13\n2 3 13\n1 4 22\n3 4 13\n4 5 13\n5 6 13\n6 1 13\n", "output": "0 13 26 39 26 13\n", "type": "code"}, {"input": "2 1 1 2\n2 1 1\n", "output": "0 1\n", "type": "code"}, {"input": "2 1 9999999 10000000\n1 2 10000000\n", "output": "0 10000000\n", "type": "code"}, {"input": "3 3 78422 6789101\n3 1 6789101\n2 1 78422\n2 3 78422\n", "output": "0 78422 156844\n", "type": "code"}, {"input": "3 3 2770628 3912422\n1 2 2770628\n2 3 2770628\n1 3 3912422\n", "output": "0 2770628 5541256\n", "type": "code"}, {"input": "3 3 2566490 5132980\n1 2 2566490\n2 3 2566490\n3 1 5132980\n", "output": "0 2566490 5132980\n", "type": "code"}, {"input": "3 2 509529 5982470\n1 2 509529\n3 2 509529\n", "output": "0 509529 1019058\n", "type": "code"}, {"input": "3 2 1349740 8457492\n2 1 1349740\n3 1 1349740\n", "output": "0 1349740 1349740\n", "type": "code"}, {"input": "3 2 150319 5002968\n3 2 150319\n1 2 5002968\n", "output": "0 5002968 5153287\n", "type": "code"}, {"input": "3 2 990530 8623767\n3 2 8623767\n1 2 990530\n", "output": "0 990530 9614297\n", "type": "code"}, {"input": "3 2 810925 2022506\n1 2 2022506\n1 3 810925\n", "output": "0 2022506 810925\n", "type": "code"}, {"input": "3 2 1651136 5131013\n1 2 5131013\n3 2 5131013\n", "output": "0 5131013 10262026\n", "type": "code"}, {"input": "3 2 451715 1577270\n1 3 1577270\n1 2 1577270\n", "output": "0 1577270 1577270\n", "type": "code"}, {"input": "3 3 1291926 4943478\n2 3 1291926\n1 2 1291926\n3 1 1291926\n", "output": "0 1291926 1291926\n", "type": "code"}, {"input": "3 3 2132137 9084127\n1 2 2132137\n3 2 9084127\n3 1 2132137\n", "output": "0 2132137 2132137\n", "type": "code"}, {"input": "3 3 1126640 9858678\n3 1 9858678\n3 2 1126640\n1 2 9858678\n", "output": "0 9858678 9858678\n", "type": "code"}, {"input": "3 3 1966851 6439891\n1 3 6439891\n1 2 1966851\n3 2 6439891\n", "output": "0 1966851 6439891\n", "type": "code"}, {"input": "3 3 1787246 7806211\n3 2 7806211\n2 1 7806211\n1 3 7806211\n", "output": "0 7806211 7806211\n", "type": "code"}] | 45835978994c3f41e17082bda084cb75 | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya and Kolya play a game with a string, using the following rules. Initially, Kolya creates a string s, consisting of small English letters, and uniformly at random chooses an integer k from a segment [0, len(s) - 1]. ... | [{"input": "technocup\n", "output": "1.000000000000000\n", "type": "code"}, {"input": "tictictactac\n", "output": "0.333333333333333\n", "type": "code"}, {"input": "bbaabaabbb\n", "output": "0.100000000000000\n", "type": "code"}, {"input": "cbbbbcaaca\n", "output": "0.800000000000000\n", "type": "code"}, {"input": "cadbcdddda\n", "output": "0.800000000000000\n", "type": "code"}, {"input": "bababbdaee\n", "output": "1.000000000000000\n", "type": "code"}, {"input": "fabbbhgedd\n", "output": "1.000000000000000\n", "type": "code"}, {"input": "gaejllebhn\n", "output": "1.000000000000000\n", "type": "code"}, {"input": "bbababaaababaabbbbbabbbbbbaaabbabaaaaabbbbbaaaabbbbabaabaabababbbabbabbabaaababbabbababaaaaabaaaabbb\n", "output": "0.000000000000000\n", "type": "code"}, {"input": "eaaebccaeacdecaedcaabbbdeebccdcdaabeeaeeaddbaabdccebecebbbbedbdcbbbbbbecbaddcddcccdcbbadbecddecedbba\n", "output": "0.080000000000000\n", "type": "code"}, {"input": "hcdhgcchbdhbeagdcfedgcbaffebgcbcccadeefacbhefgeadfgchabgeebegahfgegahbddedfhffeadcedadgfbeebhgfahhfb\n", "output": "0.450000000000000\n", "type": "code"}, {"input": "difhjdjbcdjedhiegagdejkbjfcdcdagdijdjajecbheiabfbjdgjdecfhdkgdbkcgcgakkiiggfkgcfadkjhiijkjacgejfhjge\n", "output": "0.840000000000000\n", "type": "code"}, {"input": "khjcoijiicdkdianmdolmadobdkcmgifdnffddnjehhbldlkjffknficdcmokfacioiegjedbmadjioomdacbodcajcmonmnlabo\n", "output": "0.960000000000000\n", "type": "code"}, {"input": "kpsaloedscghjeaqadfhmlibjepjafdomkkorinrpakondtnrnknbqarbejcenrlsbfgdbsdmkpphbkdnbitjfcofsjibssmmlll\n", "output": "1.000000000000000\n", "type": "code"}, {"input": "jkeaagakbifeaechkifkdghcjcgighidcgdccfbdbcackfgaebkddabgijkhjkaffkabacekdkjekeccegbecbkecbgbgcacgdackcdfjefaifgbigahkbedidfhjbikejdhejcgideaeejdcegeeccaefbddejkbdkfagfcdjbikbidfggkidcdcic\n", "output": "0.438502673796791\n", "type": "code"}, {"input": "ibledofnibedebifmnjdoaijeghajecbkjaebbkofnacceaodiifbhgkihkibddneeiemacodeafeaiiiaoajhmkjffbmmiehebhokfklhbkeoanoajdedjdlkbhenidclagggfhhhldfleccgmjbkhaginlhabkabagikalccndciokabfaebjkndf\n", "output": "0.786096256684492\n", "type": "code"}, {"input": "aaabbbaaaabbbbaaabbbbbaabbbbaaababbaaabbbbaaabbbbababbbbaaabbbbaaabbbbbaabbbbaaabbbbaaabbbb\n", "output": "0.000000000000000\n", "type": "code"}, {"input": "abbbaababbbaababbbaababbbaababbbaababbbaababbbaababbbaababbbaababbbaababbbaababbbaababbbaab\n", "output": "0.000000000000000\n", "type": "code"}, {"input": "abbacba\n", "output": "1.000000000000000\n", "type": "code"}] | e17bd6bd8d9d6fa85a97fc29bf92fa0d | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe Little Elephant has an integer a, written in the binary notation. He wants to write this number on a piece of paper.\n\nTo make sure that the number a fits on the piece of paper, the Little Elephant ought to delete ex... | [{"input": "101\n", "output": "11\n", "type": "code"}, {"input": "110010\n", "output": "11010\n", "type": "code"}, {"input": "10000\n", "output": "1000\n", "type": "code"}, {"input": "1111111110\n", "output": "111111111\n", "type": "code"}, {"input": "10100101011110101\n", "output": "1100101011110101\n", "type": "code"}, {"input": "111010010111\n", "output": "11110010111\n", "type": "code"}, {"input": "11110111011100000000\n", "output": "1111111011100000000\n", "type": "code"}, {"input": "11110010010100001110110101110011110110100111101\n", "output": "1111010010100001110110101110011110110100111101\n", "type": "code"}, {"input": "1001011111010010100111111\n", "output": "101011111010010100111111\n", "type": "code"}, {"input": "1111111111\n", "output": "111111111\n", "type": "code"}, {"input": "1111111111111111111100111101001110110111111000001111110101001101001110011000001011001111111000110101\n", "output": "111111111111111111110111101001110110111111000001111110101001101001110011000001011001111111000110101\n", "type": "code"}, {"input": "11010110000100100101111110111001001010011000011011000010010100111010101000111010011101101111110001111000101000001100011101110100\n", "output": "1110110000100100101111110111001001010011000011011000010010100111010101000111010011101101111110001111000101000001100011101110100\n", "type": "code"}, {"input": "11111111111111111111111110110111001101100111010010101101101001011100011011000111010011110010101100010001011101011010010100001000011100001101101001100010100001001010010100100001111110100110011000101100001111111011010111001011111110111101000100101001001011\n", "output": "1111111111111111111111111110111001101100111010010101101101001011100011011000111010011110010101100010001011101011010010100001000011100001101101001100010100001001010010100100001111110100110011000101100001111111011010111001011111110111101000100101001001011\n", "type": "code"}, {"input": "11100010010010000110101101101100111111001010001101101001001111010110010111001011010000001100110101000101111000001111101111110010000010101110011110101101010110001100011101111011100010011101100111110010111111100110101000000111101000000000110100100101111101000110101010101101001110001110000101011010101100011100100111100010001011010010001100011111110010011010011000111000100111100010110100011010010101011011011111110100001110000011011\n", "output": "1110010010010000110101101101100111111001010001101101001001111010110010111001011010000001100110101000101111000001111101111110010000010101110011110101101010110001100011101111011100010011101100111110010111111100110101000000111101000000000110100100101111101000110101010101101001110001110000101011010101100011100100111100010001011010010001100011111110010011010011000111000100111100010110100011010010101011011011111110100001110000011011\n", "type": "code"}, {"input": "11\n", "output": "1\n", "type": "code"}, {"input": "111\n", "output": "11\n", "type": "code"}, {"input": "111111\n", "output": "11111\n", "type": "code"}, {"input": "11111\n", "output": "1111\n", "type": "code"}, {"input": "1111\n", "output": "111\n", "type": "code"}] | caeec2e826110f44b8b28a78fb30573f | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt is so boring in the summer holiday, isn't it? So Alice and Bob have invented a new game to play. The rules are as follows. First, they get a set of n distinct integers. And then they take turns to make the following mo... | [{"input": "2\n2 3\n", "output": "Alice\n", "type": "code"}, {"input": "2\n5 3\n", "output": "Alice\n", "type": "code"}, {"input": "3\n5 6 7\n", "output": "Bob\n", "type": "code"}, {"input": "10\n72 96 24 66 6 18 12 30 60 48\n", "output": "Bob\n", "type": "code"}, {"input": "10\n78 66 6 60 18 84 36 96 72 48\n", "output": "Bob\n", "type": "code"}, {"input": "10\n98 63 42 56 14 77 70 35 84 21\n", "output": "Bob\n", "type": "code"}, {"input": "2\n1 1000000000\n", "output": "Bob\n", "type": "code"}, {"input": "2\n1000000000 999999999\n", "output": "Bob\n", "type": "code"}, {"input": "3\n2 4 6\n", "output": "Bob\n", "type": "code"}, {"input": "2\n4 6\n", "output": "Alice\n", "type": "code"}, {"input": "2\n2 6\n", "output": "Alice\n", "type": "code"}, {"input": "2\n6 2\n", "output": "Alice\n", "type": "code"}, {"input": "10\n100000000 200000000 300000000 400000000 500000000 600000000 700000000 800000000 900000000 1000000000\n", "output": "Bob\n", "type": "code"}, {"input": "2\n1 2\n", "output": "Bob\n", "type": "code"}, {"input": "10\n1 999999999 999999998 999999997 999999996 999999995 999999994 999999993 999999992 999999991\n", "output": "Alice\n", "type": "code"}, {"input": "3\n6 14 21\n", "output": "Bob\n", "type": "code"}, {"input": "3\n4 12 18\n", "output": "Bob\n", "type": "code"}, {"input": "4\n2 3 15 30\n", "output": "Bob\n", "type": "code"}, {"input": "2\n10 4\n", "output": "Alice\n", "type": "code"}] | 5d266fe7c18e142f6a9314dba0d03df9 | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMad scientist Mike does not use slow hard disks. His modification of a hard drive has not one, but n different heads that can read data in parallel.\n\nWhen viewed from the side, Mike's hard drive is an endless array of t... | [{"input": "3 4\n2 5 6\n1 3 6 8\n", "output": "2\n", "type": "code"}, {"input": "3 3\n1 2 3\n1 2 3\n", "output": "0\n", "type": "code"}, {"input": "1 2\n165\n142 200\n", "output": "81\n", "type": "code"}, {"input": "1 2\n5000000000\n1 10000000000\n", "output": "14999999998\n", "type": "code"}, {"input": "2 4\n3 12\n1 7 8 14\n", "output": "8\n", "type": "code"}, {"input": "3 3\n1 2 3\n2 3 4\n", "output": "1\n", "type": "code"}, {"input": "2 1\n1 10\n9\n", "output": "1\n", "type": "code"}, {"input": "3 19\n7 10 13\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19\n", "output": "6\n", "type": "code"}, {"input": "3 3\n2 3 4\n1 3 5\n", "output": "1\n", "type": "code"}, {"input": "10 11\n1 909090909 1818181817 2727272725 3636363633 4545454541 5454545449 6363636357 7272727265 8181818173\n454545455 1363636363 2272727271 3181818179 4090909087 4999999995 5909090903 6818181811 7727272719 8636363627 9545454535\n", "output": "1363636362\n", "type": "code"}, {"input": "3 10\n4999999999 5000000000 5000000001\n1 1000 100000 1000000 4999999999 5000000000 5000000001 6000000000 8000000000 10000000000\n", "output": "4999999999\n", "type": "code"}, {"input": "2 4\n4500000000 5500000000\n5 499999999 5000000001 9999999995\n", "output": "5499999993\n", "type": "code"}, {"input": "10 10\n331462447 1369967506 1504296131 2061390288 2309640071 3006707770 4530801731 4544099460 7357049371 9704808257\n754193799 3820869903 4594383880 5685752675 6303322854 6384906441 7863448848 8542634752 9573124462 9665646063\n", "output": "1840806981\n", "type": "code"}, {"input": "1 1\n10000000000\n1\n", "output": "9999999999\n", "type": "code"}, {"input": "1 1\n1\n10000000000\n", "output": "9999999999\n", "type": "code"}, {"input": "10 10\n9999999991 9999999992 9999999993 9999999994 9999999995 9999999996 9999999997 9999999998 9999999999 10000000000\n1 2 3 4 5 6 7 8 9 10\n", "output": "9999999990\n", "type": "code"}, {"input": "3 12\n477702277 4717363935 8947981095\n477702276 477702304 477702312 477702317 4717363895 4717363896 4717363920 4717363936 8947981094 8947981111 8947981112 8947981135\n", "output": "42\n", "type": "code"}, {"input": "10 10\n389151626 1885767612 2609703695 3054567325 4421751790 5636236054 6336088034 7961001379 8631992167 9836923433\n389144165 389158510 1885760728 1885775073 2609696234 2609710579 3054559864 3054574209 4421744329 4421758674\n", "output": "21229\n", "type": "code"}, {"input": "1 1\n10000000000\n1\n", "output": "9999999999\n", "type": "code"}] | 51d7186d50fd1c0dd446e3d3ea8b8d73 | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA schoolboy named Vasya loves reading books on programming and mathematics. He has recently read an encyclopedia article that described the method of median smoothing (or median filter) and its many applications in scienc... | [{"input": "4\n0 0 1 1\n", "output": "0\n0 0 1 1\n", "type": "code"}, {"input": "5\n0 1 0 1 0\n", "output": "2\n0 0 0 0 0\n", "type": "code"}, {"input": "3\n1 0 0\n", "output": "0\n1 0 0\n", "type": "code"}, {"input": "4\n1 0 0 1\n", "output": "0\n1 0 0 1\n", "type": "code"}, {"input": "7\n1 0 1 1 1 0 1\n", "output": "1\n1 1 1 1 1 1 1\n", "type": "code"}, {"input": "14\n0 1 0 0 0 1 1 0 1 0 1 0 1 0\n", "output": "3\n0 0 0 0 0 1 1 1 1 1 0 0 0 0\n", "type": "code"}, {"input": "3\n1 0 1\n", "output": "1\n1 1 1\n", "type": "code"}, {"input": "3\n0 0 1\n", "output": "0\n0 0 1\n", "type": "code"}, {"input": "3\n1 1 0\n", "output": "0\n1 1 0\n", "type": "code"}, {"input": "3\n1 1 1\n", "output": "0\n1 1 1\n", "type": "code"}, {"input": "4\n1 1 0 1\n", "output": "1\n1 1 1 1\n", "type": "code"}, {"input": "4\n1 0 1 1\n", "output": "1\n1 1 1 1\n", "type": "code"}, {"input": "10\n0 1 0 1 0 0 1 0 1 0\n", "output": "2\n0 0 0 0 0 0 0 0 0 0\n", "type": "code"}, {"input": "4\n0 1 1 0\n", "output": "0\n0 1 1 0\n", "type": "code"}, {"input": "168\n0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0\n", "output": "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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 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\n", "type": "code"}, {"input": "3\n0 1 1\n", "output": "0\n0 1 1\n", "type": "code"}, {"input": "3\n0 0 0\n", "output": "0\n0 0 0\n", "type": "code"}, {"input": "4\n0 1 0 1\n", "output": "1\n0 0 1 1\n", "type": "code"}, {"input": "3\n0 1 0\n", "output": "1\n0 0 0\n", "type": "code"}] | c34413535a243ca8dabee630fbe76b4e | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLimak is a little bear who loves to play. Today he is playing by destroying block towers. He built n towers in a row. The i-th tower is made of h_{i} identical blocks. For clarification see picture for the first sample.\n... | [{"input": "6\n2 1 4 6 2 2\n", "output": "3\n", "type": "code"}, {"input": "7\n3 3 3 1 3 3 3\n", "output": "2\n", "type": "code"}, {"input": "7\n5128 5672 5805 5452 5882 5567 5032\n", "output": "4\n", "type": "code"}, {"input": "10\n1 2 2 3 5 5 5 4 2 1\n", "output": "5\n", "type": "code"}, {"input": "14\n20 20 20 20 20 20 3 20 20 20 20 20 20 20\n", "output": "5\n", "type": "code"}, {"input": "50\n3 2 4 3 5 3 4 5 3 2 3 3 3 4 5 4 2 2 3 3 4 4 3 2 3 3 2 3 4 4 5 2 5 2 3 5 4 4 2 2 3 5 2 5 2 2 5 4 5 4\n", "output": "4\n", "type": "code"}, {"input": "1\n1\n", "output": "1\n", "type": "code"}, {"input": "1\n1000000000\n", "output": "1\n", "type": "code"}, {"input": "2\n1 1\n", "output": "1\n", "type": "code"}, {"input": "2\n1049 1098\n", "output": "1\n", "type": "code"}, {"input": "2\n100 100\n", "output": "1\n", "type": "code"}, {"input": "5\n1 2 3 2 1\n", "output": "3\n", "type": "code"}, {"input": "15\n2 2 1 1 2 2 2 2 2 2 2 2 2 1 2\n", "output": "2\n", "type": "code"}, {"input": "28\n415546599 415546599 415546599 415546599 415546599 415546599 415546599 415546599 415546599 2 802811737 802811737 802811737 802811737 802811737 802811737 802811737 802811737 1 550595901 550595901 550595901 550595901 550595901 550595901 550595901 550595901 550595901\n", "output": "6\n", "type": "code"}, {"input": "45\n3 12 13 11 13 13 10 11 14 15 15 13 14 12 13 11 14 10 10 14 14 11 10 12 11 11 13 14 10 11 14 13 14 11 11 11 12 15 1 10 15 12 14 14 14\n", "output": "13\n", "type": "code"}, {"input": "84\n1 3 4 5 6 5 6 7 8 9 7 4 5 4 2 5 1 1 1 3 2 7 7 8 10 9 5 6 5 2 3 3 3 3 3 2 4 8 6 5 8 9 8 7 9 3 4 4 4 2 2 1 6 4 9 5 9 9 10 7 10 4 5 4 2 4 3 3 4 4 6 6 6 9 10 12 7 5 9 8 5 3 3 2\n", "output": "8\n", "type": "code"}, {"input": "170\n1 2 1 2 1 1 1 1 2 3 2 1 1 2 2 1 2 1 2 1 1 2 3 3 2 1 1 1 1 1 1 1 1 2 1 2 3 3 2 1 2 2 1 2 3 2 1 1 2 3 2 1 2 1 1 1 2 3 3 2 1 2 1 2 1 1 1 2 1 2 1 1 2 2 1 1 2 1 2 2 1 2 1 2 2 1 2 1 2 3 2 1 1 2 3 4 4 3 2 1 2 1 2 1 2 3 3 2 1 2 1 1 1 1 1 1 1 2 2 1 1 2 1 1 1 1 2 1 1 2 3 2 1 2 2 1 2 1 1 1 2 2 1 2 1 2 3 2 1 2 1 1 1 2 3 4 5 4 3 2 1 1 2 1 2 3 4 3 2 1\n", "output": "5\n", "type": "code"}, {"input": "1\n5\n", "output": "1\n", "type": "code"}] | 0ff153c65bcdfa0ff48c248d1e888140 | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEighth-grader Vova is on duty today in the class. After classes, he went into the office to wash the board, and found on it the number n. He asked what is this number and the teacher of mathematics Inna Petrovna answered ... | [{"input": "21\n", "output": "1\n15\n", "type": "code"}, {"input": "20\n", "output": "0\n", "type": "code"}, {"input": "1\n", "output": "0\n", "type": "code"}, {"input": "2\n", "output": "1\n1\n", "type": "code"}, {"input": "3\n", "output": "0\n", "type": "code"}, {"input": "100000001\n", "output": "2\n99999937\n100000000\n", "type": "code"}, {"input": "1000000000\n", "output": "1\n999999932\n", "type": "code"}, {"input": "999999979\n", "output": "2\n999999899\n999999908\n", "type": "code"}, {"input": "9\n", "output": "0\n", "type": "code"}, {"input": "10\n", "output": "1\n5\n", "type": "code"}, {"input": "11\n", "output": "1\n10\n", "type": "code"}, {"input": "39\n", "output": "1\n33\n", "type": "code"}, {"input": "66\n", "output": "1\n60\n", "type": "code"}, {"input": "75\n", "output": "0\n", "type": "code"}, {"input": "100\n", "output": "1\n86\n", "type": "code"}, {"input": "101\n", "output": "2\n91\n100\n", "type": "code"}, {"input": "2014\n", "output": "2\n1988\n2006\n", "type": "code"}, {"input": "999999994\n", "output": "0\n", "type": "code"}] | 0ecede119f4a93897ddd3f8b9d2322f8 | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a non-empty string s consisting of lowercase English letters. You have to pick exactly one non-empty substring of s and shift all its letters 'z' $\\rightarrow$ 'y' $\\rightarrow$ 'x' $\\rightarrow \\ldots \... | [{"input": "codeforces\n", "output": "bncdenqbdr\n", "type": "code"}, {"input": "abacaba\n", "output": "aaacaba\n", "type": "code"}, {"input": "babbbabaababbaa\n", "output": "aabbbabaababbaa\n", "type": "code"}, {"input": "bcbacaabcababaccccaaaabacbbcbbaa\n", "output": "abaacaabcababaccccaaaabacbbcbbaa\n", "type": "code"}, {"input": "cabaccaacccabaacdbdcbcdbccbccbabbdadbdcdcdbdbcdcdbdadcbcda\n", "output": "babaccaacccabaacdbdcbcdbccbccbabbdadbdcdcdbdbcdcdbdadcbcda\n", "type": "code"}, {"input": "a\n", "output": "z\n", "type": "code"}, {"input": "eeeedddccbceaabdaecaebaeaecccbdeeeaadcecdbeacecdcdcceabaadbcbbadcdaeddbcccaaeebccecaeeeaebcaaccbdaccbdcadadaaeacbbdcbaeeaecedeeeedadec\n", "output": "ddddcccbbabdaabdaecaebaeaecccbdeeeaadcecdbeacecdcdcceabaadbcbbadcdaeddbcccaaeebccecaeeeaebcaaccbdaccbdcadadaaeacbbdcbaeeaecedeeeedadec\n", "type": "code"}, {"input": "fddfbabadaadaddfbfecadfaefaefefabcccdbbeeabcbbddefbafdcafdfcbdffeeaffcaebbbedabddeaecdddffcbeaafffcddccccfffdbcddcfccefafdbeaacbdeeebdeaaacdfdecadfeafaeaefbfdfffeeaefebdceebcebbfeaccfafdccdcecedeedadcadbfefccfdedfaaefabbaeebdebeecaadbebcfeafbfeeefcfaecadfe\n", "output": "ecceaabadaadaddfbfecadfaefaefefabcccdbbeeabcbbddefbafdcafdfcbdffeeaffcaebbbedabddeaecdddffcbeaafffcddccccfffdbcddcfccefafdbeaacbdeeebdeaaacdfdecadfeafaeaefbfdfffeeaefebdceebcebbfeaccfafdccdcecedeedadcadbfefccfdedfaaefabbaeebdebeecaadbebcfeafbfeeefcfaecadfe\n", "type": "code"}, {"input": "aaaaaaaaaa\n", "output": "aaaaaaaaaz\n", "type": "code"}, {"input": "abbabaaaaa\n", "output": "aaaabaaaaa\n", "type": "code"}, {"input": "bbbbbbbbbbbb\n", "output": "aaaaaaaaaaaa\n", "type": "code"}, {"input": "aabaaaaaaaaaaaa\n", "output": "aaaaaaaaaaaaaaa\n", "type": "code"}, {"input": "aaaaaaaaaaaaaaaaaaaa\n", "output": "aaaaaaaaaaaaaaaaaaaz\n", "type": "code"}, {"input": "abaabaaaaaabbaaaaaaabaaaaaaaaabaaaabaaaaaaabaaaaaaaaaabaaaaaaaaaaaaaaabaaaabbaaaaabaaaaaaaabaaaaaaaa\n", "output": "aaaabaaaaaabbaaaaaaabaaaaaaaaabaaaabaaaaaaabaaaaaaaaaabaaaaaaaaaaaaaaabaaaabbaaaaabaaaaaaaabaaaaaaaa\n", "type": "code"}, {"input": "abbbbbbbabbbbbbbbbbbbbbbbbbbbbbbabbabbbbbabbbbbbbbbbbabbbbbbbbabbabbbbbbbbbbbbbbabbabbbaababbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbabbabbbbbbbbbbbbbbbbabbbbabbbbbbbbbbbbbbbabbbbbbbbbaababbbbbbbbabbbbbbbbbbbbbbbbbbbbbbbbbbbbabbbbbbbbbbbbbbbbbbbbabbabbbbbbbbbbbbbbbbabbbabbbbbaabbabbbbbbbbbbbbbbbbbbbbbbbbbbbbbabbbbbbbbbbbbbbbbaabbbbbbbbbbbbababbabbbbbbbbbbbbbbbbbbbbbbbbabbbbbbbbbbbbbbbabbbbbbbbbbbabbbbbbbbbbbbbbbbbbbbbbabbbbbbbabbbbbbb\n", "output": "aaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbabbabbbbbabbbbbbbbbbbabbbbbbbbabbabbbbbbbbbbbbbbabbabbbaababbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbabbabbbbbbbbbbbbbbbbabbbbabbbbbbbbbbbbbbbabbbbbbbbbaababbbbbbbbabbbbbbbbbbbbbbbbbbbbbbbbbbbbabbbbbbbbbbbbbbbbbbbbabbabbbbbbbbbbbbbbbbabbbabbbbbaabbabbbbbbbbbbbbbbbbbbbbbbbbbbbbbabbbbbbbbbbbbbbbbaabbbbbbbbbbbbababbabbbbbbbbbbbbbbbbbbbbbbbbabbbbbbbbbbbbbbbabbbbbbbbbbbabbbbbbbbbbbbbbbbbbbbbbabbbbbbbabbbbbbb\n", "type": "code"}, {"input": "aaaaa\n", "output": "aaaaz\n", "type": "code"}, {"input": "aaa\n", "output": "aaz\n", "type": "code"}, {"input": "aa\n", "output": "az\n", "type": "code"}] | c3fe68424d5c8380acdd9a13fb2bcd38 | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGennady is one of the best child dentists in Berland. Today n children got an appointment with him, they lined up in front of his office.\n\nAll children love to cry loudly at the reception at the dentist. We enumerate th... | [{"input": "5\n4 2 2\n4 1 2\n5 2 4\n3 3 5\n5 1 2\n", "output": "2\n1 3 ", "type": "code"}, {"input": "5\n4 5 1\n5 3 9\n4 1 2\n2 1 8\n4 1 9\n", "output": "4\n1 2 4 5 ", "type": "code"}, {"input": "10\n10 7 10\n3 6 11\n8 4 10\n10 1 11\n7 3 13\n7 2 13\n7 6 14\n3 4 17\n9 4 20\n5 2 24\n", "output": "3\n1 2 5 ", "type": "code"}, {"input": "10\n5 6 3\n7 4 10\n9 1 17\n2 8 23\n9 10 24\n6 8 18\n3 2 35\n7 6 6\n1 3 12\n9 9 5\n", "output": "6\n1 2 3 4 5 7 ", "type": "code"}, {"input": "10\n4 9 1\n8 2 14\n7 10 20\n6 9 18\n5 3 19\n2 9 7\n6 8 30\n8 7 38\n6 5 5\n6 9 37\n", "output": "8\n1 2 3 4 5 7 8 10 ", "type": "code"}, {"input": "10\n10 3 3\n8 6 17\n9 5 26\n10 7 17\n3 10 29\n3 1 27\n3 3 7\n8 10 28\n1 3 23\n3 4 6\n", "output": "5\n1 2 3 5 8 ", "type": "code"}, {"input": "10\n5 6 1\n9 2 6\n4 1 5\n4 10 5\n1 8 23\n9 4 21\n3 9 6\n7 8 34\n7 4 24\n8 9 21\n", "output": "5\n1 2 5 6 8 ", "type": "code"}, {"input": "4\n2 10 1\n1 2 2\n2 1 1\n5 5 1\n", "output": "3\n1 2 4 ", "type": "code"}, {"input": "1\n1 1 1\n", "output": "1\n1 ", "type": "code"}, {"input": "2\n5 1 1\n1 1 5\n", "output": "2\n1 2 ", "type": "code"}, {"input": "2\n5 1 1\n1 1 4\n", "output": "1\n1 ", "type": "code"}, {"input": "2\n5 1 1\n1 1 6\n", "output": "2\n1 2 ", "type": "code"}, {"input": "3\n5 1 1\n1 1 4\n1 1 4\n", "output": "1\n1 ", "type": "code"}, {"input": "3\n5 1 1\n1 1 4\n1 1 5\n", "output": "2\n1 3 ", "type": "code"}, {"input": "3\n5 1 1\n1 1 5\n1 1 3\n", "output": "2\n1 2 ", "type": "code"}, {"input": "3\n5 1 1\n10 1 5\n1000 1000 14\n", "output": "3\n1 2 3 ", "type": "code"}, {"input": "10\n9 8 8\n2 9 33\n10 7 42\n7 2 18\n3 5 82\n9 9 25\n3 2 86\n3 5 49\n5 3 72\n4 4 71\n", "output": "10\n1 2 3 4 5 6 7 8 9 10 ", "type": "code"}, {"input": "10\n9 8 8\n2 9 8\n10 7 16\n7 2 9\n3 5 23\n9 9 25\n3 2 35\n3 5 36\n5 3 40\n4 4 42\n", "output": "1\n1 ", "type": "code"}] | f5021c47be588c5cb0a7acc990f58cf8 | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYaroslav is playing a game called \"Time\". The game has a timer showing the lifespan he's got left. As soon as the timer shows 0, Yaroslav's character dies and the game ends. Also, the game has n clock stations, station ... | [{"input": "3 1000\n1000\n0 0\n0 1\n0 3\n", "output": "2000\n", "type": "code"}, {"input": "3 1000\n1000\n1 0\n1 1\n1 2\n", "output": "1000\n", "type": "code"}, {"input": "5 1421\n896 448 727\n-19 -40\n-87 40\n69 51\n-55 61\n-7 67\n", "output": "169099\n", "type": "code"}, {"input": "6 1000\n142 712 254 869\n7 0\n95 38\n96 -20\n-7 93\n75 -45\n-80 -20\n", "output": "107000\n", "type": "code"}, {"input": "7 1288\n943 265 649 447 806\n-4 -51\n-26 32\n47 -28\n31 32\n61 65\n-45 -37\n82 42\n", "output": "229903\n", "type": "code"}, {"input": "8 1931\n440 627 324 538 539 119\n-85 -41\n-91 61\n-84 11\n92 -19\n8 -5\n16 -25\n97 -98\n91 78\n", "output": "569018\n", "type": "code"}, {"input": "9 1829\n98 513 987 291 162 637 356\n38 -3\n-89 93\n-86 45\n-43 -84\n-3 -87\n53 -59\n18 -19\n81 -74\n-85 32\n", "output": "288982\n", "type": "code"}, {"input": "10 1000\n759 222 589 423 947 507 31 414\n-4 -71\n-31 -53\n24 28\n-13 -65\n-59 -49\n-42 -79\n85 -71\n-60 -17\n28 66\n74 2\n", "output": "151000\n", "type": "code"}, {"input": "11 1199\n282 735 54 1000 419 939 901 789 128\n10 -81\n26 72\n19 -91\n-61 85\n0 -33\n-62 79\n-59 65\n-2 -77\n-63 100\n-15 53\n94 54\n", "output": "262581\n", "type": "code"}, {"input": "12 1609\n196 486 94 344 524 588 315 504 449 201\n86 -22\n-2 25\n-95 -8\n-5 -30\n-78 71\n5 -54\n-69 -92\n-41 0\n10 19\n61 17\n75 -39\n-46 22\n", "output": "282231\n", "type": "code"}, {"input": "3 97325\n40\n43 43\n45 -95\n-93 63\n", "output": "15182700\n", "type": "code"}, {"input": "11 1615\n137 681 199 33 388 585 241 518 7\n-60 89\n24 6\n-100 -55\n-26 -90\n-40 -33\n-100 28\n12 34\n-60 -13\n38 -89\n62 81\n-35 54\n", "output": "96900\n", "type": "code"}, {"input": "4 62071\n706 480\n6 96\n51 -12\n99 66\n-69 -61\n", "output": "14400472\n", "type": "code"}, {"input": "12 1542\n389 356 290 648 182 94 585 988 762 494\n-46 96\n1 88\n0 95\n-91 -100\n-42 -29\n45 -27\n-52 -34\n-62 27\n-19 46\n-100 95\n5 -55\n-36 -65\n", "output": "263034\n", "type": "code"}, {"input": "3 100000\n1\n-100 -100\n-100 -99\n100 100\n", "output": "39999999\n", "type": "code"}, {"input": "12 1211\n1 5 7 1000 1000 1000 1000 1000 1000 1000\n1 1\n5 5\n3 4\n4 3\n0 1\n0 2\n0 5\n0 7\n1 0\n3 0\n8 0\n10 10\n", "output": "20220\n", "type": "code"}, {"input": "6 1000\n1000 1000 1000 1000\n0 0\n0 -1\n1 -1\n2 -1\n2 0\n2 1\n", "output": "1000\n", "type": "code"}] | fad468c4d7507192f445729d3c0cdef0 | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSquirrel Liss lived in a forest peacefully, but unexpected trouble happens. Stones fall from a mountain. Initially Squirrel Liss occupies an interval [0, 1]. Next, n stones will fall and Liss will escape from the stones. ... | [{"input": "llrlr\n", "output": "3\n5\n4\n2\n1\n", "type": "code"}, {"input": "rrlll\n", "output": "1\n2\n5\n4\n3\n", "type": "code"}, {"input": "lrlrr\n", "output": "2\n4\n5\n3\n1\n", "type": "code"}, {"input": "lllrlrllrl\n", "output": "4\n6\n9\n10\n8\n7\n5\n3\n2\n1\n", "type": "code"}, {"input": "llrlrrrlrr\n", "output": "3\n5\n6\n7\n9\n10\n8\n4\n2\n1\n", "type": "code"}, {"input": "rlrrrllrrr\n", "output": "1\n3\n4\n5\n8\n9\n10\n7\n6\n2\n", "type": "code"}, {"input": "lrrlrrllrrrrllllllrr\n", "output": "2\n3\n5\n6\n9\n10\n11\n12\n19\n20\n18\n17\n16\n15\n14\n13\n8\n7\n4\n1\n", "type": "code"}, {"input": "rlrrrlrrrllrrllrlrll\n", "output": "1\n3\n4\n5\n7\n8\n9\n12\n13\n16\n18\n20\n19\n17\n15\n14\n11\n10\n6\n2\n", "type": "code"}, {"input": "lllrrlrlrllrrrrrllrl\n", "output": "4\n5\n7\n9\n12\n13\n14\n15\n16\n19\n20\n18\n17\n11\n10\n8\n6\n3\n2\n1\n", "type": "code"}, {"input": "rrrllrrrlllrlllrlrrr\n", "output": "1\n2\n3\n6\n7\n8\n12\n16\n18\n19\n20\n17\n15\n14\n13\n11\n10\n9\n5\n4\n", "type": "code"}, {"input": "rrlllrrrlrrlrrrlllrlrlrrrlllrllrrllrllrrlrlrrllllrlrrrrlrlllrlrrrlrlrllrlrlrrlrrllrrrlrlrlllrrllllrl\n", "output": "1\n2\n6\n7\n8\n10\n11\n13\n14\n15\n19\n21\n23\n24\n25\n29\n32\n33\n36\n39\n40\n42\n44\n45\n50\n52\n53\n54\n55\n57\n61\n63\n64\n65\n67\n69\n72\n74\n76\n77\n79\n80\n83\n84\n85\n87\n89\n93\n94\n99\n100\n98\n97\n96\n95\n92\n91\n90\n88\n86\n82\n81\n78\n75\n73\n71\n70\n68\n66\n62\n60\n59\n58\n56\n51\n49\n48\n47\n46\n43\n41\n38\n37\n35\n34\n31\n30\n28\n27\n26\n22\n20\n18\n17\n16\n12\n9\n5\n4\n3\n", "type": "code"}, {"input": "llrlrlllrrllrllllrlrrlrlrrllrlrlrrlrrrrrrlllrrlrrrrrlrrrlrlrlrrlllllrrrrllrrlrlrrrllllrlrrlrrlrlrrll\n", "output": "3\n5\n9\n10\n13\n18\n20\n21\n23\n25\n26\n29\n31\n33\n34\n36\n37\n38\n39\n40\n41\n45\n46\n48\n49\n50\n51\n52\n54\n55\n56\n58\n60\n62\n63\n69\n70\n71\n72\n75\n76\n78\n80\n81\n82\n87\n89\n90\n92\n93\n95\n97\n98\n100\n99\n96\n94\n91\n88\n86\n85\n84\n83\n79\n77\n74\n73\n68\n67\n66\n65\n64\n61\n59\n57\n53\n47\n44\n43\n42\n35\n32\n30\n28\n27\n24\n22\n19\n17\n16\n15\n14\n12\n11\n8\n7\n6\n4\n2\n1\n", "type": "code"}, {"input": "llrrrrllrrlllrlrllrlrllllllrrrrrrrrllrrrrrrllrlrrrlllrrrrrrlllllllrrlrrllrrrllllrrlllrrrlrlrrlrlrllr\n", "output": "3\n4\n5\n6\n9\n10\n14\n16\n19\n21\n28\n29\n30\n31\n32\n33\n34\n35\n38\n39\n40\n41\n42\n43\n46\n48\n49\n50\n54\n55\n56\n57\n58\n59\n67\n68\n70\n71\n74\n75\n76\n81\n82\n86\n87\n88\n90\n92\n93\n95\n97\n100\n99\n98\n96\n94\n91\n89\n85\n84\n83\n80\n79\n78\n77\n73\n72\n69\n66\n65\n64\n63\n62\n61\n60\n53\n52\n51\n47\n45\n44\n37\n36\n27\n26\n25\n24\n23\n22\n20\n18\n17\n15\n13\n12\n11\n8\n7\n2\n1\n", "type": "code"}, {"input": "lllllrllrrlllrrrllrrrrlrrlrllllrrrrrllrlrllllllrrlrllrlrllrlrrlrlrrlrrrlrrrrllrlrrrrrrrllrllrrlrllrl\n", "output": "6\n9\n10\n14\n15\n16\n19\n20\n21\n22\n24\n25\n27\n32\n33\n34\n35\n36\n39\n41\n48\n49\n51\n54\n56\n59\n61\n62\n64\n66\n67\n69\n70\n71\n73\n74\n75\n76\n79\n81\n82\n83\n84\n85\n86\n87\n90\n93\n94\n96\n99\n100\n98\n97\n95\n92\n91\n89\n88\n80\n78\n77\n72\n68\n65\n63\n60\n58\n57\n55\n53\n52\n50\n47\n46\n45\n44\n43\n42\n40\n38\n37\n31\n30\n29\n28\n26\n23\n18\n17\n13\n12\n11\n8\n7\n5\n4\n3\n2\n1\n", "type": "code"}, {"input": "llrlrlrlrlrlrrlllllllrllllrllrrrlllrrllrllrrlllrrlllrlrrllllrrlllrrllrrllllrrlllrlllrrrllrrrrrrllrrl\n", "output": "3\n5\n7\n9\n11\n13\n14\n22\n27\n30\n31\n32\n36\n37\n40\n43\n44\n48\n49\n53\n55\n56\n61\n62\n66\n67\n70\n71\n76\n77\n81\n85\n86\n87\n90\n91\n92\n93\n94\n95\n98\n99\n100\n97\n96\n89\n88\n84\n83\n82\n80\n79\n78\n75\n74\n73\n72\n69\n68\n65\n64\n63\n60\n59\n58\n57\n54\n52\n51\n50\n47\n46\n45\n42\n41\n39\n38\n35\n34\n33\n29\n28\n26\n25\n24\n23\n21\n20\n19\n18\n17\n16\n15\n12\n10\n8\n6\n4\n2\n1\n", "type": "code"}, {"input": "l\n", "output": "1\n", "type": "code"}, {"input": "r\n", "output": "1\n", "type": "code"}] | 70b847f33e91009117e6f69afc3b9d61 | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDreamoon likes coloring cells very much.\n\nThere is a row of $n$ cells. Initially, all cells are empty (don't contain any color). Cells are numbered from $1$ to $n$.\n\nYou are given an integer $m$ and $m$ integers $l_1,... | [{"input": "5 3\n3 2 2\n", "output": "1 2 4\n", "type": "code"}, {"input": "10 1\n1\n", "output": "-1\n", "type": "code"}, {"input": "1 1\n1\n", "output": "1\n", "type": "code"}, {"input": "2 2\n1 2\n", "output": "-1\n", "type": "code"}, {"input": "200 50\n49 35 42 47 134 118 14 148 58 159 33 33 8 123 99 126 75 94 1 141 61 79 122 31 48 7 66 97 141 43 25 141 7 56 120 55 49 37 154 56 13 59 153 133 18 1 141 24 151 125\n", "output": "1 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 76\n", "type": "code"}, {"input": "3 3\n3 3 1\n", "output": "-1\n", "type": "code"}, {"input": "100000 1\n100000\n", "output": "1\n", "type": "code"}, {"input": "2000 100\n5 128 1368 1679 1265 313 1854 1512 1924 338 38 1971 238 1262 1834 1878 1749 784 770 1617 191 395 303 214 1910 1300 741 1966 1367 24 268 403 1828 1033 1424 218 1146 925 1501 1760 1164 1881 1628 1596 1358 1360 29 1343 922 618 1537 1839 1114 1381 704 464 692 1450 1590 1121 670 300 1053 1730 1024 1292 1549 1112 1028 1096 794 38 1121 261 618 1489 587 1841 627 707 1693 1693 1867 1402 803 321 475 410 1664 1491 1846 1279 1250 457 1010 518 1785 514 1656 1588\n", "output": "1 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 413\n", "type": "code"}, {"input": "10000 3\n3376 5122 6812\n", "output": "1 2 3189\n", "type": "code"}, {"input": "99999 30\n31344 14090 93157 5965 57557 41264 93881 58871 57763 46958 96029 37297 75623 12215 38442 86773 66112 7512 31968 28331 90390 79301 56205 704 15486 63054 83372 45602 15573 78459\n", "output": "1 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 5968 21541\n", "type": "code"}, {"input": "100000 10\n31191 100000 99999 99999 99997 100000 99996 99994 99995 99993\n", "output": "-1\n", "type": "code"}, {"input": "1000 2\n1 1\n", "output": "-1\n", "type": "code"}, {"input": "10 3\n1 9 2\n", "output": "1 2 9\n", "type": "code"}, {"input": "6 3\n2 2 6\n", "output": "-1\n", "type": "code"}, {"input": "100 3\n45 10 45\n", "output": "1 46 56\n", "type": "code"}, {"input": "6 3\n1 2 2\n", "output": "-1\n", "type": "code"}, {"input": "9 3\n9 3 1\n", "output": "1 6 9\n", "type": "code"}] | 06f05ea33743355af9697660fb9f09da | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou work in a big office. It is a 9 floor building with an elevator that can accommodate up to 4 people. It is your responsibility to manage this elevator.\n\nToday you are late, so there are queues on some floors already... | [{"input": "2\n3 5\n5 3\n", "output": "10", "type": "code"}, {"input": "2\n5 3\n3 5\n", "output": "12", "type": "code"}, {"input": "9\n1 2\n2 3\n3 4\n4 5\n5 6\n6 7\n7 8\n8 9\n9 1\n", "output": "34", "type": "code"}, {"input": "50\n9 5\n2 6\n5 4\n7 5\n3 6\n5 8\n1 2\n6 1\n9 7\n8 1\n9 5\n6 8\n6 8\n2 8\n4 9\n6 7\n7 8\n5 8\n1 2\n9 2\n5 9\n6 7\n3 2\n9 8\n7 8\n7 4\n6 5\n1 7\n6 5\n2 6\n3 1\n6 5\n3 7\n9 3\n8 1\n8 3\n8 2\n1 9\n9 2\n3 2\n8 7\n5 1\n6 2\n2 1\n6 1\n3 4\n4 1\n2 3\n2 6\n2 9\n", "output": "278", "type": "code"}, {"input": "50\n8 9\n6 7\n6 8\n4 1\n3 2\n9 3\n8 3\n9 7\n4 6\n4 6\n5 6\n7 2\n6 3\n1 3\n8 2\n4 6\n6 8\n7 6\n8 6\n9 4\n8 6\n9 1\n3 8\n3 1\n4 7\n4 9\n9 1\n7 4\n3 5\n1 7\n3 5\n8 9\n5 4\n2 9\n2 9\n3 9\n8 5\n4 9\n9 4\n5 6\n6 1\n4 2\n3 9\n9 1\n9 4\n4 5\n2 4\n2 6\n3 6\n1 9\n", "output": "252", "type": "code"}, {"input": "50\n3 9\n8 9\n7 2\n9 1\n5 2\n2 8\n2 4\n8 6\n4 6\n1 6\n5 3\n3 8\n8 2\n6 7\n7 1\n2 4\n2 8\n3 7\n7 1\n7 9\n9 3\n7 2\n2 7\n8 4\n5 8\n6 8\n7 1\n7 5\n5 6\n9 1\n8 6\n3 6\n7 6\n4 3\n3 2\n9 2\n4 9\n2 1\n7 9\n1 8\n4 9\n5 2\n7 2\n9 8\n3 1\n4 5\n3 4\n2 7\n2 1\n6 1\n", "output": "260", "type": "code"}, {"input": "50\n7 1\n4 8\n9 3\n9 3\n2 4\n5 9\n1 5\n1 4\n7 6\n4 8\n3 6\n2 8\n5 1\n8 9\n7 4\n7 2\n2 4\n7 9\n8 7\n3 8\n1 7\n4 5\n7 2\n6 4\n6 1\n4 8\n5 6\n4 3\n6 5\n6 4\n6 9\n2 5\n9 3\n3 4\n3 4\n9 3\n7 9\n5 8\n1 6\n5 1\n8 3\n7 4\n1 8\n5 2\n1 7\n6 1\n9 6\n3 1\n6 5\n9 7\n", "output": "274", "type": "code"}, {"input": "50\n1 9\n9 4\n4 2\n2 4\n3 8\n9 5\n3 2\n8 3\n8 1\n4 7\n5 3\n2 6\n1 8\n6 5\n4 1\n5 7\n1 4\n4 7\n5 4\n8 2\n4 6\n8 7\n1 9\n1 6\n6 4\n5 2\n5 3\n2 6\n4 6\n5 2\n6 7\n5 3\n9 5\n8 3\n1 9\n2 6\n5 1\n7 3\n4 3\n7 2\n4 3\n5 7\n6 8\n8 2\n3 6\n4 9\n1 8\n7 8\n5 4\n7 6\n", "output": "258", "type": "code"}, {"input": "50\n5 9\n1 2\n6 9\n1 6\n8 1\n5 3\n2 1\n2 7\n6 1\n4 3\n6 1\n2 6\n2 8\n2 1\n3 4\n6 2\n4 8\n6 4\n2 1\n1 5\n4 9\n6 8\n4 1\n1 6\n1 5\n5 9\n2 6\n6 9\n4 2\n4 7\n8 2\n4 6\n2 5\n9 4\n3 1\n8 4\n3 9\n1 3\n2 3\n8 7\n5 4\n2 6\n9 5\n6 2\n5 8\n2 8\n8 9\n9 2\n5 3\n9 1\n", "output": "282", "type": "code"}, {"input": "50\n9 8\n8 9\n2 3\n2 6\n7 6\n9 8\n7 5\n8 5\n2 9\n4 2\n4 6\n9 4\n1 9\n4 8\n7 9\n7 4\n4 7\n7 6\n8 9\n2 8\n1 3\n6 7\n6 3\n1 8\n9 3\n4 9\n9 6\n4 2\n6 5\n3 8\n9 3\n7 5\n9 6\n5 6\n4 7\n5 7\n9 1\n7 5\n5 6\n3 1\n4 3\n7 1\n9 8\n7 8\n3 7\n8 3\n9 6\n5 7\n1 8\n6 4\n", "output": "275", "type": "code"}, {"input": "9\n2 1\n5 9\n2 6\n2 6\n4 7\n7 3\n3 1\n3 1\n7 8\n", "output": "46", "type": "code"}, {"input": "5\n1 7\n2 5\n8 6\n3 4\n1 6\n", "output": "29", "type": "code"}, {"input": "4\n2 1\n1 7\n5 8\n8 4\n", "output": "21", "type": "code"}, {"input": "1\n1 9\n", "output": "10", "type": "code"}, {"input": "1\n9 1\n", "output": "18", "type": "code"}, {"input": "1\n1 5\n", "output": "6", "type": "code"}, {"input": "1\n8 6\n", "output": "11", "type": "code"}] | 60983c5a237c58f8c7adfd7090660001 | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nToad Zitz has an array of integers, each integer is between $0$ and $m-1$ inclusive. The integers are $a_1, a_2, \\ldots, a_n$.\n\nIn one operation Zitz can choose an integer $k$ and $k$ indices $i_1, i_2, \\ldots, i_k$ s... | [{"input": "5 3\n0 0 0 1 2\n", "output": "0\n", "type": "code"}, {"input": "5 7\n0 6 1 3 2\n", "output": "1\n", "type": "code"}, {"input": "10 10\n5 0 5 9 4 6 4 5 0 0\n", "output": "6\n", "type": "code"}, {"input": "4 6\n0 3 5 1\n", "output": "3\n", "type": "code"}, {"input": "6 4\n1 3 0 2 1 0\n", "output": "2\n", "type": "code"}, {"input": "10 1000\n981 824 688 537 969 72 39 734 929 718\n", "output": "463\n", "type": "code"}, {"input": "10 300000\n111862 91787 271781 182224 260248 142019 30716 102643 141870 19206\n", "output": "208213\n", "type": "code"}, {"input": "100 10\n8 4 4 9 0 7 9 5 1 1 2 3 7 1 8 4 8 8 6 0 8 7 8 3 7 0 6 4 8 4 2 7 0 0 3 8 4 4 2 0 0 4 7 2 4 7 9 1 3 3 6 2 9 6 0 6 3 5 6 5 5 3 0 0 8 7 1 4 2 4 1 3 9 7 9 0 6 6 7 4 2 3 7 1 7 3 5 1 4 3 7 5 7 5 0 5 1 9 0 9\n", "output": "8\n", "type": "code"}, {"input": "100 1\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 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\n", "output": "0\n", "type": "code"}, {"input": "100 2\n1 1 0 1 0 1 0 0 0 1 0 1 0 0 1 1 1 1 1 0 1 1 1 1 1 1 0 0 0 1 1 0 1 0 0 0 0 0 1 1 1 1 1 0 0 0 0 1 1 1 1 0 1 0 0 1 0 0 1 0 1 0 1 1 1 0 1 1 0 1 1 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 1 0 0 0 0 0 1 0 0 0 0 1 1 1\n", "output": "1\n", "type": "code"}, {"input": "100 1000\n980 755 745 448 424 691 210 545 942 979 555 783 425 942 495 741 487 514 752 434 187 874 372 617 414 505 659 445 81 397 243 986 441 587 31 350 831 801 194 103 723 166 108 182 252 846 328 905 639 690 738 638 986 340 559 626 572 808 442 410 179 549 880 153 449 99 434 945 163 687 173 797 999 274 975 626 778 456 407 261 988 43 25 391 937 856 54 110 884 937 940 205 338 250 903 244 424 871 979 810\n", "output": "860\n", "type": "code"}, {"input": "1 1\n0\n", "output": "0\n", "type": "code"}, {"input": "10 10\n1 2 3 4 5 6 7 8 9 0\n", "output": "9\n", "type": "code"}, {"input": "2 1\n0 0\n", "output": "0\n", "type": "code"}, {"input": "2 2\n0 1\n", "output": "0\n", "type": "code"}, {"input": "2 2\n1 0\n", "output": "1\n", "type": "code"}] | 7e437f40a9c6a1c8cc0450a60244fa24 | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe life goes up and down, just like nice sequences. Sequence t_1, t_2, ..., t_{n} is called nice if the following two conditions are satisfied: t_{i} < t_{i} + 1 for each odd i < n; t_{i} > t_{i} + 1 for each even i <... | [{"input": "5\n2 8 4 7 7\n", "output": "2\n", "type": "code"}, {"input": "4\n200 150 100 50\n", "output": "1\n", "type": "code"}, {"input": "10\n3 2 1 4 1 4 1 4 1 4\n", "output": "8\n", "type": "code"}, {"input": "9\n1 2 3 4 5 6 7 8 9\n", "output": "0\n", "type": "code"}, {"input": "5\n1 1 1 4 3\n", "output": "1\n", "type": "code"}, {"input": "10\n7 7 8 10 5 10 1 5 2 6\n", "output": "2\n", "type": "code"}, {"input": "50\n11836 28308 72527 92281 139289 93797 134555 148444 40866 111317 21564 87813 65466 20541 99238 2287 74647 128071 18163 61672 39766 55589 138385 147443 138100 142683 60703 15444 52566 72976 147412 116006 115986 110545 79993 100440 9876 71470 75209 62443 64906 88987 72232 2246 63160 45041 729 148611 103397 78474\n", "output": "0\n", "type": "code"}, {"input": "10\n522 309 276 454 566 978 175 388 289 276\n", "output": "0\n", "type": "code"}, {"input": "20\n8 9 1 10 7 9 5 8 5 7 5 6 1 3 2 7 3 2 6 9\n", "output": "3\n", "type": "code"}, {"input": "25\n25 20 58 95 47 68 38 39 24 83 36 68 28 67 25 40 62 99 11 88 74 75 38 90 42\n", "output": "1\n", "type": "code"}, {"input": "30\n18647 31594 58075 122543 49766 65303 48728 102863 22542 140297 5300 90685 50141 86948 27074 40214 17945 147095 97758 140835 121469 139920 63817 138623 85609 110002 70046 128002 122139 116109\n", "output": "1\n", "type": "code"}, {"input": "39\n18329 39326 21115 36341 3916 40060 23262 41923 17476 42107 17052 23198 10756 32540 14873 28454 23912 35765 9459 45834 85 46756 31859 40087 35420 47585 9781 46544 31859 49453 7394 17459 2816 34051 12519 4077 692 44098 23345\n", "output": "15\n", "type": "code"}, {"input": "2\n5 1\n", "output": "1\n", "type": "code"}, {"input": "2\n10 10\n", "output": "0\n", "type": "code"}, {"input": "6\n1 1 1 2 2 2\n", "output": "1\n", "type": "code"}, {"input": "12\n10 15 10 15 10 8 10 15 10 20 30 20\n", "output": "1\n", "type": "code"}] | 4331e6a5fd972d9e49d9a6cbeb31dd95 | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya's telephone contains n photos. Photo number 1 is currently opened on the phone. It is allowed to move left and right to the adjacent photo by swiping finger over the screen. If you swipe left from the first photo, y... | [{"input": "4 2 3 10\nwwhw\n", "output": "2\n", "type": "code"}, {"input": "5 2 4 13\nhhwhh\n", "output": "4\n", "type": "code"}, {"input": "5 2 4 1000\nhhwhh\n", "output": "5\n", "type": "code"}, {"input": "3 1 100 10\nwhw\n", "output": "0\n", "type": "code"}, {"input": "10 2 3 32\nhhwwhwhwwh\n", "output": "7\n", "type": "code"}, {"input": "1 2 3 3\nw\n", "output": "0\n", "type": "code"}, {"input": "100 20 100 10202\nwwwwhhwhhwhhwhhhhhwwwhhhwwwhwwhwhhwwhhwwwhwwhwwwhwhwhwwhhhwhwhhwhwwhhwhwhwwwhwwwwhwhwwwwhwhhhwhwhwww\n", "output": "100\n", "type": "code"}, {"input": "20 10 10 1\nhwhwhwhwhwhwhwhwhhhw\n", "output": "1\n", "type": "code"}, {"input": "12 10 10 1\nwhwhwhwhwhwh\n", "output": "0\n", "type": "code"}, {"input": "2 5 5 1000000000\nwh\n", "output": "2\n", "type": "code"}, {"input": "16 1 1000 2100\nhhhwwwhhhwhhhwww\n", "output": "5\n", "type": "code"}, {"input": "5 2 4 13\nhhhwh\n", "output": "4\n", "type": "code"}, {"input": "7 1 1000 13\nhhhhwhh\n", "output": "6\n", "type": "code"}, {"input": "10 1 1000 10\nhhhhhhwwhh\n", "output": "5\n", "type": "code"}, {"input": "7 1 100 8\nhhhwwwh\n", "output": "4\n", "type": "code"}, {"input": "5 2 4 12\nhhhwh\n", "output": "4\n", "type": "code"}] | 168294c0edec72a1057446a83d8e34c8 | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDoubly linked list is one of the fundamental data structures. A doubly linked list is a sequence of elements, each containing information about the previous and the next elements of the list. In this problem all lists hav... | [{"input": "7\n4 7\n5 0\n0 0\n6 1\n0 2\n0 4\n1 0\n", "output": "4 7\n5 6\n0 5\n6 1\n3 2\n2 4\n1 0\n", "type": "code"}, {"input": "2\n2 0\n0 1\n", "output": "2 0\n0 1\n", "type": "code"}, {"input": "1\n0 0\n", "output": "0 0\n", "type": "code"}, {"input": "4\n0 2\n1 0\n0 4\n3 0\n", "output": "0 2\n1 3\n2 4\n3 0\n", "type": "code"}, {"input": "5\n0 0\n0 0\n0 0\n0 0\n0 0\n", "output": "0 2\n1 3\n2 4\n3 5\n4 0\n", "type": "code"}, {"input": "2\n0 0\n0 0\n", "output": "0 2\n1 0\n", "type": "code"}, {"input": "2\n0 2\n1 0\n", "output": "0 2\n1 0\n", "type": "code"}, {"input": "5\n5 3\n4 0\n1 4\n3 2\n0 1\n", "output": "5 3\n4 0\n1 4\n3 2\n0 1\n", "type": "code"}, {"input": "5\n2 0\n0 1\n0 4\n3 5\n4 0\n", "output": "2 3\n0 1\n1 4\n3 5\n4 0\n", "type": "code"}, {"input": "5\n3 4\n0 0\n0 1\n1 0\n0 0\n", "output": "3 4\n0 3\n2 1\n1 5\n4 0\n", "type": "code"}, {"input": "5\n3 0\n0 0\n0 1\n0 0\n0 0\n", "output": "3 4\n0 3\n2 1\n1 5\n4 0\n", "type": "code"}, {"input": "10\n7 5\n5 0\n4 7\n10 3\n1 2\n0 9\n3 1\n9 10\n6 8\n8 4\n", "output": "7 5\n5 0\n4 7\n10 3\n1 2\n0 9\n3 1\n9 10\n6 8\n8 4\n", "type": "code"}, {"input": "10\n6 2\n1 0\n9 4\n3 6\n10 8\n4 1\n0 10\n5 0\n0 3\n7 5\n", "output": "6 2\n1 0\n9 4\n3 6\n10 8\n4 1\n0 10\n5 9\n8 3\n7 5\n", "type": "code"}, {"input": "10\n0 9\n4 0\n5 0\n7 2\n0 3\n8 10\n0 4\n0 6\n1 0\n6 0\n", "output": "0 9\n4 8\n5 7\n7 2\n9 3\n8 10\n3 4\n2 6\n1 5\n6 0\n", "type": "code"}, {"input": "10\n7 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 1\n0 0\n0 0\n0 0\n", "output": "7 8\n0 3\n2 4\n3 5\n4 6\n5 7\n6 1\n1 9\n8 10\n9 0\n", "type": "code"}, {"input": "10\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n0 0\n", "output": "0 2\n1 3\n2 4\n3 5\n4 6\n5 7\n6 8\n7 9\n8 10\n9 0\n", "type": "code"}] | 7073b9e4a70b147bfa32fae21323bd44 | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHooray! Berl II, the king of Berland is making a knight tournament. The king has already sent the message to all knights in the kingdom and they in turn agreed to participate in this grand event.\n\nAs for you, you're jus... | [{"input": "4 3\n1 2 1\n1 3 3\n1 4 4\n", "output": "3 1 4 0 ", "type": "code"}, {"input": "8 4\n3 5 4\n3 7 6\n2 8 8\n1 8 1\n", "output": "0 8 4 6 4 8 6 1 ", "type": "code"}, {"input": "2 1\n1 2 1\n", "output": "0 1 ", "type": "code"}, {"input": "2 1\n1 2 2\n", "output": "2 0 ", "type": "code"}, {"input": "3 1\n1 3 1\n", "output": "0 1 1 ", "type": "code"}, {"input": "3 1\n1 3 2\n", "output": "2 0 2 ", "type": "code"}, {"input": "3 1\n1 3 3\n", "output": "3 3 0 ", "type": "code"}, {"input": "3 2\n1 2 1\n1 3 3\n", "output": "3 1 0 ", "type": "code"}, {"input": "3 2\n1 2 2\n1 3 2\n", "output": "2 0 2 ", "type": "code"}, {"input": "3 2\n2 3 3\n1 3 3\n", "output": "3 3 0 ", "type": "code"}, {"input": "11 6\n1 2 2\n7 8 7\n3 4 4\n6 9 6\n5 10 10\n2 11 11\n", "output": "2 11 4 11 10 10 6 7 6 11 0 ", "type": "code"}, {"input": "10 6\n9 10 10\n6 7 7\n2 4 2\n2 5 5\n1 7 5\n4 10 8\n", "output": "5 5 2 2 8 7 5 0 10 8 ", "type": "code"}, {"input": "11 8\n3 5 5\n8 9 9\n4 6 6\n8 10 10\n5 7 7\n2 7 2\n10 11 11\n1 11 1\n", "output": "0 1 5 5 6 7 2 9 10 11 1 ", "type": "code"}, {"input": "10 7\n7 8 7\n7 9 9\n5 9 5\n5 10 10\n1 2 2\n3 4 4\n2 10 4\n", "output": "2 4 4 0 10 5 9 7 5 4 ", "type": "code"}, {"input": "11 5\n8 10 9\n6 10 7\n6 11 11\n3 5 5\n1 11 1\n", "output": "0 1 5 5 1 7 11 9 7 9 1 ", "type": "code"}, {"input": "10 6\n6 7 6\n5 7 5\n3 7 4\n2 8 2\n2 10 10\n1 10 10\n", "output": "10 10 4 2 4 5 6 2 10 0 ", "type": "code"}, {"input": "11 7\n7 8 8\n5 6 5\n1 3 3\n7 9 9\n5 10 10\n10 11 11\n1 11 4\n", "output": "3 3 4 0 10 5 8 9 10 11 4 ", "type": "code"}, {"input": "10 7\n8 9 9\n3 4 3\n2 3 2\n1 5 2\n6 7 6\n6 10 10\n1 10 10\n", "output": "2 10 2 3 2 10 6 9 10 0 ", "type": "code"}, {"input": "11 6\n1 2 1\n8 9 9\n3 5 5\n3 6 6\n9 10 10\n1 11 10\n", "output": "10 1 5 5 6 10 10 9 10 0 10 ", "type": "code"}, {"input": "10 5\n1 2 1\n8 10 8\n3 6 4\n4 7 7\n1 8 7\n", "output": "7 1 4 7 4 4 0 7 8 8 ", "type": "code"}, {"input": "4 3\n1 2 2\n1 3 3\n1 4 4\n", "output": "2 3 4 0 ", "type": "code"}] | ac13aba5a034cdeedc18218906a991eb | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.\n\nThere are n citizens in Kekoland, each person has c_{i} coins. Ea... | [{"input": "4 1\n1 1 4 2\n", "output": "2\n", "type": "code"}, {"input": "3 1\n2 2 2\n", "output": "0\n", "type": "code"}, {"input": "10 20\n6 4 7 10 4 5 5 3 7 10\n", "output": "1\n", "type": "code"}, {"input": "30 7\n3 3 2 2 2 2 3 4 4 5 2 1 1 5 5 3 4 3 2 1 3 4 3 2 2 5 2 5 1 2\n", "output": "2\n", "type": "code"}, {"input": "2 0\n182 2\n", "output": "180\n", "type": "code"}, {"input": "123 54564\n38 44 41 42 59 3 95 15 45 32 44 69 35 83 94 57 65 85 64 47 24 20 34 86 26 91 98 12 36 96 80 4 70 40 95 38 70 22 58 50 34 84 80 45 14 60 61 43 11 56 19 59 50 63 21 15 97 98 27 13 9 71 32 18 90 10 2 99 75 87 74 83 79 37 89 3 49 27 92 95 49 1 26 50 72 75 81 37 60 98 28 28 10 93 99 63 14 26 69 51 47 59 42 7 20 17 75 44 44 20 44 85 27 32 65 95 47 46 12 22 64 77 21\n", "output": "1\n", "type": "code"}, {"input": "111 10\n2 8 6 1 3 5 8 3 8 2 9 9 6 9 8 8 5 2 3 8 8 3 8 3 7 9 4 3 9 7 1 8 3 1 5 5 5 8 2 4 2 7 9 1 4 4 3 1 6 7 7 4 1 3 5 3 9 4 4 4 8 8 7 3 5 6 3 3 8 2 8 4 5 8 1 8 4 1 7 1 4 9 8 9 7 6 5 6 3 7 4 8 9 3 8 9 9 3 5 9 1 3 6 8 9 1 1 3 8 7 6\n", "output": "8\n", "type": "code"}, {"input": "10 1000000\n307196 650096 355966 710719 99165 959865 500346 677478 614586 6538\n", "output": "80333\n", "type": "code"}, {"input": "5 1000000\n145119584 42061308 953418415 717474449 57984109\n", "output": "909357107\n", "type": "code"}, {"input": "100 20\n2 5 3 3 2 7 6 2 2 2 6 7 2 1 8 10 2 4 10 6 10 2 1 1 4 7 1 2 9 7 5 3 7 4 6 3 10 10 3 7 6 8 2 2 10 3 1 2 1 3 1 6 3 1 4 10 3 10 9 5 10 4 3 10 3 3 5 3 10 2 1 5 10 7 8 7 7 2 4 2 1 3 3 8 8 5 7 3 1 1 8 10 5 7 4 4 7 7 1 9\n", "output": "7\n", "type": "code"}, {"input": "10 1000\n1000000000 999999994 999999992 1000000000 999999994 999999999 999999990 999999997 999999995 1000000000\n", "output": "1\n", "type": "code"}, {"input": "2 100000\n1 3\n", "output": "0\n", "type": "code"}, {"input": "4 0\n1 4 4 4\n", "output": "3\n", "type": "code"}, {"input": "4 42\n1 1 1 1000000000\n", "output": "999999943\n", "type": "code"}, {"input": "3 4\n1 2 7\n", "output": "1\n", "type": "code"}, {"input": "4 100\n1 1 10 10\n", "output": "1\n", "type": "code"}] | 814ceb45da90093109cab93ae473ea9d | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBob recently read about bitwise operations used in computers: AND, OR and XOR. He have studied their properties and invented a new game.\n\nInitially, Bob chooses integer m, bit depth of the game, which means that all num... | [{"input": "3 3\na := 101\nb := 011\nc := ? XOR b\n", "output": "011\n100\n", "type": "code"}, {"input": "5 1\na := 1\nbb := 0\ncx := ? OR a\nd := ? XOR ?\ne := d AND bb\n", "output": "0\n0\n", "type": "code"}, {"input": "2 10\nb := 0100101101\na := ? XOR b\n", "output": "0100101101\n1011010010\n", "type": "code"}, {"input": "1 10\na := 0110110011\n", "output": "0000000000\n0000000000\n", "type": "code"}, {"input": "1 6\na := ? OR ?\n", "output": "000000\n111111\n", "type": "code"}, {"input": "13 6\na := 111010\nb := 100100\nc := 001110\nd := b AND b\ne := c AND ?\nf := e OR c\ng := 011110\nh := d XOR ?\ni := 010111\nj := 000011\nk := d OR ?\nl := 011101\nm := b OR j\n", "output": "100000\n011011\n", "type": "code"}, {"input": "16 3\na := 011\nb := 110\nc := a XOR b\nd := 110\ne := a XOR b\nf := b XOR a\ng := b XOR e\nh := 111\ni := a XOR h\nj := f XOR ?\nk := 100\nl := 000\nm := 100\nn := 110\no := 110\np := 110\n", "output": "101\n010\n", "type": "code"}, {"input": "29 2\naa := 10\nba := 11\nca := 01\nda := aa AND ?\nea := ba OR ?\nfa := da XOR ?\nga := 11\nha := fa XOR ea\nia := 01\nja := ca OR ha\nka := ha XOR ia\nla := ha OR ?\nma := ba AND ba\nna := ma OR ?\noa := 11\npa := oa OR ba\nqa := 00\nra := qa AND ia\nsa := fa OR ?\nta := ha OR ga\nua := 00\nva := 00\nwa := 11\nxa := 10\nya := ja XOR ?\nza := 00\nab := 00\nbb := pa OR qa\ncb := bb AND ?\n", "output": "00\n11\n", "type": "code"}, {"input": "10 3\na := 011\nb := ? OR a\nc := 000\nd := ? AND c\ne := 101\nf := ? AND e\ng := 001\nh := ? XOR g\ni := 001\nj := ? XOR i\n", "output": "001\n110\n", "type": "code"}, {"input": "12 3\na := 101\nb := a XOR ?\nc := b XOR b\nd := b XOR a\ne := c XOR ?\nf := e XOR ?\ng := c XOR f\nh := 100\ni := c XOR h\nj := c XOR i\nk := b XOR ?\nl := 111\n", "output": "000\n111\n", "type": "code"}, {"input": "12 14\na := 01100010000111\nb := ? XOR a\nc := 01101111001010\nd := ? XOR c\ne := 10000011101111\nf := ? XOR e\ng := 10100011001010\nh := ? XOR g\ni := 10010110111111\nj := ? XOR i\nk := 10000111110001\nl := ? XOR k\n", "output": "10000011001011\n01011000010000\n", "type": "code"}, {"input": "14 8\na := 01010000\nb := 10101111\nc := 01100100\nd := 10011011\ne := 01001100\nf := 10110011\ng := ? XOR a\nh := b XOR ?\ni := ? XOR c\nj := d XOR ?\nk := ? XOR e\nl := f XOR ?\nm := 00101111\nn := ? XOR m\n", "output": "00101111\n11010000\n", "type": "code"}, {"input": "14 14\na := 10000100110000\nb := 01111011001111\nc := 11110001111101\nd := 00001110000010\ne := 00111100000010\nf := 11000011111101\ng := ? XOR a\nh := b XOR ?\ni := ? XOR c\nj := d XOR ?\nk := ? XOR e\nl := f XOR ?\nm := 11110011011001\nn := ? XOR m\n", "output": "11110011011001\n00001100100110\n", "type": "code"}, {"input": "17 15\na := 010000111111110\nb := 101100110000100\nc := 100101100100111\nd := 010110101110110\ne := 111111000010110\nf := 011001110111110\ng := 110011010100101\nh := 000001010010001\ni := 110000111001011\nj := 000010000010111\nk := 110110111110110\nl := 010000110000100\nm := 000111101101000\nn := 011111011000111\no := 010110110010100\np := 111001110011001\nq := 000100110001000\n", "output": "000000000000000\n000000000000000\n", "type": "code"}, {"input": "22 9\na := 100101111\nb := 010001100\nc := b AND b\nd := 111000010\ne := c AND a\nf := a OR e\ng := e AND ?\nh := 000010001\ni := b OR ?\nj := d AND ?\nk := g AND h\nl := 010100000\nm := a AND a\nn := j AND ?\no := m OR n\np := o AND ?\nq := f OR ?\nr := 000011011\ns := 001110011\nt := 100111100\nu := l AND p\nv := g OR h\n", "output": "000000000\n111111111\n", "type": "code"}, {"input": "2 109\na := 1010101010100000000000011111111111111111111111111111111111111111111000000000000000000000000000111111111111111\nb := ? XOR a\n", "output": "1010101010100000000000011111111111111111111111111111111111111111111000000000000000000000000000111111111111111\n0101010101011111111111100000000000000000000000000000000000000000000111111111111111111111111111000000000000000\n", "type": "code"}] | 7020d70dd984ee91d79435196e77e78b | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote its address in the notebook. We know that the address of the written resource has format: <protocol>://<domain>.ru[/<cont... | [{"input": "httpsunrux\n", "output": "http://sun.ru/x\n", "type": "code"}, {"input": "ftphttprururu\n", "output": "ftp://http.ru/ruru\n", "type": "code"}, {"input": "httpuururrururruruurururrrrrurrurrurruruuruuu\n", "output": "http://uu.ru/rrururruruurururrrrrurrurrurruruuruuu\n", "type": "code"}, {"input": "httpabuaruauabbaruru\n", "output": "http://abua.ru/auabbaruru\n", "type": "code"}, {"input": "httpuurrruurruuruuruuurrrurururuurruuuuuuruurr\n", "output": "http://uurr.ru/urruuruuruuurrrurururuurruuuuuuruurr\n", "type": "code"}, {"input": "httpruhhphhhpuhruruhhpruhhphruhhru\n", "output": "http://ruhhphhhpuh.ru/ruhhpruhhphruhhru\n", "type": "code"}, {"input": "httpftprftprutprururftruruftptp\n", "output": "http://ftprftp.ru/tprururftruruftptp\n", "type": "code"}, {"input": "httpfttpftpfttftpftpftppfrurururu\n", "output": "http://fttpftpfttftpftpftppf.ru/rururu\n", "type": "code"}, {"input": "httpruhttttpruhttprupruhttpruhtturuhttphtruuru\n", "output": "http://ruhttttp.ru/httprupruhttpruhtturuhttphtruuru\n", "type": "code"}, {"input": "httpsjkazaaghasjkasjkabruru\n", "output": "http://sjkazaaghasjkasjkab.ru/ru\n", "type": "code"}, {"input": "httpftphttptphttphrururuhpftphtpftphtpftphtptpft\n", "output": "http://ftphttptphttph.ru/ruruhpftphtpftphtpftphtptpft\n", "type": "code"}, {"input": "httpppppru\n", "output": "http://pppp.ru\n", "type": "code"}, {"input": "ftprrurururrurururuurrururruuru\n", "output": "ftp://r.ru/rururrurururuurrururruuru\n", "type": "code"}, {"input": "ftpabaruru\n", "output": "ftp://aba.ru/ru\n", "type": "code"}, {"input": "ftpruurruurururururuuruuur\n", "output": "ftp://ruur.ru/urururururuuruuur\n", "type": "code"}, {"input": "ftphhphruhhpruhhpuhhpuruhhphruhhruhhpuhhru\n", "output": "ftp://hhph.ru/hhpruhhpuhhpuruhhphruhhruhhpuhhru\n", "type": "code"}, {"input": "ftparua\n", "output": "ftp://a.ru/a\n", "type": "code"}, {"input": "httpzru\n", "output": "http://z.ru\n", "type": "code"}, {"input": "httprrur\n", "output": "http://r.ru/r\n", "type": "code"}, {"input": "ftprru\n", "output": "ftp://r.ru\n", "type": "code"}] | aca032762cc90a0e85fffc932f55e7e4 | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs technologies develop, manufacturers are making the process of unlocking a phone as user-friendly as possible. To unlock its new phone, Arkady's pet dog Mu-mu has to bark the password once. The phone represents a passwo... | [{"input": "ya\n4\nah\noy\nto\nha\n", "output": "YES\n", "type": "code"}, {"input": "hp\n2\nht\ntp\n", "output": "NO\n", "type": "code"}, {"input": "ah\n1\nha\n", "output": "YES\n", "type": "code"}, {"input": "bb\n4\nba\nab\naa\nbb\n", "output": "YES\n", "type": "code"}, {"input": "bc\n4\nca\nba\nbb\ncc\n", "output": "YES\n", "type": "code"}, {"input": "ba\n4\ncd\nad\ncc\ncb\n", "output": "YES\n", "type": "code"}, {"input": "pg\n4\nzl\nxs\ndi\nxn\n", "output": "NO\n", "type": "code"}, {"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\nvr\nye\nzc\niw\nfv\nkv\noo\nsm\nbc\nrs\nau\nuz\nuv\ngh\nsu\njn\ndz\nrl\nwj\nbk\nzl\nas\nms\nit\nwu\n", "output": "YES\n", "type": "code"}, {"input": "bb\n1\naa\n", "output": "NO\n", "type": "code"}, {"input": "qm\n25\nqw\nwe\ner\nrt\nty\nyu\nui\nio\nop\npa\nas\nsd\ndf\nfg\ngh\nhj\njk\nkl\nlz\nzx\nxc\ncv\nvb\nbn\nnm\n", "output": "NO\n", "type": "code"}, {"input": "mq\n25\nqw\nwe\ner\nrt\nty\nyu\nui\nio\nop\npa\nas\nsd\ndf\nfg\ngh\nhj\njk\nkl\nlz\nzx\nxc\ncv\nvb\nbn\nnm\n", "output": "YES\n", "type": "code"}, {"input": "aa\n1\naa\n", "output": "YES\n", "type": "code"}, {"input": "bb\n1\nbb\n", "output": "YES\n", "type": "code"}, {"input": "ba\n1\ncc\n", "output": "NO\n", "type": "code"}, {"input": "ha\n1\nha\n", "output": "YES\n", "type": "code"}, {"input": "aa\n1\naa\n", "output": "YES\n", "type": "code"}, {"input": "ez\n1\njl\n", "output": "NO\n", "type": "code"}, {"input": "aa\n2\nab\nba\n", "output": "YES\n", "type": "code"}, {"input": "aa\n2\nca\ncc\n", "output": "NO\n", "type": "code"}, {"input": "dd\n2\nac\ndc\n", "output": "NO\n", "type": "code"}, {"input": "qc\n2\nyc\nkr\n", "output": "NO\n", "type": "code"}, {"input": "aa\n3\nba\nbb\nab\n", "output": "YES\n", "type": "code"}, {"input": "ca\n3\naa\nbb\nab\n", "output": "NO\n", "type": "code"}, {"input": "ca\n3\nbc\nbd\nca\n", "output": "YES\n", "type": "code"}, {"input": "dd\n3\nmt\nrg\nxl\n", "output": "NO\n", "type": "code"}, {"input": "be\n20\nad\ncd\ncb\ndb\ndd\naa\nab\nca\nae\ned\ndc\nbb\nba\nda\nee\nea\ncc\nac\nec\neb\n", "output": "YES\n", "type": "code"}, {"input": "fc\n20\nca\nbb\nce\nfd\nde\nfa\ncc\nec\nfb\nfc\nff\nbe\ncf\nba\ndb\ned\naf\nae\nda\nef\n", "output": "YES\n", "type": "code"}, {"input": "ca\n20\ndc\naf\ndf\neg\naa\nbc\nea\nbd\nab\ndb\ngc\nfb\nba\nbe\nee\ngf\ncf\nag\nga\nca\n", "output": "YES\n", "type": "code"}, {"input": "ke\n20\nzk\nra\nbq\nqz\nwt\nzg\nmz\nuk\nge\nuv\nud\nfd\neh\ndm\nsk\nki\nfv\ntp\nat\nfb\n", "output": "YES\n", "type": "code"}, {"input": "hh\n50\nag\nhg\ndg\nfh\neg\ngh\ngd\nda\nbh\nab\nhf\ndc\nhb\nfe\nad\nec\nac\nfd\nca\naf\ncg\nhd\neb\nce\nhe\nha\ngb\nea\nae\nfb\nff\nbe\nch\nhh\nee\nde\nge\ngf\naa\ngg\neh\ned\nbf\nfc\nah\nga\nbd\ncb\nbg\nbc\n", "output": "YES\n", "type": "code"}, {"input": "id\n50\nhi\ndc\nfg\nee\ngi\nhc\nac\nih\ndg\nfc\nde\ned\nie\neb\nic\ncf\nib\nfa\ngc\nba\nbe\nga\nha\nhg\nia\ndf\nab\nei\neh\nad\nii\nci\ndh\nec\nif\ndi\nbg\nag\nhe\neg\nca\nae\ndb\naa\nid\nfh\nhh\ncc\nfb\ngb\n", "output": "YES\n", "type": "code"}, {"input": "fe\n50\nje\nbi\nbg\ngc\nfb\nig\ndf\nji\ndg\nfe\nfc\ncf\ngf\nai\nhe\nac\nch\nja\ngh\njf\nge\ncb\nij\ngb\ncg\naf\neh\nee\nhd\njd\njb\nii\nca\nci\nga\nab\nhi\nag\nfj\nej\nfi\nie\ndj\nfg\nef\njc\njg\njh\nhf\nha\n", "output": "YES\n", "type": "code"}, {"input": "rn\n50\nba\nec\nwg\nao\nlk\nmz\njj\ncf\nfa\njk\ndy\nsz\njs\nzr\nqv\ntx\nwv\nrd\nqw\nls\nrr\nvt\nrx\nkc\neh\nnj\niq\nyi\nkh\nue\nnv\nkz\nrn\nes\nua\nzf\nvu\nll\neg\nmj\ncz\nzj\nxz\net\neb\nci\nih\nig\nam\nvd\n", "output": "YES\n", "type": "code"}, {"input": "ee\n100\nah\nfb\ncd\nbi\nii\nai\nid\nag\nie\nha\ndi\nec\nae\nce\njb\ndg\njg\ngd\ngf\nda\nih\nbd\nhj\ngg\nhb\ndf\ned\nfh\naf\nja\nci\nfc\nic\nji\nac\nhi\nfj\nch\nbc\njd\naa\nff\nad\ngj\nej\nde\nee\nhe\ncf\nga\nia\ncg\nbb\nhc\nbe\ngi\njf\nbg\naj\njj\nbh\nfe\ndj\nef\ngb\nge\ndb\nig\ncj\ndc\nij\njh\nei\ndd\nib\nhf\neg\nbf\nfg\nab\ngc\nfd\nhd\ngh\neh\njc\neb\nhh\nca\nje\nbj\nif\nea\nhg\nfa\ncc\nba\ndh\ncb\nfi\n", "output": "YES\n", "type": "code"}, {"input": "if\n100\njd\nbc\nje\nhi\nga\nde\nkb\nfc\ncd\ngd\naj\ncb\nei\nbf\ncf\ndk\ndb\ncg\nki\ngg\nkg\nfa\nkj\nii\njf\njg\ngb\nbh\nbg\neh\nhj\nhb\ndg\ndj\njc\njb\nce\ndi\nig\nci\ndf\nji\nhc\nfk\naf\nac\ngk\nhd\nae\nkd\nec\nkc\neb\nfh\nij\nie\nca\nhh\nkf\nha\ndd\nif\nef\nih\nhg\nej\nfe\njk\nea\nib\nck\nhf\nak\ngi\nch\ndc\nba\nke\nad\nka\neg\njh\nja\ngc\nfd\ncc\nab\ngj\nik\nfg\nbj\nhe\nfj\nge\ngh\nhk\nbk\ned\nid\nfi\n", "output": "YES\n", "type": "code"}, {"input": "kd\n100\nek\nea\nha\nkf\nkj\ngh\ndl\nfj\nal\nga\nlj\nik\ngd\nid\ncb\nfh\ndk\nif\nbh\nkb\nhc\nej\nhk\ngc\ngb\nef\nkk\nll\nlf\nkh\ncl\nlh\njj\nil\nhh\nci\ndb\ndf\ngk\njg\nch\nbd\ncg\nfg\nda\neb\nlg\ndg\nbk\nje\nbg\nbl\njl\ncj\nhb\nei\naa\ngl\nka\nfa\nfi\naf\nkc\nla\ngi\nij\nib\nle\ndi\nck\nag\nlc\nca\nge\nie\nlb\nke\nii\nae\nig\nic\nhe\ncf\nhd\nak\nfb\nhi\ngf\nad\nba\nhg\nbi\nkl\nac\ngg\ngj\nbe\nlk\nld\naj\n", "output": "YES\n", "type": "code"}, {"input": "ab\n1\nab\n", "output": "YES\n", "type": "code"}, {"input": "ya\n1\nya\n", "output": "YES\n", "type": "code"}, {"input": "ay\n1\nyb\n", "output": "NO\n", "type": "code"}, {"input": "ax\n2\nii\nxa\n", "output": "YES\n", "type": "code"}, {"input": "hi\n1\nhi\n", "output": "YES\n", "type": "code"}, {"input": "ag\n1\nag\n", "output": "YES\n", "type": "code"}, {"input": "th\n1\nth\n", "output": "YES\n", "type": "code"}, {"input": "sb\n1\nsb\n", "output": "YES\n", "type": "code"}, {"input": "hp\n1\nhp\n", "output": "YES\n", "type": "code"}, {"input": "ah\n1\nah\n", "output": "YES\n", "type": "code"}, {"input": "ta\n1\nta\n", "output": "YES\n", "type": "code"}, {"input": "tb\n1\ntb\n", "output": "YES\n", "type": "code"}, {"input": "ab\n5\nca\nda\nea\nfa\nka\n", "output": "NO\n", "type": "code"}, {"input": "ac\n1\nac\n", "output": "YES\n", "type": "code"}, {"input": "ha\n2\nha\nzz\n", "output": "YES\n", "type": "code"}, {"input": "ok\n1\nok\n", "output": "YES\n", "type": "code"}, {"input": "bc\n1\nbc\n", "output": "YES\n", "type": "code"}, {"input": "az\n1\nzz\n", "output": "NO\n", "type": "code"}, {"input": "ab\n2\nba\ntt\n", "output": "YES\n", "type": "code"}, {"input": "ah\n2\nap\nhp\n", "output": "NO\n", "type": "code"}, {"input": "sh\n1\nsh\n", "output": "YES\n", "type": "code"}, {"input": "az\n1\nby\n", "output": "NO\n", "type": "code"}, {"input": "as\n1\nas\n", "output": "YES\n", "type": "code"}, {"input": "ab\n2\nab\ncd\n", "output": "YES\n", "type": "code"}, {"input": "ab\n2\nxa\nza\n", "output": "NO\n", "type": "code"}, {"input": "ab\n2\net\nab\n", "output": "YES\n", "type": "code"}, {"input": "ab\n1\naa\n", "output": "NO\n", "type": "code"}, {"input": "ab\n2\nab\nde\n", "output": "YES\n", "type": "code"}, {"input": "ah\n2\nba\nha\n", "output": "YES\n", "type": "code"}, {"input": "ha\n3\ndd\ncc\nha\n", "output": "YES\n", "type": "code"}, {"input": "oo\n1\nox\n", "output": "NO\n", "type": "code"}, {"input": "ab\n2\nax\nbx\n", "output": "NO\n", "type": "code"}, {"input": "ww\n4\nuw\now\npo\nko\n", "output": "NO\n", "type": "code"}, {"input": "ay\n1\nay\n", "output": "YES\n", "type": "code"}, {"input": "yo\n1\nyo\n", "output": "YES\n", "type": "code"}, {"input": "ba\n1\nba\n", "output": "YES\n", "type": "code"}, {"input": "qw\n1\nqw\n", "output": "YES\n", "type": "code"}, {"input": "la\n1\nla\n", "output": "YES\n", "type": "code"}, {"input": "ab\n2\nbb\nbc\n", "output": "NO\n", "type": "code"}, {"input": "aa\n2\nab\nac\n", "output": "NO\n", "type": "code"}, {"input": "ah\n2\nbb\nha\n", "output": "YES\n", "type": "code"}, {"input": "ya\n42\nab\nac\nad\nae\naf\nag\nah\nai\nak\naj\nba\nbc\nbd\nbe\nbf\nbg\nbh\nbi\nbk\nbj\ncb\nca\ncd\nce\ncf\ncg\nch\nci\nck\ncj\ndb\ndc\nda\nde\ndf\ndg\ndh\ndi\ndk\ndj\nef\nek\n", "output": "NO\n", "type": "code"}, {"input": "ab\n3\nab\nxx\nyy\n", "output": "YES\n", "type": "code"}, {"input": "ab\n2\nab\ncc\n", "output": "YES\n", "type": "code"}, {"input": "sa\n2\nxx\nas\n", "output": "YES\n", "type": "code"}, {"input": "ma\n1\nma\n", "output": "YES\n", "type": "code"}, {"input": "ba\n1\nbb\n", "output": "NO\n", "type": "code"}, {"input": "bc\n1\nab\n", "output": "NO\n", "type": "code"}, {"input": "fa\n1\nfa\n", "output": "YES\n", "type": "code"}, {"input": "ap\n1\nap\n", "output": "YES\n", "type": "code"}, {"input": "ab\n1\nbb\n", "output": "NO\n", "type": "code"}, {"input": "bk\n1\nbk\n", "output": "YES\n", "type": "code"}, {"input": "xy\n2\nxy\naa\n", "output": "YES\n", "type": "code"}, {"input": "ab\n2\nza\nbz\n", "output": "YES\n", "type": "code"}] | a6311c56ccadd21148ddbaea83d3d968 | code_stdio |
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 7