{"prob_desc_description":"You are given a string $$$s$$$ consisting of lowercase Latin letters. Let the length of $$$s$$$ be $$$|s|$$$. You may perform several operations on this string.In one operation, you can choose some index $$$i$$$ and remove the $$$i$$$-th character of $$$s$$$ ($$$s_i$$$) if at least one of its adjacent characters is the previous letter in the Latin alphabet for $$$s_i$$$. For example, the previous letter for b is a, the previous letter for s is r, the letter a has no previous letters. Note that after each removal the length of the string decreases by one. So, the index $$$i$$$ should satisfy the condition $$$1 \\le i \\le |s|$$$ during each operation.For the character $$$s_i$$$ adjacent characters are $$$s_{i-1}$$$ and $$$s_{i+1}$$$. The first and the last characters of $$$s$$$ both have only one adjacent character (unless $$$|s| = 1$$$).Consider the following example. Let $$$s=$$$ bacabcab. During the first move, you can remove the first character $$$s_1=$$$ b because $$$s_2=$$$ a. Then the string becomes $$$s=$$$ acabcab. During the second move, you can remove the fifth character $$$s_5=$$$ c because $$$s_4=$$$ b. Then the string becomes $$$s=$$$ acabab. During the third move, you can remove the sixth character $$$s_6=$$$'b' because $$$s_5=$$$ a. Then the string becomes $$$s=$$$ acaba. During the fourth move, the only character you can remove is $$$s_4=$$$ b, because $$$s_3=$$$ a (or $$$s_5=$$$ a). The string becomes $$$s=$$$ acaa and you cannot do anything with it. Your task is to find the maximum possible number of characters you can remove if you choose the sequence of operations optimally.","prob_desc_output_spec":"Print one integer \u2014 the maximum possible number of characters you can remove if you choose the sequence of moves optimally.","lang_cluster":"","src_uid":"9ce37bc2d361f5bb8a0568fb479b8a38","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force","constructive algorithms","strings","greedy"],"prob_desc_created_at":"1583057400","prob_desc_sample_inputs":"[\"8\\nbacabcab\", \"4\\nbcda\", \"6\\nabbbbb\"]","prob_desc_notes":"NoteThe first example is described in the problem statement. Note that the sequence of moves provided in the statement is not the only, but it can be shown that the maximum possible answer to this test is $$$4$$$.In the second example, you can remove all but one character of $$$s$$$. The only possible answer follows. During the first move, remove the third character $$$s_3=$$$ d, $$$s$$$ becomes bca. During the second move, remove the second character $$$s_2=$$$ c, $$$s$$$ becomes ba. And during the third move, remove the first character $$$s_1=$$$ b, $$$s$$$ becomes a. ","exec_outcome":"","difficulty":1600.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The only line of the input contains one integer $$$|s|$$$ ($$$1 \\le |s| \\le 100$$$) \u2014 the length of $$$s$$$. The second line of the input contains one string $$$s$$$ consisting of $$$|s|$$$ lowercase Latin letters.","prob_desc_sample_outputs":"[\"4\", \"3\", \"5\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"8\\r\\nbacabcab\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"4\\r\\nbcda\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"6\\r\\nabbbbb\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"1\\r\\na\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1\\r\\nt\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"100\\r\\nciftajmzqbfkvbhnyugneialytrkwjlhzwltylptheadmypbjxdzkxnqovimgmzkwpuelzbbhciinfiyspfatgoexeezolulnliu\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"100\\r\\nyzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\\r\\n\", \"output\": [\"99\"]}, {\"input\": \"100\\r\\naaaaaabbcccccccddffffhhhhhhhhiiiiiikkkkkkkkmmmmmmooooooopppprrrrrrrrrttttttvvvvvvvvvvvvxxxxxxxzzzzzz\\r\\n\", \"output\": [\"21\"]}, {\"input\": \"100\\r\\nbabaababbaabbabababbabbbababababbaabababaaababaababbbaaababbaabbababababbababbabaabbaabaaaaabbababba\\r\\n\", \"output\": [\"50\"]}, {\"input\": \"100\\r\\nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\r\\n\", \"output\": [\"99\"]}, {\"input\": \"100\\r\\nacdfijmnorszzyyzzzzzzyzzyzzzzxwzzzzzyzzzzzzyzzzzzzzyzzzzzyzzzzzzyxzzzyzzzzzyzzzzzyzzyzzzzvutqplkhgeb\\r\\n\", \"output\": [\"99\"]}, {\"input\": \"100\\r\\nabcdeghfgefedeefcabaaabcedfefedacbbcaaabehhjlkjikjloqrtuyzxwvspnmnlkjgfdcbacdcghfedfebaacbcbcdbccaaa\\r\\n\", \"output\": [\"85\"]}, {\"input\": \"100\\r\\nababaaaabaabaaaaaaabaaaaaaaaaaaaacbaaaabaaaaaabaabaaaababaaaabaehijkmnpqvxzywutsrolgfdcbaaaabaabaaaa\\r\\n\", \"output\": [\"40\"]}, {\"input\": \"100\\r\\naaaaaaabaaaaaabcaaaaaaaaaaaaaaaaaaaabbbaaaaaaabefhklmnopsuxzywvtrqjigdcaaaaaaaaaaaaaaaaaaaaaaaabaaaa\\r\\n\", \"output\": [\"32\"]}, {\"input\": \"100\\r\\naaaaabcjkprsvxyzwutqonmlihgfedaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\r\\n\", \"output\": [\"26\"]}, {\"input\": \"100\\r\\nyltrygcqmgjzsxoahbvovspancmoaltdrxgjnxwxbrehubvradguoqgiodzanljxtszdutuzgcnihmwevoloceyidyvoopnqbtlb\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"100\\r\\naaaabbbcccccccdddddeeeeeffgggghhhiijjjjkkkllmmnnnoooppqqqrrrrssssssttttuuuuuuuuvvvvvwwwwxxxxyyyyzzzz\\r\\n\", \"output\": [\"96\"]}, {\"input\": \"100\\r\\nrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"100\\r\\nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"100\\r\\njupemetthxolktvhbmzdwlrekwmcugngajdgifwseksjlibsdgmegmqtmeeeqszqjxjhjenjxofvkesfjugbzephryjqqkxatrvl\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"100\\r\\nmxjrojjwtrauhhccftvjsyfyfsnbdnwjfltyjetsylbddrkoqjxbmientcowknrecfqcvxfgsbymwyvakmbulhvrxzvzbygajtgc\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"100\\r\\nbldubjepvkwhjbxrueydtpparjszjgwpxjlqlpsmdrjoaagfnrohfcabchmdwaoctmilfbpztwjrfdgdioqggokdftcniqywmvjd\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"100\\r\\nzbzevxgewibujtbyvhzohoobudkghaivlbpaywiesizahkdxmcpdoqzsxqglezenmsgvsmxcrzcntauvarpakddglhrjmzylfuyq\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"100\\r\\nwhkbjjjrpcgsfaxgcmktmwypyfhbzvvowkvxltbmnyndqkswixxqxriopddrygymbcvadjjheugxgikrlirnhhsmnjmzpizyltau\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"1\\r\\nz\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"5\\r\\nbabaa\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"5\\r\\nabbdd\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"6\\r\\naaaaaa\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"6\\r\\nbbbbab\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"6\\r\\nbaabbb\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"6\\r\\ndacbab\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"7\\r\\naaaaaaa\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"7\\r\\nbaaabab\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"7\\r\\nccababa\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"7\\r\\ncddcbcb\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"8\\r\\naaaaaaaa\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"8\\r\\naaabbaab\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"8\\r\\nabababbc\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"8\\r\\nbdaacddc\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"9\\r\\naaaaaaaaa\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"9\\r\\naabaaabab\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"9\\r\\nbaccbbaca\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"9\\r\\nacacaabaa\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"10\\r\\naaaaaaaaaa\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"10\\r\\nbbaabaabbb\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"10\\r\\ncbbbbcaaca\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"10\\r\\ncadbcdddda\\r\\n\", \"output\": [\"6\"]}]"} {"prob_desc_description":"You can not just take the file and send it. When Polycarp trying to send a file in the social network \"Codehorses\", he encountered an unexpected problem. If the name of the file contains three or more \"x\" (lowercase Latin letters \"x\") in a row, the system considers that the file content does not correspond to the social network topic. In this case, the file is not sent and an error message is displayed.Determine the minimum number of characters to remove from the file name so after that the name does not contain \"xxx\" as a substring. Print 0 if the file name does not initially contain a forbidden substring \"xxx\".You can delete characters in arbitrary positions (not necessarily consecutive). If you delete a character, then the length of a string is reduced by $$$1$$$. For example, if you delete the character in the position $$$2$$$ from the string \"exxxii\", then the resulting string is \"exxii\".","prob_desc_output_spec":"Print the minimum number of characters to remove from the file name so after that the name does not contain \"xxx\" as a substring. If initially the file name dost not contain a forbidden substring \"xxx\", print 0.","lang_cluster":"","src_uid":"8de14db41d0acee116bd5d8079cb2b02","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["strings","greedy"],"prob_desc_created_at":"1582202100","prob_desc_sample_inputs":"[\"6\\nxxxiii\", \"5\\nxxoxx\", \"10\\nxxxxxxxxxx\"]","prob_desc_notes":"NoteIn the first example Polycarp tried to send a file with name contains number $$$33$$$, written in Roman numerals. But he can not just send the file, because it name contains three letters \"x\" in a row. To send the file he needs to remove any one of this letters.","exec_outcome":"","difficulty":800.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line contains integer $$$n$$$ $$$(3 \\le n \\le 100)$$$ \u2014 the length of the file name. The second line contains a string of length $$$n$$$ consisting of lowercase Latin letters only \u2014 the file name.","prob_desc_sample_outputs":"[\"1\", \"0\", \"8\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"6\\r\\nxxxiii\\r\\n\", \"output\": [\"1\\r\\n\", \"1\", \"1\\n\"]}, {\"input\": \"5\\r\\nxxoxx\\r\\n\", \"output\": [\"0\\r\\n\", \"0\\n\", \"0\"]}, {\"input\": \"10\\r\\nxxxxxxxxxx\\r\\n\", \"output\": [\"8\\n\", \"8\", \"8\\r\\n\"]}, {\"input\": \"100\\r\\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\\r\\n\", \"output\": [\"98\", \"98\\n\", \"98\\r\\n\"]}, {\"input\": \"99\\r\\nxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxaxxa\\r\\n\", \"output\": [\"0\\r\\n\", \"0\\n\", \"0\"]}, {\"input\": \"3\\r\\nxxx\\r\\n\", \"output\": [\"1\\r\\n\", \"1\", \"1\\n\"]}, {\"input\": \"77\\r\\naaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxyyyzzz\\r\\n\", \"output\": [\"0\\r\\n\", \"0\\n\", \"0\"]}, {\"input\": \"100\\r\\nuxxxxxlmexxxxxxxwnxxexxxxxcxxfydxxxxxxvmdxxxxxxisxxxxxxxxidkxxxpxxxxxxxxmnuxxxxjxxxqcxxwmxxxxxxxxmrx\\r\\n\", \"output\": [\"41\", \"41\\r\\n\", \"41\\n\"]}, {\"input\": \"100\\r\\nxxxxxxxxxxxjtxxxxxxxxcxxxxxxcfxxxxzxxxxxxgxxxxxbxxxxbxxxxxxxxdycxxxxokixxxkizxxgcxxxxxxxxexxxxxfxxxc\\r\\n\", \"output\": [\"49\", \"49\\n\", \"49\\r\\n\"]}, {\"input\": \"100\\r\\nuxxxxxlmexxxxxxxwnxxexxxxxcxxfydxxxxxxvmdxxxxxxisxxxxxxxxidkxxxpxxxxxxxxmnuxxxxjxxxqcxxwmxxxxxwxxxxx\\r\\n\", \"output\": [\"41\", \"41\\r\\n\", \"41\\n\"]}, {\"input\": \"34\\r\\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\r\\n\", \"output\": [\"0\\r\\n\", \"0\\n\", \"0\"]}, {\"input\": \"5\\r\\nfcyju\\r\\n\", \"output\": [\"0\\r\\n\", \"0\\n\", \"0\"]}, {\"input\": \"100\\r\\nihygyvdvyeifomhxhkhdkimquvgallbqharcyriyqkidnwykozuhvkwdldlztpabgyuflikychqpdenwzgtlzotyumjgdsrbxxxx\\r\\n\", \"output\": [\"2\", \"2\\n\", \"2\\r\\n\"]}]"} {"prob_desc_description":"Pak Chanek plans to build a garage. He wants the garage to consist of a square and a right triangle that are arranged like the following illustration. Define $$$a$$$ and $$$b$$$ as the lengths of two of the sides in the right triangle as shown in the illustration. An integer $$$x$$$ is suitable if and only if we can construct a garage with assigning positive integer values for the lengths $$$a$$$ and $$$b$$$ ($$$a<b$$$) so that the area of the square at the bottom is exactly $$$x$$$. As a good friend of Pak Chanek, you are asked to help him find the $$$N$$$-th smallest suitable number.","prob_desc_output_spec":"An integer that represents the $$$N$$$-th smallest suitable number.","lang_cluster":"","src_uid":"d0a8604b78ba19ab769fd1ec90a72e4e","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"128 megabytes","file_name":"prog_syn_val.jsonl","tags":["geometry","math","binary search"],"prob_desc_created_at":"1662298500","prob_desc_sample_inputs":"[\"3\"]","prob_desc_notes":"NoteThe $$$3$$$-rd smallest suitable number is $$$7$$$. A square area of $$$7$$$ can be obtained by assigning $$$a=3$$$ and $$$b=4$$$.","exec_outcome":"","difficulty":1500.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The only line contains a single integer $$$N$$$ ($$$1 \\leq N \\leq 10^9$$$).","prob_desc_sample_outputs":"[\"7\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"3\\n\", \"output\": [\"7\\n\\n\", \"7\", \"7\\n\", \" 7 \\n\", \"7 \", \"\\n7\", \"7\\n\"]}, {\"input\": \"6\\n\", \"output\": [\"11\\n\", \"11\\n\", \"11\", \"11\\n\\n\", \"\\n11\", \"11 \"]}, {\"input\": \"5\\n\", \"output\": [\"\\n9\", \"9\\n\\n\", \"9\\n\", \"9 \", \"9\", \"9\\n\"]}, {\"input\": \"8\\n\", \"output\": [\"13 \", \"13\\n\\n\", \"13\\n\", \"13\\n\", \"\\n13\", \"13\"]}, {\"input\": \"4\\n\", \"output\": [\"8\\n\\n\", \"\\n8\", \"8 \", \"8\\n\", \"8\", \"8\\n\"]}, {\"input\": \"10\\n\", \"output\": [\"16 \", \"\\n16\", \"16\", \"16\\n\", \"16\\n\\n\", \"16\\n\"]}, {\"input\": \"18\\n\", \"output\": [\"27\", \"27\\n\", \"27 \", \"\\n27\", \"27\\n\", \"27\\n\\n\"]}, {\"input\": \"589284012\\n\", \"output\": [\"785712019\\n\", \"785712019\\n\", \"785712019\\n\\n\", \"785712019\"]}, {\"input\": \"636562060\\n\", \"output\": [\"848749416\\n\", \"848749416\\n\\n\", \"848749416 \", \"848749416\", \"848749416\\n\"]}, {\"input\": \"200000\\n\", \"output\": [\"266669\\n\", \"266669\", \"266669\\n\", \"266669\\n\\n\"]}, {\"input\": \"1000000000\\n\", \"output\": [\"1333333336\\n\", \"1333333336\", \"1333333336\\n\\n\", \"1333333336\\n\", \"1333333336 \"]}, {\"input\": \"999999999\\n\", \"output\": [\"1333333335\\n\", \"1333333335\", \"1333333335\\n\", \"1333333335\\n\\n\"]}, {\"input\": \"999999998\\n\", \"output\": [\"1333333333\", \"1333333333\\n\", \"1333333333\\n\\n\", \"1333333333\\n\"]}, {\"input\": \"999999997\\n\", \"output\": [\"1333333332 \", \"1333333332\\n\", \"1333333332\\n\\n\", \"1333333332\", \"1333333332\\n\"]}, {\"input\": \"1000005\\n\", \"output\": [\"1333343\\n\", \"1333343\\n\", \"1333343\\n\\n\", \"1333343\"]}, {\"input\": \"1000\\n\", \"output\": [\"1336\\n\\n\", \"1336\", \"1336\\n\", \"1336\\n\", \"1336 \"]}, {\"input\": \"2\\n\", \"output\": [\"5\\n\", \"5\", \" 5 \\n\", \"5\\n\\n\", \"5\\n\"]}, {\"input\": \"1\\n\", \"output\": [\"3\\n\\n\", \"3\\n\", \"3\\n\", \"3\", \" 3 \\n\"]}, {\"input\": \"767928734\\n\", \"output\": [\"1023904981\", \"1023904981\\n\", \"1023904981\\n\", \"1023904981\\n\\n\"]}, {\"input\": \"20400000\\n\", \"output\": [\"27200003\\n\", \"27200003\", \"27200003\\n\\n\", \"27200003\\n\"]}, {\"input\": \"999993999\\n\", \"output\": [\"1333325335\\n\\n\", \"1333325335\", \"1333325335\\n\", \"1333325335\\n\"]}, {\"input\": \"383964368\\n\", \"output\": [\"511952493\\n\", \"511952493\", \"511952493\\n\", \"511952493\\n\\n\"]}]"} {"prob_desc_description":"A chainword is a special type of crossword. As most of the crosswords do, it has cells that you put the letters in and some sort of hints to what these letters should be.The letter cells in a chainword are put in a single row. We will consider chainwords of length $$$m$$$ in this task.A hint to a chainword is a sequence of segments such that the segments don't intersect with each other and cover all $$$m$$$ letter cells. Each segment contains a description of the word in the corresponding cells.The twist is that there are actually two hints: one sequence is the row above the letter cells and the other sequence is the row below the letter cells. When the sequences are different, they provide a way to resolve the ambiguity in the answers.You are provided with a dictionary of $$$n$$$ words, each word consists of lowercase Latin letters. All words are pairwise distinct.An instance of a chainword is the following triple: a string of $$$m$$$ lowercase Latin letters; the first hint: a sequence of segments such that the letters that correspond to each segment spell a word from the dictionary; the second hint: another sequence of segments such that the letters that correspond to each segment spell a word from the dictionary. Note that the sequences of segments don't necessarily have to be distinct.Two instances of chainwords are considered different if they have different strings, different first hints or different second hints.Count the number of different instances of chainwords. Since the number might be pretty large, output it modulo $$$998\\,244\\,353$$$.","prob_desc_output_spec":"Print a single integer\u00a0\u2014 the number of different instances of chainwords of length $$$m$$$ for the given dictionary modulo $$$998\\,244\\,353$$$.","lang_cluster":"","src_uid":"711d15e11016d0164fb2b0c3756e4857","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["strings","string suffix structures","matrices","data structures","brute force","dp"],"prob_desc_created_at":"1618238100","prob_desc_sample_inputs":"[\"3 5\\nababa\\nab\\na\", \"2 4\\nab\\ncd\", \"5 100\\na\\naa\\naaa\\naaaa\\naaaaa\"]","prob_desc_notes":"NoteHere are all the instances of the valid chainwords for the first example: The red lines above the letters denote the segments of the first hint, the blue lines below the letters denote the segments of the second hint.In the second example the possible strings are: \"abab\", \"abcd\", \"cdab\" and \"cdcd\". All the hints are segments that cover the first two letters and the last two letters.","exec_outcome":"","difficulty":2700.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"3 seconds","prob_desc_input_spec":"The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \\le n \\le 8$$$, $$$1 \\le m \\le 10^9$$$)\u00a0\u2014 the number of words in the dictionary and the number of letter cells. Each of the next $$$n$$$ lines contains a word\u00a0\u2014 a non-empty string of no more than $$$5$$$ lowercase Latin letters. All words are pairwise distinct. ","prob_desc_sample_outputs":"[\"11\", \"4\", \"142528942\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"3 5\\r\\nababa\\r\\nab\\r\\na\\r\\n\", \"output\": [\"11\\r\\n\", \"11\\n\"]}, {\"input\": \"2 4\\r\\nab\\r\\ncd\\r\\n\", \"output\": [\"4\\r\\n\", \"4\\n\"]}, {\"input\": \"5 100\\r\\na\\r\\naa\\r\\naaa\\r\\naaaa\\r\\naaaaa\\r\\n\", \"output\": [\"142528942\\n\", \"142528942\\r\\n\"]}, {\"input\": \"8 3\\r\\nba\\r\\nbbb\\r\\nbb\\r\\naba\\r\\naab\\r\\nbaa\\r\\nb\\r\\na\\r\\n\", \"output\": [\"56\\n\", \"56\\r\\n\"]}, {\"input\": \"8 5\\r\\nabb\\r\\nbaa\\r\\na\\r\\naba\\r\\naa\\r\\nb\\r\\nba\\r\\nbb\\r\\n\", \"output\": [\"1824\\r\\n\", \"1824\\n\"]}, {\"input\": \"8 10\\r\\naa\\r\\nba\\r\\na\\r\\naaa\\r\\nbb\\r\\naab\\r\\naba\\r\\nb\\r\\n\", \"output\": [\"7610511\\n\", \"7610511\\r\\n\"]}, {\"input\": \"8 10\\r\\nbac\\r\\naa\\r\\nbbac\\r\\nbcc\\r\\nbbca\\r\\naac\\r\\nabba\\r\\nbbba\\r\\n\", \"output\": [\"227\\r\\n\", \"227\\n\"]}, {\"input\": \"8 100\\r\\naabab\\r\\naaa\\r\\naba\\r\\nbbaba\\r\\na\\r\\naa\\r\\nbabba\\r\\nbba\\r\\n\", \"output\": [\"452563662\\n\", \"452563662\\r\\n\"]}, {\"input\": \"8 100\\r\\ncbb\\r\\nbaaba\\r\\ncc\\r\\nacb\\r\\nabbba\\r\\nbb\\r\\nbcc\\r\\ncbccc\\r\\n\", \"output\": [\"85330586\\r\\n\", \"85330586\\n\"]}, {\"input\": \"8 10000\\r\\nbb\\r\\nbbb\\r\\nbaa\\r\\nbbaaa\\r\\nbbabb\\r\\nbaabb\\r\\nab\\r\\nb\\r\\n\", \"output\": [\"921272334\\r\\n\", \"921272334\\n\"]}, {\"input\": \"8 10000\\r\\ncc\\r\\nbcbac\\r\\nc\\r\\nbbbca\\r\\nbab\\r\\nbcb\\r\\naab\\r\\nacbc\\r\\n\", \"output\": [\"62834015\\r\\n\", \"62834015\\n\"]}, {\"input\": \"8 1000000\\r\\nba\\r\\nbaab\\r\\nab\\r\\nbabaa\\r\\na\\r\\nb\\r\\naaa\\r\\nabb\\r\\n\", \"output\": [\"109599579\\n\", \"109599579\\r\\n\"]}, {\"input\": \"8 1000000\\r\\nabbca\\r\\nabcbc\\r\\nbc\\r\\ncb\\r\\nbcbc\\r\\nc\\r\\nb\\r\\nabc\\r\\n\", \"output\": [\"431249243\\n\", \"431249243\\r\\n\"]}, {\"input\": \"8 1000000\\r\\na\\r\\nccdc\\r\\ndac\\r\\nb\\r\\nbdad\\r\\nc\\r\\nadbdd\\r\\nbadbd\\r\\n\", \"output\": [\"467270984\\r\\n\", \"467270984\\n\"]}, {\"input\": \"8 1000000\\r\\nks\\r\\nmbha\\r\\nbyn\\r\\ncz\\r\\ng\\r\\nmv\\r\\nnct\\r\\nbty\\r\\n\", \"output\": [\"206210322\\r\\n\", \"206210322\\n\"]}, {\"input\": \"8 1000000000\\r\\nbbba\\r\\nb\\r\\naab\\r\\naabb\\r\\naba\\r\\nbaabb\\r\\nab\\r\\na\\r\\n\", \"output\": [\"108439359\\r\\n\", \"108439359\\n\"]}, {\"input\": \"8 1000000000\\r\\na\\r\\nacbca\\r\\nabcab\\r\\naabcb\\r\\nb\\r\\ncbb\\r\\nba\\r\\nbaaca\\r\\n\", \"output\": [\"678704568\\r\\n\", \"678704568\\n\"]}, {\"input\": \"8 1000000000\\r\\ndcaab\\r\\ndacdd\\r\\nddbdd\\r\\nbcca\\r\\ndcacd\\r\\nb\\r\\nccbba\\r\\nabdd\\r\\n\", \"output\": [\"458353495\\n\", \"458353495\\r\\n\"]}, {\"input\": \"8 1000000000\\r\\num\\r\\nmruk\\r\\nif\\r\\nsnyg\\r\\njts\\r\\np\\r\\nr\\r\\niwq\\r\\n\", \"output\": [\"108201875\\n\", \"108201875\\r\\n\"]}, {\"input\": \"8 100\\r\\nag\\r\\ncsryq\\r\\nx\\r\\nkj\\r\\nfsw\\r\\ni\\r\\nrxel\\r\\nvix\\r\\n\", \"output\": [\"512164740\\r\\n\", \"512164740\\n\"]}, {\"input\": \"8 10000\\r\\ndegs\\r\\nj\\r\\nhlzua\\r\\niug\\r\\noaow\\r\\nzvyuf\\r\\nwkxv\\r\\nknwln\\r\\n\", \"output\": [\"612606463\\r\\n\", \"612606463\\n\"]}, {\"input\": \"8 1000000\\r\\no\\r\\nnct\\r\\nau\\r\\ncz\\r\\nbty\\r\\ng\\r\\nmv\\r\\nks\\r\\n\", \"output\": [\"944380708\\n\", \"944380708\\r\\n\"]}, {\"input\": \"2 1000000000\\r\\nb\\r\\nab\\r\\n\", \"output\": [\"857532742\\n\", \"857532742\\r\\n\"]}, {\"input\": \"3 1000000000\\r\\ncbb\\r\\na\\r\\nb\\r\\n\", \"output\": [\"801305101\\n\", \"801305101\\r\\n\"]}, {\"input\": \"4 1000000000\\r\\ndcaab\\r\\nabdd\\r\\nccbba\\r\\nbcca\\r\\n\", \"output\": [\"946198550\\n\", \"946198550\\r\\n\"]}, {\"input\": \"8 1000000000\\r\\np\\r\\nr\\r\\nyywvs\\r\\num\\r\\nmruk\\r\\nsnyg\\r\\njts\\r\\nif\\r\\n\", \"output\": [\"91058640\\r\\n\", \"91058640\\n\"]}, {\"input\": \"8 1000000000\\r\\naaaaa\\r\\naaaa\\r\\nbbbbb\\r\\nbbbb\\r\\nccccc\\r\\ncccc\\r\\nddddd\\r\\ndddd\\r\\n\", \"output\": [\"906861955\\r\\n\", \"906861955\\n\"]}, {\"input\": \"8 1000000000\\r\\nbb\\r\\naaba\\r\\naabab\\r\\nab\\r\\nbbbb\\r\\nbba\\r\\nbab\\r\\naabba\\r\\n\", \"output\": [\"863094010\\n\", \"863094010\\r\\n\"]}, {\"input\": \"8 1000000000\\r\\nb\\r\\nbabab\\r\\nbaba\\r\\nab\\r\\nbb\\r\\naabaa\\r\\nbbbab\\r\\naa\\r\\n\", \"output\": [\"862350285\\r\\n\", \"862350285\\n\"]}, {\"input\": \"8 1000000000\\r\\nbaab\\r\\nbbbba\\r\\nb\\r\\nabab\\r\\na\\r\\nbabab\\r\\nabbb\\r\\naabb\\r\\n\", \"output\": [\"174056525\\n\", \"174056525\\r\\n\"]}, {\"input\": \"8 1000000000\\r\\nbbaba\\r\\nbab\\r\\nbaabb\\r\\nabbba\\r\\na\\r\\nb\\r\\nbbbab\\r\\naaab\\r\\n\", \"output\": [\"134173168\\r\\n\", \"134173168\\n\"]}, {\"input\": \"8 1000000000\\r\\naaaa\\r\\nbabbb\\r\\nbbaab\\r\\nabbbb\\r\\nabb\\r\\na\\r\\nbaaab\\r\\nbabab\\r\\n\", \"output\": [\"431759116\\n\", \"431759116\\r\\n\"]}, {\"input\": \"8 1000000000\\r\\nbaaaa\\r\\nbba\\r\\naaabb\\r\\nabbaa\\r\\nababb\\r\\naab\\r\\naaaba\\r\\naabaa\\r\\n\", \"output\": [\"749577944\\r\\n\", \"749577944\\n\"]}, {\"input\": \"8 1000000000\\r\\nbabba\\r\\nb\\r\\nbb\\r\\nbbaaa\\r\\naaaba\\r\\nabaab\\r\\naabaa\\r\\nbaaba\\r\\n\", \"output\": [\"3182713\\n\", \"3182713\\r\\n\"]}, {\"input\": \"8 1000000000\\r\\nbaabb\\r\\nbabbb\\r\\nb\\r\\naabbb\\r\\nbbbba\\r\\nbbaa\\r\\nabbbb\\r\\nabab\\r\\n\", \"output\": [\"834686688\\r\\n\", \"834686688\\n\"]}, {\"input\": \"8 671088639\\r\\naaaaa\\r\\naaaa\\r\\nbbbbb\\r\\nbbbb\\r\\nccccc\\r\\ncccc\\r\\nddddd\\r\\ndddd\\r\\n\", \"output\": [\"840688293\\r\\n\", \"840688293\\n\"]}, {\"input\": \"8 671088639\\r\\naaaaa\\r\\naaaa\\r\\nbbbbb\\r\\nbbbb\\r\\naaabb\\r\\nbbbaa\\r\\naabbb\\r\\nbbaaa\\r\\n\", \"output\": [\"376573480\\r\\n\", \"376573480\\n\"]}, {\"input\": \"8 671088639\\r\\naaaaa\\r\\naaaa\\r\\nbbbbb\\r\\nbbbb\\r\\naaaab\\r\\nbbbba\\r\\naaabb\\r\\nbbbaa\\r\\n\", \"output\": [\"775296008\\n\", \"775296008\\r\\n\"]}, {\"input\": \"8 805306367\\r\\naaaaa\\r\\naaaab\\r\\naaabb\\r\\naabbb\\r\\nabbbb\\r\\nbbbbb\\r\\naaaa\\r\\nbbbb\\r\\n\", \"output\": [\"233390545\\r\\n\", \"233390545\\n\"]}, {\"input\": \"8 805306367\\r\\nbbbb\\r\\nabbaa\\r\\nababa\\r\\naabba\\r\\nbbaab\\r\\nbabab\\r\\nbaabb\\r\\nbbbbb\\r\\n\", \"output\": [\"40171194\\n\", \"40171194\\r\\n\"]}, {\"input\": \"8 805306367\\r\\naaaaa\\r\\nbbbbb\\r\\nccccc\\r\\nddddd\\r\\neeeee\\r\\nfffff\\r\\nggggg\\r\\nhhhhh\\r\\n\", \"output\": [\"0\\r\\n\", \"0\\n\"]}, {\"input\": \"8 805306367\\r\\naeifj\\r\\ncaeif\\r\\neifjg\\r\\nfjgc\\r\\nfjgca\\r\\ngcaei\\r\\nifjgc\\r\\njgcae\\r\\n\", \"output\": [\"223759404\\n\", \"223759404\\r\\n\"]}, {\"input\": \"8 805306367\\r\\nbidek\\r\\ndekhj\\r\\nekhjb\\r\\nhjbid\\r\\nidekh\\r\\njbide\\r\\nkhjbi\\r\\nbide\\r\\n\", \"output\": [\"223759404\\n\", \"223759404\\r\\n\"]}, {\"input\": \"8 805306365\\r\\ncefdj\\r\\ndjhic\\r\\nefdjh\\r\\nfdjhi\\r\\nhicef\\r\\nicefd\\r\\njhice\\r\\ndjhi\\r\\n\", \"output\": [\"275348811\\r\\n\", \"275348811\\n\"]}, {\"input\": \"3 5\\nababa\\nab\\na\\n\", \"output\": [\"11\\n\", \"11\", \"11\\n\"]}, {\"input\": \"2 4\\nab\\ncd\\n\", \"output\": [\"4\", \"4\\n\", \"4\\n\"]}, {\"input\": \"5 100\\na\\naa\\naaa\\naaaa\\naaaaa\\n\", \"output\": [\"142528942\", \"142528942\\n\", \"142528942\\n\"]}, {\"input\": \"8 3\\nba\\nbbb\\nbb\\naba\\naab\\nbaa\\nb\\na\\n\", \"output\": [\"56\", \"56\\n\", \"56\\n\"]}, {\"input\": \"8 5\\nabb\\nbaa\\na\\naba\\naa\\nb\\nba\\nbb\\n\", \"output\": [\"1824\", \"1824\\n\", \"1824\\n\"]}, {\"input\": \"8 10\\naa\\nba\\na\\naaa\\nbb\\naab\\naba\\nb\\n\", \"output\": [\"7610511\\n\", \"7610511\\n\", \"7610511\"]}, {\"input\": \"8 10\\nbac\\naa\\nbbac\\nbcc\\nbbca\\naac\\nabba\\nbbba\\n\", \"output\": [\"227\", \"227\\n\", \"227\\n\"]}, {\"input\": \"8 100\\naabab\\naaa\\naba\\nbbaba\\na\\naa\\nbabba\\nbba\\n\", \"output\": [\"452563662\\n\", \"452563662\\n\", \"452563662\"]}, {\"input\": \"8 100\\ncbb\\nbaaba\\ncc\\nacb\\nabbba\\nbb\\nbcc\\ncbccc\\n\", \"output\": [\"85330586\", \"85330586\\n\", \"85330586\\n\"]}, {\"input\": \"8 10000\\nbb\\nbbb\\nbaa\\nbbaaa\\nbbabb\\nbaabb\\nab\\nb\\n\", \"output\": [\"921272334\", \"921272334\\n\", \"921272334\\n\"]}, {\"input\": \"8 10000\\ncc\\nbcbac\\nc\\nbbbca\\nbab\\nbcb\\naab\\nacbc\\n\", \"output\": [\"62834015\", \"62834015\\n\", \"62834015\\n\"]}, {\"input\": \"8 1000000\\nba\\nbaab\\nab\\nbabaa\\na\\nb\\naaa\\nabb\\n\", \"output\": [\"109599579\\n\", \"109599579\\n\", \"109599579\"]}, {\"input\": \"8 1000000\\nabbca\\nabcbc\\nbc\\ncb\\nbcbc\\nc\\nb\\nabc\\n\", \"output\": [\"431249243\\n\", \"431249243\\n\", \"431249243\"]}, {\"input\": \"8 1000000\\na\\nccdc\\ndac\\nb\\nbdad\\nc\\nadbdd\\nbadbd\\n\", \"output\": [\"467270984\", \"467270984\\n\", \"467270984\\n\"]}, {\"input\": \"8 1000000\\nks\\nmbha\\nbyn\\ncz\\ng\\nmv\\nnct\\nbty\\n\", \"output\": [\"206210322\\n\", \"206210322\\n\", \"206210322\"]}, {\"input\": \"8 1000000000\\nbbba\\nb\\naab\\naabb\\naba\\nbaabb\\nab\\na\\n\", \"output\": [\"108439359\\n\", \"108439359\\n\", \"108439359\"]}, {\"input\": \"8 1000000000\\na\\nacbca\\nabcab\\naabcb\\nb\\ncbb\\nba\\nbaaca\\n\", \"output\": [\"678704568\\n\", \"678704568\", \"678704568\\n\"]}, {\"input\": \"8 1000000000\\ndcaab\\ndacdd\\nddbdd\\nbcca\\ndcacd\\nb\\nccbba\\nabdd\\n\", \"output\": [\"458353495\\n\", \"458353495\\n\", \"458353495\"]}, {\"input\": \"8 1000000000\\num\\nmruk\\nif\\nsnyg\\njts\\np\\nr\\niwq\\n\", \"output\": [\"108201875\", \"108201875\\n\", \"108201875\\n\"]}, {\"input\": \"8 100\\nag\\ncsryq\\nx\\nkj\\nfsw\\ni\\nrxel\\nvix\\n\", \"output\": [\"512164740\\n\", \"512164740\\n\", \"512164740\"]}, {\"input\": \"8 10000\\ndegs\\nj\\nhlzua\\niug\\noaow\\nzvyuf\\nwkxv\\nknwln\\n\", \"output\": [\"612606463\\n\", \"612606463\", \"612606463\\n\"]}, {\"input\": \"8 1000000\\no\\nnct\\nau\\ncz\\nbty\\ng\\nmv\\nks\\n\", \"output\": [\"944380708\\n\", \"944380708\", \"944380708\\n\"]}, {\"input\": \"2 1000000000\\nb\\nab\\n\", \"output\": [\"857532742\\n\", \"857532742\", \"857532742\\n\"]}, {\"input\": \"3 1000000000\\ncbb\\na\\nb\\n\", \"output\": [\"801305101\\n\", \"801305101\", \"801305101\\n\"]}, {\"input\": \"4 1000000000\\ndcaab\\nabdd\\nccbba\\nbcca\\n\", \"output\": [\"946198550\\n\", \"946198550\\n\", \"946198550\"]}, {\"input\": \"8 1000000000\\np\\nr\\nyywvs\\num\\nmruk\\nsnyg\\njts\\nif\\n\", \"output\": [\"91058640\\n\", \"91058640\", \"91058640\\n\"]}, {\"input\": \"8 1000000000\\naaaaa\\naaaa\\nbbbbb\\nbbbb\\nccccc\\ncccc\\nddddd\\ndddd\\n\", \"output\": [\"906861955\\n\", \"906861955\\n\", \"906861955\"]}, {\"input\": \"8 1000000000\\nbb\\naaba\\naabab\\nab\\nbbbb\\nbba\\nbab\\naabba\\n\", \"output\": [\"863094010\\n\", \"863094010\", \"863094010\\n\"]}, {\"input\": \"8 1000000000\\nb\\nbabab\\nbaba\\nab\\nbb\\naabaa\\nbbbab\\naa\\n\", \"output\": [\"862350285\\n\", \"862350285\", \"862350285\\n\"]}, {\"input\": \"8 1000000000\\nbaab\\nbbbba\\nb\\nabab\\na\\nbabab\\nabbb\\naabb\\n\", \"output\": [\"174056525\\n\", \"174056525\\n\", \"174056525\"]}, {\"input\": \"8 1000000000\\nbbaba\\nbab\\nbaabb\\nabbba\\na\\nb\\nbbbab\\naaab\\n\", \"output\": [\"134173168\\n\", \"134173168\\n\", \"134173168\"]}, {\"input\": \"8 1000000000\\naaaa\\nbabbb\\nbbaab\\nabbbb\\nabb\\na\\nbaaab\\nbabab\\n\", \"output\": [\"431759116\", \"431759116\\n\", \"431759116\\n\"]}, {\"input\": \"8 1000000000\\nbaaaa\\nbba\\naaabb\\nabbaa\\nababb\\naab\\naaaba\\naabaa\\n\", \"output\": [\"749577944\\n\", \"749577944\\n\", \"749577944\"]}, {\"input\": \"8 1000000000\\nbabba\\nb\\nbb\\nbbaaa\\naaaba\\nabaab\\naabaa\\nbaaba\\n\", \"output\": [\"3182713\", \"3182713\\n\", \"3182713\\n\"]}, {\"input\": \"8 1000000000\\nbaabb\\nbabbb\\nb\\naabbb\\nbbbba\\nbbaa\\nabbbb\\nabab\\n\", \"output\": [\"834686688\\n\", \"834686688\", \"834686688\\n\"]}, {\"input\": \"8 671088639\\naaaaa\\naaaa\\nbbbbb\\nbbbb\\nccccc\\ncccc\\nddddd\\ndddd\\n\", \"output\": [\"840688293\", \"840688293\\n\", \"840688293\\n\"]}, {\"input\": \"8 671088639\\naaaaa\\naaaa\\nbbbbb\\nbbbb\\naaabb\\nbbbaa\\naabbb\\nbbaaa\\n\", \"output\": [\"376573480\\n\", \"376573480\\n\", \"376573480\"]}, {\"input\": \"8 671088639\\naaaaa\\naaaa\\nbbbbb\\nbbbb\\naaaab\\nbbbba\\naaabb\\nbbbaa\\n\", \"output\": [\"775296008\\n\", \"775296008\", \"775296008\\n\"]}, {\"input\": \"8 805306367\\naaaaa\\naaaab\\naaabb\\naabbb\\nabbbb\\nbbbbb\\naaaa\\nbbbb\\n\", \"output\": [\"233390545\", \"233390545\\n\", \"233390545\\n\"]}, {\"input\": \"8 805306367\\nbbbb\\nabbaa\\nababa\\naabba\\nbbaab\\nbabab\\nbaabb\\nbbbbb\\n\", \"output\": [\"40171194\\n\", \"40171194\\n\", \"40171194\"]}, {\"input\": \"8 805306367\\naaaaa\\nbbbbb\\nccccc\\nddddd\\neeeee\\nfffff\\nggggg\\nhhhhh\\n\", \"output\": [\"0\\n\", \"0\", \"0\\n\"]}, {\"input\": \"8 805306367\\naeifj\\ncaeif\\neifjg\\nfjgc\\nfjgca\\ngcaei\\nifjgc\\njgcae\\n\", \"output\": [\"223759404\", \"223759404\\n\", \"223759404\\n\"]}, {\"input\": \"8 805306367\\nbidek\\ndekhj\\nekhjb\\nhjbid\\nidekh\\njbide\\nkhjbi\\nbide\\n\", \"output\": [\"223759404\", \"223759404\\n\", \"223759404\\n\"]}, {\"input\": \"8 805306365\\ncefdj\\ndjhic\\nefdjh\\nfdjhi\\nhicef\\nicefd\\njhice\\ndjhi\\n\", \"output\": [\"275348811\\n\", \"275348811\", \"275348811\\n\"]}]"} {"prob_desc_description":"Little Johnny Bubbles enjoys spending hours in front of his computer playing video games. His favorite game is Bubble Strike, fast-paced bubble shooting online game for two players.Each game is set in one of the N maps, each having different terrain configuration. First phase of each game decides on which map the game will be played. The game system randomly selects three maps and shows them to the players. Each player must pick one of those three maps to be discarded. The game system then randomly selects one of the maps that were not picked by any of the players and starts the game.Johnny is deeply enthusiastic about the game and wants to spend some time studying maps, thus increasing chances to win games played on those maps. However, he also needs to do his homework, so he does not have time to study all the maps. That is why he asked himself the following question: \"What is the minimum number of maps I have to study, so that the probability to play one of those maps is at least $$$P$$$\"?Can you help Johnny find the answer for this question? You can assume Johnny's opponents do not know him, and they will randomly pick maps.","prob_desc_output_spec":"Output contains one integer number \u2013 minimum number of maps Johnny has to study.","lang_cluster":"","src_uid":"788ed59a964264bd0e755e155a37e14d","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["combinatorics","binary search","ternary search","probabilities","math"],"prob_desc_created_at":"1633770300","prob_desc_sample_inputs":"[\"7 1.0000\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":2000.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"0.5 seconds","prob_desc_input_spec":"The first line contains two integers $$$N$$$ ($$$3$$$ $$$\\leq$$$ $$$N$$$ $$$\\leq$$$ $$$10^{3}$$$) and $$$P$$$ ($$$0$$$ $$$\\leq$$$ $$$P$$$ $$$\\leq$$$ $$$1$$$) \u2013 total number of maps in the game and probability to play map Johnny has studied. $$$P$$$ will have at most four digits after the decimal point.","prob_desc_sample_outputs":"[\"6\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"7 1.0000\\n\", \"output\": [\"6\", \"6\\n\", \"6 \\n\", \"6\\n\\n\"]}, {\"input\": \"3 0.0000\\n\", \"output\": [\"0\\n\\n\", \"0\\n\", \"0\", \"0 \\n\"]}, {\"input\": \"3 1.0000\\n\", \"output\": [\"2\\n\", \"2\\n\\n\", \"2\", \"2 \\n\"]}, {\"input\": \"1000 0.0000\\n\", \"output\": [\"0\\n\\n\", \"0\\n\", \"0\", \"0 \\n\"]}, {\"input\": \"1000 1.0000\\n\", \"output\": [\"999\\n\\n\", \"999\\n\", \"999\", \"999 \\n\"]}, {\"input\": \"999 1.0000\\n\", \"output\": [\"998\\n\", \"998 \\n\", \"998\", \"998\\n\\n\"]}, {\"input\": \"38 0.2356\\n\", \"output\": [\"6\", \"6\\n\", \"6 \\n\", \"6\\n\\n\"]}, {\"input\": \"217 0.0744\\n\", \"output\": [\"11\", \"11\\n\", \"11 \\n\", \"11\\n\\n\"]}, {\"input\": \"847 0.3600\\n\", \"output\": [\"208 \\n\", \"208\", \"208\\n\\n\", \"208\\n\"]}, {\"input\": \"357 0.9853\\n\", \"output\": [\"321\", \"321\\n\", \"321 \\n\", \"321\\n\\n\"]}, {\"input\": \"440 0.9342\\n\", \"output\": [\"344 \\n\", \"344\\n\\n\", \"344\", \"344\\n\"]}, {\"input\": \"848 0.8576\\n\", \"output\": [\"571 \\n\", \"571\\n\\n\", \"571\", \"571\\n\"]}, {\"input\": \"141 0.0086\\n\", \"output\": [\"1\\n\\n\", \"1\", \"1\\n\", \"1 \\n\"]}, {\"input\": \"517 0.4859\\n\", \"output\": [\"174\\n\", \"174\\n\\n\", \"174\", \"174 \\n\"]}, {\"input\": \"937 0.8022\\n\", \"output\": [\"573\", \"573\\n\", \"573\\n\\n\", \"573 \\n\"]}, {\"input\": \"995 0.4480\\n\", \"output\": [\"307\\n\", \"307\", \"307\\n\\n\", \"307 \\n\"]}, {\"input\": \"956 0.9733\\n\", \"output\": [\"826\", \"826\\n\\n\", \"826\\n\", \"826 \\n\"]}, {\"input\": \"634 0.7906\\n\", \"output\": [\"380\\n\\n\", \"380\\n\", \"380\", \"380 \\n\"]}, {\"input\": \"439 0.0404\\n\", \"output\": [\"12\\n\\n\", \"12\", \"12\\n\", \"12 \\n\"]}, {\"input\": \"853 0.0684\\n\", \"output\": [\"39 \\n\", \"39\", \"39\\n\", \"39\\n\\n\"]}, {\"input\": \"716 0.9851\\n\", \"output\": [\"643 \\n\", \"643\\n\\n\", \"643\", \"643\\n\"]}, {\"input\": \"444 0.0180\\n\", \"output\": [\"6\", \"6\\n\", \"6 \\n\", \"6\\n\\n\"]}, {\"input\": \"840 0.5672\\n\", \"output\": [\"336\", \"336 \\n\", \"336\\n\\n\", \"336\\n\"]}, {\"input\": \"891 0.6481\\n\", \"output\": [\"415\\n\", \"415 \\n\", \"415\", \"415\\n\\n\"]}, {\"input\": \"588 0.3851\\n\", \"output\": [\"155 \\n\", \"155\", \"155\\n\", \"155\\n\\n\"]}, {\"input\": \"444 0.0265\\n\", \"output\": [\"8\", \"8\\n\", \"8 \\n\", \"8\\n\\n\"]}, {\"input\": \"504 0.2099\\n\", \"output\": [\"71\", \"71\\n\", \"71\\n\\n\", \"71 \\n\"]}, {\"input\": \"195 0.5459\\n\", \"output\": [\"75\", \"75\\n\\n\", \"75 \\n\", \"75\\n\"]}, {\"input\": \"566 0.6282\\n\", \"output\": [\"254\\n\", \"254\", \"254 \\n\", \"254\\n\\n\"]}, {\"input\": \"200 0.9495\\n\", \"output\": [\"162\", \"162\\n\\n\", \"162\\n\", \"162 \\n\"]}, {\"input\": \"571 0.5208\\n\", \"output\": [\"208 \\n\", \"208\", \"208\\n\\n\", \"208\\n\"]}, {\"input\": \"622 0.8974\\n\", \"output\": [\"452\\n\", \"452 \\n\", \"452\", \"452\\n\\n\"]}, {\"input\": \"267 0.4122\\n\", \"output\": [\"76\", \"76 \\n\", \"76\\n\", \"76\\n\\n\"]}, {\"input\": \"364 0.3555\\n\", \"output\": [\"88\\n\\n\", \"88 \\n\", \"88\\n\", \"88\"]}, {\"input\": \"317 0.2190\\n\", \"output\": [\"47\", \"47\\n\\n\", \"47\\n\", \"47 \\n\"]}, {\"input\": \"329 0.5879\\n\", \"output\": [\"137\\n\", \"137 \\n\", \"137\\n\\n\", \"137\"]}]"} {"prob_desc_description":"You are given an undirected graph consisting of $$$n$$$ vertices and $$$m$$$ edges. Initially there is a single integer written on every vertex: the vertex $$$i$$$ has $$$p_i$$$ written on it. All $$$p_i$$$ are distinct integers from $$$1$$$ to $$$n$$$.You have to process $$$q$$$ queries of two types: $$$1$$$ $$$v$$$ \u2014 among all vertices reachable from the vertex $$$v$$$ using the edges of the graph (including the vertex $$$v$$$ itself), find a vertex $$$u$$$ with the largest number $$$p_u$$$ written on it, print $$$p_u$$$ and replace $$$p_u$$$ with $$$0$$$; $$$2$$$ $$$i$$$ \u2014 delete the $$$i$$$-th edge from the graph. Note that, in a query of the first type, it is possible that all vertices reachable from $$$v$$$ have $$$0$$$ written on them. In this case, $$$u$$$ is not explicitly defined, but since the selection of $$$u$$$ does not affect anything, you can choose any vertex reachable from $$$v$$$ and print its value (which is $$$0$$$). ","prob_desc_output_spec":"For every query of the first type, print the value of $$$p_u$$$ written on the chosen vertex $$$u$$$.","lang_cluster":"","src_uid":"ad014bde729222db14f38caa521e4167","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["trees","data structures","graphs","dsu","implementation"],"prob_desc_created_at":"1601219100","prob_desc_sample_inputs":"[\"5 4 6\\n1 2 5 4 3\\n1 2\\n2 3\\n1 3\\n4 5\\n1 1\\n2 1\\n2 3\\n1 1\\n1 2\\n1 2\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":2600.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1.5 seconds","prob_desc_input_spec":"The first line contains three integers $$$n$$$, $$$m$$$ and $$$q$$$ ($$$1 \\le n \\le 2 \\cdot 10^5$$$; $$$1 \\le m \\le 3 \\cdot 10^5$$$; $$$1 \\le q \\le 5 \\cdot 10^5$$$). The second line contains $$$n$$$ distinct integers $$$p_1$$$, $$$p_2$$$, ..., $$$p_n$$$, where $$$p_i$$$ is the number initially written on vertex $$$i$$$ ($$$1 \\le p_i \\le n$$$). Then $$$m$$$ lines follow, the $$$i$$$-th of them contains two integers $$$a_i$$$ and $$$b_i$$$ ($$$1 \\le a_i, b_i \\le n$$$, $$$a_i \\ne b_i$$$) and means that the $$$i$$$-th edge connects vertices $$$a_i$$$ and $$$b_i$$$. It is guaranteed that the graph does not contain multi-edges. Then $$$q$$$ lines follow, which describe the queries. Each line is given by one of the following formats: $$$1$$$ $$$v$$$ \u2014 denotes a query of the first type with a vertex $$$v$$$ ($$$1 \\le v \\le n$$$). $$$2$$$ $$$i$$$ \u2014 denotes a query of the second type with an edge $$$i$$$ ($$$1 \\le i \\le m$$$). For each query of the second type, it is guaranteed that the corresponding edge is not deleted from the graph yet. ","prob_desc_sample_outputs":"[\"5\\n1\\n2\\n0\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"5 4 6\\r\\n1 2 5 4 3\\r\\n1 2\\r\\n2 3\\r\\n1 3\\r\\n4 5\\r\\n1 1\\r\\n2 1\\r\\n2 3\\r\\n1 1\\r\\n1 2\\r\\n1 2\\r\\n\", \"output\": [\"5\\r\\n1\\r\\n2\\r\\n0\"]}, {\"input\": \"6 5 8\\r\\n1 2 6 3 4 5\\r\\n2 4\\r\\n1 3\\r\\n1 6\\r\\n3 5\\r\\n2 5\\r\\n1 1\\r\\n1 4\\r\\n1 1\\r\\n2 1\\r\\n2 5\\r\\n2 2\\r\\n2 3\\r\\n1 4\\r\\n\", \"output\": [\"6\\r\\n5\\r\\n4\\r\\n3\"]}, {\"input\": \"9 5 14\\r\\n7 1 4 8 5 2 6 9 3\\r\\n2 8\\r\\n1 6\\r\\n5 7\\r\\n1 3\\r\\n3 9\\r\\n1 5\\r\\n1 8\\r\\n1 5\\r\\n1 4\\r\\n1 8\\r\\n1 3\\r\\n1 5\\r\\n1 5\\r\\n1 7\\r\\n1 7\\r\\n2 3\\r\\n1 2\\r\\n1 1\\r\\n1 2\\r\\n\", \"output\": [\"6\\r\\n9\\r\\n5\\r\\n8\\r\\n1\\r\\n7\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n4\\r\\n0\"]}, {\"input\": \"96 141 151\\r\\n94 95 96 15 36 76 48 59 46 34 6 39 43 2 54 64 71 91 18 3 79 50 89 61 40 88 51 67 37 52 41 30 29 8 55 26 9 14 82 17 63 19 56 74 87 31 5 38 60 10 66 83 35 62 1 77 90 68 24 70 23 22 13 7 45 4 20 53 32 78 73 86 11 85 72 21 28 42 44 57 93 75 92 80 47 12 33 16 84 58 69 25 81 65 27 49\\r\\n18 43\\r\\n31 68\\r\\n12 47\\r\\n41 46\\r\\n18 29\\r\\n7 70\\r\\n72 86\\r\\n46 90\\r\\n84 93\\r\\n26 69\\r\\n54 68\\r\\n48 61\\r\\n49 80\\r\\n10 46\\r\\n14 85\\r\\n77 88\\r\\n10 28\\r\\n20 56\\r\\n49 57\\r\\n7 40\\r\\n4 54\\r\\n35 80\\r\\n32 67\\r\\n16 61\\r\\n24 83\\r\\n20 94\\r\\n58 66\\r\\n67 72\\r\\n3 35\\r\\n70 85\\r\\n39 78\\r\\n63 79\\r...\", \"output\": [\"96\\r\\n95\\r\\n94\\r\\n93\\r\\n92\\r\\n91\\r\\n90\\r\\n89\\r\\n88\\r\\n87\\r\\n86\\r\\n85\\r\\n84\\r\\n83\\r\\n82\\r\\n81\\r\\n80\\r\\n79\\r\\n78\\r\\n77\\r\\n75\\r\\n74\\r\\n73\\r\\n72\\r\\n71\\r\\n70\\r\\n69\\r\\n68\\r\\n67\\r\\n66\\r\\n65\\r\\n64\\r\\n40\\r\\n63\\r\\n62\\r\\n60\\r\\n59\\r\\n58\\r\\n57\\r\\n56\\r\\n55\\r\\n54\\r\\n53\\r\\n51\\r\\n50\\r\\n61\\r\\n49\\r\\n48\\r\\n47\\r\\n46\\r\\n45\\r\\n44\\r\\n43\\r\\n42\\r\\n41\\r\\n39\\r\\n38\\r\\n37\\r\\n36\\r\\n35\\r\\n34\\r\\n33\\r\\n32\\r\\n31\\r\\n30\\r\\n0\\r\\n29\\r\\n28\\r\\n0\\r\\n26\\r\\n25\\r\\n17\\r\\n52\\r\\n0\\r\\n24\\r\\n20\\r\\n18\\r\\n16\\r\\n15\\r\\n14\\r\\n10\"]}, {\"input\": \"95 135 175\\r\\n65 40 61 17 58 55 77 84 79 27 35 54 87 36 25 2 45 43 63 34 89 15 49 60 42 20 10 9 7 38 5 74 52 16 56 14 6 29 53 57 46 78 28 95 8 72 32 50 85 66 62 4 13 3 19 39 48 41 33 31 70 37 1 64 44 51 18 94 83 82 11 23 21 47 22 30 24 75 92 93 88 76 80 59 91 67 12 69 81 71 68 90 26 73 86\\r\\n39 74\\r\\n6 32\\r\\n78 81\\r\\n43 93\\r\\n71 79\\r\\n59 77\\r\\n31 49\\r\\n29 88\\r\\n22 56\\r\\n5 70\\r\\n39 46\\r\\n53 58\\r\\n17 19\\r\\n18 64\\r\\n11 67\\r\\n14 69\\r\\n72 80\\r\\n18 40\\r\\n5 60\\r\\n6 80\\r\\n5 45\\r\\n63 83\\r\\n8 55\\r\\n79 93\\r\\n65 91\\r\\n15 67\\r\\n6 23\\r\\n21 68\\r\\n57 84\\r\\n24 85\\r\\n19 85\\r\\n51 67\\r\\n11 69...\", \"output\": [\"95\\r\\n94\\r\\n93\\r\\n92\\r\\n91\\r\\n90\\r\\n89\\r\\n88\\r\\n87\\r\\n86\\r\\n85\\r\\n84\\r\\n83\\r\\n82\\r\\n81\\r\\n80\\r\\n61\\r\\n79\\r\\n78\\r\\n77\\r\\n75\\r\\n74\\r\\n73\\r\\n72\\r\\n71\\r\\n70\\r\\n69\\r\\n68\\r\\n67\\r\\n76\\r\\n66\\r\\n65\\r\\n64\\r\\n63\\r\\n62\\r\\n59\\r\\n58\\r\\n0\\r\\n57\\r\\n56\\r\\n0\\r\\n55\\r\\n54\\r\\n53\\r\\n52\\r\\n51\\r\\n50\\r\\n49\\r\\n4\\r\\n41\\r\\n60\\r\\n3\\r\\n48\\r\\n47\\r\\n46\\r\\n45\\r\\n0\\r\\n0\\r\\n44\\r\\n15\\r\\n8\\r\\n0\\r\\n43\\r\\n42\\r\\n25\\r\\n40\\r\\n36\\r\\n34\\r\\n0\\r\\n35\\r\\n5\\r\\n39\\r\\n33\\r\\n0\\r\\n32\\r\\n0\\r\\n30\\r\\n0\\r\\n28\\r\\n29\\r\\n0\\r\\n27\\r\\n26\\r\\n24\\r\\n0\\r\\n20\\r\\n0\\r\\n0\\r\\n16\\r\\n9\\r\\n0\\r\\n0\\r\\n12\\r\\n0\"]}, {\"input\": \"95 136 190\\r\\n43 38 21 83 75 16 90 31 17 2 30 50 11 9 19 48 32 88 58 60 62 53 85 82 78 12 79 47 94 63 33 7 95 35 52 69 40 64 74 10 1 56 3 71 37 92 27 67 13 29 6 46 51 65 39 61 23 72 14 87 20 91 93 84 73 57 68 8 41 42 80 26 54 70 18 66 45 86 5 4 55 89 15 49 59 81 24 34 44 36 25 76 77 22 28\\r\\n35 48\\r\\n30 55\\r\\n57 64\\r\\n35 95\\r\\n60 90\\r\\n47 74\\r\\n7 28\\r\\n26 85\\r\\n37 91\\r\\n26 42\\r\\n12 83\\r\\n33 36\\r\\n24 88\\r\\n54 78\\r\\n62 86\\r\\n2 39\\r\\n62 93\\r\\n33 48\\r\\n41 80\\r\\n40 88\\r\\n91 94\\r\\n60 94\\r\\n55 87\\r\\n51 69\\r\\n48 93\\r\\n48 78\\r\\n13 79\\r\\n22 78\\r\\n38 91\\r\\n69 74\\r\\n64 90\\r\\n19 81\\r\\n...\", \"output\": [\"95\\r\\n94\\r\\n93\\r\\n92\\r\\n91\\r\\n90\\r\\n89\\r\\n88\\r\\n87\\r\\n78\\r\\n86\\r\\n85\\r\\n75\\r\\n84\\r\\n83\\r\\n82\\r\\n81\\r\\n80\\r\\n79\\r\\n77\\r\\n76\\r\\n74\\r\\n73\\r\\n48\\r\\n72\\r\\n71\\r\\n70\\r\\n68\\r\\n67\\r\\n66\\r\\n65\\r\\n64\\r\\n4\\r\\n63\\r\\n62\\r\\n61\\r\\n60\\r\\n58\\r\\n57\\r\\n56\\r\\n0\\r\\n69\\r\\n1\\r\\n55\\r\\n54\\r\\n53\\r\\n52\\r\\n51\\r\\n42\\r\\n50\\r\\n44\\r\\n49\\r\\n47\\r\\n45\\r\\n43\\r\\n0\\r\\n41\\r\\n46\\r\\n0\\r\\n40\\r\\n39\\r\\n37\\r\\n36\\r\\n0\\r\\n17\\r\\n14\\r\\n7\\r\\n34\\r\\n32\\r\\n6\\r\\n25\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n30\\r\\n2\\r\\n27\\r\\n38\\r\\n22\\r\\n20\\r\\n0\\r\\n0\\r\\n18\\r\\n0\\r\\n11\\r\\n29\\r\\n21\\r\\n3\\r\\n28\\r\\n0\\r\\n0\"]}, {\"input\": \"199998 299995 500000\\r\\n153412 35198 17343 46228 6928 75192 114464 157343 77601 124480 35526 8250 159607 117598 127301 14907 142148 113646 9279 13964 100293 191098 67767 174884 195356 172276 148583 67937 76083 62111 74204 157877 6258 199948 110132 73279 133863 66457 141633 37349 102702 136082 172280 171155 107690 146380 79248 79444 90312 12813 111262 18340 130380 22636 47489 123750 92754 120437 132649 184554 120382 8761 70744 7602 161965 191117 148929 165312 41648 33800 30457 185926 175425 90428 162843 62284...\", \"output\": [\"199998\\r\\n199997\\r\\n199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r...\"]}, {\"input\": \"199996 299992 500000\\r\\n134969 119070 62268 75542 161097 173429 45635 151168 19946 135122 74875 134424 31874 37302 79901 81696 42708 90725 196628 129748 21626 87953 174792 7460 158323 25320 68197 47874 14595 3536 14822 189176 199180 69986 20660 66406 31439 93214 26489 119279 158389 102844 118926 25739 118514 167586 111517 57976 166780 197301 88273 39379 137688 76319 110925 23009 54749 142749 137334 179650 188691 154104 59776 71041 164658 111663 167798 66632 13396 119714 175605 19059 63569 50549 84981 113073 ...\", \"output\": [\"199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r...\"]}, {\"input\": \"200000 299998 500000\\r\\n63954 186266 141361 37431 119610 97083 85069 51029 71720 199562 148270 183111 93287 197272 132986 184628 76678 9926 112644 103293 26006 181326 94392 74861 7606 154319 81537 92058 167401 118222 60803 160416 97000 89617 128732 168038 98960 100507 31036 143779 400 182663 119262 45751 79146 87393 41734 105835 160167 168566 161531 94869 60050 54311 196202 98422 78561 168636 107719 154079 115735 44228 42704 151318 58277 191724 76745 93644 117287 4387 41455 178742 194641 151300 171235 131516...\", \"output\": [\"200000\\r\\n199999\\r\\n199998\\r\\n199997\\r\\n199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r...\"]}, {\"input\": \"199998 299996 500000\\r\\n181007 145459 43706 122329 124404 59328 176095 51696 41499 43811 45123 82905 195328 80344 20782 102980 158516 166155 38254 6195 9192 21696 168146 166868 93724 127345 21765 81568 173820 158620 52734 168654 44342 80483 184804 79826 79596 144292 87781 155604 188568 20602 81604 101679 128809 27347 124214 194856 47065 54059 40486 79412 95100 93384 59132 156771 186347 187589 17444 35503 44710 176266 63308 159420 48713 151645 79239 191000 28002 112544 63362 50622 6545 153038 120370 80215 190...\", \"output\": [\"199998\\r\\n199997\\r\\n199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r...\"]}, {\"input\": \"199978 199971 247151\\r\\n122905 77210 171173 112732 151982 126721 165720 29934 91387 187388 188392 70313 156833 145317 127748 192782 70892 137438 97296 103831 150427 196878 104095 134289 66928 156667 1317 467 46663 189057 35199 132170 95449 141615 49430 100725 89056 178237 60781 161876 99968 197781 38856 40660 10306 127540 132253 37153 121676 81157 147517 19903 32423 100856 113653 113853 9394 119349 30169 119457 196399 133093 59051 183693 173482 159337 199125 189757 163555 68269 75744 76142 67971 107116 19856...\", \"output\": [\"199978\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199977\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199954\\r\\n199955\\r\\n199953\\r\\n199952\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n179863\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199951\\r\\n199942\\r\\n199940\\r\\n199941\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r\\n199930\\r\\n199929\\r\\n199927\\r\\n199926\\r\\n199924\\r\\n199921\\r\\n199920\\r\\n199919\\r\\n199939\\r\\n199918\\r\\n199917\\r\\n199916\\r\\n199966\\r\\n199935\\r\\n199915\\r\\n199914\\r\\n199928\\r\\n199913\\r...\"]}, {\"input\": \"199906 199892 368111\\r\\n4908 150212 132016 195480 71707 17329 98184 136565 122263 25450 123367 15397 122813 77282 57567 147067 149857 170740 168034 57918 195900 30630 154784 29648 33813 89456 73233 51489 165629 49973 130865 136786 38446 121330 131420 136542 131953 146986 149408 186040 57432 87912 141325 103719 198963 174496 115663 84444 119425 105263 78283 108070 53928 26995 53086 108517 143558 25423 29684 47323 58574 43763 183842 18542 20579 91187 179845 111089 58608 128026 20592 119716 35489 133023 24339 4...\", \"output\": [\"199906\\r\\n199898\\r\\n199899\\r\\n199894\\r\\n199904\\r\\n199886\\r\\n199905\\r\\n199851\\r\\n199903\\r\\n199902\\r\\n199901\\r\\n199888\\r\\n199900\\r\\n199897\\r\\n199896\\r\\n199895\\r\\n199883\\r\\n199893\\r\\n199892\\r\\n199891\\r\\n199822\\r\\n199884\\r\\n199862\\r\\n199890\\r\\n199889\\r\\n199875\\r\\n199887\\r\\n199864\\r\\n199885\\r\\n199882\\r\\n199880\\r\\n199863\\r\\n199879\\r\\n199848\\r\\n199803\\r\\n199881\\r\\n199878\\r\\n199845\\r\\n199877\\r\\n199876\\r\\n199874\\r\\n199873\\r\\n199842\\r\\n199872\\r\\n199868\\r\\n199840\\r\\n199865\\r\\n199859\\r\\n199827\\r\\n199826\\r\\n199870\\r\\n199801\\r\\n199858\\r\\n199856\\r\\n199871\\r\\n199855\\r\\n199854\\r\\n199819\\r\\n199818\\r\\n199804\\r\\n199817\\r\\n199869\\r\\n199802\\r\\n199853\\r...\"]}, {\"input\": \"199927 299916 317862\\r\\n81031 17306 143702 145450 165821 44531 82986 131598 155613 52863 10233 143035 17754 58248 60778 27401 9520 139911 179900 32450 74610 39574 80568 68296 180932 162574 120287 159697 20721 11926 44622 19467 30784 108572 170660 176719 145116 190208 75479 108036 147482 92504 120613 80425 151710 188512 93298 184700 54887 198838 170651 99420 26215 21142 22195 30939 135228 182860 166957 54605 13426 149320 166196 45103 92221 19268 132409 174216 141507 94041 123608 76707 44111 162297 152998 6779...\", \"output\": [\"199927\\r\\n199926\\r\\n199925\\r\\n199924\\r\\n199923\\r\\n199922\\r\\n199921\\r\\n199920\\r\\n199919\\r\\n199918\\r\\n199917\\r\\n199916\\r\\n199915\\r\\n199914\\r\\n199913\\r\\n199912\\r\\n199911\\r\\n199910\\r\\n199909\\r\\n199908\\r\\n199907\\r\\n199906\\r\\n199905\\r\\n199904\\r\\n199903\\r\\n199902\\r\\n199901\\r\\n199900\\r\\n199899\\r\\n199898\\r\\n199897\\r\\n199896\\r\\n199895\\r\\n199894\\r\\n199893\\r\\n199892\\r\\n199891\\r\\n199890\\r\\n199889\\r\\n199888\\r\\n199887\\r\\n199886\\r\\n199885\\r\\n199884\\r\\n199883\\r\\n199882\\r\\n199881\\r\\n199880\\r\\n199879\\r\\n199878\\r\\n199877\\r\\n199876\\r\\n199875\\r\\n199874\\r\\n199873\\r\\n199872\\r\\n199871\\r\\n199870\\r\\n199869\\r\\n199868\\r\\n199867\\r\\n199866\\r\\n199865\\r\\n199864\\r...\"]}, {\"input\": \"199955 299946 386234\\r\\n25899 52005 71447 179054 13803 4999 39800 189902 73662 22532 150515 20678 18942 84081 44849 56867 149436 2043 78621 119983 19416 137161 85737 118788 119127 69917 60506 17304 105819 90136 155602 3273 66507 17049 16963 4673 67980 133995 3411 42578 44416 13356 122719 196178 47240 150529 19037 18987 89874 53206 38723 137060 12257 53500 90868 146326 115864 189524 27239 168000 59405 133429 78012 194501 114169 111020 111219 170148 118058 102024 31123 19296 95434 188551 127743 56255 179001 16...\", \"output\": [\"199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r\\n199930\\r\\n199929\\r\\n199928\\r\\n199927\\r\\n199926\\r\\n199925\\r\\n199924\\r\\n199923\\r\\n199922\\r\\n199921\\r\\n199920\\r\\n199919\\r\\n199918\\r\\n199917\\r\\n199916\\r\\n199915\\r\\n199914\\r\\n199913\\r\\n199912\\r\\n199911\\r\\n199910\\r\\n199909\\r\\n199908\\r\\n199907\\r\\n199906\\r\\n199905\\r\\n199904\\r\\n199903\\r\\n199902\\r\\n199901\\r\\n199900\\r\\n199899\\r\\n199898\\r\\n199897\\r\\n199896\\r\\n199895\\r\\n199894\\r\\n199893\\r\\n199892\\r...\"]}, {\"input\": \"200000 299997 500000\\r\\n646 168693 20991 146409 49906 55323 29221 167407 150660 68954 94099 188060 138058 183566 44308 63254 140236 32321 194212 48066 55169 183956 132819 117368 101351 12915 168943 154167 27856 116838 128357 105631 166007 81786 69130 134925 92157 55655 114702 64149 89306 27281 122540 159078 43865 126344 36227 17277 143867 111348 100462 177011 195040 119060 52707 32185 96165 106207 112016 156841 43889 57834 8590 104268 103907 6217 184046 170236 98053 43671 21982 115710 188303 47018 11660 1291...\", \"output\": [\"200000\\r\\n199999\\r\\n199998\\r\\n199997\\r\\n199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r...\"]}, {\"input\": \"199994 299992 500000\\r\\n76987 76446 175899 195489 84005 133401 152208 132385 166869 128988 101333 185849 90697 165775 68836 121627 21520 138533 31295 119030 163331 120388 33454 79984 156966 171188 40531 147153 14660 183267 55640 76326 199958 46438 118043 32207 174114 164260 159396 55603 1691 82020 164140 29025 155022 191812 175338 32530 113959 166912 85029 24731 178277 152816 90196 7489 166903 136823 161636 37728 11511 96751 85511 6441 64103 167754 144532 148407 131241 19767 25205 170713 95862 94693 168604 4...\", \"output\": [\"199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r...\"]}, {\"input\": \"199992 299991 500000\\r\\n70710 168311 98352 90645 184806 93638 136900 12825 2009 41454 112976 160766 185637 164308 100967 161591 91822 177386 13271 51019 11398 120138 194791 95113 151446 151123 98922 184576 199341 187470 52721 68937 21575 10953 64316 178006 125932 144143 84859 105933 28907 85390 128004 26767 61698 163640 114724 72661 148905 67807 113774 62301 65383 179311 109997 152030 116397 179654 83378 121519 184778 165927 39760 55022 106013 177392 88389 38378 134010 141937 28184 111496 135426 183262 13713...\", \"output\": [\"199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r\\n199930\\r\\n199929\\r...\"]}, {\"input\": \"199996 299993 500000\\r\\n20847 72720 159447 40660 96829 20582 9244 77949 128895 53362 87933 105252 109019 27921 196577 8773 69029 199855 182759 29000 65007 130461 87323 126371 160303 13976 39516 44983 101211 112080 68566 42179 149325 19350 77651 185327 171060 1458 107124 67569 65668 30382 36677 112601 128214 39781 97559 41321 142074 126308 196377 67991 72428 25148 142520 164687 64059 188244 195027 123254 185566 179824 140849 89269 61756 63527 191320 70764 91867 77116 199170 56429 82021 5810 140014 15884 12500...\", \"output\": [\"199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r...\"]}, {\"input\": \"199994 299991 500000\\r\\n60519 158311 134576 62313 30711 74292 72959 138863 57080 76168 99874 61017 130415 136605 122902 3244 138302 70386 67924 39125 108905 155795 21209 190973 109684 51478 7746 70960 103252 25583 124668 142548 52264 159260 13733 98035 84572 165888 144205 194229 29857 125204 29970 147218 66714 28696 130729 58286 117317 162262 81119 123763 70603 169946 36684 45135 133905 63273 38936 25828 54397 188263 154654 110848 37899 109113 92555 188866 167467 66215 21842 53684 296 172316 108535 151299 39...\", \"output\": [\"199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r...\"]}, {\"input\": \"199993 299990 500000\\r\\n139264 116052 180847 65644 1957 69062 133537 77818 24122 3148 88158 133011 83965 59266 162608 63772 156123 65464 159593 154803 53503 38421 132185 158440 179908 139991 11899 132916 23421 87079 160234 101407 120400 69389 66197 69937 126591 135195 84064 13316 31678 99409 65980 9199 127729 193787 159073 47710 145226 174644 13690 102375 127856 38775 74141 106676 16426 189512 61829 116400 84890 6191 182857 2139 65962 170884 54618 179270 41519 105080 1278 167644 56380 52455 180492 53889 1447...\", \"output\": [\"199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r\\n199930\\r...\"]}, {\"input\": \"199991 299989 500000\\r\\n124653 25916 159224 176722 25988 184620 166214 21954 114831 142424 82097 41166 183981 118589 162445 175877 88166 34884 167268 146467 33213 79243 170443 198175 77873 394 74034 171812 148704 11853 86516 116753 73458 58417 35259 2356 71738 51209 118950 11947 30465 431 75327 170871 136277 135351 61744 57048 141516 146208 54586 48275 24227 181418 77604 183925 84117 127607 67264 147824 87774 15226 103847 155488 117325 57613 110875 126289 32535 82741 50618 189671 5264 41052 150568 26295 3129...\", \"output\": [\"199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r\\n199930\\r\\n199929\\r\\n199928\\r...\"]}, {\"input\": \"199996 299993 500000\\r\\n198118 141242 163773 143460 105378 29566 58798 79290 77701 126756 89258 140733 73363 4213 10517 105680 95739 166785 54245 69849 77066 193496 76803 3183 81295 142013 148825 91849 130143 126938 194458 68567 193183 36951 66002 160653 114420 107430 57502 82786 178794 53320 10629 1934 15815 169936 37032 132075 59017 22755 57697 307 10355 127413 139206 73293 85328 91694 169819 45846 62652 136242 58347 199476 179846 160470 14234 140052 52147 13185 120155 85718 33994 128769 137106 71267 18324...\", \"output\": [\"199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r...\"]}, {\"input\": \"199994 299990 500000\\r\\n120584 8788 107728 138096 118712 140346 48551 160087 189072 92072 143021 30862 195391 57948 17488 104504 51633 40813 155845 118131 94846 97591 130473 43326 25370 168003 69518 9128 73180 163541 158025 39217 189995 34651 121695 195064 196001 73348 166330 3859 88642 36780 43450 184702 118964 151462 12968 31005 78279 139379 145886 110818 100923 47195 196461 107643 90838 180665 55851 88323 56126 153783 97234 153714 66316 23567 125905 87081 102781 77358 52153 91134 27964 24595 181000 44262 ...\", \"output\": [\"199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r...\"]}, {\"input\": \"199998 299995 500000\\r\\n189779 163106 135461 67146 81677 13459 72510 99872 4973 121440 97259 70596 136217 85953 99801 96600 112509 44845 57680 115636 178565 21240 194203 66061 174953 129523 199648 13821 147117 4848 177571 138956 191832 4217 113008 42254 36004 100742 143366 740 8123 147212 118906 99612 80684 30041 121425 150170 40649 137726 78427 45290 121631 16286 95751 55670 181101 53698 12684 118356 75768 114907 115344 190525 69229 150297 171180 89354 52661 145053 25957 76037 91981 98616 52942 172974 75414...\", \"output\": [\"199998\\r\\n199997\\r\\n199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r...\"]}, {\"input\": \"199992 299989 500000\\r\\n25026 90086 14470 53894 5710 11993 1334 126038 95880 196386 26470 96834 41474 4861 59488 24632 85581 83231 72417 128995 168878 30920 101768 139736 111493 66274 37677 27 6349 5376 197489 46856 6245 90219 56772 116903 84082 73216 78113 176667 162203 147010 138152 143404 15638 18085 40989 42682 114845 59298 71518 155416 107101 160517 12384 171128 56601 79725 127801 125975 69241 132331 175635 104195 107319 109662 170076 157116 126872 2810 95701 29989 50785 14778 42950 85986 2114 129307 87...\", \"output\": [\"199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r\\n199930\\r\\n199929\\r...\"]}, {\"input\": \"199996 299992 500000\\r\\n126903 69209 118680 187422 185783 190922 10479 152408 18545 195284 148240 107035 101123 27371 117840 92028 165948 66684 73336 199677 64828 188217 22228 105790 45391 22362 68103 38455 163084 97652 44348 155807 19492 158390 29249 139592 181520 194819 118133 92456 190705 48990 101350 85558 120452 188919 145597 83851 407 11836 173080 68484 109054 129450 148314 162104 116991 103160 68543 3350 107542 100013 96532 120695 128714 105239 5490 7310 25177 82543 102178 180049 81421 142824 73931 16...\", \"output\": [\"199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r...\"]}, {\"input\": \"199999 202998 500000\\r\\n97471 108530 933 115050 64659 153537 127372 174580 43937 188492 141628 47205 108901 33242 102205 180536 84359 28347 84228 138322 137172 63800 69520 518 77254 184544 189346 112921 120219 100529 93581 121470 89583 171621 82909 176858 40505 144937 175546 43308 162260 100204 146360 47458 45744 116607 2308 4468 100994 87139 151709 175828 11485 51089 104125 193451 18840 95593 170723 104523 69112 100353 95230 187996 110080 117064 70242 98965 184258 183885 164655 97094 87069 129610 104505 109...\", \"output\": [\"199999\\r\\n199998\\r\\n199997\\r\\n199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r...\"]}, {\"input\": \"199993 202991 500000\\r\\n166879 76526 85524 92747 184800 32033 193808 160273 70328 164198 141696 5666 184779 199493 95052 26005 113052 121276 34404 53075 2594 65840 53261 132714 14889 177562 137368 127015 117182 127386 38119 35539 22560 34886 191861 123842 155250 88940 20168 33909 192499 50916 22419 25540 89412 193674 83179 66142 29968 198645 145018 26044 6124 156863 45302 34260 148687 92114 23063 76344 40946 144752 23472 104947 63498 14735 155603 38366 98716 43783 168332 196622 111547 69923 182560 24618 5743...\", \"output\": [\"199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r\\n199930\\r...\"]}, {\"input\": \"199991 202990 500000\\r\\n197823 51331 94238 169670 35064 178223 64617 70187 155237 76449 72861 120250 5514 191663 39923 45567 60114 91955 193047 190885 186773 100743 70406 13365 52653 77050 8227 185379 38408 79131 26552 72214 55802 108890 8214 47765 139514 101534 49717 93180 31416 43449 60761 22545 191039 59775 22925 90190 134200 67444 124533 9500 165237 141632 12240 141364 108534 70174 175308 144353 36091 14134 193440 95865 173833 188162 155871 172609 166726 117377 93772 48242 93663 56811 53655 87385 107656 ...\", \"output\": [\"199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r\\n199930\\r\\n199929\\r\\n199928\\r...\"]}, {\"input\": \"199991 202990 500000\\r\\n68475 191493 51607 98800 152301 100636 143191 27160 108526 25770 133278 22937 108599 55080 61128 174371 187635 113939 100905 26150 11113 14656 190525 184530 42412 150061 45578 186226 174332 53272 161487 18512 76238 196313 126391 34622 29097 198912 145836 106383 138251 184780 56208 139249 178200 76748 57596 50707 20477 95638 65539 197066 20663 51278 174235 12955 78302 61257 87367 3717 62847 125184 149852 143508 65798 123482 32958 144114 143135 6533 19933 30681 173453 39655 72280 67058 ...\", \"output\": [\"199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r\\n199930\\r\\n199929\\r\\n199928\\r...\"]}, {\"input\": \"199999 202998 500000\\r\\n171570 87649 199932 93319 8456 88799 80005 132713 86194 115428 73151 124726 25308 35856 41771 120151 142480 10321 110198 50741 26916 188430 143924 69914 22812 43754 192441 173871 198564 136486 92733 91651 58525 187663 106442 107703 196017 116331 60579 154434 12274 90254 107748 51856 152852 17833 14811 70354 47580 23349 131131 150593 41660 148103 10484 40781 151513 153771 57547 180669 77946 136716 164584 9116 7833 47744 74778 4321 82516 132489 31345 32838 177293 90533 67870 49854 15471...\", \"output\": [\"199999\\r\\n199998\\r\\n199997\\r\\n199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r...\"]}, {\"input\": \"199998 299984 320049\\r\\n191435 112176 167007 195345 100748 119718 95963 84827 73351 39288 90785 80017 197684 48340 47637 5976 196530 110787 160847 101272 190333 32932 183488 36599 49647 89698 46402 3405 53323 95890 97618 161535 190041 62726 66399 133016 144969 174320 59212 12044 14892 85475 152835 56952 69045 17697 110372 36465 132855 109441 92881 196943 12274 190748 128526 105477 89547 36204 68217 15696 44525 20983 52811 16780 96982 102286 194844 47151 117468 57766 195445 144111 52672 106292 107035 79215 15...\", \"output\": [\"199998\\r\\n199997\\r\\n199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r...\"]}, {\"input\": \"199996 299977 443135\\r\\n188404 137821 170302 193428 112333 171204 187973 10284 176362 93301 19960 74549 135441 60626 113274 39253 117415 182422 42077 69224 15003 171206 18425 28514 78926 102190 67268 96755 17705 74618 161513 101935 28235 159361 84215 146832 158392 3762 7618 104153 182347 86704 145721 59775 163671 194431 88683 177936 135675 92174 76949 135566 177808 112173 64875 82303 171240 143165 26840 134063 45850 173570 148385 154410 20052 131153 62350 138015 71227 197165 12135 35481 184152 184690 161945 ...\", \"output\": [\"199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r...\"]}, {\"input\": \"199994 299982 371616\\r\\n198651 179181 66898 114664 25305 108606 45704 78268 43280 98602 97405 41507 104776 6670 27344 153984 187983 125687 87136 151408 69927 193382 99192 155010 48194 148300 141776 95489 30812 89654 116421 104291 155181 170080 75334 188341 119346 155331 136192 143295 46458 1493 139196 121314 78889 54795 103869 150791 87349 121829 88220 117350 152922 104844 57790 184805 11161 164412 1265 107771 160012 38845 57744 47816 86747 148631 172122 192902 73870 108782 118413 55185 173936 154880 106041 ...\", \"output\": [\"199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r...\"]}, {\"input\": \"199994 299982 314117\\r\\n98243 142831 76219 198147 172239 162074 88424 26528 179208 157724 70326 120994 25336 195334 137468 110096 70765 19906 186402 56682 139077 178367 48566 106994 166647 127631 178834 40218 128338 176057 24965 83383 10141 36265 112636 195948 32413 85295 52987 31325 7800 123552 174634 98683 40146 39950 165187 77379 97490 74767 193155 9535 37214 90034 12631 117607 128265 195511 21629 112926 179431 159951 79098 119540 100766 75455 37940 157242 164467 57983 72151 88765 188714 38552 67833 17976...\", \"output\": [\"199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r...\"]}, {\"input\": \"199992 299977 305122\\r\\n72109 136779 12035 106622 102526 195974 127963 23670 56671 28048 45551 96577 120292 192320 23418 109689 14327 138287 118228 185499 86505 45864 52422 143419 43940 79843 175253 97495 76979 37128 95230 190785 17594 152042 109007 316 79039 15150 46997 71837 171052 148373 138462 140918 3361 34377 122510 145266 156148 16993 20653 26352 74766 183681 145969 183668 174390 153875 132654 9514 43864 168709 197808 122740 45365 3773 65364 45522 95470 100270 20504 115875 133407 118497 154296 175221 ...\", \"output\": [\"199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r\\n199930\\r\\n199929\\r...\"]}, {\"input\": \"199996 299984 371086\\r\\n3007 38825 186229 37453 79438 45048 124757 114047 127221 38306 172198 10363 6792 33004 70884 45648 15628 171215 118894 199088 118614 145484 37052 123246 109719 13776 46336 198852 130033 18280 144998 156503 141840 51119 85378 67677 13401 191095 40357 114962 38089 167921 104569 46199 124320 40539 39392 50740 102461 162498 140515 49488 141567 61810 162525 17534 95687 35647 133238 102918 157292 160211 1542 138468 98487 153156 52002 19413 104378 66350 159553 106729 140436 49139 170668 4481...\", \"output\": [\"199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r...\"]}, {\"input\": \"199994 299981 476844\\r\\n181810 197363 36888 46502 19678 73881 191473 185314 181034 63794 143233 92750 39645 91133 118326 7234 34574 87590 64297 119504 113376 13891 7792 122131 195735 185675 112179 112670 25362 87530 175320 10398 157198 138965 167642 115314 34085 85969 158239 130831 52180 41181 157970 119137 90365 139188 199991 157407 180652 61380 63802 53321 180223 96938 139275 147391 194677 72107 167686 42851 182109 92945 90869 125891 112597 9574 25298 71377 187840 47789 116007 94466 173261 189088 110952 51...\", \"output\": [\"199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r...\"]}, {\"input\": \"199994 299986 437772\\r\\n187932 130751 56170 140535 173942 117313 14161 194467 36189 92873 179812 135431 36778 90193 30983 73774 81288 121450 187395 122852 90394 106578 184055 16272 162449 58446 25082 84936 21261 67762 61624 185209 180637 34952 121947 46295 12937 27974 44852 136865 33830 167782 45588 131608 53275 88828 136549 69288 179895 188850 115086 172510 86562 81897 102738 62811 169274 27764 72227 40516 113758 87977 102764 184067 24738 107065 84808 115993 123685 141851 82640 140944 69453 192489 3998 5768...\", \"output\": [\"199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r...\"]}, {\"input\": \"199992 299973 442570\\r\\n68152 47977 116106 103424 20174 47727 77050 1880 20334 182191 172486 187237 32167 21582 42274 21484 63586 192594 194694 105162 187841 105551 112861 164381 178605 35054 68352 98991 59456 87879 56302 27039 180388 187941 22949 45610 684 62002 24289 10236 83790 102986 138356 163811 112586 132660 178514 104411 69745 182268 74372 154109 199523 196763 71173 78304 128936 157980 21146 15968 6578 62243 24874 110154 73318 113476 144865 7741 142460 101484 58956 82784 49549 66456 87768 193447 1985...\", \"output\": [\"199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r\\n199930\\r\\n199929\\r\\n199928\\r...\"]}, {\"input\": \"199996 299985 498855\\r\\n137750 118252 72566 186838 149984 138986 97856 31878 84598 94843 151007 138795 110831 78087 161934 63118 10051 139049 122095 171804 116283 80902 61307 96137 134771 135002 6239 6264 160224 87372 156715 8938 39133 129104 139779 78029 176245 124775 31408 42741 138095 138362 57077 128050 74756 72345 65595 43115 88862 180876 52497 78462 61301 144017 10956 41742 151821 77414 23353 196137 177974 118405 124616 83547 138908 93128 167765 35568 56691 3629 13312 82104 168312 171704 47397 125191 1...\", \"output\": [\"199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r...\"]}, {\"input\": \"199991 299980 302357\\r\\n150511 148850 5028 3357 115247 133375 169486 126576 11675 52241 116797 132988 16301 169903 144123 163459 84343 44778 199301 111170 175257 25252 23078 55915 132367 50266 195386 95476 78944 35933 41598 5880 81439 194576 85985 154932 180357 75386 61655 27070 4410 15368 32414 154971 164548 137314 91666 182014 29598 184607 103855 169128 192837 122472 82630 132541 134139 74321 90228 22765 186716 148462 177068 191828 37304 54351 63544 172974 168904 30440 151889 143147 1603 120197 94097 76305...\", \"output\": [\"199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r\\n199930\\r\\n199929\\r\\n199928\\r...\"]}, {\"input\": \"199999 299973 475161\\r\\n168303 63596 126562 143371 159987 60676 65533 54088 23914 12934 152471 85325 104744 104830 59 191081 156468 75110 169115 9162 94990 18285 14418 99978 1048 54954 154149 38307 135262 170892 105115 1422 32530 24557 98991 61765 56785 60505 128579 36675 63248 93069 163339 91767 7539 155316 196947 37908 122413 111267 57256 29487 147569 12499 48301 40616 33209 115088 118015 97399 78704 125242 43983 88966 78365 134003 7700 26947 125810 46529 22647 62217 177626 161964 171189 28437 182777 44835...\", \"output\": [\"199999\\r\\n199998\\r\\n199997\\r\\n199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r...\"]}, {\"input\": \"199993 299981 344745\\r\\n146218 4670 17598 25266 199004 84749 69516 151012 17322 176694 1128 45359 10978 127833 149628 162128 80845 588 153908 110025 118883 186655 139889 28171 15486 61174 192140 73344 141077 82209 65174 57443 33618 44414 175663 48399 186194 182555 92629 25716 38916 5500 88469 54608 149571 146197 2830 22216 179142 51597 180342 103848 196213 185753 148135 127711 179737 36063 185163 72095 195572 8748 79697 14394 160874 53640 155798 43116 107562 188115 156445 185486 141918 69047 44164 47191 1558...\", \"output\": [\"199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r\\n199930\\r...\"]}, {\"input\": \"199997 299977 358941\\r\\n198927 2931 16991 128017 20708 163232 132266 119214 111856 175646 32228 1394 12932 191241 144654 195882 177750 139832 184692 154986 124746 32990 197086 82438 51140 31760 77621 118295 173875 104616 28720 104167 54406 96144 141918 65346 73206 60659 182460 158178 95457 80215 195815 152286 34972 188730 170850 109130 183941 129369 127526 100068 112365 116361 3436 98464 60345 121148 2599 12611 172239 158604 27664 33258 14126 172142 116409 135013 67277 4698 115984 8286 44519 41311 143068 798...\", \"output\": [\"199997\\r\\n199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r...\"]}, {\"input\": \"199995 299978 340338\\r\\n93408 136644 116330 9068 150509 197921 112933 10216 110088 65641 94922 107831 176070 119609 143963 30130 78918 199368 53841 20726 160638 86637 38620 125813 26608 155604 177136 7995 134011 193944 45486 159672 18048 3965 3087 130672 106307 184652 95760 169411 116002 11782 199017 161909 111878 175971 152580 128299 18986 132087 86190 120127 16401 125462 21283 49888 195688 176970 176989 57258 190933 83759 40438 39046 9945 174270 99904 126906 136461 85289 187958 147135 40443 12676 14562 668...\", \"output\": [\"199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r...\"]}, {\"input\": \"199999 299978 354096\\r\\n60249 7545 87998 117654 130859 83699 184947 63666 192212 94766 172033 55111 156962 175202 161583 151752 23639 134581 149917 30198 189751 55479 3643 144413 80929 129459 79445 71431 48034 97110 65994 199666 198484 134113 40892 12666 6100 48032 125813 92199 116545 18251 95381 132284 133610 62844 127008 173684 56996 4212 147006 73909 191257 11156 73317 52387 191680 178641 137213 81503 177866 80728 38973 87370 28204 118392 187905 103068 111875 148681 16568 34633 132785 87526 8011 152230 61...\", \"output\": [\"199999\\r\\n199998\\r\\n199997\\r\\n199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r...\"]}, {\"input\": \"199993 299975 487718\\r\\n68563 95943 55843 174068 187026 184309 190833 159914 9753 81400 4249 67471 165023 100985 91545 65378 162650 174392 178429 8350 70507 17594 65502 128309 93459 136420 69415 3108 192249 95043 36866 27615 58494 105938 34136 67267 28284 15942 143834 51585 10915 180071 183700 34575 199835 6551 159726 139130 405 84658 13865 190391 76416 68278 168168 177767 142077 187833 22874 183202 140258 35005 149834 14498 52912 113937 37353 2061 49447 56337 13339 22529 138145 90960 174160 27280 21413 1823...\", \"output\": [\"199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r\\n199930\\r...\"]}, {\"input\": \"199997 299977 463944\\r\\n104094 50638 106125 35166 115684 188432 146043 198414 163534 70373 107837 28582 149154 147334 180178 191910 159894 101987 145527 125450 123363 118428 76960 71833 191068 163420 155511 9174 46354 170708 107384 21286 77218 68544 119423 59341 199302 33071 173086 128672 22570 62180 161643 25803 26957 179100 16388 142802 195563 110101 21544 163813 104064 62064 109272 183354 156480 137858 57227 68259 130274 160209 61372 86212 35408 41316 13570 127050 195941 52240 27116 63851 523 104411 30428...\", \"output\": [\"199997\\r\\n199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r...\"]}, {\"input\": \"199995 299992 500000\\r\\n2595 164276 86631 147729 157802 64691 194672 197828 153815 21961 169253 131898 22703 51966 119265 97063 52940 92909 137510 55702 102687 21064 87134 12824 53012 149555 126273 88575 177140 149279 77160 192225 4326 180032 158569 13401 16706 136982 10435 56528 39052 177138 27197 30227 79357 158928 127775 121309 35407 157949 65438 199145 10023 149975 106515 56538 116546 112139 173051 197336 97480 51673 27220 178715 59986 56959 82247 185105 93154 184749 155327 166058 62175 102392 10186 2688...\", \"output\": [\"199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r...\"]}, {\"input\": \"199994 299991 500000\\r\\n122631 26814 115227 69881 17553 49453 93023 34901 78780 130372 15462 126599 178130 3758 59693 43835 167944 10399 63240 198 188595 64079 91530 188317 105315 151693 170177 38837 196071 179854 170826 142366 146871 126457 112383 181361 190213 177123 56396 18348 112918 144872 34861 187876 89055 167299 82384 14627 56045 98790 33286 36343 109886 24057 65462 1049 161625 89607 198234 120105 179057 121033 15681 125975 56821 112569 157320 113122 116230 197937 19482 183441 151338 55739 133591 193...\", \"output\": [\"199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r...\"]}, {\"input\": \"200000 299998 500000\\r\\n29383 74944 165424 78298 106976 26932 163545 72152 94609 45167 137330 20438 178263 33957 104688 107228 126631 162710 54842 138784 177917 133664 141375 2779 82534 196161 129297 158237 79970 135726 161078 39155 173327 43749 20080 55776 53471 122465 110943 30080 81144 91668 160128 167606 46796 43291 109186 171771 39105 172908 41566 67628 51036 86716 176441 162840 198834 163979 84900 24059 172177 11640 40903 76450 191680 117544 96812 62736 71847 91757 156359 37694 198871 177606 178888 503...\", \"output\": [\"200000\\r\\n199999\\r\\n199998\\r\\n199997\\r\\n199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r...\"]}, {\"input\": \"199994 299991 500000\\r\\n77159 96176 60632 113942 190769 37274 66985 160173 23055 178906 146956 97412 58199 5231 16903 71107 111971 1808 166329 20931 87936 108114 141640 184977 106436 19962 161810 89385 76874 108148 94156 183813 136717 135205 142096 79304 170576 158226 14655 121167 57549 1173 5774 174211 107717 84267 54577 6382 146382 56329 135125 170526 27924 179941 166672 186452 91964 195694 47255 138062 114314 164871 11579 66395 115817 81614 101080 67619 108786 2858 143800 152724 51199 39796 81449 158076 9...\", \"output\": [\"199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r...\"]}, {\"input\": \"199998 299994 500000\\r\\n73932 124525 147364 129483 73626 55750 187902 197483 183331 98879 60872 63495 189660 35080 168095 166882 28671 48144 132548 41911 91574 191074 78732 198948 116392 97985 174867 186750 11569 9646 29326 12511 185566 10257 188506 190056 41576 20631 77873 134045 165826 8913 158560 39720 148033 196885 5480 128436 1151 113340 152189 181722 82885 15343 181239 138170 173018 11751 140237 149001 87186 182510 86430 43351 123319 17614 89942 95433 5541 36532 118917 70365 80870 98268 3243 24505 1073...\", \"output\": [\"199998\\r\\n199997\\r\\n199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r...\"]}, {\"input\": \"199996 299992 500000\\r\\n95078 31753 62552 59003 136518 193886 173167 161703 59980 96378 166385 178348 174088 129724 100865 2964 180237 135663 137221 16329 107464 98228 152063 158658 27711 125138 128068 154127 12238 146478 154796 177693 150447 165352 174035 90365 187759 175127 147962 148980 135952 135433 182219 104647 143468 111985 20461 183931 34431 83249 141194 27953 160434 126613 54362 19146 153287 157594 69225 99629 158679 111191 14104 48192 33487 125089 138661 190654 98467 157995 157027 168237 98655 1264...\", \"output\": [\"199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r...\"]}, {\"input\": \"200000 299995 500000\\r\\n102802 82789 138815 137692 91359 120728 160302 141889 20281 169039 102385 85472 56528 195081 53384 76593 127850 111642 188955 74166 117501 122640 91284 83544 116614 146782 186512 181109 136335 113305 41859 89979 73963 13326 118094 17818 18414 124640 33610 36479 105130 144081 170184 66744 168661 43244 174192 44528 14709 56087 35319 166437 61617 38929 77870 105379 128345 198523 47574 9672 180938 87867 13169 27521 189455 144694 126556 80263 90395 72362 7907 79372 88857 174533 41092 11349...\", \"output\": [\"200000\\r\\n199999\\r\\n199998\\r\\n199997\\r\\n199996\\r\\n199995\\r\\n199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r...\"]}, {\"input\": \"199994 299992 500000\\r\\n78740 107111 63218 111629 121716 77886 113766 54160 5382 111745 81729 163768 94027 106312 46074 76974 89979 23943 38113 117609 153875 138464 61287 54489 170804 53123 100964 10363 49427 53386 135659 138210 83853 60123 173648 71231 119765 108074 121431 155987 169034 183068 49177 165334 145371 134549 69876 189175 37713 63611 102956 4406 135555 19801 179259 13934 104693 188297 86758 120246 176574 153984 160 63497 31646 9002 150832 98703 128381 72956 88560 69929 84141 44345 79173 146103 10...\", \"output\": [\"199994\\r\\n199993\\r\\n199992\\r\\n199991\\r\\n199990\\r\\n199989\\r\\n199988\\r\\n199987\\r\\n199986\\r\\n199985\\r\\n199984\\r\\n199983\\r\\n199982\\r\\n199981\\r\\n199980\\r\\n199979\\r\\n199978\\r\\n199977\\r\\n199976\\r\\n199975\\r\\n199974\\r\\n199973\\r\\n199972\\r\\n199971\\r\\n199970\\r\\n199969\\r\\n199968\\r\\n199967\\r\\n199966\\r\\n199965\\r\\n199964\\r\\n199963\\r\\n199962\\r\\n199961\\r\\n199960\\r\\n199959\\r\\n199958\\r\\n199957\\r\\n199956\\r\\n199955\\r\\n199954\\r\\n199953\\r\\n199952\\r\\n199951\\r\\n199950\\r\\n199949\\r\\n199948\\r\\n199947\\r\\n199946\\r\\n199945\\r\\n199944\\r\\n199943\\r\\n199942\\r\\n199941\\r\\n199940\\r\\n199939\\r\\n199938\\r\\n199937\\r\\n199936\\r\\n199935\\r\\n199934\\r\\n199933\\r\\n199932\\r\\n199931\\r...\"]}, {\"input\": \"2 1 3\\r\\n1 2\\r\\n1 2\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n\", \"output\": [\"2\\r\\n1\\r\\n0\"]}]"} {"prob_desc_description":"Andrey thinks he is truly a successful developer, but in reality he didn't know about the binary search algorithm until recently. After reading some literature Andrey understood that this algorithm allows to quickly find a certain number $$$x$$$ in an array. For an array $$$a$$$ indexed from zero, and an integer $$$x$$$ the pseudocode of the algorithm is as follows: Note that the elements of the array are indexed from zero, and the division is done in integers (rounding down).Andrey read that the algorithm only works if the array is sorted. However, he found this statement untrue, because there certainly exist unsorted arrays for which the algorithm find $$$x$$$!Andrey wants to write a letter to the book authors, but before doing that he must consider the permutations of size $$$n$$$ such that the algorithm finds $$$x$$$ in them. A permutation of size $$$n$$$ is an array consisting of $$$n$$$ distinct integers between $$$1$$$ and $$$n$$$ in arbitrary order.Help Andrey and find the number of permutations of size $$$n$$$ which contain $$$x$$$ at position $$$pos$$$ and for which the given implementation of the binary search algorithm finds $$$x$$$ (returns true). As the result may be extremely large, print the remainder of its division by $$$10^9+7$$$.","prob_desc_output_spec":"Print a single number\u00a0\u2014 the remainder of the division of the number of valid permutations by $$$10^9+7$$$.","lang_cluster":"","src_uid":"24e2f10463f440affccc2755f4462d8a","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["combinatorics","binary search"],"prob_desc_created_at":"1603548300","prob_desc_sample_inputs":"[\"4 1 2\", \"123 42 24\"]","prob_desc_notes":"NoteAll possible permutations in the first test case: $$$(2, 3, 1, 4)$$$, $$$(2, 4, 1, 3)$$$, $$$(3, 2, 1, 4)$$$, $$$(3, 4, 1, 2)$$$, $$$(4, 2, 1, 3)$$$, $$$(4, 3, 1, 2)$$$.","exec_outcome":"","difficulty":1500.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The only line of input contains integers $$$n$$$, $$$x$$$ and $$$pos$$$ ($$$1 \\le x \\le n \\le 1000$$$, $$$0 \\le pos \\le n - 1$$$) \u2014 the required length of the permutation, the number to search, and the required position of that number, respectively.","prob_desc_sample_outputs":"[\"6\", \"824071958\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"4 1 2\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"123 42 24\\r\\n\", \"output\": [\"824071958\"]}, {\"input\": \"1 1 0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1000 501 501\\r\\n\", \"output\": [\"646597996\"]}, {\"input\": \"1000 999 799\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 2 0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3 1 2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3 2 2\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"3 3 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"4 2 0\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"4 3 2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"4 4 3\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"7 1 1\\r\\n\", \"output\": [\"720\"]}, {\"input\": \"7 7 6\\r\\n\", \"output\": [\"720\"]}, {\"input\": \"7 2 4\\r\\n\", \"output\": [\"120\"]}, {\"input\": \"7 4 4\\r\\n\", \"output\": [\"216\"]}, {\"input\": \"8 4 1\\r\\n\", \"output\": [\"1440\"]}, {\"input\": \"8 1 5\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"8 8 7\\r\\n\", \"output\": [\"5040\"]}, {\"input\": \"8 7 6\\r\\n\", \"output\": [\"720\"]}, {\"input\": \"8 3 0\\r\\n\", \"output\": [\"1440\"]}, {\"input\": \"9 1 7\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"9 9 5\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"9 5 5\\r\\n\", \"output\": [\"5760\"]}, {\"input\": \"9 4 4\\r\\n\", \"output\": [\"7200\"]}, {\"input\": \"9 3 3\\r\\n\", \"output\": [\"8640\"]}, {\"input\": \"10 1 1\\r\\n\", \"output\": [\"362880\"]}, {\"input\": \"10 10 9\\r\\n\", \"output\": [\"362880\"]}, {\"input\": \"10 5 5\\r\\n\", \"output\": [\"43200\"]}, {\"input\": \"10 3 7\\r\\n\", \"output\": [\"70560\"]}, {\"input\": \"10 4 4\\r\\n\", \"output\": [\"90720\"]}, {\"input\": \"10 6 6\\r\\n\", \"output\": [\"43200\"]}, {\"input\": \"10 7 7\\r\\n\", \"output\": [\"90720\"]}, {\"input\": \"10 9 5\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"74 16 54\\r\\n\", \"output\": [\"625981152\"]}, {\"input\": \"63 15 45\\r\\n\", \"output\": [\"581829795\"]}, {\"input\": \"54 4 47\\r\\n\", \"output\": [\"911648281\"]}, {\"input\": \"92 22 62\\r\\n\", \"output\": [\"628152721\"]}, {\"input\": \"82 15 14\\r\\n\", \"output\": [\"187724629\"]}, {\"input\": \"91 60 48\\r\\n\", \"output\": [\"233776714\"]}, {\"input\": \"91 51 5\\r\\n\", \"output\": [\"660447677\"]}, {\"input\": \"70 45 16\\r\\n\", \"output\": [\"578976138\"]}, {\"input\": \"61 21 16\\r\\n\", \"output\": [\"516359078\"]}, {\"input\": \"61 29 15\\r\\n\", \"output\": [\"252758304\"]}, {\"input\": \"69 67 68\\r\\n\", \"output\": [\"736622722\"]}, {\"input\": \"59 40 1\\r\\n\", \"output\": [\"384105577\"]}, {\"input\": \"98 86 39\\r\\n\", \"output\": [\"132656801\"]}, {\"input\": \"97 89 29\\r\\n\", \"output\": [\"673334741\"]}, {\"input\": \"78 66 16\\r\\n\", \"output\": [\"703501645\"]}, {\"input\": \"777 254 720\\r\\n\", \"output\": [\"57449468\"]}, {\"input\": \"908 216 521\\r\\n\", \"output\": [\"601940707\"]}, {\"input\": \"749 158 165\\r\\n\", \"output\": [\"849211382\"]}, {\"input\": \"535 101 250\\r\\n\", \"output\": [\"111877808\"]}, {\"input\": \"665 5 305\\r\\n\", \"output\": [\"400272219\"]}, {\"input\": \"856 406 675\\r\\n\", \"output\": [\"663368144\"]}, {\"input\": \"697 390 118\\r\\n\", \"output\": [\"844062514\"]}, {\"input\": \"539 246 0\\r\\n\", \"output\": [\"410139856\"]}, {\"input\": \"669 380 461\\r\\n\", \"output\": [\"921432102\"]}, {\"input\": \"954 325 163\\r\\n\", \"output\": [\"917113541\"]}, {\"input\": \"646 467 58\\r\\n\", \"output\": [\"214437899\"]}, {\"input\": \"542 427 258\\r\\n\", \"output\": [\"830066531\"]}, {\"input\": \"562 388 191\\r\\n\", \"output\": [\"935998075\"]}, {\"input\": \"958 817 269\\r\\n\", \"output\": [\"513948977\"]}, {\"input\": \"1000 888 888\\r\\n\", \"output\": [\"644649893\"]}, {\"input\": \"1000 2 2\\r\\n\", \"output\": [\"22779421\"]}, {\"input\": \"534 376 180\\r\\n\", \"output\": [\"984450056\"]}, {\"input\": \"1000 1 1\\r\\n\", \"output\": [\"756641425\"]}, {\"input\": \"1000 3 3\\r\\n\", \"output\": [\"606772288\"]}, {\"input\": \"1000 500 500\\r\\n\", \"output\": [\"646597996\"]}, {\"input\": \"1000 1000 999\\r\\n\", \"output\": [\"756641425\"]}, {\"input\": \"1000 501 50\\r\\n\", \"output\": [\"636821580\"]}, {\"input\": \"6 4 3\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"3 2 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"100 5 50\\r\\n\", \"output\": [\"469732450\"]}, {\"input\": \"999 490 499\\r\\n\", \"output\": [\"998308393\"]}, {\"input\": \"7 3 3\\r\\n\", \"output\": [\"288\"]}, {\"input\": \"10 7 5\\r\\n\", \"output\": [\"4320\"]}, {\"input\": \"123 1 24\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"5 5 2\\r\\n\", \"output\": [\"0\"]}]"} {"prob_desc_description":"Today is the final contest of INOI (Iranian National Olympiad in Informatics). The contest room is a row with $$$n$$$ computers. All computers are numbered with integers from $$$1$$$ to $$$n$$$ from left to right. There are $$$m$$$ participants, numbered with integers from $$$1$$$ to $$$m$$$.We have an array $$$a$$$ of length $$$m$$$ where $$$a_{i}$$$ ($$$1 \\leq a_i \\leq n$$$) is the computer behind which the $$$i$$$-th participant wants to sit.Also, we have another array $$$b$$$ of length $$$m$$$ consisting of characters 'L' and 'R'. $$$b_i$$$ is the side from which the $$$i$$$-th participant enters the room. 'L' means the participant enters from the left of computer $$$1$$$ and goes from left to right, and 'R' means the participant enters from the right of computer $$$n$$$ and goes from right to left.The participants in the order from $$$1$$$ to $$$m$$$ enter the room one by one. The $$$i$$$-th of them enters the contest room in the direction $$$b_i$$$ and goes to sit behind the $$$a_i$$$-th computer. If it is occupied he keeps walking in his direction until he reaches the first unoccupied computer. After that, he sits behind it. If he doesn't find any computer he gets upset and gives up on the contest.The madness of the $$$i$$$-th participant is the distance between his assigned computer ($$$a_i$$$) and the computer he ends up sitting behind. The distance between computers $$$i$$$ and $$$j$$$ is equal to $$$|i - j|$$$.The values in the array $$$a$$$ can be equal. There exist $$$n^m \\cdot 2^m$$$ possible pairs of arrays $$$(a, b)$$$.Consider all pairs of arrays $$$(a, b)$$$ such that no person becomes upset. For each of them let's calculate the sum of participants madnesses. Find the sum of all these values.You will be given some prime modulo $$$p$$$. Find this sum by modulo $$$p$$$.","prob_desc_output_spec":"Print only one integer\u00a0\u2014 the required sum by modulo $$$p$$$.","lang_cluster":"","src_uid":"9812de5f2d272511a63ead8765b23190","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["fft","dp","combinatorics"],"prob_desc_created_at":"1605623700","prob_desc_sample_inputs":"[\"3 1 1000000007\", \"2 2 1000000009\", \"3 2 998244353\", \"20 10 1000000009\"]","prob_desc_notes":"NoteIn the first test, there are three possible arrays $$$a$$$: $$$\\{1\\}$$$, $$$\\{2\\}$$$, and $$$ \\{3\\}$$$ and two possible arrays $$$b$$$: $$$\\{\\mathtt{L}\\}$$$ and $$$\\{\\mathtt{R}\\}$$$. For all six pairs of arrays $$$(a, b)$$$, the only participant will sit behind the computer $$$a_1$$$, so his madness will be $$$0$$$. So the total sum of madnesses will be $$$0$$$.In the second test, all possible pairs of arrays $$$(a, b)$$$, such that no person becomes upset are: $$$(\\{1, 1\\}, \\{\\mathtt{L}, \\mathtt{L}\\})$$$, the sum of madnesses is $$$1$$$; $$$(\\{1, 1\\}, \\{\\mathtt{R}, \\mathtt{L}\\})$$$, the sum of madnesses is $$$1$$$; $$$(\\{2, 2\\}, \\{\\mathtt{R}, \\mathtt{R}\\})$$$, the sum of madnesses is $$$1$$$; $$$(\\{2, 2\\}, \\{\\mathtt{L}, \\mathtt{R}\\})$$$, the sum of madnesses is $$$1$$$; all possible pairs of $$$a \\in \\{\\{1, 2\\}, \\{2, 1\\}\\}$$$ and $$$b \\in \\{\\{\\mathtt{L}, \\mathtt{L}\\}, \\{\\mathtt{R}, \\mathtt{L}\\}, \\{\\mathtt{L}, \\mathtt{R}\\}, \\{\\mathtt{R}, \\mathtt{R}\\}\\}$$$, the sum of madnesses is $$$0$$$. So, the answer is $$$1 + 1 + 1 + 1 + 0 \\ldots = 4$$$.","exec_outcome":"","difficulty":3100.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"3 seconds","prob_desc_input_spec":"The only line contains three integers $$$n$$$, $$$m$$$, $$$p$$$ ($$$1 \\leq m \\leq n \\leq 500, 10^8 \\leq p \\leq 10 ^ 9 + 9$$$). It is guaranteed, that the number $$$p$$$ is prime.","prob_desc_sample_outputs":"[\"0\", \"4\", \"8\", \"352081045\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"3 1 1000000007\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 2 1000000009\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"3 2 998244353\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"20 10 1000000009\\r\\n\", \"output\": [\"352081045\"]}, {\"input\": \"5 2 1000000007\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"500 498 1000000007\\r\\n\", \"output\": [\"497900737\"]}, {\"input\": \"10 9 1000000007\\r\\n\", \"output\": [\"904119416\"]}, {\"input\": \"7 4 1000000009\\r\\n\", \"output\": [\"31488\"]}, {\"input\": \"8 8 700001153\\r\\n\", \"output\": [\"247497204\"]}, {\"input\": \"6 3 999999487\\r\\n\", \"output\": [\"768\"]}, {\"input\": \"310 228 998244799\\r\\n\", \"output\": [\"861313351\"]}, {\"input\": \"385 76 998244353\\r\\n\", \"output\": [\"750286580\"]}, {\"input\": \"259 76 998244353\\r\\n\", \"output\": [\"41310904\"]}, {\"input\": \"459 14 200003077\\r\\n\", \"output\": [\"142997933\"]}, {\"input\": \"1 1 1000000007\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"498 155 998244799\\r\\n\", \"output\": [\"673213318\"]}, {\"input\": \"372 309 1000000009\\r\\n\", \"output\": [\"698627891\"]}, {\"input\": \"44 19 998244799\\r\\n\", \"output\": [\"81944049\"]}, {\"input\": \"70 39 700001153\\r\\n\", \"output\": [\"401935379\"]}, {\"input\": \"282 190 300001657\\r\\n\", \"output\": [\"210852530\"]}, {\"input\": \"370 100 1000000007\\r\\n\", \"output\": [\"112411341\"]}, {\"input\": \"234 21 200003077\\r\\n\", \"output\": [\"137641479\"]}, {\"input\": \"194 184 200003077\\r\\n\", \"output\": [\"76845836\"]}, {\"input\": \"499 497 998244799\\r\\n\", \"output\": [\"514945258\"]}, {\"input\": \"500 117 1000000007\\r\\n\", \"output\": [\"234794832\"]}, {\"input\": \"45 41 200003077\\r\\n\", \"output\": [\"176259818\"]}, {\"input\": \"2 1 1000000007\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 2 1000000007\\r\\n\", \"output\": [\"4\"]}]"} {"prob_desc_description":"The map of Bertown can be represented as a set of $$$n$$$ intersections, numbered from $$$1$$$ to $$$n$$$ and connected by $$$m$$$ one-way roads. It is possible to move along the roads from any intersection to any other intersection. The length of some path from one intersection to another is the number of roads that one has to traverse along the path. The shortest path from one intersection $$$v$$$ to another intersection $$$u$$$ is the path that starts in $$$v$$$, ends in $$$u$$$ and has the minimum length among all such paths.Polycarp lives near the intersection $$$s$$$ and works in a building near the intersection $$$t$$$. Every day he gets from $$$s$$$ to $$$t$$$ by car. Today he has chosen the following path to his workplace: $$$p_1$$$, $$$p_2$$$, ..., $$$p_k$$$, where $$$p_1 = s$$$, $$$p_k = t$$$, and all other elements of this sequence are the intermediate intersections, listed in the order Polycarp arrived at them. Polycarp never arrived at the same intersection twice, so all elements of this sequence are pairwise distinct. Note that you know Polycarp's path beforehand (it is fixed), and it is not necessarily one of the shortest paths from $$$s$$$ to $$$t$$$.Polycarp's car has a complex navigation system installed in it. Let's describe how it works. When Polycarp starts his journey at the intersection $$$s$$$, the system chooses some shortest path from $$$s$$$ to $$$t$$$ and shows it to Polycarp. Let's denote the next intersection in the chosen path as $$$v$$$. If Polycarp chooses to drive along the road from $$$s$$$ to $$$v$$$, then the navigator shows him the same shortest path (obviously, starting from $$$v$$$ as soon as he arrives at this intersection). However, if Polycarp chooses to drive to another intersection $$$w$$$ instead, the navigator rebuilds the path: as soon as Polycarp arrives at $$$w$$$, the navigation system chooses some shortest path from $$$w$$$ to $$$t$$$ and shows it to Polycarp. The same process continues until Polycarp arrives at $$$t$$$: if Polycarp moves along the road recommended by the system, it maintains the shortest path it has already built; but if Polycarp chooses some other path, the system rebuilds the path by the same rules.Here is an example. Suppose the map of Bertown looks as follows, and Polycarp drives along the path $$$[1, 2, 3, 4]$$$ ($$$s = 1$$$, $$$t = 4$$$): Check the picture by the link http:\/\/tk.codeforces.com\/a.png When Polycarp starts at $$$1$$$, the system chooses some shortest path from $$$1$$$ to $$$4$$$. There is only one such path, it is $$$[1, 5, 4]$$$; Polycarp chooses to drive to $$$2$$$, which is not along the path chosen by the system. When Polycarp arrives at $$$2$$$, the navigator rebuilds the path by choosing some shortest path from $$$2$$$ to $$$4$$$, for example, $$$[2, 6, 4]$$$ (note that it could choose $$$[2, 3, 4]$$$); Polycarp chooses to drive to $$$3$$$, which is not along the path chosen by the system. When Polycarp arrives at $$$3$$$, the navigator rebuilds the path by choosing the only shortest path from $$$3$$$ to $$$4$$$, which is $$$[3, 4]$$$; Polycarp arrives at $$$4$$$ along the road chosen by the navigator, so the system does not have to rebuild anything. Overall, we get $$$2$$$ rebuilds in this scenario. Note that if the system chose $$$[2, 3, 4]$$$ instead of $$$[2, 6, 4]$$$ during the second step, there would be only $$$1$$$ rebuild (since Polycarp goes along the path, so the system maintains the path $$$[3, 4]$$$ during the third step).The example shows us that the number of rebuilds can differ even if the map of Bertown and the path chosen by Polycarp stays the same. Given this information (the map and Polycarp's path), can you determine the minimum and the maximum number of rebuilds that could have happened during the journey?","prob_desc_output_spec":"Print two integers: the minimum and the maximum number of rebuilds that could have happened during the journey.","lang_cluster":"","src_uid":"19a0c05eb2d1559ccfe60e210c6fcd6a","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"512 megabytes","file_name":"prog_syn_val.jsonl","tags":["shortest paths","graphs"],"prob_desc_created_at":"1583068500","prob_desc_sample_inputs":"[\"6 9\\n1 5\\n5 4\\n1 2\\n2 3\\n3 4\\n4 1\\n2 6\\n6 4\\n4 2\\n4\\n1 2 3 4\", \"7 7\\n1 2\\n2 3\\n3 4\\n4 5\\n5 6\\n6 7\\n7 1\\n7\\n1 2 3 4 5 6 7\", \"8 13\\n8 7\\n8 6\\n7 5\\n7 4\\n6 5\\n6 4\\n5 3\\n5 2\\n4 3\\n4 2\\n3 1\\n2 1\\n1 8\\n5\\n8 7 5 2 1\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":null,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line contains two integers $$$n$$$ and $$$m$$$ ($$$2 \\le n \\le m \\le 2 \\cdot 10^5$$$) \u2014 the number of intersections and one-way roads in Bertown, respectively. Then $$$m$$$ lines follow, each describing a road. Each line contains two integers $$$u$$$ and $$$v$$$ ($$$1 \\le u, v \\le n$$$, $$$u \\ne v$$$) denoting a road from intersection $$$u$$$ to intersection $$$v$$$. All roads in Bertown are pairwise distinct, which means that each ordered pair $$$(u, v)$$$ appears at most once in these $$$m$$$ lines (but if there is a road $$$(u, v)$$$, the road $$$(v, u)$$$ can also appear). The following line contains one integer $$$k$$$ ($$$2 \\le k \\le n$$$) \u2014 the number of intersections in Polycarp's path from home to his workplace. The last line contains $$$k$$$ integers $$$p_1$$$, $$$p_2$$$, ..., $$$p_k$$$ ($$$1 \\le p_i \\le n$$$, all these integers are pairwise distinct) \u2014 the intersections along Polycarp's path in the order he arrived at them. $$$p_1$$$ is the intersection where Polycarp lives ($$$s = p_1$$$), and $$$p_k$$$ is the intersection where Polycarp's workplace is situated ($$$t = p_k$$$). It is guaranteed that for every $$$i \\in [1, k - 1]$$$ the road from $$$p_i$$$ to $$$p_{i + 1}$$$ exists, so the path goes along the roads of Bertown. ","prob_desc_sample_outputs":"[\"1 2\", \"0 0\", \"0 3\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"6 9\\r\\n1 5\\r\\n5 4\\r\\n1 2\\r\\n2 3\\r\\n3 4\\r\\n4 1\\r\\n2 6\\r\\n6 4\\r\\n4 2\\r\\n4\\r\\n1 2 3 4\\r\\n\", \"output\": [\"1 2\"]}, {\"input\": \"7 7\\r\\n1 2\\r\\n2 3\\r\\n3 4\\r\\n4 5\\r\\n5 6\\r\\n6 7\\r\\n7 1\\r\\n7\\r\\n1 2 3 4 5 6 7\\r\\n\", \"output\": [\"0 0\"]}, {\"input\": \"8 13\\r\\n8 7\\r\\n8 6\\r\\n7 5\\r\\n7 4\\r\\n6 5\\r\\n6 4\\r\\n5 3\\r\\n5 2\\r\\n4 3\\r\\n4 2\\r\\n3 1\\r\\n2 1\\r\\n1 8\\r\\n5\\r\\n8 7 5 2 1\\r\\n\", \"output\": [\"0 3\"]}, {\"input\": \"20 50\\r\\n2 3\\r\\n18 10\\r\\n11 6\\r\\n11 1\\r\\n18 17\\r\\n18 7\\r\\n15 20\\r\\n6 11\\r\\n11 2\\r\\n8 2\\r\\n14 2\\r\\n20 1\\r\\n1 19\\r\\n17 2\\r\\n5 17\\r\\n15 17\\r\\n19 12\\r\\n16 9\\r\\n12 4\\r\\n19 2\\r\\n2 19\\r\\n14 3\\r\\n6 5\\r\\n20 19\\r\\n2 16\\r\\n1 12\\r\\n2 12\\r\\n9 2\\r\\n13 18\\r\\n2 13\\r\\n10 4\\r\\n12 8\\r\\n12 3\\r\\n17 5\\r\\n18 12\\r\\n18 11\\r\\n2 17\\r\\n6 20\\r\\n19 20\\r\\n7 9\\r\\n3 2\\r\\n19 15\\r\\n10 20\\r\\n13 12\\r\\n4 3\\r\\n18 15\\r\\n13 9\\r\\n2 11\\r\\n19 14\\r\\n16 11\\r\\n8\\r\\n18 10 4 3 2 19 12 8\\r\\n\", \"output\": [\"3 3\"]}, {\"input\": \"20 50\\r\\n20 3\\r\\n5 16\\r\\n1 3\\r\\n10 11\\r\\n10 15\\r\\n15 9\\r\\n20 9\\r\\n14 6\\r\\n16 5\\r\\n13 4\\r\\n11 5\\r\\n3 20\\r\\n13 17\\r\\n11 8\\r\\n11 6\\r\\n12 14\\r\\n16 18\\r\\n17 13\\r\\n18 7\\r\\n3 1\\r\\n8 10\\r\\n17 15\\r\\n7 2\\r\\n9 13\\r\\n5 11\\r\\n6 1\\r\\n2 16\\r\\n8 18\\r\\n10 8\\r\\n4 13\\r\\n9 15\\r\\n14 12\\r\\n1 6\\r\\n9 20\\r\\n7 18\\r\\n6 14\\r\\n7 6\\r\\n18 16\\r\\n2 7\\r\\n3 11\\r\\n15 17\\r\\n3 12\\r\\n14 10\\r\\n4 14\\r\\n19 4\\r\\n11 10\\r\\n4 19\\r\\n8 12\\r\\n17 8\\r\\n12 8\\r\\n16\\r\\n7 2 16 5 11 8 10 15 9 13 4 14 6 1 3 20\\r\\n\", \"output\": [\"5 8\"]}, {\"input\": \"200000 200000\\r\\n136681 174056\\r\\n15423 127122\\r\\n137672 18542\\r\\n61006 42559\\r\\n100993 75825\\r\\n127154 78864\\r\\n45846 107290\\r\\n90566 138733\\r\\n14816 162076\\r\\n103420 129914\\r\\n114282 76956\\r\\n84055 109451\\r\\n60410 98835\\r\\n87450 128443\\r\\n88089 53597\\r\\n17504 29650\\r\\n191714 90663\\r\\n123767 131600\\r\\n159335 5416\\r\\n50211 165717\\r\\n155480 122795\\r\\n114778 79131\\r\\n160130 30508\\r\\n122082 161582\\r\\n84675 57923\\r\\n160533 123470\\r\\n104475 154615\\r\\n71811 66321\\r\\n146618 29051\\r\\n9884 148531\\r\\n174343 136606\\r\\n12006 184589\\r\\n90277 132097\\r\\n36794 103218\\r\\n2543 158399\\r\\n31228 8...\", \"output\": [\"0 0\"]}, {\"input\": \"100000 200000\\r\\n99425 19372\\r\\n65894 49823\\r\\n46049 81197\\r\\n47047 88322\\r\\n27333 52675\\r\\n17577 47048\\r\\n37090 87556\\r\\n57515 38881\\r\\n68912 15728\\r\\n87086 45332\\r\\n96140 96168\\r\\n91687 85568\\r\\n35009 99210\\r\\n70897 52531\\r\\n1665 83360\\r\\n43728 59264\\r\\n4310 31016\\r\\n12521 45397\\r\\n88644 57610\\r\\n89520 60896\\r\\n74367 87421\\r\\n40373 75625\\r\\n4086 28966\\r\\n89659 97328\\r\\n11690 28936\\r\\n63889 64887\\r\\n65444 78523\\r\\n4094 65878\\r\\n10240 6571\\r\\n21220 88133\\r\\n92056 22730\\r\\n34150 86090\\r\\n4181 91377\\r\\n45325 74245\\r\\n96372 84468\\r\\n55543 44377\\r\\n21982 79978\\r\\n41173 8571\\r\\n39069 880...\", \"output\": [\"13658 17355\"]}, {\"input\": \"66668 199998\\r\\n54202 10061\\r\\n27399 48918\\r\\n63834 62512\\r\\n63237 48918\\r\\n63834 8529\\r\\n7426 48918\\r\\n63834 50008\\r\\n48663 48918\\r\\n63834 36905\\r\\n6143 34962\\r\\n59866 48918\\r\\n14997 28719\\r\\n63834 63519\\r\\n29036 57825\\r\\n56192 48918\\r\\n60013 56736\\r\\n49439 48918\\r\\n63834 40749\\r\\n51888 48918\\r\\n12876 10716\\r\\n53017 34537\\r\\n11086 48918\\r\\n11485 56649\\r\\n3292 48918\\r\\n48001 26029\\r\\n2556 40975\\r\\n38363 48918\\r\\n63834 61877\\r\\n61369 21205\\r\\n51001 48918\\r\\n59413 15530\\r\\n7210 2938\\r\\n63834 2013\\r\\n63834 49213\\r\\n63834 38881\\r\\n63335 52339\\r\\n8888 16158\\r\\n27119 48918\\r\\n63834 58487\\r...\", \"output\": [\"66665 66666\"]}, {\"input\": \"20 50\\r\\n18 11\\r\\n17 13\\r\\n19 6\\r\\n13 18\\r\\n20 9\\r\\n10 20\\r\\n6 13\\r\\n13 9\\r\\n2 1\\r\\n17 14\\r\\n11 20\\r\\n8 7\\r\\n14 9\\r\\n10 14\\r\\n8 16\\r\\n11 12\\r\\n1 3\\r\\n4 7\\r\\n7 15\\r\\n19 2\\r\\n9 14\\r\\n15 17\\r\\n14 7\\r\\n4 6\\r\\n20 19\\r\\n1 19\\r\\n13 4\\r\\n15 8\\r\\n6 9\\r\\n6 17\\r\\n1 20\\r\\n3 1\\r\\n16 15\\r\\n19 8\\r\\n15 14\\r\\n7 14\\r\\n16 18\\r\\n16 5\\r\\n5 9\\r\\n6 4\\r\\n11 16\\r\\n12 14\\r\\n3 17\\r\\n2 13\\r\\n5 4\\r\\n12 10\\r\\n18 15\\r\\n5 1\\r\\n6 14\\r\\n1 13\\r\\n12\\r\\n10 20 9 14 7 15 17 13 18 11 16 5\\r\\n\", \"output\": [\"2 2\"]}, {\"input\": \"200000 200000\\r\\n145827 139546\\r\\n8937 173880\\r\\n12265 41379\\r\\n44734 140550\\r\\n128308 185639\\r\\n59326 11112\\r\\n194954 30244\\r\\n171297 34263\\r\\n98450 125220\\r\\n165342 31193\\r\\n90455 21545\\r\\n185807 133949\\r\\n166935 169540\\r\\n26369 20977\\r\\n166107 165803\\r\\n111186 116254\\r\\n36724 161354\\r\\n168237 61786\\r\\n155174 177648\\r\\n47890 34273\\r\\n187397 104456\\r\\n126697 31133\\r\\n107618 128829\\r\\n78416 104932\\r\\n18942 167157\\r\\n195769 134503\\r\\n173639 81244\\r\\n154499 71888\\r\\n105810 168499\\r\\n123113 138873\\r\\n10218 57335\\r\\n67225 87735\\r\\n52261 81729\\r\\n104155 64431\\r\\n171616 12730\\r\\n780...\", \"output\": [\"0 0\"]}, {\"input\": \"20 50\\r\\n3 12\\r\\n5 18\\r\\n17 6\\r\\n19 12\\r\\n10 9\\r\\n18 12\\r\\n12 16\\r\\n11 15\\r\\n2 12\\r\\n12 18\\r\\n1 12\\r\\n20 3\\r\\n16 12\\r\\n6 12\\r\\n10 12\\r\\n4 12\\r\\n12 1\\r\\n5 12\\r\\n9 6\\r\\n13 12\\r\\n17 1\\r\\n10 5\\r\\n20 12\\r\\n11 12\\r\\n7 12\\r\\n20 16\\r\\n6 2\\r\\n13 14\\r\\n9 4\\r\\n16 7\\r\\n1 16\\r\\n5 13\\r\\n6 17\\r\\n9 2\\r\\n19 16\\r\\n18 11\\r\\n20 19\\r\\n12 20\\r\\n20 13\\r\\n14 17\\r\\n14 12\\r\\n8 12\\r\\n10 15\\r\\n15 12\\r\\n17 12\\r\\n2 8\\r\\n5 8\\r\\n9 12\\r\\n12 10\\r\\n12 9\\r\\n4\\r\\n18 12 20 19\\r\\n\", \"output\": [\"0 0\"]}, {\"input\": \"2 2\\r\\n1 2\\r\\n2 1\\r\\n2\\r\\n1 2\\r\\n\", \"output\": [\"0 0\"]}, {\"input\": \"100001 199999\\r\\n1648 23231\\r\\n88206 83495\\r\\n28950 23231\\r\\n17831 23231\\r\\n63696 23231\\r\\n52496 23231\\r\\n84137 23231\\r\\n39901 16491\\r\\n35144 20282\\r\\n93964 1069\\r\\n31347 98654\\r\\n24248 83914\\r\\n22641 23231\\r\\n65304 23231\\r\\n82861 65035\\r\\n80282 81037\\r\\n52366 97567\\r\\n43136 78294\\r\\n13077 23231\\r\\n81391 23231\\r\\n83279 1790\\r\\n69228 16741\\r\\n23711 23231\\r\\n49448 21239\\r\\n24885 23231\\r\\n69664 23231\\r\\n82337 22412\\r\\n42661 23231\\r\\n64506 23231\\r\\n85395 90754\\r\\n73095 96477\\r\\n76855 23231\\r\\n39198 68183\\r\\n53805 23231\\r\\n86277 23231\\r\\n27612 23231\\r\\n95062 23231\\r\\n65275 23231\\r\\n78368...\", \"output\": [\"99998 99998\"]}, {\"input\": \"133332 199997\\r\\n54855 83839\\r\\n51921 90785\\r\\n30290 64291\\r\\n77831 90301\\r\\n94178 87501\\r\\n9628 6663\\r\\n24907 105653\\r\\n132637 6854\\r\\n72877 62555\\r\\n61365 76196\\r\\n33831 47042\\r\\n122320 13361\\r\\n22924 102156\\r\\n28927 91792\\r\\n108352 131614\\r\\n36948 38741\\r\\n121153 2614\\r\\n105606 34738\\r\\n113759 128239\\r\\n115309 124254\\r\\n3445 105377\\r\\n79866 17855\\r\\n96250 32754\\r\\n19779 76922\\r\\n76241 22989\\r\\n20447 130741\\r\\n79540 37660\\r\\n36778 15038\\r\\n54517 108460\\r\\n53902 97462\\r\\n9626 59371\\r\\n31129 108814\\r\\n49940 61223\\r\\n68974 66884\\r\\n130721 1149\\r\\n120216 129025\\r\\n85133 8069\\r\\n8874...\", \"output\": [\"0 66665\"]}, {\"input\": \"100000 200000\\r\\n99880 75854\\r\\n8015 53356\\r\\n37935 54583\\r\\n99880 77754\\r\\n84405 92819\\r\\n49062 80780\\r\\n25394 50738\\r\\n63131 11124\\r\\n59443 42805\\r\\n89455 40330\\r\\n65865 59282\\r\\n48386 60514\\r\\n43397 35497\\r\\n99880 53152\\r\\n50871 10094\\r\\n37354 2063\\r\\n39473 85486\\r\\n37935 77237\\r\\n78013 37221\\r\\n99880 8953\\r\\n63131 69401\\r\\n37042 43360\\r\\n70093 49387\\r\\n84879 18886\\r\\n37935 34461\\r\\n41752 93262\\r\\n34177 47168\\r\\n13678 550\\r\\n99880 54660\\r\\n74950 54273\\r\\n20151 49424\\r\\n98248 89313\\r\\n84114 13042\\r\\n41866 49812\\r\\n37935 3699\\r\\n67164 29849\\r\\n26333 83027\\r\\n14813 67926\\r\\n52069 38...\", \"output\": [\"1 1\"]}, {\"input\": \"100000 200000\\r\\n80405 14948\\r\\n47995 47522\\r\\n24872 7313\\r\\n21670 5847\\r\\n79073 664\\r\\n26805 48377\\r\\n80405 82208\\r\\n90933 63795\\r\\n59778 654\\r\\n59778 73300\\r\\n37543 54698\\r\\n30425 22234\\r\\n883 59623\\r\\n38578 55377\\r\\n87700 1497\\r\\n79974 26917\\r\\n18370 47716\\r\\n45327 35298\\r\\n52595 84134\\r\\n18239 8112\\r\\n96215 86111\\r\\n85509 50965\\r\\n80405 66867\\r\\n80701 14051\\r\\n45327 22741\\r\\n6927 10507\\r\\n67111 17967\\r\\n38454 15183\\r\\n90135 23528\\r\\n37543 83723\\r\\n80405 94780\\r\\n80405 76176\\r\\n79974 85464\\r\\n27521 97996\\r\\n20271 88834\\r\\n26390 94437\\r\\n80405 32817\\r\\n46732 19448\\r\\n7543 79349\\r\\n7...\", \"output\": [\"47 47\"]}, {\"input\": \"100000 200000\\r\\n62981 14466\\r\\n12678 28357\\r\\n70405 82432\\r\\n42177 85035\\r\\n96251 61605\\r\\n13855 56103\\r\\n96511 79429\\r\\n92416 67727\\r\\n70711 70422\\r\\n84720 52605\\r\\n94207 69087\\r\\n69435 5642\\r\\n4277 46436\\r\\n74583 8169\\r\\n26942 86652\\r\\n90042 8224\\r\\n66670 78287\\r\\n27626 58025\\r\\n34286 19840\\r\\n93657 33346\\r\\n34365 50812\\r\\n12694 68044\\r\\n417 19791\\r\\n3596 93613\\r\\n55402 50797\\r\\n85898 41472\\r\\n2564 43442\\r\\n63263 73805\\r\\n77197 39441\\r\\n22841 71185\\r\\n73204 19470\\r\\n76634 59895\\r\\n18678 45354\\r\\n55865 31509\\r\\n58786 28539\\r\\n11346 8480\\r\\n67808 87431\\r\\n37368 3483\\r\\n3999 58259\\r\\n...\", \"output\": [\"2 2\"]}, {\"input\": \"50000 200000\\r\\n11584 19329\\r\\n36815 27598\\r\\n6917 28520\\r\\n45056 19198\\r\\n11607 45243\\r\\n27603 21003\\r\\n31175 7397\\r\\n33367 38766\\r\\n13379 15958\\r\\n46661 35875\\r\\n26910 21963\\r\\n12706 8289\\r\\n24363 7470\\r\\n36413 10250\\r\\n9977 19193\\r\\n19424 25957\\r\\n20808 43285\\r\\n21345 6745\\r\\n19424 19514\\r\\n38138 3894\\r\\n19651 23687\\r\\n11607 28684\\r\\n36413 9352\\r\\n9894 18994\\r\\n36509 2870\\r\\n7536 42343\\r\\n44470 24882\\r\\n28414 41409\\r\\n27636 9030\\r\\n27636 25186\\r\\n13531 21433\\r\\n36413 28066\\r\\n38657 1443\\r\\n7599 42889\\r\\n41997 6345\\r\\n17622 28530\\r\\n11607 48370\\r\\n5810 47783\\r\\n36599 42447\\r\\n13531 ...\", \"output\": [\"12642 17666\"]}, {\"input\": \"50000 200000\\r\\n46095 5557\\r\\n10996 45395\\r\\n18157 24049\\r\\n46095 43885\\r\\n30441 29575\\r\\n18157 38269\\r\\n5770 13886\\r\\n21841 33812\\r\\n4880 15208\\r\\n26523 7532\\r\\n924 17222\\r\\n23752 14771\\r\\n22163 13957\\r\\n18157 49949\\r\\n43123 31480\\r\\n22596 42861\\r\\n36276 24122\\r\\n43216 3751\\r\\n16704 15821\\r\\n36486 6725\\r\\n26167 1797\\r\\n20311 8194\\r\\n8476 42706\\r\\n10849 25031\\r\\n12163 39417\\r\\n11426 46248\\r\\n22031 17299\\r\\n47975 5278\\r\\n44813 3894\\r\\n46095 1032\\r\\n18157 12986\\r\\n17724 26027\\r\\n3417 24986\\r\\n27660 5102\\r\\n8606 32813\\r\\n45345 31738\\r\\n27660 38476\\r\\n6795 1181\\r\\n47593 47243\\r\\n4292 4736...\", \"output\": [\"11537 16051\"]}, {\"input\": \"50000 200000\\r\\n13859 17413\\r\\n34424 3708\\r\\n260 48877\\r\\n9210 36152\\r\\n49516 49500\\r\\n19701 17870\\r\\n49955 45687\\r\\n42965 44596\\r\\n19392 43224\\r\\n19885 19222\\r\\n34599 26070\\r\\n2908 6690\\r\\n36075 7582\\r\\n32777 27870\\r\\n3708 15661\\r\\n49126 6374\\r\\n14374 14147\\r\\n46505 17009\\r\\n2030 32691\\r\\n33998 27597\\r\\n13647 12951\\r\\n44817 33578\\r\\n4678 49850\\r\\n40524 1067\\r\\n7385 14576\\r\\n46354 48803\\r\\n8661 22857\\r\\n2230 42878\\r\\n30981 22716\\r\\n35416 7032\\r\\n47787 2165\\r\\n49080 15944\\r\\n37966 14024\\r\\n3308 30746\\r\\n3191 32338\\r\\n31789 29374\\r\\n24479 13645\\r\\n36174 46946\\r\\n25577 15994\\r\\n26228 419...\", \"output\": [\"11239 15776\"]}, {\"input\": \"50000 200000\\r\\n29993 21906\\r\\n33136 6164\\r\\n28285 8924\\r\\n36437 48672\\r\\n45141 27978\\r\\n11720 45315\\r\\n42257 45802\\r\\n15623 33122\\r\\n39981 5517\\r\\n24188 14675\\r\\n3493 8694\\r\\n19167 32464\\r\\n29322 2746\\r\\n37451 14698\\r\\n26966 25943\\r\\n38817 34207\\r\\n27712 33920\\r\\n2391 8086\\r\\n17653 26278\\r\\n25655 31039\\r\\n39203 26812\\r\\n31973 30262\\r\\n16815 11947\\r\\n11772 19276\\r\\n29920 23750\\r\\n6175 49005\\r\\n35904 12241\\r\\n33976 1830\\r\\n44118 39385\\r\\n13137 34478\\r\\n1601 8388\\r\\n20557 30145\\r\\n1281 46747\\r\\n25563 22975\\r\\n21822 5551\\r\\n5527 37696\\r\\n47901 4873\\r\\n2421 27720\\r\\n32357 17404\\r\\n42531 1...\", \"output\": [\"1843 2602\"]}, {\"input\": \"200000 200000\\r\\n1112 154640\\r\\n195908 146502\\r\\n74402 168131\\r\\n22837 98711\\r\\n127696 154816\\r\\n99192 65799\\r\\n129816 36743\\r\\n34747 117801\\r\\n31571 102564\\r\\n171083 37778\\r\\n86451 112908\\r\\n66353 35307\\r\\n93809 64070\\r\\n193183 127865\\r\\n197358 119908\\r\\n92501 96601\\r\\n151456 117195\\r\\n44959 184080\\r\\n187971 31208\\r\\n58167 16392\\r\\n156693 5086\\r\\n129143 155922\\r\\n100533 88559\\r\\n66928 127100\\r\\n160147 148387\\r\\n35951 112324\\r\\n161330 135392\\r\\n105995 24592\\r\\n144297 57553\\r\\n22366 87727\\r\\n74677 76510\\r\\n174828 191148\\r\\n101478 83218\\r\\n149973 163318\\r\\n70028 142456\\r\\n7795 2...\", \"output\": [\"0 0\"]}, {\"input\": \"200000 200000\\r\\n4127 77182\\r\\n60736 141161\\r\\n13537 21078\\r\\n32747 147134\\r\\n72073 118191\\r\\n14789 183959\\r\\n198943 142162\\r\\n162137 185042\\r\\n151961 90253\\r\\n44419 98014\\r\\n105100 195228\\r\\n1835 31011\\r\\n193710 92394\\r\\n173266 51857\\r\\n26066 136422\\r\\n26756 60454\\r\\n13468 109574\\r\\n150082 81044\\r\\n5825 96329\\r\\n195848 82215\\r\\n188635 102601\\r\\n163425 13887\\r\\n12295 46391\\r\\n21228 79586\\r\\n146143 191216\\r\\n90908 55015\\r\\n61301 184231\\r\\n137799 106335\\r\\n112122 115108\\r\\n13161 89584\\r\\n149549 88303\\r\\n124945 14421\\r\\n68813 191073\\r\\n174812 102238\\r\\n127254 136475\\r\\n85740 5616...\", \"output\": [\"0 0\"]}, {\"input\": \"200000 200000\\r\\n89762 23210\\r\\n106015 24887\\r\\n160020 28808\\r\\n106075 27804\\r\\n127405 100643\\r\\n174192 26553\\r\\n22909 105445\\r\\n93674 139264\\r\\n191898 83091\\r\\n90879 147501\\r\\n80544 40256\\r\\n115811 48618\\r\\n32262 27902\\r\\n47740 61000\\r\\n69644 195230\\r\\n164964 96811\\r\\n140491 188089\\r\\n126576 16672\\r\\n176970 129371\\r\\n173174 50602\\r\\n185265 9256\\r\\n23907 38343\\r\\n13677 927\\r\\n168103 195877\\r\\n86047 35930\\r\\n106285 90951\\r\\n18899 12629\\r\\n86242 64203\\r\\n139205 95955\\r\\n77741 103668\\r\\n104237 9770\\r\\n187558 79677\\r\\n56435 100466\\r\\n185076 104608\\r\\n22451 57555\\r\\n10332 132673\\r\\n2...\", \"output\": [\"0 0\"]}, {\"input\": \"320 385\\r\\n1 2\\r\\n1 3\\r\\n2 4\\r\\n3 4\\r\\n4 5\\r\\n4 6\\r\\n5 7\\r\\n6 7\\r\\n7 8\\r\\n7 9\\r\\n8 10\\r\\n9 10\\r\\n10 11\\r\\n10 12\\r\\n11 13\\r\\n12 13\\r\\n13 14\\r\\n13 15\\r\\n14 16\\r\\n15 16\\r\\n16 17\\r\\n16 18\\r\\n17 19\\r\\n18 19\\r\\n19 20\\r\\n19 21\\r\\n20 22\\r\\n21 22\\r\\n22 23\\r\\n22 24\\r\\n23 25\\r\\n24 25\\r\\n25 26\\r\\n25 27\\r\\n26 28\\r\\n27 28\\r\\n28 29\\r\\n28 30\\r\\n29 31\\r\\n30 31\\r\\n31 32\\r\\n31 33\\r\\n32 34\\r\\n33 34\\r\\n34 35\\r\\n34 36\\r\\n35 37\\r\\n36 37\\r\\n37 38\\r\\n37 39\\r\\n38 40\\r\\n39 40\\r\\n40 41\\r\\n40 42\\r\\n41 43\\r\\n42 43\\r\\n43 44\\r\\n43 45\\r\\n44 46\\r\\n45 46\\r\\n46 47\\r\\n46 48\\r\\n47 49\\r\\n48 49\\r\\n49 50\\r\\n49 51\\r\\n50 52\\r\\n51 52\\r\\n52 53\\r\\n52 54\\r\\n53 55\\r\\n54 55\\r\\n55 56\\r\\n55 57\\r\\n56 58\\r...\", \"output\": [\"0 1\"]}]"} {"prob_desc_description":"Makoto has a big blackboard with a positive integer $$$n$$$ written on it. He will perform the following action exactly $$$k$$$ times:Suppose the number currently written on the blackboard is $$$v$$$. He will randomly pick one of the divisors of $$$v$$$ (possibly $$$1$$$ and $$$v$$$) and replace $$$v$$$ with this divisor. As Makoto uses his famous random number generator (RNG) and as he always uses $$$58$$$ as his generator seed, each divisor is guaranteed to be chosen with equal probability.He now wonders what is the expected value of the number written on the blackboard after $$$k$$$ steps.It can be shown that this value can be represented as $$$\\frac{P}{Q}$$$ where $$$P$$$ and $$$Q$$$ are coprime integers and $$$Q \\not\\equiv 0 \\pmod{10^9+7}$$$. Print the value of $$$P \\cdot Q^{-1}$$$ modulo $$$10^9+7$$$.","prob_desc_output_spec":"Print a single integer \u2014 the expected value of the number on the blackboard after $$$k$$$ steps as $$$P \\cdot Q^{-1} \\pmod{10^9+7}$$$ for $$$P$$$, $$$Q$$$ defined above.","lang_cluster":"","src_uid":"dc466d9c24b7dcb37c0e99337b4124d2","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","number theory","probabilities","dp"],"prob_desc_created_at":"1546613100","prob_desc_sample_inputs":"[\"6 1\", \"6 2\", \"60 5\"]","prob_desc_notes":"NoteIn the first example, after one step, the number written on the blackboard is $$$1$$$, $$$2$$$, $$$3$$$ or $$$6$$$ \u2014 each occurring with equal probability. Hence, the answer is $$$\\frac{1+2+3+6}{4}=3$$$.In the second example, the answer is equal to $$$1 \\cdot \\frac{9}{16}+2 \\cdot \\frac{3}{16}+3 \\cdot \\frac{3}{16}+6 \\cdot \\frac{1}{16}=\\frac{15}{8}$$$.","exec_outcome":"","difficulty":2200.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The only line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \\leq n \\leq 10^{15}$$$, $$$1 \\leq k \\leq 10^4$$$).","prob_desc_sample_outputs":"[\"3\", \"875000008\", \"237178099\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"6 1\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"6 2\\r\\n\", \"output\": [\"875000008\"]}, {\"input\": \"60 5\\r\\n\", \"output\": [\"237178099\"]}, {\"input\": \"2 4\\r\\n\", \"output\": [\"562500005\"]}, {\"input\": \"12 3\\r\\n\", \"output\": [\"775462970\"]}, {\"input\": \"55 5\\r\\n\", \"output\": [\"789062507\"]}, {\"input\": \"935 9\\r\\n\", \"output\": [\"658825880\"]}, {\"input\": \"1 10000\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"120 1\\r\\n\", \"output\": [\"500000026\"]}, {\"input\": \"1000000000000000 10000\\r\\n\", \"output\": [\"215514159\"]}, {\"input\": \"671058194037157 8673\\r\\n\", \"output\": [\"298638658\"]}, {\"input\": \"900018062553298 4801\\r\\n\", \"output\": [\"345432320\"]}, {\"input\": \"128973636102142 5521\\r\\n\", \"output\": [\"99152648\"]}, {\"input\": \"999999999999993 8123\\r\\n\", \"output\": [\"868053217\"]}, {\"input\": \"260858031033600 9696\\r\\n\", \"output\": [\"692221824\"]}, {\"input\": \"562949953421312 9779\\r\\n\", \"output\": [\"98057767\"]}, {\"input\": \"357933504618282 1649\\r\\n\", \"output\": [\"197730476\"]}, {\"input\": \"586884783199831 5073\\r\\n\", \"output\": [\"883678085\"]}, {\"input\": \"187877211524483 8497\\r\\n\", \"output\": [\"562808746\"]}, {\"input\": \"866421317361600 10000\\r\\n\", \"output\": [\"82212846\"]}, {\"input\": \"782574093100800 9999\\r\\n\", \"output\": [\"293217028\"]}, {\"input\": \"577614211574400 9998\\r\\n\", \"output\": [\"681915605\"]}, {\"input\": \"65214507758400 9997\\r\\n\", \"output\": [\"677959603\"]}, {\"input\": \"963761198400 9996\\r\\n\", \"output\": [\"669401143\"]}, {\"input\": \"5587021440 9995\\r\\n\", \"output\": [\"360750834\"]}, {\"input\": \"17297280 9994\\r\\n\", \"output\": [\"94383698\"]}, {\"input\": \"7560 9993\\r\\n\", \"output\": [\"412712546\"]}, {\"input\": \"120 9992\\r\\n\", \"output\": [\"167656619\"]}, {\"input\": \"1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"609359740010496 1337\\r\\n\", \"output\": [\"263703037\"]}, {\"input\": \"912750790581630 9876\\r\\n\", \"output\": [\"291557094\"]}, {\"input\": \"617673396283947 7777\\r\\n\", \"output\": [\"488769014\"]}, {\"input\": \"890604418498560 9119\\r\\n\", \"output\": [\"185509970\"]}, {\"input\": \"524288004718592 8888\\r\\n\", \"output\": [\"851726115\"]}, {\"input\": \"999999999999989 8998\\r\\n\", \"output\": [\"391873310\"]}, {\"input\": \"999999999999999 8123\\r\\n\", \"output\": [\"41003922\"]}, {\"input\": \"817237005720659 4233\\r\\n\", \"output\": [\"533017938\"]}, {\"input\": \"1000000007 1\\r\\n\", \"output\": [\"500000004\"]}, {\"input\": \"1000000007 2\\r\\n\", \"output\": [\"750000006\"]}, {\"input\": \"999999999999970 8998\\r\\n\", \"output\": [\"939941657\"]}, {\"input\": \"900000060000001 8123\\r\\n\", \"output\": [\"865356488\"]}, {\"input\": \"999011322032079 4233\\r\\n\", \"output\": [\"546309400\"]}, {\"input\": \"999005327998113 9119\\r\\n\", \"output\": [\"106270540\"]}, {\"input\": \"900000720000023 9876\\r\\n\", \"output\": [\"511266473\"]}]"} {"prob_desc_description":"Let's introduce some definitions that will be needed later.Let $$$prime(x)$$$ be the set of prime divisors of $$$x$$$. For example, $$$prime(140) = \\{ 2, 5, 7 \\}$$$, $$$prime(169) = \\{ 13 \\}$$$.Let $$$g(x, p)$$$ be the maximum possible integer $$$p^k$$$ where $$$k$$$ is an integer such that $$$x$$$ is divisible by $$$p^k$$$. For example: $$$g(45, 3) = 9$$$ ($$$45$$$ is divisible by $$$3^2=9$$$ but not divisible by $$$3^3=27$$$), $$$g(63, 7) = 7$$$ ($$$63$$$ is divisible by $$$7^1=7$$$ but not divisible by $$$7^2=49$$$). Let $$$f(x, y)$$$ be the product of $$$g(y, p)$$$ for all $$$p$$$ in $$$prime(x)$$$. For example: $$$f(30, 70) = g(70, 2) \\cdot g(70, 3) \\cdot g(70, 5) = 2^1 \\cdot 3^0 \\cdot 5^1 = 10$$$, $$$f(525, 63) = g(63, 3) \\cdot g(63, 5) \\cdot g(63, 7) = 3^2 \\cdot 5^0 \\cdot 7^1 = 63$$$. You have integers $$$x$$$ and $$$n$$$. Calculate $$$f(x, 1) \\cdot f(x, 2) \\cdot \\ldots \\cdot f(x, n) \\bmod{(10^{9} + 7)}$$$.","prob_desc_output_spec":"Print the answer.","lang_cluster":"","src_uid":"04610fbaa746c083dda30e21fa6e1a0c","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","number theory"],"prob_desc_created_at":"1569762300","prob_desc_sample_inputs":"[\"10 2\", \"20190929 1605\", \"947 987654321987654321\"]","prob_desc_notes":"NoteIn the first example, $$$f(10, 1) = g(1, 2) \\cdot g(1, 5) = 1$$$, $$$f(10, 2) = g(2, 2) \\cdot g(2, 5) = 2$$$.In the second example, actual value of formula is approximately $$$1.597 \\cdot 10^{171}$$$. Make sure you print the answer modulo $$$(10^{9} + 7)$$$.In the third example, be careful about overflow issue.","exec_outcome":"","difficulty":1700.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The only line contains integers $$$x$$$ and $$$n$$$ ($$$2 \\le x \\le 10^{9}$$$, $$$1 \\le n \\le 10^{18}$$$)\u00a0\u2014 the numbers used in formula.","prob_desc_sample_outputs":"[\"2\", \"363165664\", \"593574252\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"10 2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"20190929 1605\\r\\n\", \"output\": [\"363165664\"]}, {\"input\": \"947 987654321987654321\\r\\n\", \"output\": [\"593574252\"]}, {\"input\": \"2 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1000000000 1000000000000000000\\r\\n\", \"output\": [\"997440007\"]}, {\"input\": \"688829161 296569860304026304\\r\\n\", \"output\": [\"388155331\"]}, {\"input\": \"666010979 443570624148538441\\r\\n\", \"output\": [\"886507301\"]}, {\"input\": \"62459 243660471368579\\r\\n\", \"output\": [\"842535934\"]}, {\"input\": \"7946761 48034259999420806\\r\\n\", \"output\": [\"286862630\"]}, {\"input\": \"651423529 424352614134813841\\r\\n\", \"output\": [\"408736200\"]}, {\"input\": \"9 188\\r\\n\", \"output\": [\"954137859\"]}, {\"input\": \"670514203 852730801385798525\\r\\n\", \"output\": [\"355832385\"]}, {\"input\": \"610455946 416624575433175279\\r\\n\", \"output\": [\"338494046\"]}, {\"input\": \"49 79792266297612001\\r\\n\", \"output\": [\"444608448\"]}, {\"input\": \"3 450283905890997363\\r\\n\", \"output\": [\"137055211\"]}, {\"input\": \"46957 103538299629493\\r\\n\", \"output\": [\"516798047\"]}, {\"input\": \"732253291 788822690846812980\\r\\n\", \"output\": [\"73304767\"]}, {\"input\": \"97073 914735122128017\\r\\n\", \"output\": [\"829607048\"]}, {\"input\": \"17282811 699905460125739623\\r\\n\", \"output\": [\"59360995\"]}, {\"input\": \"181 6364290927201661\\r\\n\", \"output\": [\"475029602\"]}, {\"input\": \"858913688 891530069762947837\\r\\n\", \"output\": [\"647838042\"]}, {\"input\": \"967354019 885482785588887131\\r\\n\", \"output\": [\"808625396\"]}, {\"input\": \"266771957 238077331412324150\\r\\n\", \"output\": [\"739449215\"]}, {\"input\": \"830311913 317759021041529386\\r\\n\", \"output\": [\"693455621\"]}, {\"input\": \"848817679 656378982730193530\\r\\n\", \"output\": [\"62821476\"]}, {\"input\": \"195871858 768946182432660488\\r\\n\", \"output\": [\"392505530\"]}, {\"input\": \"711775563 733987980910045529\\r\\n\", \"output\": [\"162577667\"]}, {\"input\": \"525248617 82607938303742375\\r\\n\", \"output\": [\"23639347\"]}, {\"input\": \"143742939 719404683072701713\\r\\n\", \"output\": [\"302790025\"]}, {\"input\": \"28436 878968615689292495\\r\\n\", \"output\": [\"214265329\"]}, {\"input\": \"84649 916822936406978638\\r\\n\", \"output\": [\"246601699\"]}, {\"input\": \"87620 877857688202236881\\r\\n\", \"output\": [\"744263233\"]}, {\"input\": \"593239213 160216936483594374\\r\\n\", \"output\": [\"304167038\"]}, {\"input\": \"701679551 498836898172258517\\r\\n\", \"output\": [\"430076831\"]}, {\"input\": \"570117590 448352800956119696\\r\\n\", \"output\": [\"137534751\"]}, {\"input\": \"955489921 180523632657788226\\r\\n\", \"output\": [\"983910063\"]}, {\"input\": \"292681 817149800101377878\\r\\n\", \"output\": [\"608820127\"]}, {\"input\": \"1369 886139189349580965\\r\\n\", \"output\": [\"84873742\"]}, {\"input\": \"354907921 125959632388542241\\r\\n\", \"output\": [\"911890209\"]}, {\"input\": \"844561 602411242538130481\\r\\n\", \"output\": [\"731875446\"]}, {\"input\": \"841 353814783205469041\\r\\n\", \"output\": [\"865189676\"]}, {\"input\": \"602555209 363072779893033681\\r\\n\", \"output\": [\"506211588\"]}, {\"input\": \"822649 556728843703025449\\r\\n\", \"output\": [\"339554911\"]}, {\"input\": \"307371493 799006685782884121\\r\\n\", \"output\": [\"29424494\"]}, {\"input\": \"2 576460752303423488\\r\\n\", \"output\": [\"222384588\"]}, {\"input\": \"5 298023223876953125\\r\\n\", \"output\": [\"570366926\"]}, {\"input\": \"31891 32434291280971\\r\\n\", \"output\": [\"947227318\"]}, {\"input\": \"2 576460752303423487\\r\\n\", \"output\": [\"198832797\"]}, {\"input\": \"183 183\\r\\n\", \"output\": [\"387952563\"]}, {\"input\": \"139 1000000000000000000\\r\\n\", \"output\": [\"141180258\"]}]"} {"prob_desc_description":"Anadi has a set of dominoes. Every domino has two parts, and each part contains some dots. For every $$$a$$$ and $$$b$$$ such that $$$1 \\leq a \\leq b \\leq 6$$$, there is exactly one domino with $$$a$$$ dots on one half and $$$b$$$ dots on the other half. The set contains exactly $$$21$$$ dominoes. Here is an exact illustration of his set: Also, Anadi has an undirected graph without self-loops and multiple edges. He wants to choose some dominoes and place them on the edges of this graph. He can use at most one domino of each type. Each edge can fit at most one domino. It's not necessary to place a domino on each edge of the graph.When placing a domino on an edge, he also chooses its direction. In other words, one half of any placed domino must be directed toward one of the endpoints of the edge and the other half must be directed toward the other endpoint. There's a catch: if there are multiple halves of dominoes directed toward the same vertex, each of these halves must contain the same number of dots.How many dominoes at most can Anadi place on the edges of his graph?","prob_desc_output_spec":"Output one integer which denotes the maximum number of dominoes which Anadi can place on the edges of the graph.","lang_cluster":"","src_uid":"11e6559cfb71b8f6ca88242094b17a2b","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force","graphs"],"prob_desc_created_at":"1569143100","prob_desc_sample_inputs":"[\"4 4\\n1 2\\n2 3\\n3 4\\n4 1\", \"7 0\", \"3 1\\n1 3\", \"7 21\\n1 2\\n1 3\\n1 4\\n1 5\\n1 6\\n1 7\\n2 3\\n2 4\\n2 5\\n2 6\\n2 7\\n3 4\\n3 5\\n3 6\\n3 7\\n4 5\\n4 6\\n4 7\\n5 6\\n5 7\\n6 7\"]","prob_desc_notes":"NoteHere is an illustration of Anadi's graph from the first sample test: And here is one of the ways to place a domino on each of its edges: Note that each vertex is faced by the halves of dominoes with the same number of dots. For instance, all halves directed toward vertex $$$1$$$ have three dots.","exec_outcome":"","difficulty":1700.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \\leq n \\leq 7$$$, $$$0 \\leq m \\leq \\frac{n\\cdot(n-1)}{2}$$$) \u2014 the number of vertices and the number of edges in the graph. The next $$$m$$$ lines contain two integers each. Integers in the $$$i$$$-th line are $$$a_i$$$ and $$$b_i$$$ ($$$1 \\leq a, b \\leq n$$$, $$$a \\neq b$$$) and denote that there is an edge which connects vertices $$$a_i$$$ and $$$b_i$$$. The graph might be disconnected. It's however guaranteed that the graph doesn't contain any self-loops, and that there is at most one edge between any pair of vertices.","prob_desc_sample_outputs":"[\"4\", \"0\", \"1\", \"16\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"4 4\\r\\n1 2\\r\\n2 3\\r\\n3 4\\r\\n4 1\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"7 0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3 1\\r\\n1 3\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"7 21\\r\\n1 2\\r\\n1 3\\r\\n1 4\\r\\n1 5\\r\\n1 6\\r\\n1 7\\r\\n2 3\\r\\n2 4\\r\\n2 5\\r\\n2 6\\r\\n2 7\\r\\n3 4\\r\\n3 5\\r\\n3 6\\r\\n3 7\\r\\n4 5\\r\\n4 6\\r\\n4 7\\r\\n5 6\\r\\n5 7\\r\\n6 7\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"4 4\\r\\n4 2\\r\\n2 3\\r\\n3 4\\r\\n2 1\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"5 7\\r\\n4 3\\r\\n3 2\\r\\n1 4\\r\\n5 3\\r\\n5 2\\r\\n4 5\\r\\n1 5\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"6 9\\r\\n2 5\\r\\n3 6\\r\\n1 2\\r\\n1 4\\r\\n2 6\\r\\n6 1\\r\\n3 4\\r\\n1 3\\r\\n5 3\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"7 5\\r\\n5 6\\r\\n3 7\\r\\n7 2\\r\\n4 2\\r\\n1 4\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"7 14\\r\\n7 3\\r\\n2 4\\r\\n2 1\\r\\n2 5\\r\\n5 3\\r\\n6 7\\r\\n4 7\\r\\n5 4\\r\\n7 5\\r\\n4 3\\r\\n4 1\\r\\n6 1\\r\\n6 3\\r\\n3 1\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"7 15\\r\\n4 6\\r\\n7 3\\r\\n3 1\\r\\n6 5\\r\\n2 7\\r\\n3 6\\r\\n7 6\\r\\n2 6\\r\\n7 5\\r\\n3 5\\r\\n5 4\\r\\n4 7\\r\\n2 1\\r\\n2 4\\r\\n2 3\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"7 18\\r\\n1 5\\r\\n5 7\\r\\n1 3\\r\\n1 6\\r\\n4 5\\r\\n3 7\\r\\n6 7\\r\\n4 7\\r\\n2 7\\r\\n1 2\\r\\n7 1\\r\\n5 6\\r\\n6 2\\r\\n4 2\\r\\n5 3\\r\\n3 6\\r\\n4 6\\r\\n4 3\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"7 14\\r\\n2 7\\r\\n5 7\\r\\n3 4\\r\\n4 2\\r\\n2 3\\r\\n4 1\\r\\n6 5\\r\\n4 7\\r\\n6 2\\r\\n6 1\\r\\n5 3\\r\\n5 1\\r\\n7 6\\r\\n3 1\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"7 11\\r\\n4 7\\r\\n6 4\\r\\n5 1\\r\\n1 4\\r\\n5 4\\r\\n1 2\\r\\n3 4\\r\\n4 2\\r\\n6 1\\r\\n3 1\\r\\n7 1\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"7 18\\r\\n3 2\\r\\n5 3\\r\\n6 7\\r\\n7 3\\r\\n5 4\\r\\n4 6\\r\\n2 4\\r\\n7 1\\r\\n5 6\\r\\n5 2\\r\\n5 1\\r\\n3 4\\r\\n7 4\\r\\n6 1\\r\\n3 6\\r\\n7 2\\r\\n1 3\\r\\n1 2\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"7 17\\r\\n1 7\\r\\n5 6\\r\\n6 3\\r\\n1 2\\r\\n1 6\\r\\n3 4\\r\\n6 7\\r\\n4 5\\r\\n1 3\\r\\n1 5\\r\\n4 1\\r\\n5 2\\r\\n3 5\\r\\n4 6\\r\\n7 5\\r\\n7 2\\r\\n6 2\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"7 10\\r\\n3 6\\r\\n6 1\\r\\n4 6\\r\\n1 7\\r\\n7 4\\r\\n5 3\\r\\n5 6\\r\\n6 7\\r\\n7 5\\r\\n5 1\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"1 0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 1\\r\\n2 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"3 0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3 2\\r\\n2 3\\r\\n1 3\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"3 3\\r\\n1 2\\r\\n2 3\\r\\n1 3\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"4 0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"4 2\\r\\n2 4\\r\\n1 3\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"4 6\\r\\n2 1\\r\\n1 4\\r\\n2 4\\r\\n3 1\\r\\n3 2\\r\\n3 4\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"5 0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"5 3\\r\\n5 1\\r\\n1 4\\r\\n5 4\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"5 10\\r\\n1 2\\r\\n3 4\\r\\n1 3\\r\\n2 3\\r\\n5 4\\r\\n5 1\\r\\n4 1\\r\\n5 3\\r\\n5 2\\r\\n2 4\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"6 0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"6 3\\r\\n4 2\\r\\n5 4\\r\\n4 3\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"6 6\\r\\n4 3\\r\\n4 6\\r\\n1 2\\r\\n4 5\\r\\n6 3\\r\\n3 2\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"6 15\\r\\n4 3\\r\\n2 1\\r\\n3 6\\r\\n1 3\\r\\n4 1\\r\\n2 3\\r\\n3 5\\r\\n4 5\\r\\n6 1\\r\\n2 5\\r\\n1 5\\r\\n2 6\\r\\n6 4\\r\\n5 6\\r\\n4 2\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"6 12\\r\\n2 1\\r\\n4 3\\r\\n1 5\\r\\n6 4\\r\\n6 2\\r\\n3 6\\r\\n1 6\\r\\n2 4\\r\\n1 4\\r\\n2 5\\r\\n5 4\\r\\n1 3\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"7 1\\r\\n5 3\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"7 2\\r\\n5 1\\r\\n3 5\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"7 3\\r\\n1 5\\r\\n5 7\\r\\n2 7\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"7 4\\r\\n3 7\\r\\n7 5\\r\\n1 3\\r\\n1 6\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"7 6\\r\\n3 5\\r\\n7 1\\r\\n3 7\\r\\n5 4\\r\\n7 4\\r\\n3 6\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"7 7\\r\\n2 5\\r\\n6 1\\r\\n5 4\\r\\n7 2\\r\\n3 2\\r\\n4 1\\r\\n7 3\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"7 8\\r\\n4 1\\r\\n5 7\\r\\n6 4\\r\\n7 1\\r\\n6 3\\r\\n3 4\\r\\n3 1\\r\\n6 7\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"7 9\\r\\n2 6\\r\\n7 4\\r\\n2 5\\r\\n2 7\\r\\n4 2\\r\\n3 5\\r\\n5 6\\r\\n6 7\\r\\n7 3\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"7 11\\r\\n2 4\\r\\n1 3\\r\\n5 2\\r\\n2 7\\r\\n1 4\\r\\n4 3\\r\\n2 1\\r\\n7 6\\r\\n3 2\\r\\n7 4\\r\\n4 5\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"7 12\\r\\n6 3\\r\\n3 5\\r\\n7 5\\r\\n1 5\\r\\n1 7\\r\\n7 6\\r\\n4 1\\r\\n2 1\\r\\n1 6\\r\\n5 6\\r\\n3 4\\r\\n4 2\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"7 13\\r\\n6 5\\r\\n5 7\\r\\n4 2\\r\\n7 2\\r\\n4 1\\r\\n6 7\\r\\n4 3\\r\\n1 6\\r\\n2 5\\r\\n5 4\\r\\n2 1\\r\\n6 4\\r\\n6 2\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"7 16\\r\\n3 5\\r\\n1 3\\r\\n3 7\\r\\n4 2\\r\\n1 4\\r\\n1 6\\r\\n7 6\\r\\n5 1\\r\\n7 2\\r\\n4 3\\r\\n3 6\\r\\n2 3\\r\\n2 5\\r\\n4 5\\r\\n2 6\\r\\n5 7\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"7 17\\r\\n4 6\\r\\n1 7\\r\\n7 5\\r\\n3 7\\r\\n7 2\\r\\n2 5\\r\\n6 7\\r\\n1 3\\r\\n5 1\\r\\n6 2\\r\\n4 2\\r\\n3 2\\r\\n1 2\\r\\n5 3\\r\\n4 5\\r\\n3 4\\r\\n1 6\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"7 19\\r\\n6 1\\r\\n6 4\\r\\n6 5\\r\\n1 7\\r\\n2 7\\r\\n3 5\\r\\n7 6\\r\\n2 4\\r\\n5 7\\r\\n3 4\\r\\n6 2\\r\\n4 1\\r\\n5 1\\r\\n4 7\\r\\n3 2\\r\\n4 5\\r\\n3 1\\r\\n2 5\\r\\n6 3\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"7 20\\r\\n4 7\\r\\n1 4\\r\\n2 3\\r\\n4 3\\r\\n3 7\\r\\n7 5\\r\\n4 5\\r\\n1 2\\r\\n6 7\\r\\n3 1\\r\\n3 5\\r\\n1 5\\r\\n1 7\\r\\n2 6\\r\\n6 4\\r\\n5 2\\r\\n5 6\\r\\n6 3\\r\\n1 6\\r\\n2 7\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"7 21\\r\\n3 5\\r\\n7 2\\r\\n2 3\\r\\n6 5\\r\\n5 2\\r\\n4 7\\r\\n2 6\\r\\n2 4\\r\\n6 7\\r\\n5 1\\r\\n1 4\\r\\n4 5\\r\\n5 7\\r\\n4 6\\r\\n3 1\\r\\n1 2\\r\\n3 4\\r\\n7 1\\r\\n3 7\\r\\n6 1\\r\\n3 6\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"7 12\\r\\n3 4\\r\\n5 4\\r\\n1 7\\r\\n7 3\\r\\n2 5\\r\\n3 2\\r\\n1 4\\r\\n5 6\\r\\n6 1\\r\\n6 3\\r\\n2 1\\r\\n5 7\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"7 7\\r\\n7 6\\r\\n4 2\\r\\n3 1\\r\\n4 7\\r\\n6 3\\r\\n2 5\\r\\n1 5\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"7 6\\r\\n7 5\\r\\n5 2\\r\\n1 5\\r\\n5 4\\r\\n3 5\\r\\n6 5\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"7 15\\r\\n5 1\\r\\n3 2\\r\\n2 5\\r\\n3 5\\r\\n6 1\\r\\n4 3\\r\\n6 2\\r\\n4 5\\r\\n7 5\\r\\n3 6\\r\\n3 1\\r\\n7 3\\r\\n4 6\\r\\n6 5\\r\\n6 7\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"7 18\\r\\n3 7\\r\\n3 2\\r\\n2 1\\r\\n1 7\\r\\n5 1\\r\\n3 4\\r\\n5 6\\r\\n4 2\\r\\n6 2\\r\\n1 4\\r\\n2 5\\r\\n6 3\\r\\n3 1\\r\\n6 7\\r\\n6 1\\r\\n7 2\\r\\n6 4\\r\\n3 5\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"7 19\\r\\n1 2\\r\\n7 3\\r\\n3 4\\r\\n4 7\\r\\n3 6\\r\\n7 5\\r\\n6 2\\r\\n4 6\\r\\n6 7\\r\\n5 2\\r\\n3 2\\r\\n6 5\\r\\n4 1\\r\\n2 4\\r\\n4 5\\r\\n6 1\\r\\n3 1\\r\\n1 7\\r\\n5 1\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"7 16\\r\\n3 2\\r\\n6 3\\r\\n6 1\\r\\n5 6\\r\\n7 5\\r\\n5 2\\r\\n6 2\\r\\n2 1\\r\\n5 4\\r\\n4 1\\r\\n7 2\\r\\n1 5\\r\\n2 4\\r\\n7 3\\r\\n1 7\\r\\n6 7\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"7 12\\r\\n4 1\\r\\n6 4\\r\\n3 4\\r\\n3 1\\r\\n2 4\\r\\n7 5\\r\\n5 4\\r\\n2 1\\r\\n6 7\\r\\n2 3\\r\\n7 4\\r\\n6 5\\r\\n\", \"output\": [\"11\"]}]"} {"prob_desc_description":"Melody Pond was stolen from her parents as a newborn baby by Madame Kovarian, to become a weapon of the Silence in their crusade against the Doctor. Madame Kovarian changed Melody's name to River Song, giving her a new identity that allowed her to kill the Eleventh Doctor.Heidi figured out that Madame Kovarian uses a very complicated hashing function in order to change the names of the babies she steals. In order to prevent this from happening to future Doctors, Heidi decided to prepare herself by learning some basic hashing techniques.The first hashing function she designed is as follows.Given two positive integers $$$(x, y)$$$ she defines $$$H(x,y):=x^2+2xy+x+1$$$.Now, Heidi wonders if the function is reversible. That is, given a positive integer $$$r$$$, can you find a pair $$$(x, y)$$$ (of positive integers) such that $$$H(x, y) = r$$$?If multiple such pairs exist, output the one with smallest possible $$$x$$$. If there is no such pair, output \"NO\".","prob_desc_output_spec":"Output integers $$$x, y$$$ such that $$$H(x,y) = r$$$ and $$$x$$$ is smallest possible, or \"NO\" if no such pair exists.","lang_cluster":"","src_uid":"3ff1c25a1026c90aeb14d148d7fb96ba","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force","math","number theory"],"prob_desc_created_at":"1562483100","prob_desc_sample_inputs":"[\"19\", \"16\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":1200.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first and only line contains an integer $$$r$$$ ($$$1 \\le r \\le 10^{12}$$$).","prob_desc_sample_outputs":"[\"1 8\", \"NO\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"19\\r\\n\", \"output\": [\"1 8\"]}, {\"input\": \"16\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"1\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"2\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"3\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"4\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"5\\r\\n\", \"output\": [\"1 1\"]}, {\"input\": \"6\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"7\\r\\n\", \"output\": [\"1 2\"]}, {\"input\": \"8\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"9\\r\\n\", \"output\": [\"1 3\"]}, {\"input\": \"10\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"11\\r\\n\", \"output\": [\"1 4\"]}, {\"input\": \"12\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"13\\r\\n\", \"output\": [\"1 5\"]}, {\"input\": \"14\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"15\\r\\n\", \"output\": [\"1 6\"]}, {\"input\": \"17\\r\\n\", \"output\": [\"1 7\"]}, {\"input\": \"18\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"20\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"21\\r\\n\", \"output\": [\"1 9\"]}, {\"input\": \"260158260522\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"250877914575\\r\\n\", \"output\": [\"1 125438957286\"]}, {\"input\": \"116602436426\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"540024979445\\r\\n\", \"output\": [\"1 270012489721\"]}, {\"input\": \"917861648772\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"962623690081\\r\\n\", \"output\": [\"1 481311845039\"]}, {\"input\": \"54433933447\\r\\n\", \"output\": [\"1 27216966722\"]}, {\"input\": \"16476190629\\r\\n\", \"output\": [\"1 8238095313\"]}, {\"input\": \"426262703497\\r\\n\", \"output\": [\"1 213131351747\"]}, {\"input\": \"723211047202\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"652509336151\\r\\n\", \"output\": [\"1 326254668074\"]}, {\"input\": \"215283472163\\r\\n\", \"output\": [\"1 107641736080\"]}, {\"input\": \"29617919\\r\\n\", \"output\": [\"1 14808958\"]}, {\"input\": \"7505295085\\r\\n\", \"output\": [\"1 3752647541\"]}, {\"input\": \"149890929717\\r\\n\", \"output\": [\"1 74945464857\"]}, {\"input\": \"185589070745\\r\\n\", \"output\": [\"1 92794535371\"]}, {\"input\": \"419450839\\r\\n\", \"output\": [\"1 209725418\"]}, {\"input\": \"519397679401\\r\\n\", \"output\": [\"1 259698839699\"]}, {\"input\": \"943447972637\\r\\n\", \"output\": [\"1 471723986317\"]}, {\"input\": \"54336309171\\r\\n\", \"output\": [\"1 27168154584\"]}, {\"input\": \"688373050717\\r\\n\", \"output\": [\"1 344186525357\"]}, {\"input\": \"156231653273\\r\\n\", \"output\": [\"1 78115826635\"]}, {\"input\": \"23744498401\\r\\n\", \"output\": [\"1 11872249199\"]}, {\"input\": \"768407398177\\r\\n\", \"output\": [\"1 384203699087\"]}, {\"input\": \"963761198401\\r\\n\", \"output\": [\"1 481880599199\"]}, {\"input\": \"240940299601\\r\\n\", \"output\": [\"1 120470149799\"]}]"} {"prob_desc_description":"You are given a regular polygon with $$$n$$$ vertices labeled from $$$1$$$ to $$$n$$$ in counter-clockwise order. The triangulation of a given polygon is a set of triangles such that each vertex of each triangle is a vertex of the initial polygon, there is no pair of triangles such that their intersection has non-zero area, and the total area of all triangles is equal to the area of the given polygon. The weight of a triangulation is the sum of weigths of triangles it consists of, where the weight of a triagle is denoted as the product of labels of its vertices.Calculate the minimum weight among all triangulations of the polygon.","prob_desc_output_spec":"Print one integer \u2014 the minimum weight among all triangulations of the given polygon.","lang_cluster":"","src_uid":"1bd29d7a8793c22e81a1f6fd3991307a","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["dp","greedy","math"],"prob_desc_created_at":"1553267100","prob_desc_sample_inputs":"[\"3\", \"4\"]","prob_desc_notes":"NoteAccording to Wiki: polygon triangulation is the decomposition of a polygonal area (simple polygon) $$$P$$$ into a set of triangles, i.\u2009e., finding a set of triangles with pairwise non-intersecting interiors whose union is $$$P$$$.In the first example the polygon is a triangle, so we don't need to cut it further, so the answer is $$$1 \\cdot 2 \\cdot 3 = 6$$$.In the second example the polygon is a rectangle, so it should be divided into two triangles. It's optimal to cut it using diagonal $$$1-3$$$ so answer is $$$1 \\cdot 2 \\cdot 3 + 1 \\cdot 3 \\cdot 4 = 6 + 12 = 18$$$.","exec_outcome":"","difficulty":1200.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line contains single integer $$$n$$$ ($$$3 \\le n \\le 500$$$) \u2014 the number of vertices in the regular polygon.","prob_desc_sample_outputs":"[\"6\", \"18\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"3\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"4\\r\\n\", \"output\": [\"18\"]}, {\"input\": \"5\\r\\n\", \"output\": [\"38\"]}, {\"input\": \"6\\r\\n\", \"output\": [\"68\"]}, {\"input\": \"7\\r\\n\", \"output\": [\"110\"]}, {\"input\": \"8\\r\\n\", \"output\": [\"166\"]}, {\"input\": \"9\\r\\n\", \"output\": [\"238\"]}, {\"input\": \"10\\r\\n\", \"output\": [\"328\"]}, {\"input\": \"100\\r\\n\", \"output\": [\"333298\"]}, {\"input\": \"101\\r\\n\", \"output\": [\"343398\"]}, {\"input\": \"102\\r\\n\", \"output\": [\"353700\"]}, {\"input\": \"103\\r\\n\", \"output\": [\"364206\"]}, {\"input\": \"104\\r\\n\", \"output\": [\"374918\"]}, {\"input\": \"105\\r\\n\", \"output\": [\"385838\"]}, {\"input\": \"106\\r\\n\", \"output\": [\"396968\"]}, {\"input\": \"107\\r\\n\", \"output\": [\"408310\"]}, {\"input\": \"108\\r\\n\", \"output\": [\"419866\"]}, {\"input\": \"109\\r\\n\", \"output\": [\"431638\"]}, {\"input\": \"110\\r\\n\", \"output\": [\"443628\"]}, {\"input\": \"500\\r\\n\", \"output\": [\"41666498\"]}, {\"input\": \"497\\r\\n\", \"output\": [\"40920990\"]}, {\"input\": \"494\\r\\n\", \"output\": [\"40184428\"]}, {\"input\": \"491\\r\\n\", \"output\": [\"39456758\"]}, {\"input\": \"488\\r\\n\", \"output\": [\"38737926\"]}, {\"input\": \"485\\r\\n\", \"output\": [\"38027878\"]}, {\"input\": \"482\\r\\n\", \"output\": [\"37326560\"]}, {\"input\": \"479\\r\\n\", \"output\": [\"36633918\"]}, {\"input\": \"476\\r\\n\", \"output\": [\"35949898\"]}, {\"input\": \"473\\r\\n\", \"output\": [\"35274446\"]}, {\"input\": \"470\\r\\n\", \"output\": [\"34607508\"]}, {\"input\": \"467\\r\\n\", \"output\": [\"33949030\"]}, {\"input\": \"464\\r\\n\", \"output\": [\"33298958\"]}, {\"input\": \"461\\r\\n\", \"output\": [\"32657238\"]}, {\"input\": \"458\\r\\n\", \"output\": [\"32023816\"]}, {\"input\": \"455\\r\\n\", \"output\": [\"31398638\"]}, {\"input\": \"452\\r\\n\", \"output\": [\"30781650\"]}, {\"input\": \"449\\r\\n\", \"output\": [\"30172798\"]}, {\"input\": \"446\\r\\n\", \"output\": [\"29572028\"]}, {\"input\": \"42\\r\\n\", \"output\": [\"24680\"]}, {\"input\": \"69\\r\\n\", \"output\": [\"109478\"]}, {\"input\": \"228\\r\\n\", \"output\": [\"3950706\"]}, {\"input\": \"233\\r\\n\", \"output\": [\"4216366\"]}, {\"input\": \"420\\r\\n\", \"output\": [\"24695858\"]}, {\"input\": \"368\\r\\n\", \"output\": [\"16611886\"]}, {\"input\": \"225\\r\\n\", \"output\": [\"3796798\"]}, {\"input\": \"11\\r\\n\", \"output\": [\"438\"]}, {\"input\": \"12\\r\\n\", \"output\": [\"570\"]}, {\"input\": \"13\\r\\n\", \"output\": [\"726\"]}, {\"input\": \"14\\r\\n\", \"output\": [\"908\"]}, {\"input\": \"135\\r\\n\", \"output\": [\"820078\"]}, {\"input\": \"199\\r\\n\", \"output\": [\"2626798\"]}, {\"input\": \"137\\r\\n\", \"output\": [\"857070\"]}, {\"input\": \"131\\r\\n\", \"output\": [\"749318\"]}, {\"input\": \"130\\r\\n\", \"output\": [\"732288\"]}, {\"input\": \"139\\r\\n\", \"output\": [\"895158\"]}]"} {"prob_desc_description":"Welcome to Codeforces Stock Exchange! We're pretty limited now as we currently allow trading on one stock, Codeforces Ltd. We hope you'll still be able to make profit from the market!In the morning, there are $$$n$$$ opportunities to buy shares. The $$$i$$$-th of them allows to buy as many shares as you want, each at the price of $$$s_i$$$ bourles.In the evening, there are $$$m$$$ opportunities to sell shares. The $$$i$$$-th of them allows to sell as many shares as you want, each at the price of $$$b_i$$$ bourles. You can't sell more shares than you have.It's morning now and you possess $$$r$$$ bourles and no shares.What is the maximum number of bourles you can hold after the evening?","prob_desc_output_spec":"Output a single integer \u2014 the maximum number of bourles you can hold after the evening.","lang_cluster":"","src_uid":"42f25d492bddc12d3d89d39315d63cb9","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["greedy","implementation"],"prob_desc_created_at":"1556548500","prob_desc_sample_inputs":"[\"3 4 11\\n4 2 5\\n4 4 5 4\", \"2 2 50\\n5 7\\n4 2\"]","prob_desc_notes":"NoteIn the first example test, you have $$$11$$$ bourles in the morning. It's optimal to buy $$$5$$$ shares of a stock at the price of $$$2$$$ bourles in the morning, and then to sell all of them at the price of $$$5$$$ bourles in the evening. It's easy to verify that you'll have $$$26$$$ bourles after the evening.In the second example test, it's optimal not to take any action.","exec_outcome":"","difficulty":800.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line of the input contains three integers $$$n, m, r$$$ ($$$1 \\leq n \\leq 30$$$, $$$1 \\leq m \\leq 30$$$, $$$1 \\leq r \\leq 1000$$$) \u2014 the number of ways to buy the shares on the market, the number of ways to sell the shares on the market, and the number of bourles you hold now. The next line contains $$$n$$$ integers $$$s_1, s_2, \\dots, s_n$$$ ($$$1 \\leq s_i \\leq 1000$$$); $$$s_i$$$ indicates the opportunity to buy shares at the price of $$$s_i$$$ bourles. The following line contains $$$m$$$ integers $$$b_1, b_2, \\dots, b_m$$$ ($$$1 \\leq b_i \\leq 1000$$$); $$$b_i$$$ indicates the opportunity to sell shares at the price of $$$b_i$$$ bourles.","prob_desc_sample_outputs":"[\"26\", \"50\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"3 4 11\\r\\n4 2 5\\r\\n4 4 5 4\\r\\n\", \"output\": [\"26\"]}, {\"input\": \"2 2 50\\r\\n5 7\\r\\n4 2\\r\\n\", \"output\": [\"50\"]}, {\"input\": \"1 1 1\\r\\n1\\r\\n1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 1 35\\r\\n5\\r\\n7\\r\\n\", \"output\": [\"49\"]}, {\"input\": \"1 1 36\\r\\n5\\r\\n7\\r\\n\", \"output\": [\"50\"]}, {\"input\": \"3 5 20\\r\\n1000 4 6\\r\\n1 2 7 6 5\\r\\n\", \"output\": [\"35\"]}, {\"input\": \"5 3 20\\r\\n5 4 3 2 1\\r\\n6 7 1000\\r\\n\", \"output\": [\"20000\"]}, {\"input\": \"30 30 987\\r\\n413 937 166 77 749 925 792 353 773 88 218 863 71 186 753 306 952 966 236 501 84 163 767 99 887 380 435 888 589 761\\r\\n68 501 323 916 506 952 411 813 664 49 860 151 120 543 168 944 302 521 245 517 464 734 205 235 173 893 109 655 346 837\\r\\n\", \"output\": [\"12440\"]}, {\"input\": \"30 22 1000\\r\\n999 953 947 883 859 857 775 766 723 713 696 691 659 650 597 474 472 456 455 374 367 354 347 215 111 89 76 76 59 55\\r\\n172 188 223 247 404 445 449 489 493 554 558 587 588 627 686 714 720 744 747 786 830 953\\r\\n\", \"output\": [\"17164\"]}, {\"input\": \"28 29 1000\\r\\n555 962 781 562 856 700 628 591 797 873 950 607 526 513 552 954 768 823 863 650 984 653 741 548 676 577 625 902\\r\\n185 39 223 383 221 84 165 492 79 53 475 410 314 489 59 138 395 346 91 258 14 354 410 25 41 394 463 432 325\\r\\n\", \"output\": [\"1000\"]}, {\"input\": \"30 29 999\\r\\n993 982 996 992 988 984 981 982 981 981 992 997 982 996 995 981 995 982 994 996 988 986 990 991 987 993 1000 989 998 991\\r\\n19 12 14 5 20 11 15 11 7 14 12 8 1 9 7 15 6 20 15 20 17 15 20 1 4 13 2 2 17\\r\\n\", \"output\": [\"999\"]}, {\"input\": \"30 30 999\\r\\n19 8 6 1 4 12 14 12 8 14 14 2 13 11 10 15 13 14 2 5 15 17 18 16 9 4 2 14 12 9\\r\\n993 987 993 998 998 987 980 986 995 987 998 989 981 982 983 981 997 991 989 989 993 990 984 997 995 984 982 994 990 984\\r\\n\", \"output\": [\"997002\"]}, {\"input\": \"28 30 1000\\r\\n185 184 177 171 165 162 162 154 150 136 133 127 118 111 106 106 95 92 86 85 77 66 65 40 28 10 10 4\\r\\n305 309 311 313 319 321 323 338 349 349 349 351 359 373 378 386 405 409 420 445 457 462 463 466 466 471 473 479 479 482\\r\\n\", \"output\": [\"120500\"]}, {\"input\": \"1 1 10\\r\\n11\\r\\n1000\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"29 30 989\\r\\n450 450 450 450 450 450 450 450 450 450 450 450 450 450 450 450 450 450 450 450 450 450 450 450 450 450 450 450 450\\r\\n451 451 451 451 451 451 451 451 451 451 451 451 451 451 451 451 451 451 451 451 451 451 451 451 451 451 451 451 451 451\\r\\n\", \"output\": [\"991\"]}, {\"input\": \"25 30 989\\r\\n153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153\\r\\n153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153\\r\\n\", \"output\": [\"989\"]}, {\"input\": \"30 26 997\\r\\n499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499 499\\r\\n384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384\\r\\n\", \"output\": [\"997\"]}, {\"input\": \"30 30 1000\\r\\n1 4 2 2 2 1 2 2 2 3 3 3 1 4 2 4 3 1 2 2 3 2 4 2 3 4 2 4 3 2\\r\\n1000 999 997 1000 999 998 999 999 1000 1000 997 997 999 997 999 997 997 999 1000 999 997 998 998 998 997 997 999 1000 998 998\\r\\n\", \"output\": [\"1000000\"]}, {\"input\": \"30 29 42\\r\\n632 501 892 532 293 47 45 669 129 616 322 92 812 499 205 115 889 442 589 34 681 944 49 546 134 625 937 179 1000 69\\r\\n837 639 443 361 323 493 639 573 645 55 711 190 905 628 627 278 967 926 398 479 71 829 960 916 360 43 341 337 90\\r\\n\", \"output\": [\"975\"]}, {\"input\": \"30 30 1000\\r\\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\\r\\n962 987 940 905 911 993 955 994 984 994 923 959 923 993 959 925 922 909 932 911 994 1000 994 976 915 979 928 999 993 956\\r\\n\", \"output\": [\"1000000\"]}, {\"input\": \"1 1 100\\r\\n90\\r\\n91\\r\\n\", \"output\": [\"101\"]}, {\"input\": \"1 1 1000\\r\\n501\\r\\n502\\r\\n\", \"output\": [\"1001\"]}, {\"input\": \"2 1 8\\r\\n3 4\\r\\n5\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"1 3 10\\r\\n2\\r\\n4 5 10\\r\\n\", \"output\": [\"50\"]}, {\"input\": \"4 4 50\\r\\n12 11 30 30\\r\\n12 12 12 12\\r\\n\", \"output\": [\"54\"]}, {\"input\": \"5 10 10\\r\\n2 2 2 2 2\\r\\n2 2 2 2 2 2 2 2 2 3\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"1 2 100\\r\\n1\\r\\n1 100\\r\\n\", \"output\": [\"10000\"]}, {\"input\": \"9 7 999\\r\\n999 999 999 999 999 999 999 999 999\\r\\n999 999 999 999 999 999 999\\r\\n\", \"output\": [\"999\"]}, {\"input\": \"1 3 10\\r\\n2\\r\\n2 3 5\\r\\n\", \"output\": [\"25\"]}, {\"input\": \"1 1 4\\r\\n3\\r\\n4\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"1 1 100\\r\\n99\\r\\n100\\r\\n\", \"output\": [\"101\"]}, {\"input\": \"1 2 5\\r\\n1\\r\\n2 5\\r\\n\", \"output\": [\"25\"]}, {\"input\": \"3 3 10\\r\\n10 12 15\\r\\n30 50 50\\r\\n\", \"output\": [\"50\"]}, {\"input\": \"1 1 13\\r\\n11\\r\\n12\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"1 2 2\\r\\n1\\r\\n1 10\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"1 10 10\\r\\n2\\r\\n4 5 10 1 1 1 1 1 1 1\\r\\n\", \"output\": [\"50\"]}, {\"input\": \"2 16 729\\r\\n831 752\\r\\n331 882 112 57 754 314 781 390 193 285 109 301 308 750 39 94\\r\\n\", \"output\": [\"729\"]}, {\"input\": \"1 1 7\\r\\n5\\r\\n6\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"3 3 1000\\r\\n600 600 600\\r\\n999 999 999\\r\\n\", \"output\": [\"1399\"]}, {\"input\": \"1 1 10\\r\\n4\\r\\n5\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"1 1 7\\r\\n5\\r\\n7\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"1 1 5\\r\\n5\\r\\n6\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"2 3 100\\r\\n2 2\\r\\n2 2 10\\r\\n\", \"output\": [\"500\"]}, {\"input\": \"1 5 10\\r\\n2\\r\\n1 1 1 1 10\\r\\n\", \"output\": [\"50\"]}, {\"input\": \"2 4 2\\r\\n1 1\\r\\n1 1 1 100\\r\\n\", \"output\": [\"200\"]}, {\"input\": \"1 2 100\\r\\n1\\r\\n1 2\\r\\n\", \"output\": [\"200\"]}, {\"input\": \"1 1 15\\r\\n6\\r\\n7\\r\\n\", \"output\": [\"17\"]}, {\"input\": \"2 5 100\\r\\n10 10\\r\\n2 2 2 100 100\\r\\n\", \"output\": [\"1000\"]}, {\"input\": \"1 2 4\\r\\n3\\r\\n4 1\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"1 2 100\\r\\n50\\r\\n50 100\\r\\n\", \"output\": [\"200\"]}, {\"input\": \"1 2 10\\r\\n1\\r\\n2 10\\r\\n\", \"output\": [\"100\"]}, {\"input\": \"2 4 100\\r\\n1 1\\r\\n1 1 1 100\\r\\n\", \"output\": [\"10000\"]}, {\"input\": \"1 1 10\\r\\n10\\r\\n20\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"1 1 4\\r\\n4\\r\\n5\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"1 28 10\\r\\n5\\r\\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 10\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"1 1 3\\r\\n3\\r\\n20\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"2 1 1000\\r\\n52 51\\r\\n53\\r\\n\", \"output\": [\"1038\"]}, {\"input\": \"2 1 7\\r\\n5 4\\r\\n10\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"2 1 10\\r\\n5 4\\r\\n100\\r\\n\", \"output\": [\"202\"]}, {\"input\": \"2 1 11\\r\\n5 4\\r\\n6\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"1 30 1\\r\\n1\\r\\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\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 1 5\\r\\n5\\r\\n10\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"1 1 5\\r\\n5\\r\\n20\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"2 2 50\\r\\n5 7\\r\\n6 2\\r\\n\", \"output\": [\"60\"]}, {\"input\": \"2 1 8\\r\\n6 5\\r\\n10\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"2 1 17\\r\\n8 7\\r\\n10\\r\\n\", \"output\": [\"23\"]}, {\"input\": \"2 3 8\\r\\n4 3\\r\\n10 20 30\\r\\n\", \"output\": [\"62\"]}, {\"input\": \"1 2 2\\r\\n2\\r\\n1 3\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"1 2 10\\r\\n1\\r\\n1 5\\r\\n\", \"output\": [\"50\"]}, {\"input\": \"1 1 100\\r\\n1000\\r\\n10\\r\\n\", \"output\": [\"100\"]}, {\"input\": \"2 3 100\\r\\n5 5\\r\\n1 1 100\\r\\n\", \"output\": [\"2000\"]}, {\"input\": \"1 1 10\\r\\n20\\r\\n30\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"1 2 4\\r\\n1\\r\\n1 2\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"1 3 1\\r\\n1\\r\\n1 1 100\\r\\n\", \"output\": [\"100\"]}, {\"input\": \"1 1 999\\r\\n500\\r\\n501\\r\\n\", \"output\": [\"1000\"]}, {\"input\": \"1 2 10\\r\\n1\\r\\n1 2\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"1 1 10\\r\\n7\\r\\n9\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"2 5 100\\r\\n2 2\\r\\n2 2 2 2 5\\r\\n\", \"output\": [\"250\"]}, {\"input\": \"2 3 10\\r\\n1 1\\r\\n1 1 2\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"1 2 10\\r\\n1\\r\\n9 8\\r\\n\", \"output\": [\"90\"]}, {\"input\": \"2 5 10\\r\\n2 2\\r\\n2 2 2 2 5\\r\\n\", \"output\": [\"25\"]}, {\"input\": \"5 6 8\\r\\n7 7 10 5 5\\r\\n5 6 2 8 1 8\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"1 1 5\\r\\n1\\r\\n4\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"12 21 30\\r\\n24 15 29 5 16 29 12 17 6 19 16 11\\r\\n8 15 12 10 15 20 21 27 18 18 22 15 28 21 29 13 13 9 13 5 3\\r\\n\", \"output\": [\"174\"]}, {\"input\": \"1 3 5\\r\\n1\\r\\n1 2 1\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"1 3 1000\\r\\n10\\r\\n10 30 20\\r\\n\", \"output\": [\"3000\"]}, {\"input\": \"1 1 15\\r\\n4\\r\\n5\\r\\n\", \"output\": [\"18\"]}, {\"input\": \"1 1 4\\r\\n8\\r\\n7\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"1 1 12\\r\\n10\\r\\n11\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"2 4 7\\r\\n1 1\\r\\n1 1 1 10\\r\\n\", \"output\": [\"70\"]}, {\"input\": \"2 5 10\\r\\n1 2\\r\\n3 4 5 6 7\\r\\n\", \"output\": [\"70\"]}, {\"input\": \"1 2 5\\r\\n3\\r\\n2 10\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"2 3 11\\r\\n2 2\\r\\n3 3 5\\r\\n\", \"output\": [\"26\"]}, {\"input\": \"1 3 50\\r\\n10\\r\\n10 30 20\\r\\n\", \"output\": [\"150\"]}, {\"input\": \"1 5 10\\r\\n5\\r\\n1 1 1 1 10\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"1 2 19\\r\\n10\\r\\n1 11\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"1 3 4\\r\\n1\\r\\n1 5 2\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"1 2 100\\r\\n2\\r\\n1 10\\r\\n\", \"output\": [\"500\"]}, {\"input\": \"1 1 12\\r\\n9\\r\\n10\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"3 4 11\\r\\n4 2 5\\r\\n4 4 4 5\\r\\n\", \"output\": [\"26\"]}, {\"input\": \"1 1 8\\r\\n6\\r\\n7\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"1 1 7\\r\\n4\\r\\n5\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"1 5 10\\r\\n1\\r\\n5 5 5 5 10\\r\\n\", \"output\": [\"100\"]}, {\"input\": \"1 2 10\\r\\n1\\r\\n1 20\\r\\n\", \"output\": [\"200\"]}, {\"input\": \"1 2 5\\r\\n1\\r\\n2 3\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"1 3 100\\r\\n5\\r\\n1 1 1000\\r\\n\", \"output\": [\"20000\"]}, {\"input\": \"2 1 11\\r\\n5 4\\r\\n5\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"4 3 11\\r\\n1 2 3 4\\r\\n1 2 3\\r\\n\", \"output\": [\"33\"]}, {\"input\": \"1 2 5\\r\\n2\\r\\n2 100\\r\\n\", \"output\": [\"201\"]}, {\"input\": \"1 5 10\\r\\n2\\r\\n1 1 1 1 100\\r\\n\", \"output\": [\"500\"]}, {\"input\": \"3 3 11\\r\\n4 5 6\\r\\n1 2 5\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"2 3 5\\r\\n1 1\\r\\n2 2 5\\r\\n\", \"output\": [\"25\"]}, {\"input\": \"3 4 10\\r\\n5 3 1\\r\\n10 10 10 1000\\r\\n\", \"output\": [\"10000\"]}, {\"input\": \"1 1 13\\r\\n5\\r\\n6\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"1 1 1000\\r\\n51\\r\\n52\\r\\n\", \"output\": [\"1019\"]}, {\"input\": \"1 2 10\\r\\n1\\r\\n3 10\\r\\n\", \"output\": [\"100\"]}, {\"input\": \"3 4 2\\r\\n5 3 5\\r\\n10 10 10 1000\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1 1 11\\r\\n8\\r\\n9\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"1 2 5\\r\\n5\\r\\n5 10\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"1 5 10\\r\\n1\\r\\n2 2 2 2 5\\r\\n\", \"output\": [\"50\"]}, {\"input\": \"1 2 1\\r\\n1\\r\\n1 2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"3 5 100\\r\\n1 1 1\\r\\n2 2 2 2 7\\r\\n\", \"output\": [\"700\"]}, {\"input\": \"1 2 10\\r\\n2\\r\\n2 10\\r\\n\", \"output\": [\"50\"]}, {\"input\": \"3 9 15\\r\\n1 2 3\\r\\n1 2 3 4 4 6 5 5 4\\r\\n\", \"output\": [\"90\"]}]"} {"prob_desc_description":"Getting closer and closer to a mathematician, Serval becomes a university student on math major in Japari University. On the Calculus class, his teacher taught him how to calculate the expected length of a random subsegment of a given segment. Then he left a bonus problem as homework, with the award of a garage kit from IOI. The bonus is to extend this problem to the general case as follows.You are given a segment with length $$$l$$$. We randomly choose $$$n$$$ segments by choosing two points (maybe with non-integer coordinates) from the given segment equiprobably and the interval between the two points forms a segment. You are given the number of random segments $$$n$$$, and another integer $$$k$$$. The $$$2n$$$ endpoints of the chosen segments split the segment into $$$(2n+1)$$$ intervals. Your task is to calculate the expected total length of those intervals that are covered by at least $$$k$$$ segments of the $$$n$$$ random segments.You should find the answer modulo $$$998244353$$$.","prob_desc_output_spec":"Output one integer\u00a0\u2014 the expected total length of all the intervals covered by at least $$$k$$$ segments of the $$$n$$$ random segments modulo $$$998244353$$$. Formally, let $$$M = 998244353$$$. It can be shown that the answer can be expressed as an irreducible fraction $$$\\frac{p}{q}$$$, where $$$p$$$ and $$$q$$$ are integers and $$$q \\not \\equiv 0 \\pmod{M}$$$. Output the integer equal to $$$p \\cdot q^{-1} \\bmod M$$$. In other words, output such an integer $$$x$$$ that $$$0 \\le x < M$$$ and $$$x \\cdot q \\equiv p \\pmod{M}$$$.","lang_cluster":"","src_uid":"c9e79e83928d5d034123ebc3b2f5e064","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","probabilities","combinatorics","dp"],"prob_desc_created_at":"1555164300","prob_desc_sample_inputs":"[\"1 1 1\", \"6 2 1\", \"7 5 3\", \"97 31 9984524\"]","prob_desc_notes":"NoteIn the first example, the expected total length is $$$\\int_0^1 \\int_0^1 |x-y| \\,\\mathrm{d}x\\,\\mathrm{d}y = {1\\over 3}$$$, and $$$3^{-1}$$$ modulo $$$998244353$$$ is $$$332748118$$$.","exec_outcome":"","difficulty":2600.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"First line contains three space-separated positive integers $$$n$$$, $$$k$$$ and $$$l$$$ ($$$1\\leq k \\leq n \\leq 2000$$$, $$$1\\leq l\\leq 10^9$$$).","prob_desc_sample_outputs":"[\"332748118\", \"760234711\", \"223383352\", \"267137618\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"1 1 1\\r\\n\", \"output\": [\"332748118\"]}, {\"input\": \"6 2 1\\r\\n\", \"output\": [\"760234711\"]}, {\"input\": \"7 5 3\\r\\n\", \"output\": [\"223383352\"]}, {\"input\": \"97 31 9984524\\r\\n\", \"output\": [\"267137618\"]}, {\"input\": \"2000 1 772197283\\r\\n\", \"output\": [\"905584809\"]}, {\"input\": \"2000 2 76039754\\r\\n\", \"output\": [\"855496918\"]}, {\"input\": \"2000 3 40337285\\r\\n\", \"output\": [\"782495326\"]}, {\"input\": \"2000 2000 773356966\\r\\n\", \"output\": [\"104351589\"]}, {\"input\": \"2000 1999 239479112\\r\\n\", \"output\": [\"620815507\"]}, {\"input\": \"2000 1998 334042678\\r\\n\", \"output\": [\"322694394\"]}, {\"input\": \"2000 976 671942688\\r\\n\", \"output\": [\"767696001\"]}, {\"input\": \"2000 1415 40371690\\r\\n\", \"output\": [\"171032298\"]}, {\"input\": \"2000 1000 1000000000\\r\\n\", \"output\": [\"491672258\"]}, {\"input\": \"1998 1001 998244353\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2000 4 136878315\\r\\n\", \"output\": [\"880870575\"]}, {\"input\": \"2000 5 558837462\\r\\n\", \"output\": [\"18859862\"]}, {\"input\": \"2000 1997 525997660\\r\\n\", \"output\": [\"843278067\"]}, {\"input\": \"2000 1996 45458693\\r\\n\", \"output\": [\"772786701\"]}, {\"input\": \"2000 1947 62604662\\r\\n\", \"output\": [\"540795249\"]}, {\"input\": \"2000 1728 63723796\\r\\n\", \"output\": [\"421421553\"]}, {\"input\": \"1961 206 931072038\\r\\n\", \"output\": [\"794464980\"]}, {\"input\": \"1948 978 501529426\\r\\n\", \"output\": [\"50139353\"]}, {\"input\": \"1878 1529 66841298\\r\\n\", \"output\": [\"880727658\"]}, {\"input\": \"1900 1 495084177\\r\\n\", \"output\": [\"338668438\"]}, {\"input\": \"1885 2 286102770\\r\\n\", \"output\": [\"443099162\"]}, {\"input\": \"1928 3 200575371\\r\\n\", \"output\": [\"291241927\"]}, {\"input\": \"1978 4 436588015\\r\\n\", \"output\": [\"282947523\"]}, {\"input\": \"1987 1987 191667504\\r\\n\", \"output\": [\"627381301\"]}, {\"input\": \"1821 1820 866603455\\r\\n\", \"output\": [\"318623064\"]}, {\"input\": \"1824 1822 151884700\\r\\n\", \"output\": [\"462069981\"]}, {\"input\": \"1486 1 170331068\\r\\n\", \"output\": [\"692176218\"]}, {\"input\": \"1424 1 217388653\\r\\n\", \"output\": [\"56808622\"]}, {\"input\": \"1703 1 803103605\\r\\n\", \"output\": [\"660333930\"]}, {\"input\": \"1555 1 700556118\\r\\n\", \"output\": [\"615656029\"]}, {\"input\": \"1224 1 71403225\\r\\n\", \"output\": [\"128242924\"]}, {\"input\": \"1492 1 599215694\\r\\n\", \"output\": [\"195441337\"]}, {\"input\": \"1281 1 415457117\\r\\n\", \"output\": [\"111407914\"]}, {\"input\": \"1664 1 517151944\\r\\n\", \"output\": [\"126430274\"]}, {\"input\": \"1771 1 555450393\\r\\n\", \"output\": [\"280416119\"]}, {\"input\": \"1045 1 375567139\\r\\n\", \"output\": [\"983012429\"]}, {\"input\": \"1025 1025 871316577\\r\\n\", \"output\": [\"266993477\"]}, {\"input\": \"1243 1243 296556443\\r\\n\", \"output\": [\"209836419\"]}, {\"input\": \"1240 1240 846679367\\r\\n\", \"output\": [\"744376915\"]}, {\"input\": \"1946 1946 432053608\\r\\n\", \"output\": [\"329055332\"]}, {\"input\": \"1806 1806 174417450\\r\\n\", \"output\": [\"287857698\"]}, {\"input\": \"1321 1321 774237640\\r\\n\", \"output\": [\"573916469\"]}, {\"input\": \"1205 1205 972407779\\r\\n\", \"output\": [\"970505824\"]}, {\"input\": \"1063 1063 497812546\\r\\n\", \"output\": [\"203394740\"]}, {\"input\": \"1443 1443 784034214\\r\\n\", \"output\": [\"489871338\"]}, {\"input\": \"1099 1099 548018740\\r\\n\", \"output\": [\"530449224\"]}, {\"input\": \"1334 667 998244356\\r\\n\", \"output\": [\"123570327\"]}, {\"input\": \"1621 810 998244355\\r\\n\", \"output\": [\"334476739\"]}, {\"input\": \"1253 626 998244353\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1217 608 998244355\\r\\n\", \"output\": [\"465345479\"]}, {\"input\": \"1966 983 998244357\\r\\n\", \"output\": [\"81898103\"]}, {\"input\": \"1471 735 998244354\\r\\n\", \"output\": [\"399941190\"]}, {\"input\": \"1496 748 998244357\\r\\n\", \"output\": [\"419593982\"]}, {\"input\": \"1307 653 998244355\\r\\n\", \"output\": [\"823060783\"]}, {\"input\": \"1706 853 998244357\\r\\n\", \"output\": [\"627644358\"]}, {\"input\": \"1025 512 998244357\\r\\n\", \"output\": [\"120622427\"]}]"} {"prob_desc_description":"Young Teodor enjoys drawing. His favourite hobby is drawing segments with integer borders inside his huge [1;m] segment. One day Teodor noticed that picture he just drawn has one interesting feature: there doesn't exist an integer point, that belongs each of segments in the picture. Having discovered this fact, Teodor decided to share it with Sasha.Sasha knows that Teodor likes to show off so he never trusts him. Teodor wants to prove that he can be trusted sometimes, so he decided to convince Sasha that there is no such integer point in his picture, which belongs to each segment. However Teodor is lazy person and neither wills to tell Sasha all coordinates of segments' ends nor wills to tell him their amount, so he suggested Sasha to ask him series of questions 'Given the integer point xi, how many segments in Fedya's picture contain that point?', promising to tell correct answers for this questions.Both boys are very busy studying and don't have much time, so they ask you to find out how many questions can Sasha ask Teodor, that having only answers on his questions, Sasha can't be sure that Teodor isn't lying to him. Note that Sasha doesn't know amount of segments in Teodor's picture. Sure, Sasha is smart person and never asks about same point twice.","prob_desc_output_spec":"Single line of output should contain one integer number k \u2013 size of largest set (xi,\u2009cnt(xi)) where all xi are different, 1\u2009\u2264\u2009xi\u2009\u2264\u2009m, and cnt(xi) is amount of segments, containing point with coordinate xi, such that one can't be sure that there doesn't exist point, belonging to all of segments in initial picture, if he knows only this set(and doesn't know n).","lang_cluster":"","src_uid":"ce8350be138ce2061349d7f9224a5aaf","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["data structures","dp","binary search"],"prob_desc_created_at":"1520177700","prob_desc_sample_inputs":"[\"2 4\\n1 2\\n3 4\", \"4 6\\n1 3\\n2 3\\n4 6\\n5 6\"]","prob_desc_notes":"NoteFirst example shows situation where Sasha can never be sure that Teodor isn't lying to him, because even if one knows cnt(xi) for each point in segment [1;4], he can't distinguish this case from situation Teodor has drawn whole [1;4] segment.In second example Sasha can ask about 5 points e.g. 1,\u20092,\u20093,\u20095,\u20096, still not being sure if Teodor haven't lied to him. But once he knows information about all points in [1;6] segment, Sasha can be sure that Teodor haven't lied to him.","exec_outcome":"","difficulty":1900.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"First line of input contains two integer numbers: n and m (1\u2009\u2264\u2009n,\u2009m\u2009\u2264\u2009100\u2009000)\u00a0\u2014 amount of segments of Teodor's picture and maximal coordinate of point that Sasha can ask about. ith of next n lines contains two integer numbers li and ri (1\u2009\u2264\u2009li\u2009\u2264\u2009ri\u2009\u2264\u2009m)\u00a0\u2014 left and right ends of ith segment in the picture. Note that that left and right ends of segment can be the same point. It is guaranteed that there is no integer point, that belongs to all segments.","prob_desc_sample_outputs":"[\"4\", \"5\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2 4\\r\\n1 2\\r\\n3 4\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"4 6\\r\\n1 3\\r\\n2 3\\r\\n4 6\\r\\n5 6\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"70 1495\\r\\n148 339\\r\\n470 596\\r\\n859 1322\\r\\n214 443\\r\\n74 1320\\r\\n995 1246\\r\\n266 1261\\r\\n147 1240\\r\\n690 1439\\r\\n1178 1455\\r\\n789 1478\\r\\n563 1206\\r\\n68 1490\\r\\n339 467\\r\\n1324 1471\\r\\n681 1289\\r\\n346 822\\r\\n72 1080\\r\\n126 1326\\r\\n382 910\\r\\n267 1168\\r\\n101 119\\r\\n382 666\\r\\n79 1176\\r\\n358 1185\\r\\n958 1426\\r\\n590 989\\r\\n80 539\\r\\n273 617\\r\\n1129 1343\\r\\n210 1071\\r\\n144 1484\\r\\n210 609\\r\\n397 1077\\r\\n950 1112\\r\\n523 1343\\r\\n396 888\\r\\n640 1281\\r\\n491 729\\r\\n704 761\\r\\n1208 1276\\r\\n357 1139\\r\\n341 772\\r\\n1111 1453\\r\\n893 1482\\r\\n718 1200\\r\\n67 547\\r\\n302 494\\r\\n98 949\\r\\n17 69\\r\\n353 1146\\r\\n346 534\\r\\n997 132...\", \"output\": [\"1108\"]}, {\"input\": \"85 1596\\r\\n125 264\\r\\n823 1193\\r\\n811 1042\\r\\n278 1556\\r\\n257 1311\\r\\n273 586\\r\\n210 576\\r\\n443 1082\\r\\n16 639\\r\\n460 1206\\r\\n580 1521\\r\\n636 1128\\r\\n729 1299\\r\\n1257 1387\\r\\n428 1577\\r\\n838 979\\r\\n1019 1422\\r\\n342 344\\r\\n1222 1316\\r\\n1045 1352\\r\\n136 463\\r\\n280 1558\\r\\n199 763\\r\\n126 1248\\r\\n281 713\\r\\n803 1476\\r\\n1230 1493\\r\\n190 693\\r\\n1137 1417\\r\\n383 615\\r\\n236 1243\\r\\n271 1500\\r\\n174 488\\r\\n316 1500\\r\\n132 1199\\r\\n298 1251\\r\\n47 336\\r\\n117 1310\\r\\n619 668\\r\\n272 1239\\r\\n11 870\\r\\n501 1535\\r\\n1041 1105\\r\\n906 1119\\r\\n251 525\\r\\n578 1393\\r\\n820 1182\\r\\n854 1141\\r\\n77 610\\r\\n566 1210\\r\\n320 969\\r\\n114 312...\", \"output\": [\"1249\"]}, {\"input\": \"458 1408\\r\\n530 595\\r\\n182 831\\r\\n180 1002\\r\\n874 1012\\r\\n135 990\\r\\n718 879\\r\\n618 778\\r\\n582 891\\r\\n630 825\\r\\n491 1239\\r\\n941 1140\\r\\n659 683\\r\\n109 272\\r\\n144 1228\\r\\n985 1349\\r\\n1012 1273\\r\\n67 1349\\r\\n236 1019\\r\\n827 1066\\r\\n24 1105\\r\\n198 1348\\r\\n227 473\\r\\n697 1337\\r\\n405 952\\r\\n186 902\\r\\n138 555\\r\\n277 1192\\r\\n1126 1229\\r\\n436 684\\r\\n890 946\\r\\n432 913\\r\\n15 1059\\r\\n868 1346\\r\\n525 879\\r\\n59 189\\r\\n367 1400\\r\\n224 1131\\r\\n419 603\\r\\n1130 1265\\r\\n833 1323\\r\\n267 1024\\r\\n846 1085\\r\\n809 1212\\r\\n611 759\\r\\n203 595\\r\\n716 1203\\r\\n196 1228\\r\\n406 1332\\r\\n73 501\\r\\n354 849\\r\\n98 498\\r\\n85 900\\r\\n403 916\\r\\n2...\", \"output\": [\"1051\"]}, {\"input\": \"43 1319\\r\\n750 1030\\r\\n857 946\\r\\n941 1203\\r\\n407 1034\\r\\n947 1290\\r\\n546 585\\r\\n630 1201\\r\\n72 342\\r\\n693 1315\\r\\n34 719\\r\\n176 1097\\r\\n36 931\\r\\n198 973\\r\\n5 1025\\r\\n892 1054\\r\\n461 1287\\r\\n195 1273\\r\\n832 1039\\r\\n308 955\\r\\n642 866\\r\\n770 838\\r\\n440 777\\r\\n289 948\\r\\n98 814\\r\\n458 768\\r\\n82 265\\r\\n300 596\\r\\n182 706\\r\\n368 1225\\r\\n237 626\\r\\n36 348\\r\\n100 222\\r\\n46 937\\r\\n364 396\\r\\n288 668\\r\\n1158 1243\\r\\n31 1108\\r\\n570 1000\\r\\n435 619\\r\\n339 1007\\r\\n132 734\\r\\n281 441\\r\\n636 1319\\r\\n\", \"output\": [\"1082\"]}, {\"input\": \"31 1600\\r\\n643 1483\\r\\n8 475\\r\\n15 472\\r\\n49 81\\r\\n300 1485\\r\\n627 682\\r\\n44 443\\r\\n1191 1541\\r\\n478 732\\r\\n1112 1202\\r\\n741 1341\\r\\n475 1187\\r\\n1218 1463\\r\\n523 1513\\r\\n355 477\\r\\n1259 1559\\r\\n384 928\\r\\n487 766\\r\\n227 1224\\r\\n1102 1268\\r\\n833 1240\\r\\n872 1342\\r\\n666 1075\\r\\n734 874\\r\\n32 880\\r\\n1411 1536\\r\\n520 778\\r\\n179 1003\\r\\n51 313\\r\\n1148 1288\\r\\n1467 1509\\r\\n\", \"output\": [\"1181\"]}, {\"input\": \"246 1909\\r\\n1155 1906\\r\\n27 1495\\r\\n81 1780\\r\\n101 1799\\r\\n1102 1601\\r\\n247 1036\\r\\n65 1175\\r\\n197 1672\\r\\n286 1632\\r\\n548 1899\\r\\n125 1384\\r\\n666 1798\\r\\n1638 1831\\r\\n659 1548\\r\\n71 141\\r\\n623 701\\r\\n375 1252\\r\\n1321 1786\\r\\n993 1574\\r\\n677 911\\r\\n469 1030\\r\\n351 1256\\r\\n18 1550\\r\\n252 1088\\r\\n709 1427\\r\\n965 1309\\r\\n845 850\\r\\n1259 1292\\r\\n669 1664\\r\\n1017 1690\\r\\n1022 1527\\r\\n282 454\\r\\n1272 1831\\r\\n598 1394\\r\\n1394 1631\\r\\n583 1165\\r\\n1447 1565\\r\\n855 1441\\r\\n1415 1551\\r\\n860 1046\\r\\n737 1081\\r\\n1064 1123\\r\\n775 816\\r\\n915 1287\\r\\n1350 1790\\r\\n272 330\\r\\n52 758\\r\\n975 1730\\r\\n1441 1590\\r\\n1185 1426\\r\\n...\", \"output\": [\"1412\"]}, {\"input\": \"376 1479\\r\\n1008 1198\\r\\n916 1363\\r\\n56 164\\r\\n526 1196\\r\\n467 1199\\r\\n143 822\\r\\n115 1143\\r\\n70 921\\r\\n668 1332\\r\\n1261 1377\\r\\n547 660\\r\\n368 1009\\r\\n799 865\\r\\n646 1001\\r\\n1111 1449\\r\\n323 517\\r\\n1314 1454\\r\\n973 1449\\r\\n227 1131\\r\\n1187 1391\\r\\n319 944\\r\\n421 1435\\r\\n1211 1284\\r\\n341 708\\r\\n1074 1387\\r\\n1109 1187\\r\\n266 668\\r\\n148 1423\\r\\n418 1416\\r\\n685 946\\r\\n104 1268\\r\\n865 1296\\r\\n385 994\\r\\n1128 1400\\r\\n133 1016\\r\\n548 992\\r\\n154 843\\r\\n216 316\\r\\n497 1101\\r\\n103 606\\r\\n820 1030\\r\\n172 770\\r\\n212 351\\r\\n285 1225\\r\\n1228 1284\\r\\n1171 1427\\r\\n251 1272\\r\\n424 564\\r\\n699 1068\\r\\n548 741\\r\\n616 798\\r\\n10...\", \"output\": [\"1159\"]}, {\"input\": \"38 1109\\r\\n61 332\\r\\n429 756\\r\\n260 272\\r\\n57 991\\r\\n420 985\\r\\n143 219\\r\\n399 925\\r\\n486 1079\\r\\n69 881\\r\\n75 447\\r\\n678 774\\r\\n973 1016\\r\\n983 1059\\r\\n518 1049\\r\\n393 853\\r\\n375 1101\\r\\n475 946\\r\\n300 427\\r\\n294 715\\r\\n504 798\\r\\n211 1066\\r\\n730 815\\r\\n114 515\\r\\n589 1001\\r\\n464 1014\\r\\n451 757\\r\\n370 1017\\r\\n225 619\\r\\n452 988\\r\\n611 955\\r\\n349 1029\\r\\n73 165\\r\\n759 951\\r\\n574 803\\r\\n253 1045\\r\\n545 565\\r\\n603 773\\r\\n226 453\\r\\n\", \"output\": [\"996\"]}, {\"input\": \"199 1078\\r\\n78 174\\r\\n98 428\\r\\n34 127\\r\\n114 767\\r\\n309 593\\r\\n402 794\\r\\n626 857\\r\\n227 810\\r\\n26 456\\r\\n338 353\\r\\n706 1040\\r\\n134 347\\r\\n169 605\\r\\n736 776\\r\\n49 714\\r\\n437 535\\r\\n468 973\\r\\n138 951\\r\\n260 705\\r\\n457 1043\\r\\n368 1015\\r\\n63 405\\r\\n67 723\\r\\n265 470\\r\\n46 953\\r\\n456 941\\r\\n49 380\\r\\n918 1034\\r\\n96 958\\r\\n559 915\\r\\n334 1024\\r\\n178 789\\r\\n200 1025\\r\\n283 926\\r\\n137 837\\r\\n28 824\\r\\n753 987\\r\\n105 248\\r\\n56 880\\r\\n462 758\\r\\n509 1032\\r\\n4 873\\r\\n104 110\\r\\n84 385\\r\\n242 260\\r\\n538 689\\r\\n242 318\\r\\n240 401\\r\\n406 438\\r\\n629 1068\\r\\n170 1048\\r\\n312 768\\r\\n432 525\\r\\n302 600\\r\\n317 361\\r\\n769 958\\r\\n456...\", \"output\": [\"903\"]}, {\"input\": \"222 1469\\r\\n59 98\\r\\n310 1337\\r\\n71 958\\r\\n184 662\\r\\n818 1304\\r\\n1118 1306\\r\\n337 743\\r\\n428 1015\\r\\n1179 1259\\r\\n56 605\\r\\n223 1003\\r\\n134 767\\r\\n1173 1215\\r\\n467 659\\r\\n170 214\\r\\n514 736\\r\\n443 1048\\r\\n361 1243\\r\\n70 808\\r\\n212 387\\r\\n69 872\\r\\n1000 1204\\r\\n630 726\\r\\n1011 1293\\r\\n843 1106\\r\\n253 1084\\r\\n101 999\\r\\n429 998\\r\\n464 1118\\r\\n517 1196\\r\\n986 1058\\r\\n536 1045\\r\\n671 1049\\r\\n633 1000\\r\\n307 998\\r\\n571 610\\r\\n547 1038\\r\\n979 1135\\r\\n508 1432\\r\\n33 274\\r\\n403 1053\\r\\n1167 1361\\r\\n453 1172\\r\\n131 678\\r\\n366 1271\\r\\n366 1023\\r\\n54 343\\r\\n604 1013\\r\\n382 805\\r\\n744 848\\r\\n953 1082\\r\\n492 920\\r\\n890 12...\", \"output\": [\"1202\"]}, {\"input\": \"3665 47536\\r\\n29107 29576\\r\\n5669 21584\\r\\n588 28996\\r\\n8681 28973\\r\\n3052 40821\\r\\n23760 42122\\r\\n11972 35644\\r\\n18419 29768\\r\\n17490 22057\\r\\n34072 35088\\r\\n25800 38221\\r\\n10359 18371\\r\\n11606 23348\\r\\n6336 12337\\r\\n6468 44124\\r\\n22085 25312\\r\\n28336 32658\\r\\n24047 35510\\r\\n11709 33575\\r\\n27181 35984\\r\\n19832 24987\\r\\n5999 41385\\r\\n7066 22633\\r\\n5583 25044\\r\\n10325 40347\\r\\n49 35579\\r\\n22204 41523\\r\\n15757 19103\\r\\n41583 45307\\r\\n5762 47471\\r\\n15277 23228\\r\\n6810 35085\\r\\n28474 30491\\r\\n10811 25376\\r\\n13704 36285\\r\\n1963 30108\\r\\n20351 26419\\r\\n20408 41907\\r\\n28446 37908\\r\\n265 2082...\", \"output\": [\"35778\"]}, {\"input\": \"1499 45851\\r\\n10181 21404\\r\\n1966 7385\\r\\n19615 28911\\r\\n11553 43310\\r\\n12326 36312\\r\\n22271 31416\\r\\n4833 9767\\r\\n7985 27367\\r\\n464 20180\\r\\n18411 25016\\r\\n1334 20248\\r\\n9942 13129\\r\\n14063 23736\\r\\n1189 6219\\r\\n35143 39805\\r\\n4584 33201\\r\\n5153 34260\\r\\n10265 27394\\r\\n6413 44069\\r\\n20573 23355\\r\\n16462 22025\\r\\n22037 42475\\r\\n30388 37994\\r\\n736 35432\\r\\n19522 29316\\r\\n18487 28222\\r\\n6662 33023\\r\\n24214 40678\\r\\n5630 33991\\r\\n27695 35149\\r\\n6209 24457\\r\\n26647 34001\\r\\n15481 39910\\r\\n22245 29105\\r\\n21835 27115\\r\\n30341 45253\\r\\n36615 42341\\r\\n5670 22393\\r\\n5738 36571\\r\\n12737 19092\\r\\n...\", \"output\": [\"35846\"]}, {\"input\": \"2258 19241\\r\\n4359 17588\\r\\n2093 4590\\r\\n6074 12281\\r\\n3923 14014\\r\\n6944 9336\\r\\n10465 15161\\r\\n2134 11530\\r\\n9775 10665\\r\\n3396 13176\\r\\n8279 12652\\r\\n10572 16513\\r\\n5587 11258\\r\\n11496 18524\\r\\n4254 12592\\r\\n607 9497\\r\\n6978 13316\\r\\n6504 6585\\r\\n643 11185\\r\\n4394 9337\\r\\n7264 9620\\r\\n5468 13435\\r\\n12216 18261\\r\\n4055 14381\\r\\n4967 11426\\r\\n1838 10900\\r\\n7910 17191\\r\\n2572 3402\\r\\n2275 11822\\r\\n2878 16684\\r\\n5202 15567\\r\\n6776 14652\\r\\n9178 11824\\r\\n3310 11876\\r\\n1771 9994\\r\\n2226 14389\\r\\n3848 18669\\r\\n2533 9122\\r\\n7040 15865\\r\\n4887 14401\\r\\n12340 18617\\r\\n3793 18998\\r\\n7485 11035\\r\\n8...\", \"output\": [\"14826\"]}, {\"input\": \"3337 45896\\r\\n192 3432\\r\\n22664 28148\\r\\n12757 33609\\r\\n18666 31615\\r\\n24499 35758\\r\\n14904 15580\\r\\n8087 33344\\r\\n7709 11509\\r\\n40433 44158\\r\\n3240 37286\\r\\n9600 41506\\r\\n33038 34132\\r\\n15939 26379\\r\\n13291 22343\\r\\n7856 38730\\r\\n10104 19193\\r\\n30755 36531\\r\\n21039 35683\\r\\n25770 31728\\r\\n15936 28625\\r\\n8855 15613\\r\\n37215 40978\\r\\n19371 29832\\r\\n19980 36385\\r\\n24175 38960\\r\\n15417 38256\\r\\n30149 35338\\r\\n13510 40857\\r\\n10884 23967\\r\\n20398 34214\\r\\n10376 12024\\r\\n1137 13736\\r\\n10061 24003\\r\\n8781 40862\\r\\n40523 43550\\r\\n1409 13019\\r\\n19866 40704\\r\\n12963 17262\\r\\n2140 3071\\r\\n2835 4...\", \"output\": [\"34393\"]}, {\"input\": \"3333 49268\\r\\n26757 32783\\r\\n1709 49045\\r\\n33010 44913\\r\\n36698 47691\\r\\n11312 32974\\r\\n6901 33873\\r\\n7932 39905\\r\\n14474 31209\\r\\n14198 34040\\r\\n765 40652\\r\\n16447 23024\\r\\n12550 39264\\r\\n5648 45690\\r\\n17538 45078\\r\\n21819 22602\\r\\n19346 47164\\r\\n16948 34247\\r\\n880 1006\\r\\n1899 5997\\r\\n18765 31006\\r\\n11671 47755\\r\\n1079 48978\\r\\n11623 35845\\r\\n3842 20079\\r\\n24980 47772\\r\\n15945 26345\\r\\n22478 31704\\r\\n1770 25425\\r\\n27614 40478\\r\\n17875 40583\\r\\n7618 18900\\r\\n7273 27958\\r\\n31515 48209\\r\\n5584 42062\\r\\n34147 41502\\r\\n67 49127\\r\\n4911 45520\\r\\n14658 42783\\r\\n40840 48802\\r\\n22782 45645\\r\\n...\", \"output\": [\"37104\"]}, {\"input\": \"1761 36010\\r\\n28478 31193\\r\\n2530 7425\\r\\n12650 18703\\r\\n9236 14644\\r\\n10740 33418\\r\\n24381 29269\\r\\n23646 27946\\r\\n13450 28743\\r\\n16446 23470\\r\\n27272 35366\\r\\n21622 31287\\r\\n20994 30543\\r\\n2316 21172\\r\\n5061 8700\\r\\n312 2985\\r\\n6540 9393\\r\\n4046 18568\\r\\n18890 26811\\r\\n937 34306\\r\\n1665 24627\\r\\n664 19865\\r\\n16895 27159\\r\\n27361 27560\\r\\n26014 30714\\r\\n5647 28092\\r\\n7156 26264\\r\\n31302 31727\\r\\n14088 27624\\r\\n13841 33864\\r\\n9342 27828\\r\\n13305 31183\\r\\n12720 20665\\r\\n12039 16207\\r\\n2626 23659\\r\\n4055 21474\\r\\n7849 17176\\r\\n25730 35672\\r\\n26631 30685\\r\\n13049 20263\\r\\n32498 35498\\r\\n13...\", \"output\": [\"27748\"]}, {\"input\": \"3062 35932\\r\\n385 16746\\r\\n4927 34748\\r\\n6848 20735\\r\\n15837 17051\\r\\n1436 16701\\r\\n5212 28534\\r\\n12160 34793\\r\\n33136 33176\\r\\n1984 32010\\r\\n3481 33738\\r\\n17834 18491\\r\\n18153 25467\\r\\n13778 19432\\r\\n5418 31891\\r\\n16135 30379\\r\\n4222 12814\\r\\n10311 30958\\r\\n13431 25946\\r\\n9361 19316\\r\\n4643 11797\\r\\n27420 31459\\r\\n14870 24631\\r\\n16307 23383\\r\\n1362 22027\\r\\n1887 5615\\r\\n2129 5439\\r\\n7345 17601\\r\\n17731 29883\\r\\n1746 22065\\r\\n9204 33118\\r\\n12725 24961\\r\\n18299 29552\\r\\n4740 24224\\r\\n9141 32835\\r\\n9758 11607\\r\\n1473 6852\\r\\n16982 32227\\r\\n16734 30576\\r\\n17897 26896\\r\\n27433 34674\\r\\n2768...\", \"output\": [\"27194\"]}, {\"input\": \"3271 41871\\r\\n5402 38721\\r\\n2695 6849\\r\\n7380 22612\\r\\n7772 34282\\r\\n27408 39485\\r\\n1864 32125\\r\\n1132 19947\\r\\n20238 23584\\r\\n6305 35812\\r\\n8093 21048\\r\\n19794 36050\\r\\n6 17072\\r\\n2545 18055\\r\\n10978 29927\\r\\n16460 40836\\r\\n23922 37856\\r\\n9725 18603\\r\\n14231 32675\\r\\n616 31713\\r\\n9740 32661\\r\\n22261 38444\\r\\n11503 29921\\r\\n17632 39882\\r\\n26526 30579\\r\\n4568 23459\\r\\n2235 27170\\r\\n4254 33342\\r\\n5587 6003\\r\\n3048 32478\\r\\n31149 31222\\r\\n10106 10513\\r\\n20188 20665\\r\\n7492 18485\\r\\n861 8629\\r\\n32745 38070\\r\\n10893 14811\\r\\n9799 19478\\r\\n33144 33704\\r\\n12861 21997\\r\\n7023 21439\\r\\n32433 373...\", \"output\": [\"31014\"]}, {\"input\": \"2253 13790\\r\\n4137 4887\\r\\n11861 12084\\r\\n4999 9382\\r\\n4640 12935\\r\\n1024 4456\\r\\n3845 7372\\r\\n4243 7942\\r\\n445 1777\\r\\n2997 4670\\r\\n7543 12734\\r\\n9040 13354\\r\\n1988 11290\\r\\n6831 13131\\r\\n1973 6348\\r\\n2251 4236\\r\\n3952 11610\\r\\n2394 4403\\r\\n7896 9690\\r\\n9391 13110\\r\\n4253 6997\\r\\n7556 9037\\r\\n2327 11540\\r\\n1033 12157\\r\\n5964 11380\\r\\n5384 12915\\r\\n10086 12109\\r\\n2765 13198\\r\\n6585 11832\\r\\n2858 10329\\r\\n7932 13739\\r\\n5071 6049\\r\\n5993 7297\\r\\n2126 5238\\r\\n1444 9773\\r\\n4574 10406\\r\\n8955 11075\\r\\n2875 10912\\r\\n8343 11901\\r\\n1212 9834\\r\\n3939 10833\\r\\n7732 8463\\r\\n1650 11529\\r\\n1467 13645\\r\\n4...\", \"output\": [\"10475\"]}, {\"input\": \"4211 49769\\r\\n37864 40008\\r\\n18673 34312\\r\\n14576 38933\\r\\n29321 39751\\r\\n29302 39586\\r\\n19615 39878\\r\\n29784 43056\\r\\n21432 27318\\r\\n10852 41059\\r\\n2979 27063\\r\\n19814 38625\\r\\n8043 38433\\r\\n33841 41207\\r\\n10218 38755\\r\\n42082 49745\\r\\n6250 11678\\r\\n7544 12643\\r\\n16471 31695\\r\\n28415 32994\\r\\n883 8043\\r\\n33245 46403\\r\\n9174 29504\\r\\n26582 48166\\r\\n2546 13867\\r\\n7271 35607\\r\\n8814 26515\\r\\n23991 44396\\r\\n11184 14948\\r\\n32166 49281\\r\\n17503 38458\\r\\n21626 22645\\r\\n35623 48142\\r\\n4574 40304\\r\\n5897 12782\\r\\n29481 38908\\r\\n12967 38298\\r\\n8395 14014\\r\\n3587 15947\\r\\n4556 21579\\r\\n12602 23...\", \"output\": [\"36561\"]}, {\"input\": \"91503 95156\\r\\n34333 89352\\r\\n488 44104\\r\\n2371 67097\\r\\n7028 7779\\r\\n22486 47671\\r\\n60877 81552\\r\\n38103 88842\\r\\n33002 39466\\r\\n33202 90944\\r\\n14413 91554\\r\\n33173 66651\\r\\n25683 81313\\r\\n73431 95020\\r\\n23303 94858\\r\\n20738 53404\\r\\n33391 93725\\r\\n30763 30861\\r\\n45631 93425\\r\\n26998 55668\\r\\n69731 93932\\r\\n54914 59586\\r\\n16681 39239\\r\\n32447 61420\\r\\n52879 70548\\r\\n2662 28344\\r\\n60982 64050\\r\\n20945 66221\\r\\n42052 43668\\r\\n3820 26758\\r\\n12685 41675\\r\\n36092 67557\\r\\n76742 86973\\r\\n23959 37772\\r\\n15584 62433\\r\\n57728 78157\\r\\n37269 69495\\r\\n29807 86461\\r\\n42315 71480\\r\\n16571 51327...\", \"output\": [\"73149\"]}, {\"input\": \"54866 91453\\r\\n14931 34343\\r\\n50995 87828\\r\\n47478 67758\\r\\n27714 56742\\r\\n80637 81447\\r\\n11233 62356\\r\\n14696 46203\\r\\n14117 27042\\r\\n8753 84450\\r\\n14901 39901\\r\\n16149 62555\\r\\n32482 78085\\r\\n14922 35193\\r\\n20838 77887\\r\\n20454 60487\\r\\n32817 74027\\r\\n12121 43712\\r\\n9223 57931\\r\\n21673 77894\\r\\n45372 90556\\r\\n63252 87654\\r\\n44165 81020\\r\\n34994 82045\\r\\n46964 59875\\r\\n22476 68723\\r\\n48748 69112\\r\\n24046 49749\\r\\n1967 34279\\r\\n3269 62669\\r\\n70912 79014\\r\\n20599 48355\\r\\n5275 28293\\r\\n62831 70257\\r\\n12546 21286\\r\\n24377 58658\\r\\n32252 69168\\r\\n40893 41631\\r\\n26365 27909\\r\\n17275 398...\", \"output\": [\"68968\"]}, {\"input\": \"100000 100000\\r\\n13036 23902\\r\\n9482 71466\\r\\n78471 98728\\r\\n2470 22915\\r\\n5999 53211\\r\\n3996 25994\\r\\n11349 30511\\r\\n17277 56448\\r\\n18316 78308\\r\\n38636 42069\\r\\n26256 63127\\r\\n57249 63985\\r\\n58305 64366\\r\\n17839 28518\\r\\n18980 95945\\r\\n6076 36316\\r\\n69530 96509\\r\\n6039 6940\\r\\n41847 56048\\r\\n41054 82118\\r\\n49670 95896\\r\\n45891 74636\\r\\n75413 90736\\r\\n27251 87730\\r\\n66202 68344\\r\\n51666 71879\\r\\n8985 42722\\r\\n43845 49000\\r\\n4961 44614\\r\\n64751 97655\\r\\n79361 80091\\r\\n12747 20934\\r\\n9188 74058\\r\\n8454 93662\\r\\n79516 91323\\r\\n33567 42656\\r\\n44392 58833\\r\\n86157 93051\\r\\n10398 79297\\r\\n...\", \"output\": [\"77461\"]}, {\"input\": \"2082 31492\\r\\n8124 21423\\r\\n8573 25478\\r\\n9682 22408\\r\\n19967 23818\\r\\n4330 8983\\r\\n14435 20568\\r\\n12603 20160\\r\\n23017 23436\\r\\n25845 28196\\r\\n11447 24484\\r\\n13249 17370\\r\\n407 21337\\r\\n15516 22770\\r\\n8322 28421\\r\\n10718 12194\\r\\n21061 25102\\r\\n2847 2914\\r\\n12083 14456\\r\\n1471 29335\\r\\n13981 14283\\r\\n3275 6566\\r\\n5744 8447\\r\\n5298 6662\\r\\n5046 6306\\r\\n8666 13765\\r\\n2492 27103\\r\\n12201 30518\\r\\n262 13450\\r\\n7296 21010\\r\\n11508 21863\\r\\n8203 10303\\r\\n17460 18065\\r\\n5484 6387\\r\\n9096 9587\\r\\n9854 31179\\r\\n734 31453\\r\\n2980 16136\\r\\n2199 5769\\r\\n2837 21325\\r\\n8645 30363\\r\\n733 17991\\r\\n12228...\", \"output\": [\"23604\"]}, {\"input\": \"1738 29888\\r\\n2359 27953\\r\\n12852 25588\\r\\n11661 23733\\r\\n6189 28878\\r\\n3853 21060\\r\\n1727 8350\\r\\n10666 28184\\r\\n2869 24410\\r\\n3403 7008\\r\\n8918 19364\\r\\n23969 26407\\r\\n6402 17261\\r\\n4453 19675\\r\\n1868 12637\\r\\n2851 7037\\r\\n10560 11464\\r\\n10668 26481\\r\\n7137 13748\\r\\n19326 20693\\r\\n2999 29067\\r\\n2999 4369\\r\\n21788 22476\\r\\n11377 18554\\r\\n15000 29487\\r\\n5676 21218\\r\\n11990 12533\\r\\n3265 20463\\r\\n755 1999\\r\\n6389 17731\\r\\n133 6626\\r\\n3686 25034\\r\\n4818 16395\\r\\n13787 21429\\r\\n9767 18883\\r\\n12217 26490\\r\\n29312 29568\\r\\n13135 23311\\r\\n10241 12280\\r\\n14284 24438\\r\\n6141 29210\\r\\n3075 17837...\", \"output\": [\"23733\"]}, {\"input\": \"2045 38392\\r\\n8287 38249\\r\\n21446 23477\\r\\n1314 5016\\r\\n25610 30776\\r\\n20118 37629\\r\\n10437 10955\\r\\n1638 19760\\r\\n15959 35278\\r\\n16758 25625\\r\\n20840 30695\\r\\n9962 35406\\r\\n20321 34024\\r\\n22449 23405\\r\\n929 6733\\r\\n8715 30432\\r\\n11953 18615\\r\\n14374 19140\\r\\n7239 26933\\r\\n6321 12216\\r\\n25896 34276\\r\\n2555 32740\\r\\n3689 20060\\r\\n9511 24059\\r\\n441 24086\\r\\n9032 12870\\r\\n3305 6161\\r\\n8488 8772\\r\\n2423 26413\\r\\n22130 32246\\r\\n7477 22055\\r\\n5868 33185\\r\\n869 13726\\r\\n32241 36470\\r\\n30767 36457\\r\\n9054 13204\\r\\n12754 21303\\r\\n16806 32368\\r\\n20883 36258\\r\\n2993 6857\\r\\n13489 28019\\r\\n29912 31...\", \"output\": [\"28328\"]}, {\"input\": \"3327 18192\\r\\n1900 16595\\r\\n1320 9601\\r\\n7867 10945\\r\\n4907 9091\\r\\n2644 16872\\r\\n6868 9861\\r\\n7289 11430\\r\\n88 12757\\r\\n4251 17343\\r\\n285 7511\\r\\n750 7377\\r\\n3233 13314\\r\\n1430 14285\\r\\n656 9475\\r\\n7812 10481\\r\\n4344 10466\\r\\n15040 17774\\r\\n651 15175\\r\\n7961 11620\\r\\n5021 8240\\r\\n4980 7045\\r\\n8826 9374\\r\\n12049 17487\\r\\n3011 11380\\r\\n13834 15153\\r\\n4238 4436\\r\\n11388 14845\\r\\n4536 5943\\r\\n8444 8692\\r\\n9554 16806\\r\\n3720 9800\\r\\n10880 16801\\r\\n1218 15695\\r\\n8172 14761\\r\\n13619 14941\\r\\n15418 16669\\r\\n1587 7124\\r\\n6115 6432\\r\\n14180 14192\\r\\n1336 2067\\r\\n97 2798\\r\\n4545 12874\\r\\n1110 16399\\r\\n...\", \"output\": [\"13907\"]}, {\"input\": \"4084 21389\\r\\n8585 11875\\r\\n1783 20895\\r\\n5390 8596\\r\\n5035 16072\\r\\n2165 18145\\r\\n13255 17908\\r\\n7011 8601\\r\\n2412 11288\\r\\n13232 17068\\r\\n8013 16679\\r\\n2120 3820\\r\\n7792 14949\\r\\n12560 18353\\r\\n869 5049\\r\\n2911 11872\\r\\n19102 20787\\r\\n4910 14319\\r\\n10507 20349\\r\\n8404 13203\\r\\n6811 8463\\r\\n1893 13311\\r\\n12313 18857\\r\\n4946 17046\\r\\n7698 19111\\r\\n3801 4874\\r\\n3284 11162\\r\\n10754 17880\\r\\n9741 17124\\r\\n542 4896\\r\\n6380 15782\\r\\n4138 11206\\r\\n10237 11401\\r\\n4190 19921\\r\\n5497 7976\\r\\n12667 20397\\r\\n8209 10358\\r\\n14455 15268\\r\\n11982 19240\\r\\n1121 3321\\r\\n8603 13703\\r\\n1453 13565\\r\\n771 164...\", \"output\": [\"15979\"]}, {\"input\": \"2344 41826\\r\\n8815 37791\\r\\n700 29553\\r\\n12107 16515\\r\\n13735 34424\\r\\n28205 29893\\r\\n8259 12603\\r\\n27039 39817\\r\\n20715 39767\\r\\n17573 40401\\r\\n19058 26363\\r\\n12502 22923\\r\\n7624 28093\\r\\n1346 16780\\r\\n26062 36158\\r\\n11466 30357\\r\\n24588 34403\\r\\n19932 41018\\r\\n12445 22897\\r\\n17692 38150\\r\\n21617 28390\\r\\n13220 34682\\r\\n38139 41179\\r\\n9348 14763\\r\\n28448 36941\\r\\n4290 20132\\r\\n31322 36353\\r\\n783 36963\\r\\n15237 20693\\r\\n28188 30547\\r\\n3951 21828\\r\\n8693 39637\\r\\n23676 25996\\r\\n1341 28759\\r\\n23145 40930\\r\\n23149 31796\\r\\n30177 40462\\r\\n13497 40115\\r\\n15136 30811\\r\\n9172 28103\\r\\n4405 4...\", \"output\": [\"31604\"]}, {\"input\": \"1160 33800\\r\\n6967 29159\\r\\n8264 33328\\r\\n14519 24396\\r\\n17142 24660\\r\\n3103 24533\\r\\n14087 32381\\r\\n15177 20428\\r\\n10048 13774\\r\\n11852 20526\\r\\n20280 27940\\r\\n5553 26729\\r\\n18916 19856\\r\\n23813 27548\\r\\n20264 30035\\r\\n3840 25773\\r\\n24161 25055\\r\\n6774 15565\\r\\n1861 5135\\r\\n5154 20486\\r\\n12754 24103\\r\\n26723 31238\\r\\n7013 12547\\r\\n2191 28702\\r\\n10485 21301\\r\\n17036 17442\\r\\n12446 20723\\r\\n3480 24717\\r\\n15715 19931\\r\\n6699 8890\\r\\n2468 25239\\r\\n19032 20444\\r\\n10594 26949\\r\\n1711 26015\\r\\n19152 32694\\r\\n1156 4070\\r\\n19084 19434\\r\\n14489 16371\\r\\n10013 19078\\r\\n5823 6020\\r\\n1249 12749\\r\\n...\", \"output\": [\"25564\"]}, {\"input\": \"3729 30209\\r\\n10200 21741\\r\\n16819 29074\\r\\n9458 11821\\r\\n28109 29423\\r\\n14288 28011\\r\\n22033 27532\\r\\n2324 9014\\r\\n15533 22927\\r\\n1186 17429\\r\\n11515 26232\\r\\n9524 28586\\r\\n5729 25381\\r\\n586 1357\\r\\n11366 15423\\r\\n5948 26418\\r\\n19296 22354\\r\\n17112 23126\\r\\n4176 8418\\r\\n12507 19409\\r\\n7994 10873\\r\\n1988 21059\\r\\n257 18633\\r\\n13919 27249\\r\\n3606 20272\\r\\n21265 23180\\r\\n18528 29413\\r\\n1627 14239\\r\\n24506 26072\\r\\n4916 30108\\r\\n11934 13605\\r\\n5028 21469\\r\\n6609 14871\\r\\n823 2474\\r\\n9189 21012\\r\\n22460 26662\\r\\n6978 15846\\r\\n15689 22265\\r\\n3282 19431\\r\\n5273 27407\\r\\n4606 5737\\r\\n1090 4603...\", \"output\": [\"23263\"]}, {\"input\": \"4439 24373\\r\\n15436 19385\\r\\n3974 17179\\r\\n1211 16522\\r\\n1754 14472\\r\\n11213 16104\\r\\n3285 22382\\r\\n9705 16144\\r\\n10048 14000\\r\\n724 1155\\r\\n10759 19834\\r\\n3092 22446\\r\\n9593 15960\\r\\n5534 13015\\r\\n19768 22870\\r\\n4110 17313\\r\\n3475 17599\\r\\n13473 22712\\r\\n5681 15561\\r\\n2726 23925\\r\\n12308 14407\\r\\n6631 6844\\r\\n3057 4974\\r\\n7137 15329\\r\\n17908 18111\\r\\n11776 21483\\r\\n185 22676\\r\\n12895 22820\\r\\n17308 18038\\r\\n8185 9661\\r\\n14404 18091\\r\\n6419 21977\\r\\n11256 23113\\r\\n4261 15134\\r\\n13707 23057\\r\\n8022 11705\\r\\n18343 19579\\r\\n2527 10489\\r\\n15704 18684\\r\\n16685 23613\\r\\n6745 13820\\r\\n3449 811...\", \"output\": [\"18603\"]}, {\"input\": \"2755 28236\\r\\n417 11040\\r\\n21622 25993\\r\\n5547 11001\\r\\n6143 27149\\r\\n9376 19956\\r\\n8309 16342\\r\\n4805 5350\\r\\n181 2446\\r\\n5443 17667\\r\\n2594 26264\\r\\n15793 19032\\r\\n10639 15438\\r\\n6639 25269\\r\\n8489 27558\\r\\n14712 27133\\r\\n11277 13973\\r\\n18079 23475\\r\\n21941 23237\\r\\n3929 26490\\r\\n10164 12319\\r\\n18746 24233\\r\\n5996 10022\\r\\n2907 22418\\r\\n1012 1397\\r\\n4892 27261\\r\\n2061 5605\\r\\n21828 24261\\r\\n15927 16890\\r\\n16002 21439\\r\\n7980 15455\\r\\n193 27175\\r\\n13947 26407\\r\\n4597 19017\\r\\n6807 13492\\r\\n2251 20998\\r\\n21152 27899\\r\\n11198 15271\\r\\n14955 16574\\r\\n8102 18644\\r\\n21601 27074\\r\\n13603 201...\", \"output\": [\"21486\"]}, {\"input\": \"57085 95915\\r\\n16138 31980\\r\\n2959 69176\\r\\n484 53844\\r\\n49465 75425\\r\\n19660 21700\\r\\n8220 84606\\r\\n25871 55685\\r\\n35357 71747\\r\\n37049 41397\\r\\n34057 89401\\r\\n70124 81855\\r\\n4544 80433\\r\\n41688 56108\\r\\n46883 48121\\r\\n20406 47993\\r\\n47726 77541\\r\\n53345 87508\\r\\n27741 41991\\r\\n49216 76231\\r\\n32290 53539\\r\\n8544 72285\\r\\n47722 55847\\r\\n3876 32309\\r\\n786 49509\\r\\n31272 76010\\r\\n5919 9798\\r\\n63907 66594\\r\\n61110 65271\\r\\n23482 68173\\r\\n91047 91970\\r\\n443 13852\\r\\n42426 68410\\r\\n41235 66075\\r\\n37437 64985\\r\\n60009 64507\\r\\n2244 64111\\r\\n15723 42433\\r\\n64713 70462\\r\\n22559 62818\\r\\n24177...\", \"output\": [\"72843\"]}, {\"input\": \"77241 82069\\r\\n39127 47748\\r\\n11494 25676\\r\\n72547 73052\\r\\n12725 81069\\r\\n17874 50659\\r\\n5932 13583\\r\\n55455 72964\\r\\n15929 42693\\r\\n12071 16216\\r\\n20328 32804\\r\\n28482 54430\\r\\n35090 41583\\r\\n19427 33973\\r\\n21816 68205\\r\\n53588 60141\\r\\n12787 32100\\r\\n60785 72622\\r\\n12811 44375\\r\\n24243 34543\\r\\n16833 79773\\r\\n30527 68457\\r\\n59733 65239\\r\\n2563 21904\\r\\n19582 70853\\r\\n17873 21137\\r\\n12586 77463\\r\\n22387 25493\\r\\n5967 39319\\r\\n11516 66208\\r\\n41135 79004\\r\\n8500 37166\\r\\n17364 56912\\r\\n20576 33913\\r\\n57487 68289\\r\\n11575 12257\\r\\n52983 75286\\r\\n22997 45977\\r\\n36370 80574\\r\\n28709 77...\", \"output\": [\"62734\"]}, {\"input\": \"77248 97173\\r\\n65919 80791\\r\\n35313 45326\\r\\n3798 34873\\r\\n8247 53450\\r\\n24184 96979\\r\\n15002 64861\\r\\n38526 54189\\r\\n32535 81860\\r\\n14354 59810\\r\\n35859 70570\\r\\n82861 96759\\r\\n81740 96529\\r\\n48081 62558\\r\\n80309 83059\\r\\n10366 85699\\r\\n19 28946\\r\\n20037 48147\\r\\n89322 89996\\r\\n35400 62267\\r\\n17080 52747\\r\\n40159 57279\\r\\n29806 49861\\r\\n13374 89033\\r\\n37341 63678\\r\\n13005 42410\\r\\n28490 47846\\r\\n54139 79434\\r\\n32972 56207\\r\\n30467 85675\\r\\n6726 14401\\r\\n59447 62192\\r\\n24673 77467\\r\\n59046 79109\\r\\n9785 45912\\r\\n9130 74009\\r\\n58237 78606\\r\\n11574 44793\\r\\n14012 84229\\r\\n46621 50786\\r...\", \"output\": [\"74212\"]}, {\"input\": \"66853 82485\\r\\n17690 48410\\r\\n3919 36713\\r\\n21385 60159\\r\\n39024 68102\\r\\n47066 63421\\r\\n18251 40576\\r\\n39787 68753\\r\\n13467 78012\\r\\n34444 47422\\r\\n14836 29860\\r\\n28872 56534\\r\\n3123 15332\\r\\n10528 80517\\r\\n32445 37799\\r\\n58853 65478\\r\\n8970 40649\\r\\n29539 30816\\r\\n3444 31466\\r\\n2530 9530\\r\\n40443 80291\\r\\n15276 73485\\r\\n23497 42059\\r\\n38491 67279\\r\\n6048 37514\\r\\n30175 67295\\r\\n53865 81777\\r\\n39254 67208\\r\\n17537 55082\\r\\n46547 70611\\r\\n13350 75756\\r\\n32 40220\\r\\n12338 37921\\r\\n27727 70788\\r\\n9634 58935\\r\\n15389 68231\\r\\n41676 66682\\r\\n58907 61829\\r\\n19401 23491\\r\\n12715 68365\\r\\n22...\", \"output\": [\"63065\"]}, {\"input\": \"59635 97816\\r\\n47579 86827\\r\\n15159 61964\\r\\n3210 45414\\r\\n27135 27329\\r\\n38045 74784\\r\\n2932 86395\\r\\n832 24745\\r\\n13790 72565\\r\\n55090 63278\\r\\n75406 75992\\r\\n30035 30743\\r\\n5030 47258\\r\\n57402 95536\\r\\n54196 80421\\r\\n7130 80339\\r\\n10050 34202\\r\\n52040 92802\\r\\n67999 75971\\r\\n16527 53614\\r\\n42817 74436\\r\\n48574 97583\\r\\n82708 84936\\r\\n6898 24668\\r\\n9308 47902\\r\\n6717 22951\\r\\n36152 69745\\r\\n75525 95329\\r\\n1164 40116\\r\\n1972 2709\\r\\n21938 82056\\r\\n26624 54513\\r\\n8348 37042\\r\\n10102 71400\\r\\n6008 50792\\r\\n14527 19283\\r\\n58195 70054\\r\\n16942 87278\\r\\n29083 85245\\r\\n53642 59887\\r\\n9026 ...\", \"output\": [\"74340\"]}, {\"input\": \"92793 88333\\r\\n42616 74872\\r\\n54141 85690\\r\\n42062 59359\\r\\n24292 37682\\r\\n41786 49100\\r\\n38110 60457\\r\\n1703 48473\\r\\n4003 65392\\r\\n33866 81040\\r\\n55879 71432\\r\\n32527 37012\\r\\n50119 63769\\r\\n23578 48730\\r\\n27555 66039\\r\\n40185 62709\\r\\n76021 88332\\r\\n30516 52505\\r\\n79445 82384\\r\\n34012 69986\\r\\n9034 51729\\r\\n46074 81724\\r\\n41162 80407\\r\\n37484 50740\\r\\n53248 63158\\r\\n37210 41520\\r\\n8931 81086\\r\\n22037 52566\\r\\n80692 84901\\r\\n33623 44774\\r\\n19598 80283\\r\\n44859 84997\\r\\n53108 54338\\r\\n30475 72962\\r\\n61223 78515\\r\\n3797 30539\\r\\n14097 46224\\r\\n53607 86328\\r\\n23827 44592\\r\\n1905 7205...\", \"output\": [\"68106\"]}, {\"input\": \"66471 86093\\r\\n40599 41179\\r\\n13329 42461\\r\\n30797 62465\\r\\n19801 24394\\r\\n13976 28959\\r\\n25228 76677\\r\\n47175 63717\\r\\n23699 35087\\r\\n9388 68807\\r\\n2831 22435\\r\\n17097 22146\\r\\n25680 80679\\r\\n31434 66814\\r\\n24923 75751\\r\\n50794 65533\\r\\n6376 31614\\r\\n28111 72456\\r\\n6022 77054\\r\\n31738 67370\\r\\n9903 82269\\r\\n61602 63239\\r\\n12976 61538\\r\\n64555 74421\\r\\n42824 70641\\r\\n13116 69978\\r\\n40535 40956\\r\\n34103 42248\\r\\n10144 43873\\r\\n70224 77288\\r\\n42957 62460\\r\\n9480 28299\\r\\n56991 75015\\r\\n18949 27590\\r\\n27342 52951\\r\\n46017 71865\\r\\n1633 26674\\r\\n4729 82349\\r\\n7036 61345\\r\\n6164 42479\\r\\n6...\", \"output\": [\"65527\"]}, {\"input\": \"71235 85445\\r\\n3239 23614\\r\\n50662 72054\\r\\n69943 78235\\r\\n12419 18613\\r\\n42249 53618\\r\\n11842 33072\\r\\n34920 35233\\r\\n35608 81390\\r\\n7188 35353\\r\\n33556 80880\\r\\n29281 51523\\r\\n12104 59772\\r\\n60939 78038\\r\\n21990 56334\\r\\n54932 56615\\r\\n67328 70668\\r\\n33300 60616\\r\\n51548 84338\\r\\n48366 62011\\r\\n14619 78042\\r\\n31719 37698\\r\\n44547 55424\\r\\n3763 60634\\r\\n56900 68252\\r\\n27801 57030\\r\\n23613 67316\\r\\n8936 24206\\r\\n22027 64002\\r\\n3918 50038\\r\\n41734 49090\\r\\n43693 60092\\r\\n13949 78413\\r\\n44811 80092\\r\\n61778 81523\\r\\n8222 51348\\r\\n72620 74282\\r\\n2189 64165\\r\\n36780 64107\\r\\n7829 65240\\r...\", \"output\": [\"65523\"]}, {\"input\": \"52603 81157\\r\\n16889 25334\\r\\n41836 73978\\r\\n13496 67234\\r\\n31847 63624\\r\\n15860 74969\\r\\n12382 61565\\r\\n19568 78762\\r\\n19579 55432\\r\\n1075 32213\\r\\n22741 38473\\r\\n9807 58754\\r\\n9324 80579\\r\\n9038 59462\\r\\n52566 77687\\r\\n56424 79294\\r\\n21091 32659\\r\\n39997 70527\\r\\n6678 28014\\r\\n49703 60460\\r\\n18666 42815\\r\\n24857 73974\\r\\n62242 77717\\r\\n56703 78265\\r\\n28039 36817\\r\\n6009 43436\\r\\n46938 73775\\r\\n6093 52041\\r\\n35928 72074\\r\\n46910 79583\\r\\n29901 64853\\r\\n31716 48370\\r\\n11571 65682\\r\\n64410 67222\\r\\n32144 43362\\r\\n8546 46547\\r\\n68661 80080\\r\\n36213 74307\\r\\n30667 60134\\r\\n11016 38318\\r...\", \"output\": [\"61566\"]}, {\"input\": \"59525 89384\\r\\n22351 37316\\r\\n65890 74214\\r\\n28398 69995\\r\\n7467 43872\\r\\n55064 76804\\r\\n17923 40495\\r\\n62371 74803\\r\\n4078 41237\\r\\n5070 74654\\r\\n38831 68938\\r\\n34960 50130\\r\\n6497 10295\\r\\n20711 72215\\r\\n358 62798\\r\\n20330 76559\\r\\n31787 44161\\r\\n58696 68851\\r\\n41746 60647\\r\\n862 24831\\r\\n6657 41239\\r\\n23616 39414\\r\\n63285 88377\\r\\n78268 81666\\r\\n77321 83615\\r\\n14826 49605\\r\\n17298 58135\\r\\n61310 66378\\r\\n41532 60393\\r\\n7443 42799\\r\\n10376 67040\\r\\n10755 23961\\r\\n27367 46089\\r\\n11675 88260\\r\\n16142 17354\\r\\n6602 42235\\r\\n37343 83132\\r\\n17087 49236\\r\\n33715 43589\\r\\n41925 85734\\r\\n25...\", \"output\": [\"67524\"]}, {\"input\": \"99143 93090\\r\\n50949 54195\\r\\n32798 34537\\r\\n17211 79559\\r\\n36749 92805\\r\\n13116 39671\\r\\n67088 71043\\r\\n22544 47957\\r\\n26386 35771\\r\\n37980 37987\\r\\n9822 61785\\r\\n8101 73845\\r\\n5149 8215\\r\\n47380 80113\\r\\n20561 86349\\r\\n52610 71366\\r\\n43269 57659\\r\\n41120 52324\\r\\n32491 73474\\r\\n35902 90128\\r\\n5725 71756\\r\\n27877 35227\\r\\n11910 90238\\r\\n32044 70574\\r\\n10722 72856\\r\\n15517 54617\\r\\n6547 8884\\r\\n47616 61104\\r\\n53770 57368\\r\\n16732 26101\\r\\n7105 64634\\r\\n61970 77705\\r\\n10903 29752\\r\\n18239 66216\\r\\n65594 66758\\r\\n82949 89760\\r\\n8633 48276\\r\\n77048 88335\\r\\n38243 65802\\r\\n10328 51408\\r\\n...\", \"output\": [\"72086\"]}, {\"input\": \"80038 95220\\r\\n27728 33168\\r\\n83975 94946\\r\\n76876 85129\\r\\n14236 79899\\r\\n6047 54365\\r\\n9883 68142\\r\\n31694 74447\\r\\n42889 94287\\r\\n2440 72173\\r\\n2946 6315\\r\\n25159 28719\\r\\n4559 66970\\r\\n28291 64140\\r\\n35011 46851\\r\\n54309 89457\\r\\n38510 40730\\r\\n39559 43176\\r\\n43629 62353\\r\\n30265 48534\\r\\n3953 63839\\r\\n30212 54534\\r\\n12094 63189\\r\\n51397 51837\\r\\n4583 37642\\r\\n89248 94413\\r\\n737 76815\\r\\n24524 72921\\r\\n10358 63341\\r\\n6131 26984\\r\\n25453 46820\\r\\n38211 46668\\r\\n44254 86369\\r\\n39007 84346\\r\\n10570 15013\\r\\n21086 64657\\r\\n53177 57118\\r\\n10582 23461\\r\\n28625 85735\\r\\n81544 90724\\r\\n28...\", \"output\": [\"73158\"]}, {\"input\": \"62566 97927\\r\\n68317 77647\\r\\n21653 94931\\r\\n7414 64175\\r\\n998 48021\\r\\n11329 57019\\r\\n4429 79689\\r\\n63794 85527\\r\\n62731 76214\\r\\n66545 79506\\r\\n18043 32928\\r\\n34373 56177\\r\\n61044 78810\\r\\n1286 95569\\r\\n30285 63149\\r\\n43609 48993\\r\\n3798 75012\\r\\n18286 52430\\r\\n45974 66319\\r\\n65151 65727\\r\\n91617 97765\\r\\n14752 17033\\r\\n4498 87772\\r\\n6188 27320\\r\\n85342 86948\\r\\n27865 65647\\r\\n27855 49251\\r\\n14868 58888\\r\\n33808 43690\\r\\n43321 86031\\r\\n32626 95314\\r\\n63421 94544\\r\\n262 50279\\r\\n4267 88940\\r\\n27526 71711\\r\\n20509 61941\\r\\n17617 93054\\r\\n35039 57388\\r\\n24592 65582\\r\\n7713 41455\\r\\n393...\", \"output\": [\"74433\"]}, {\"input\": \"65563 90360\\r\\n5917 72615\\r\\n1527 10076\\r\\n21803 22289\\r\\n36217 75333\\r\\n17621 20343\\r\\n71805 85391\\r\\n1295 50612\\r\\n49982 90286\\r\\n53712 69340\\r\\n32990 41756\\r\\n59756 68713\\r\\n38135 39485\\r\\n31019 50729\\r\\n59732 65657\\r\\n56770 61017\\r\\n1089 58646\\r\\n423 72757\\r\\n795 16334\\r\\n8304 58577\\r\\n82708 87667\\r\\n61234 77087\\r\\n9132 62236\\r\\n44889 49543\\r\\n16031 21015\\r\\n14643 54441\\r\\n1804 88183\\r\\n26959 86411\\r\\n15435 83636\\r\\n21892 24019\\r\\n56029 69807\\r\\n4552 38176\\r\\n19898 23801\\r\\n62208 88196\\r\\n2744 14470\\r\\n44354 45484\\r\\n54899 68475\\r\\n10739 46722\\r\\n3359 64876\\r\\n41128 53716\\r\\n69030...\", \"output\": [\"68828\"]}, {\"input\": \"58242 95875\\r\\n50628 88159\\r\\n10216 42194\\r\\n24797 75311\\r\\n35327 94418\\r\\n10294 41016\\r\\n74579 81427\\r\\n2681 20988\\r\\n43652 85835\\r\\n22030 87583\\r\\n15623 83335\\r\\n7167 41731\\r\\n39891 82405\\r\\n13018 95058\\r\\n29503 89074\\r\\n16348 84112\\r\\n44981 46647\\r\\n44355 74204\\r\\n47555 60988\\r\\n3502 77623\\r\\n30152 42128\\r\\n11686 87903\\r\\n4261 9361\\r\\n8147 29496\\r\\n10263 87608\\r\\n36553 62806\\r\\n14753 27358\\r\\n31756 60790\\r\\n13952 69174\\r\\n4623 54241\\r\\n36090 92900\\r\\n84953 89229\\r\\n40187 53301\\r\\n41345 83109\\r\\n17296 92667\\r\\n7741 57946\\r\\n61708 93175\\r\\n27516 86322\\r\\n36765 90186\\r\\n6476 9807\\r\\n3...\", \"output\": [\"72658\"]}, {\"input\": \"58571 94052\\r\\n18089 88936\\r\\n2964 47107\\r\\n300 70501\\r\\n51871 89730\\r\\n43263 84195\\r\\n63464 64360\\r\\n41784 57811\\r\\n13956 49997\\r\\n45205 67429\\r\\n14439 59561\\r\\n8396 89897\\r\\n15925 25159\\r\\n7612 54254\\r\\n25352 55548\\r\\n37823 88837\\r\\n65531 85460\\r\\n24387 77030\\r\\n8884 16625\\r\\n18167 36805\\r\\n54449 55664\\r\\n80274 86111\\r\\n42838 44052\\r\\n49963 79598\\r\\n5276 46778\\r\\n43604 53916\\r\\n71609 83318\\r\\n5997 17697\\r\\n14843 26608\\r\\n46229 80954\\r\\n2081 81328\\r\\n22502 59827\\r\\n3741 87969\\r\\n80446 80495\\r\\n74921 79210\\r\\n65941 81086\\r\\n68241 86906\\r\\n22428 91169\\r\\n38976 44477\\r\\n560 33035\\r\\n136...\", \"output\": [\"70990\"]}, {\"input\": \"11 3\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n2 2\\r\\n2 2\\r\\n2 2\\r\\n3 3\\r\\n3 3\\r\\n3 3\\r\\n3 3\\r\\n\", \"output\": [\"2\"]}]"} {"prob_desc_description":"You are given an integer N. Consider all possible segments on the coordinate axis with endpoints at integer points with coordinates between 0 and N, inclusive; there will be of them.You want to draw these segments in several layers so that in each layer the segments don't overlap (they might touch at the endpoints though). You can not move the segments to a different location on the coordinate axis. Find the minimal number of layers you have to use for the given N.","prob_desc_output_spec":"Output a single integer - the minimal number of layers required to draw the segments for the given N.","lang_cluster":"","src_uid":"f8af5dfcf841a7f105ac4c144eb51319","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","constructive algorithms"],"prob_desc_created_at":"1514392500","prob_desc_sample_inputs":"[\"2\", \"3\", \"4\"]","prob_desc_notes":"NoteAs an example, here are the segments and their optimal arrangement into layers for N\u2009=\u20094. ","exec_outcome":"","difficulty":1300.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The only input line contains a single integer N (1\u2009\u2264\u2009N\u2009\u2264\u2009100).","prob_desc_sample_outputs":"[\"2\", \"4\", \"6\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"3\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"4\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"21\\r\\n\", \"output\": [\"121\"]}, {\"input\": \"100\\r\\n\", \"output\": [\"2550\"]}, {\"input\": \"1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"5\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"6\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"7\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"8\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"9\\r\\n\", \"output\": [\"25\"]}, {\"input\": \"10\\r\\n\", \"output\": [\"30\"]}, {\"input\": \"11\\r\\n\", \"output\": [\"36\"]}, {\"input\": \"12\\r\\n\", \"output\": [\"42\"]}, {\"input\": \"13\\r\\n\", \"output\": [\"49\"]}, {\"input\": \"14\\r\\n\", \"output\": [\"56\"]}, {\"input\": \"15\\r\\n\", \"output\": [\"64\"]}, {\"input\": \"16\\r\\n\", \"output\": [\"72\"]}, {\"input\": \"17\\r\\n\", \"output\": [\"81\"]}, {\"input\": \"18\\r\\n\", \"output\": [\"90\"]}, {\"input\": \"19\\r\\n\", \"output\": [\"100\"]}, {\"input\": \"20\\r\\n\", \"output\": [\"110\"]}, {\"input\": \"22\\r\\n\", \"output\": [\"132\"]}, {\"input\": \"23\\r\\n\", \"output\": [\"144\"]}, {\"input\": \"24\\r\\n\", \"output\": [\"156\"]}, {\"input\": \"25\\r\\n\", \"output\": [\"169\"]}, {\"input\": \"26\\r\\n\", \"output\": [\"182\"]}, {\"input\": \"27\\r\\n\", \"output\": [\"196\"]}, {\"input\": \"28\\r\\n\", \"output\": [\"210\"]}, {\"input\": \"29\\r\\n\", \"output\": [\"225\"]}, {\"input\": \"30\\r\\n\", \"output\": [\"240\"]}, {\"input\": \"31\\r\\n\", \"output\": [\"256\"]}, {\"input\": \"32\\r\\n\", \"output\": [\"272\"]}, {\"input\": \"33\\r\\n\", \"output\": [\"289\"]}, {\"input\": \"34\\r\\n\", \"output\": [\"306\"]}, {\"input\": \"35\\r\\n\", \"output\": [\"324\"]}, {\"input\": \"36\\r\\n\", \"output\": [\"342\"]}, {\"input\": \"37\\r\\n\", \"output\": [\"361\"]}, {\"input\": \"38\\r\\n\", \"output\": [\"380\"]}, {\"input\": \"39\\r\\n\", \"output\": [\"400\"]}, {\"input\": \"40\\r\\n\", \"output\": [\"420\"]}, {\"input\": \"41\\r\\n\", \"output\": [\"441\"]}, {\"input\": \"42\\r\\n\", \"output\": [\"462\"]}, {\"input\": \"43\\r\\n\", \"output\": [\"484\"]}, {\"input\": \"44\\r\\n\", \"output\": [\"506\"]}, {\"input\": \"45\\r\\n\", \"output\": [\"529\"]}, {\"input\": \"46\\r\\n\", \"output\": [\"552\"]}, {\"input\": \"47\\r\\n\", \"output\": [\"576\"]}, {\"input\": \"48\\r\\n\", \"output\": [\"600\"]}, {\"input\": \"49\\r\\n\", \"output\": [\"625\"]}, {\"input\": \"50\\r\\n\", \"output\": [\"650\"]}, {\"input\": \"51\\r\\n\", \"output\": [\"676\"]}, {\"input\": \"52\\r\\n\", \"output\": [\"702\"]}, {\"input\": \"53\\r\\n\", \"output\": [\"729\"]}, {\"input\": \"54\\r\\n\", \"output\": [\"756\"]}, {\"input\": \"55\\r\\n\", \"output\": [\"784\"]}, {\"input\": \"56\\r\\n\", \"output\": [\"812\"]}, {\"input\": \"57\\r\\n\", \"output\": [\"841\"]}, {\"input\": \"58\\r\\n\", \"output\": [\"870\"]}, {\"input\": \"59\\r\\n\", \"output\": [\"900\"]}, {\"input\": \"60\\r\\n\", \"output\": [\"930\"]}, {\"input\": \"61\\r\\n\", \"output\": [\"961\"]}, {\"input\": \"62\\r\\n\", \"output\": [\"992\"]}, {\"input\": \"63\\r\\n\", \"output\": [\"1024\"]}, {\"input\": \"64\\r\\n\", \"output\": [\"1056\"]}, {\"input\": \"65\\r\\n\", \"output\": [\"1089\"]}, {\"input\": \"66\\r\\n\", \"output\": [\"1122\"]}, {\"input\": \"67\\r\\n\", \"output\": [\"1156\"]}, {\"input\": \"68\\r\\n\", \"output\": [\"1190\"]}, {\"input\": \"69\\r\\n\", \"output\": [\"1225\"]}, {\"input\": \"70\\r\\n\", \"output\": [\"1260\"]}, {\"input\": \"71\\r\\n\", \"output\": [\"1296\"]}, {\"input\": \"72\\r\\n\", \"output\": [\"1332\"]}, {\"input\": \"73\\r\\n\", \"output\": [\"1369\"]}, {\"input\": \"74\\r\\n\", \"output\": [\"1406\"]}, {\"input\": \"75\\r\\n\", \"output\": [\"1444\"]}, {\"input\": \"76\\r\\n\", \"output\": [\"1482\"]}, {\"input\": \"77\\r\\n\", \"output\": [\"1521\"]}, {\"input\": \"78\\r\\n\", \"output\": [\"1560\"]}, {\"input\": \"79\\r\\n\", \"output\": [\"1600\"]}, {\"input\": \"80\\r\\n\", \"output\": [\"1640\"]}, {\"input\": \"81\\r\\n\", \"output\": [\"1681\"]}, {\"input\": \"82\\r\\n\", \"output\": [\"1722\"]}, {\"input\": \"83\\r\\n\", \"output\": [\"1764\"]}, {\"input\": \"84\\r\\n\", \"output\": [\"1806\"]}, {\"input\": \"85\\r\\n\", \"output\": [\"1849\"]}, {\"input\": \"86\\r\\n\", \"output\": [\"1892\"]}, {\"input\": \"87\\r\\n\", \"output\": [\"1936\"]}, {\"input\": \"88\\r\\n\", \"output\": [\"1980\"]}, {\"input\": \"89\\r\\n\", \"output\": [\"2025\"]}, {\"input\": \"90\\r\\n\", \"output\": [\"2070\"]}, {\"input\": \"91\\r\\n\", \"output\": [\"2116\"]}, {\"input\": \"92\\r\\n\", \"output\": [\"2162\"]}, {\"input\": \"93\\r\\n\", \"output\": [\"2209\"]}, {\"input\": \"94\\r\\n\", \"output\": [\"2256\"]}, {\"input\": \"95\\r\\n\", \"output\": [\"2304\"]}, {\"input\": \"96\\r\\n\", \"output\": [\"2352\"]}, {\"input\": \"97\\r\\n\", \"output\": [\"2401\"]}, {\"input\": \"98\\r\\n\", \"output\": [\"2450\"]}, {\"input\": \"99\\r\\n\", \"output\": [\"2500\"]}]"} {"prob_desc_description":"Given an integer $$$x$$$. Your task is to find out how many positive integers $$$n$$$ ($$$1 \\leq n \\leq x$$$) satisfy $$$$$$n \\cdot a^n \\equiv b \\quad (\\textrm{mod}\\;p),$$$$$$ where $$$a, b, p$$$ are all known constants.","prob_desc_output_spec":"Print a single integer: the number of possible answers $$$n$$$.","lang_cluster":"","src_uid":"4b9f470e5889da29affae6376f6c9f6a","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","chinese remainder theorem","number theory"],"prob_desc_created_at":"1517403900","prob_desc_sample_inputs":"[\"2 3 5 8\", \"4 6 7 13\", \"233 233 10007 1\"]","prob_desc_notes":"NoteIn the first sample, we can see that $$$n=2$$$ and $$$n=8$$$ are possible answers.","exec_outcome":"","difficulty":2100.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"3 seconds","prob_desc_input_spec":"The only line contains four integers $$$a,b,p,x$$$ ($$$2 \\leq p \\leq 10^6+3$$$, $$$1 \\leq a,b < p$$$, $$$1 \\leq x \\leq 10^{12}$$$). It is guaranteed that $$$p$$$ is a prime.","prob_desc_sample_outputs":"[\"2\", \"1\", \"1\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2 3 5 8\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"4 6 7 13\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"233 233 10007 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"338792 190248 339821 152634074578\\r\\n\", \"output\": [\"449263\"]}, {\"input\": \"629260 663548 739463 321804928248\\r\\n\", \"output\": [\"434818\"]}, {\"input\": \"656229 20757 818339 523535590429\\r\\n\", \"output\": [\"639482\"]}, {\"input\": \"1000002 1000002 1000003 1000000000000\\r\\n\", \"output\": [\"999998\"]}, {\"input\": \"345 2746 1000003 5000000\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"802942 824238 836833 605503824329\\r\\n\", \"output\": [\"723664\"]}, {\"input\": \"1 1 2 880336470888\\r\\n\", \"output\": [\"440168235444\"]}, {\"input\": \"2 2 3 291982585081\\r\\n\", \"output\": [\"97327528361\"]}, {\"input\": \"699601 39672 1000003 391631540387\\r\\n\", \"output\": [\"391905\"]}, {\"input\": \"9 1 11 792412106895\\r\\n\", \"output\": [\"72037464262\"]}, {\"input\": \"85 535 541 680776274925\\r\\n\", \"output\": [\"1258366493\"]}, {\"input\": \"3153 4504 7919 903755230811\\r\\n\", \"output\": [\"114124839\"]}, {\"input\": \"10021 18448 20719 509684975746\\r\\n\", \"output\": [\"24599907\"]}, {\"input\": \"66634 64950 66889 215112576953\\r\\n\", \"output\": [\"3215965\"]}, {\"input\": \"585128 179390 836839 556227387547\\r\\n\", \"output\": [\"664796\"]}, {\"input\": \"299973 381004 1000003 140225320941\\r\\n\", \"output\": [\"140481\"]}, {\"input\": \"941641 359143 1000003 851964325687\\r\\n\", \"output\": [\"851984\"]}, {\"input\": \"500719 741769 1000003 596263138944\\r\\n\", \"output\": [\"596056\"]}, {\"input\": \"142385 83099 1000003 308002143690\\r\\n\", \"output\": [\"307937\"]}, {\"input\": \"891986 300056 999983 445202944465\\r\\n\", \"output\": [\"445451\"]}, {\"input\": \"620328 378284 999983 189501757723\\r\\n\", \"output\": [\"189574\"]}, {\"input\": \"524578 993938 999979 535629124351\\r\\n\", \"output\": [\"535377\"]}, {\"input\": \"419620 683571 999979 243073161801\\r\\n\", \"output\": [\"243611\"]}, {\"input\": \"339138 549930 999883 962863668031\\r\\n\", \"output\": [\"962803\"]}, {\"input\": \"981603 635385 999233 143056117417\\r\\n\", \"output\": [\"143126\"]}, {\"input\": \"416133 340425 998561 195227456237\\r\\n\", \"output\": [\"195090\"]}, {\"input\": \"603835 578057 996323 932597132292\\r\\n\", \"output\": [\"936103\"]}, {\"input\": \"997998 999323 1000003 999968459613\\r\\n\", \"output\": [\"999964\"]}, {\"input\": \"997642 996418 999983 999997055535\\r\\n\", \"output\": [\"1000007\"]}, {\"input\": \"812415 818711 820231 999990437063\\r\\n\", \"output\": [\"1219017\"]}, {\"input\": \"994574 993183 1000003 999974679059\\r\\n\", \"output\": [\"999965\"]}, {\"input\": \"999183 998981 999979 999970875649\\r\\n\", \"output\": [\"999996\"]}, {\"input\": \"1 1 2 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"699601 39672 1000003 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"4 1 5 15\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"912896 91931 999983 236754\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"154814 35966 269041 1234567\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"1 2 5 470854713201\\r\\n\", \"output\": [\"94170942640\"]}, {\"input\": \"3 27 29 968042258975\\r\\n\", \"output\": [\"33380767549\"]}, {\"input\": \"473 392 541 108827666667\\r\\n\", \"output\": [\"201160200\"]}, {\"input\": \"8 27 29 193012366642\\r\\n\", \"output\": [\"6655598851\"]}, {\"input\": \"1302 504 1987 842777827450\\r\\n\", \"output\": [\"424145863\"]}, {\"input\": \"693528 398514 1000003 1000000000000\\r\\n\", \"output\": [\"999995\"]}, {\"input\": \"533806 514846 1000003 999999999999\\r\\n\", \"output\": [\"999997\"]}, {\"input\": \"812509 699256 1000003 999999999999\\r\\n\", \"output\": [\"999997\"]}, {\"input\": \"28361 465012 1000003 1000000000000\\r\\n\", \"output\": [\"999996\"]}, {\"input\": \"28361 465012 1000003 12693229\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"28361 465012 1000003 13271836\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"28361 465012 1000003 13271835\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"28361 465012 1000003 13421000\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"28361 465012 1000003 19609900\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"28361 465012 1000003 12693228\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 1 2 1000000000000\\r\\n\", \"output\": [\"500000000000\"]}, {\"input\": \"1 1000002 1000003 1000000000000\\r\\n\", \"output\": [\"999997\"]}, {\"input\": \"1 44444 1000003 999999999998\\r\\n\", \"output\": [\"999997\"]}, {\"input\": \"2 1000002 1000003 1000000000000\\r\\n\", \"output\": [\"1000001\"]}, {\"input\": \"2 23333 1000003 1000000000000\\r\\n\", \"output\": [\"999999\"]}]"} {"prob_desc_description":"Imp is in a magic forest, where xorangles grow (wut?) A xorangle of order n is such a non-degenerate triangle, that lengths of its sides are integers not exceeding n, and the xor-sum of the lengths is equal to zero. Imp has to count the number of distinct xorangles of order n to get out of the forest. Formally, for a given integer n you have to find the number of such triples (a,\u2009b,\u2009c), that: 1\u2009\u2264\u2009a\u2009\u2264\u2009b\u2009\u2264\u2009c\u2009\u2264\u2009n; , where denotes the bitwise xor of integers x and y. (a,\u2009b,\u2009c) form a non-degenerate (with strictly positive area) triangle. ","prob_desc_output_spec":"Print the number of xorangles of order n.","lang_cluster":"","src_uid":"838f2e75fdff0f13f002c0dfff0b2e8d","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force"],"prob_desc_created_at":"1518023700","prob_desc_sample_inputs":"[\"6\", \"10\"]","prob_desc_notes":"NoteThe only xorangle in the first sample is (3,\u20095,\u20096).","exec_outcome":"","difficulty":1300.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The only line contains a single integer n (1\u2009\u2264\u2009n\u2009\u2264\u20092500).","prob_desc_sample_outputs":"[\"1\", \"2\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"6\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"10\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"3\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"4\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"5\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2500\\r\\n\", \"output\": [\"700393\"]}, {\"input\": \"952\\r\\n\", \"output\": [\"118547\"]}, {\"input\": \"88\\r\\n\", \"output\": [\"536\"]}, {\"input\": \"1216\\r\\n\", \"output\": [\"160822\"]}, {\"input\": \"2140\\r\\n\", \"output\": [\"614785\"]}, {\"input\": \"564\\r\\n\", \"output\": [\"35087\"]}, {\"input\": \"1488\\r\\n\", \"output\": [\"239580\"]}, {\"input\": \"116\\r\\n\", \"output\": [\"1332\"]}, {\"input\": \"1040\\r\\n\", \"output\": [\"145820\"]}, {\"input\": \"1965\\r\\n\", \"output\": [\"545494\"]}, {\"input\": \"593\\r\\n\", \"output\": [\"36605\"]}, {\"input\": \"779\\r\\n\", \"output\": [\"63500\"]}, {\"input\": \"1703\\r\\n\", \"output\": [\"352045\"]}, {\"input\": \"331\\r\\n\", \"output\": [\"9877\"]}, {\"input\": \"1051\\r\\n\", \"output\": [\"145985\"]}, {\"input\": \"2179\\r\\n\", \"output\": [\"618074\"]}, {\"input\": \"603\\r\\n\", \"output\": [\"37312\"]}, {\"input\": \"1731\\r\\n\", \"output\": [\"369691\"]}, {\"input\": \"2451\\r\\n\", \"output\": [\"681980\"]}, {\"input\": \"1079\\r\\n\", \"output\": [\"146833\"]}, {\"input\": \"2207\\r\\n\", \"output\": [\"621708\"]}, {\"input\": \"2394\\r\\n\", \"output\": [\"663240\"]}, {\"input\": \"818\\r\\n\", \"output\": [\"73972\"]}, {\"input\": \"1946\\r\\n\", \"output\": [\"529383\"]}, {\"input\": \"166\\r\\n\", \"output\": [\"2200\"]}, {\"input\": \"1294\\r\\n\", \"output\": [\"175915\"]}, {\"input\": \"2218\\r\\n\", \"output\": [\"623386\"]}, {\"input\": \"846\\r\\n\", \"output\": [\"82106\"]}, {\"input\": \"1566\\r\\n\", \"output\": [\"273341\"]}, {\"input\": \"194\\r\\n\", \"output\": [\"3240\"]}, {\"input\": \"1322\\r\\n\", \"output\": [\"183405\"]}, {\"input\": \"1508\\r\\n\", \"output\": [\"247634\"]}, {\"input\": \"2433\\r\\n\", \"output\": [\"675245\"]}, {\"input\": \"857\\r\\n\", \"output\": [\"85529\"]}, {\"input\": \"1781\\r\\n\", \"output\": [\"402718\"]}, {\"input\": \"1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2444\\r\\n\", \"output\": [\"679373\"]}, {\"input\": \"2498\\r\\n\", \"output\": [\"699536\"]}]"} {"prob_desc_description":"Mahmoud and Ehab play a game called the even-odd game. Ehab chooses his favorite integer n and then they take turns, starting from Mahmoud. In each player's turn, he has to choose an integer a and subtract it from n such that: 1\u2009\u2264\u2009a\u2009\u2264\u2009n. If it's Mahmoud's turn, a has to be even, but if it's Ehab's turn, a has to be odd. If the current player can't choose any number satisfying the conditions, he loses. Can you determine the winner if they both play optimally?","prob_desc_output_spec":"Output \"Mahmoud\" (without quotes) if Mahmoud wins and \"Ehab\" (without quotes) otherwise.","lang_cluster":"","src_uid":"5e74750f44142624e6da41d4b35beb9a","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["games","math"],"prob_desc_created_at":"1522771500","prob_desc_sample_inputs":"[\"1\", \"2\"]","prob_desc_notes":"NoteIn the first sample, Mahmoud can't choose any integer a initially because there is no positive even integer less than or equal to 1 so Ehab wins.In the second sample, Mahmoud has to choose a\u2009=\u20092 and subtract it from n. It's Ehab's turn and n\u2009=\u20090. There is no positive odd integer less than or equal to 0 so Mahmoud wins.","exec_outcome":"","difficulty":800.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The only line contains an integer n (1\u2009\u2264\u2009n\u2009\u2264\u2009109), the number at the beginning of the game.","prob_desc_sample_outputs":"[\"Ehab\", \"Mahmoud\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"1\\r\\n\", \"output\": [\"Ehab\"]}, {\"input\": \"2\\r\\n\", \"output\": [\"Mahmoud\"]}, {\"input\": \"10000\\r\\n\", \"output\": [\"Mahmoud\"]}, {\"input\": \"33333\\r\\n\", \"output\": [\"Ehab\"]}, {\"input\": \"5\\r\\n\", \"output\": [\"Ehab\"]}, {\"input\": \"1000000000\\r\\n\", \"output\": [\"Mahmoud\"]}, {\"input\": \"999999999\\r\\n\", \"output\": [\"Ehab\"]}, {\"input\": \"123123123\\r\\n\", \"output\": [\"Ehab\"]}, {\"input\": \"22222221\\r\\n\", \"output\": [\"Ehab\"]}, {\"input\": \"22222220\\r\\n\", \"output\": [\"Mahmoud\"]}, {\"input\": \"3\\r\\n\", \"output\": [\"Ehab\"]}, {\"input\": \"4\\r\\n\", \"output\": [\"Mahmoud\"]}, {\"input\": \"6\\r\\n\", \"output\": [\"Mahmoud\"]}, {\"input\": \"7\\r\\n\", \"output\": [\"Ehab\"]}, {\"input\": \"8\\r\\n\", \"output\": [\"Mahmoud\"]}, {\"input\": \"9\\r\\n\", \"output\": [\"Ehab\"]}, {\"input\": \"10\\r\\n\", \"output\": [\"Mahmoud\"]}, {\"input\": \"536870912\\r\\n\", \"output\": [\"Mahmoud\"]}, {\"input\": \"536870913\\r\\n\", \"output\": [\"Ehab\"]}, {\"input\": \"536870911\\r\\n\", \"output\": [\"Ehab\"]}]"} {"prob_desc_description":"Katie, Kuro and Shiro are best friends. They have known each other since kindergarten. That's why they often share everything with each other and work together on some very hard problems.Today is Shiro's birthday. She really loves pizza so she wants to invite her friends to the pizza restaurant near her house to celebrate her birthday, including her best friends Katie and Kuro.She has ordered a very big round pizza, in order to serve her many friends. Exactly $$$n$$$ of Shiro's friends are here. That's why she has to divide the pizza into $$$n + 1$$$ slices (Shiro also needs to eat). She wants the slices to be exactly the same size and shape. If not, some of her friends will get mad and go home early, and the party will be over.Shiro is now hungry. She wants to cut the pizza with minimum of straight cuts. A cut is a straight segment, it might have ends inside or outside the pizza. But she is too lazy to pick up the calculator.As usual, she will ask Katie and Kuro for help. But they haven't come yet. Could you help Shiro with this problem?","prob_desc_output_spec":"A single integer\u00a0\u2014 the number of straight cuts Shiro needs.","lang_cluster":"","src_uid":"236177ff30dafe68295b5d33dc501828","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"128 megabytes","file_name":"prog_syn_val.jsonl","tags":["math"],"prob_desc_created_at":"1526308500","prob_desc_sample_inputs":"[\"3\", \"4\"]","prob_desc_notes":"NoteTo cut the round pizza into quarters one has to make two cuts through the center with angle $$$90^{\\circ}$$$ between them.To cut the round pizza into five equal parts one has to make five cuts.","exec_outcome":"","difficulty":1000.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"A single line contains one non-negative integer $$$n$$$ ($$$0 \\le n \\leq 10^{18}$$$)\u00a0\u2014 the number of Shiro's friends. The circular pizza has to be sliced into $$$n + 1$$$ pieces.","prob_desc_sample_outputs":"[\"2\", \"5\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"3\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"4\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"10\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"10000000000\\r\\n\", \"output\": [\"10000000001\"]}, {\"input\": \"1234567891\\r\\n\", \"output\": [\"617283946\"]}, {\"input\": \"7509213957\\r\\n\", \"output\": [\"3754606979\"]}, {\"input\": \"99999999999999999\\r\\n\", \"output\": [\"50000000000000000\"]}, {\"input\": \"21\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"712394453192\\r\\n\", \"output\": [\"712394453193\"]}, {\"input\": \"172212168\\r\\n\", \"output\": [\"172212169\"]}, {\"input\": \"822981260158260519\\r\\n\", \"output\": [\"411490630079130260\"]}, {\"input\": \"28316250877914571\\r\\n\", \"output\": [\"14158125438957286\"]}, {\"input\": \"779547116602436424\\r\\n\", \"output\": [\"779547116602436425\"]}, {\"input\": \"578223540024979436\\r\\n\", \"output\": [\"578223540024979437\"]}, {\"input\": \"335408917861648766\\r\\n\", \"output\": [\"335408917861648767\"]}, {\"input\": \"74859962623690078\\r\\n\", \"output\": [\"74859962623690079\"]}, {\"input\": \"252509054433933439\\r\\n\", \"output\": [\"126254527216966720\"]}, {\"input\": \"760713016476190622\\r\\n\", \"output\": [\"760713016476190623\"]}, {\"input\": \"919845426262703496\\r\\n\", \"output\": [\"919845426262703497\"]}, {\"input\": \"585335723211047194\\r\\n\", \"output\": [\"585335723211047195\"]}, {\"input\": \"522842184971407769\\r\\n\", \"output\": [\"261421092485703885\"]}, {\"input\": \"148049062628894320\\r\\n\", \"output\": [\"148049062628894321\"]}, {\"input\": \"84324828731963974\\r\\n\", \"output\": [\"84324828731963975\"]}, {\"input\": \"354979173822804781\\r\\n\", \"output\": [\"177489586911402391\"]}, {\"input\": \"1312150450968413\\r\\n\", \"output\": [\"656075225484207\"]}, {\"input\": \"269587449430302150\\r\\n\", \"output\": [\"269587449430302151\"]}, {\"input\": \"645762258982631926\\r\\n\", \"output\": [\"645762258982631927\"]}, {\"input\": \"615812229161735895\\r\\n\", \"output\": [\"307906114580867948\"]}, {\"input\": \"0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"349993004923078531\\r\\n\", \"output\": [\"174996502461539266\"]}, {\"input\": \"891351282707723851\\r\\n\", \"output\": [\"445675641353861926\"]}, {\"input\": \"563324731189330734\\r\\n\", \"output\": [\"563324731189330735\"]}, {\"input\": \"520974001910286909\\r\\n\", \"output\": [\"260487000955143455\"]}, {\"input\": \"666729339802329204\\r\\n\", \"output\": [\"666729339802329205\"]}, {\"input\": \"856674611404539671\\r\\n\", \"output\": [\"428337305702269836\"]}, {\"input\": \"791809296303238499\\r\\n\", \"output\": [\"395904648151619250\"]}, {\"input\": \"711066337317063338\\r\\n\", \"output\": [\"711066337317063339\"]}, {\"input\": \"931356503492686566\\r\\n\", \"output\": [\"931356503492686567\"]}, {\"input\": \"234122432773361866\\r\\n\", \"output\": [\"234122432773361867\"]}, {\"input\": \"1000000000000000000\\r\\n\", \"output\": [\"1000000000000000001\"]}, {\"input\": \"1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"7\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"63\\r\\n\", \"output\": [\"32\"]}, {\"input\": \"24\\r\\n\", \"output\": [\"25\"]}, {\"input\": \"8\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"15\\r\\n\", \"output\": [\"8\"]}]"} {"prob_desc_description":"Today on Informatics class Nastya learned about GCD and LCM (see links below). Nastya is very intelligent, so she solved all the tasks momentarily and now suggests you to solve one of them as well.We define a pair of integers (a,\u2009b) good, if GCD(a,\u2009b)\u2009=\u2009x and LCM(a,\u2009b)\u2009=\u2009y, where GCD(a,\u2009b) denotes the greatest common divisor of a and b, and LCM(a,\u2009b) denotes the least common multiple of a and b.You are given two integers x and y. You are to find the number of good pairs of integers (a,\u2009b) such that l\u2009\u2264\u2009a,\u2009b\u2009\u2264\u2009r. Note that pairs (a,\u2009b) and (b,\u2009a) are considered different if a\u2009\u2260\u2009b.","prob_desc_output_spec":"In the only line print the only integer\u00a0\u2014 the answer for the problem.","lang_cluster":"","src_uid":"d37dde5841116352c9b37538631d0b15","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","number theory"],"prob_desc_created_at":"1529339700","prob_desc_sample_inputs":"[\"1 2 1 2\", \"1 12 1 12\", \"50 100 3 30\"]","prob_desc_notes":"NoteIn the first example there are two suitable good pairs of integers (a,\u2009b): (1,\u20092) and (2,\u20091).In the second example there are four suitable good pairs of integers (a,\u2009b): (1,\u200912), (12,\u20091), (3,\u20094) and (4,\u20093).In the third example there are good pairs of integers, for example, (3,\u200930), but none of them fits the condition l\u2009\u2264\u2009a,\u2009b\u2009\u2264\u2009r.","exec_outcome":"","difficulty":1600.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The only line contains four integers l,\u2009r,\u2009x,\u2009y (1\u2009\u2264\u2009l\u2009\u2264\u2009r\u2009\u2264\u2009109, 1\u2009\u2264\u2009x\u2009\u2264\u2009y\u2009\u2264\u2009109).","prob_desc_sample_outputs":"[\"2\", \"4\", \"0\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"1 2 1 2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1 12 1 12\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"50 100 3 30\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 1000000000 1 1000000000\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"1 1000000000 158260522 200224287\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 1000000000 2 755829150\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"1 1000000000 158260522 158260522\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 1000000000 877914575 877914575\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"232 380232688 116 760465376\\r\\n\", \"output\": [\"30\"]}, {\"input\": \"47259 3393570 267 600661890\\r\\n\", \"output\": [\"30\"]}, {\"input\": \"1 1000000000 1 672672000\\r\\n\", \"output\": [\"64\"]}, {\"input\": \"1000000000 1000000000 1000000000 1000000000\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 1000000000 1 649209600\\r\\n\", \"output\": [\"32\"]}, {\"input\": \"1 1000000000 1 682290000\\r\\n\", \"output\": [\"32\"]}, {\"input\": \"1 1000000000 1 228614400\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"1 1000000000 1 800280000\\r\\n\", \"output\": [\"32\"]}, {\"input\": \"1 1000000000 1 919987200\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"1 1000000000 1 456537870\\r\\n\", \"output\": [\"64\"]}, {\"input\": \"1 1000000000 1 7198102\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"1 1000000000 1 58986263\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"1 1000000000 1 316465536\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"1 1000000000 1 9558312\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"1 1000000000 1 5461344\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"58 308939059 29 617878118\\r\\n\", \"output\": [\"62\"]}, {\"input\": \"837 16262937 27 504151047\\r\\n\", \"output\": [\"28\"]}, {\"input\": \"47275 402550 25 761222050\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"22 944623394 22 944623394\\r\\n\", \"output\": [\"32\"]}, {\"input\": \"1032 8756124 12 753026664\\r\\n\", \"output\": [\"18\"]}, {\"input\": \"7238 939389 11 618117962\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"58351 322621 23 818489477\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"3450 7068875 25 975504750\\r\\n\", \"output\": [\"86\"]}, {\"input\": \"13266 1606792 22 968895576\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"21930 632925 15 925336350\\r\\n\", \"output\": [\"42\"]}, {\"input\": \"2193 4224517 17 544962693\\r\\n\", \"output\": [\"42\"]}, {\"input\": \"526792 39807152 22904 915564496\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"67728 122875524 16932 491502096\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"319813 63298373 24601 822878849\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"572464 23409136 15472 866138032\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"39443 809059020 19716 777638472\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"2544768 8906688 27072 837228672\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"413592 46975344 21768 892531536\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"11349 816231429 11349 816231429\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"16578 939956022 16578 939956022\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"2783175 6882425 21575 887832825\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"2862252 7077972 22188 913058388\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1856828 13124976 25436 958123248\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"100 1000000000 158260522 158260522\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"100 1000000000 877914575 877914575\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"100 1000000000 602436426 602436426\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"100 1000000000 24979445 24979445\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 1000000000 18470 112519240\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"1 1000000000 22692 2201124\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1 1000000000 24190 400949250\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"1 1000000000 33409 694005157\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1 1000000000 24967 470827686\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"1 1000000000 35461 152517761\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"2 1000000000 158260522 200224287\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 1000000000 602436426 611751520\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 1000000000 861648772 942726551\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 1000000000 433933447 485982495\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 1000000000 262703497 480832794\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2672374 422235092 1336187 844470184\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1321815 935845020 1321815 935845020\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"29259607 69772909 2250739 907047817\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"11678540 172842392 2335708 864211960\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"297 173688298 2876112 851329152\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"7249 55497026 659 610467286\\r\\n\", \"output\": [\"28\"]}, {\"input\": \"398520 1481490 810 728893080\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"2354 369467362 1177 738934724\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"407264 2497352 1144 889057312\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"321399 1651014 603 879990462\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"475640 486640 440 526057840\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"631714 179724831 1136 717625968\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"280476 1595832 588 761211864\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"10455 39598005 615 673166085\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"24725 19759875 575 849674625\\r\\n\", \"output\": [\"22\"]}, {\"input\": \"22 158 2 1738\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1 2623 1 2623\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"7 163677675 3 18\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"159 20749927 1 158\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"5252 477594071 1 5251\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2202 449433679 3 6603\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"6 111 3 222\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"26 46 2 598\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"26 82 2 1066\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1 2993 1 2993\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"17 17 1 289\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"177 267 3 15753\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"7388 22705183 1 7387\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 100 3 100\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 1000 6 1024\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 100 2 4\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1 10000 2 455\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 1000000000 250000000 1000000000\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"3 3 1 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 1000000000 100000000 1000000000\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"5 10 3 3\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 1000 5 13\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 2 3 3\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 1000000000 499999993 999999986\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1 1 1 10\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 10 10 100\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 1000 4 36\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1 1000000000 10000000 20000000\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"100 100 5 5\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3 3 3 9\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"36 200 24 144\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1 100 3 10\\r\\n\", \"output\": [\"0\"]}]"} {"prob_desc_description":"Vasya has got a tree consisting of $$$n$$$ vertices. He wants to delete some (possibly zero) edges in this tree such that the maximum matching in the resulting graph is unique. He asks you to calculate the number of ways to choose a set of edges to remove.A matching in the graph is a subset of its edges such that there is no vertex incident to two (or more) edges from the subset. A maximum matching is a matching such that the number of edges in the subset is maximum possible among all matchings in this graph.Since the answer may be large, output it modulo $$$998244353$$$.","prob_desc_output_spec":"Print one integer \u2014 the number of ways to delete some (possibly empty) subset of edges so that the maximum matching in the resulting graph is unique. Print the answer modulo $$$998244353$$$.","lang_cluster":"","src_uid":"a40e78a7144ac2fae1890ac7598990bf","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["dp","trees"],"prob_desc_created_at":"1542557100","prob_desc_sample_inputs":"[\"4\\n1 2\\n1 3\\n1 4\", \"4\\n1 2\\n2 3\\n3 4\", \"1\"]","prob_desc_notes":"NotePossible ways to delete edges in the first example: delete $$$(1, 2)$$$ and $$$(1, 3)$$$. delete $$$(1, 2)$$$ and $$$(1, 4)$$$. delete $$$(1, 3)$$$ and $$$(1, 4)$$$. delete all edges. Possible ways to delete edges in the second example: delete no edges. delete $$$(1, 2)$$$ and $$$(2, 3)$$$. delete $$$(1, 2)$$$ and $$$(3, 4)$$$. delete $$$(2, 3)$$$ and $$$(3, 4)$$$. delete $$$(2, 3)$$$. delete all edges. ","exec_outcome":"","difficulty":2400.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"3 seconds","prob_desc_input_spec":"The first line contains one integer $$$n$$$ ($$$1 \\le n \\le 3 \\cdot 10^5$$$) \u2014 the number of vertices in the tree. Each of the next $$$n \u2212 1$$$ lines contains two integers $$$u$$$ and $$$v$$$ ($$$1 \\le u, v \\le n, u \\neq v$$$) denoting an edge between vertex $$$u$$$ and vertex $$$v$$$. It is guaranteed that these edges form a tree.","prob_desc_sample_outputs":"[\"4\", \"6\", \"1\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"4\\r\\n1 2\\r\\n1 3\\r\\n1 4\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"4\\r\\n1 2\\r\\n2 3\\r\\n3 4\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"10\\r\\n7 4\\r\\n3 8\\r\\n7 8\\r\\n9 5\\r\\n10 8\\r\\n9 7\\r\\n2 4\\r\\n1 3\\r\\n6 9\\r\\n\", \"output\": [\"161\"]}, {\"input\": \"299600\\r\\n186599 238798\\r\\n125435 238798\\r\\n141148 238798\\r\\n120933 238798\\r\\n238798 197437\\r\\n39681 238798\\r\\n150685 238798\\r\\n238798 201653\\r\\n173007 238798\\r\\n238798 177497\\r\\n285789 238798\\r\\n238798 40789\\r\\n203051 238798\\r\\n283442 238798\\r\\n238798 1521\\r\\n238798 147196\\r\\n238798 36884\\r\\n238798 212334\\r\\n140653 238798\\r\\n238798 38375\\r\\n238798 224506\\r\\n238798 183809\\r\\n238798 31698\\r\\n238798 63074\\r\\n238798 147783\\r\\n238798 40988\\r\\n238798 16903\\r\\n238798 146423\\r\\n238798 34693\\r\\n162130 238798\\r\\n65245 238798\\r\\n238798 198612\\r\\n155623 238798\\r\\n238798 22343\\r\\n238798...\", \"output\": [\"481433832\"]}, {\"input\": \"294266\\r\\n281371 22661\\r\\n9974 281371\\r\\n281371 225646\\r\\n281371 27648\\r\\n281371 98116\\r\\n102889 281371\\r\\n281371 66071\\r\\n85838 281371\\r\\n281371 112197\\r\\n281371 22696\\r\\n255108 281371\\r\\n281371 118001\\r\\n70525 281371\\r\\n98692 281371\\r\\n281371 119421\\r\\n281371 184523\\r\\n281371 156423\\r\\n89060 281371\\r\\n281371 119498\\r\\n243390 281371\\r\\n281371 196700\\r\\n281371 49875\\r\\n291699 281371\\r\\n281371 58229\\r\\n139940 281371\\r\\n290343 281371\\r\\n281371 143639\\r\\n293446 281371\\r\\n281371 71825\\r\\n281371 78045\\r\\n281371 181995\\r\\n281371 89679\\r\\n281371 154078\\r\\n208040 281371\\r\\n171339 28...\", \"output\": [\"450489665\"]}, {\"input\": \"298985\\r\\n64446 99754\\r\\n278175 99754\\r\\n99754 240063\\r\\n99754 255208\\r\\n99754 53168\\r\\n147592 99754\\r\\n38700 99754\\r\\n100219 99754\\r\\n99754 259572\\r\\n144551 12018\\r\\n269339 99754\\r\\n183941 99754\\r\\n31624 99754\\r\\n99754 109796\\r\\n268440 99754\\r\\n99754 226087\\r\\n235334 99754\\r\\n48983 99754\\r\\n43330 12018\\r\\n189689 99754\\r\\n99754 200964\\r\\n73398 99754\\r\\n12018 151748\\r\\n99754 244692\\r\\n12018 207060\\r\\n7819 99754\\r\\n28733 99754\\r\\n99754 63040\\r\\n30821 99754\\r\\n211291 99754\\r\\n99754 199203\\r\\n99754 292050\\r\\n166324 99754\\r\\n99754 245904\\r\\n99754 102644\\r\\n45308 99754\\r\\n272255 99754...\", \"output\": [\"461156598\"]}, {\"input\": \"293446\\r\\n26678 1130\\r\\n141703 277091\\r\\n123966 36434\\r\\n251005 141703\\r\\n141703 256197\\r\\n141703 260540\\r\\n141703 123131\\r\\n141703 10551\\r\\n141703 241657\\r\\n259399 36434\\r\\n63584 251336\\r\\n141703 59007\\r\\n26511 141703\\r\\n141703 117000\\r\\n57782 15990\\r\\n1644 141703\\r\\n206530 1130\\r\\n1130 56435\\r\\n141703 165741\\r\\n141703 17475\\r\\n214567 36434\\r\\n116104 141703\\r\\n141703 55857\\r\\n36434 202849\\r\\n134018 1130\\r\\n95333 141703\\r\\n1130 65212\\r\\n57782 176515\\r\\n1130 103717\\r\\n21854 1130\\r\\n141703 86337\\r\\n273623 141703\\r\\n141703 188972\\r\\n141703 127819\\r\\n239787 141703\\r\\n36434 73510\\r\\n...\", \"output\": [\"868896728\"]}, {\"input\": \"290474\\r\\n98044 273873\\r\\n43650 48238\\r\\n144443 85944\\r\\n166256 144443\\r\\n7524 209112\\r\\n182828 53106\\r\\n288868 285545\\r\\n160255 23712\\r\\n23942 281836\\r\\n115777 6670\\r\\n189878 48238\\r\\n262488 61697\\r\\n48238 32392\\r\\n281836 21014\\r\\n273635 33156\\r\\n195900 115777\\r\\n229186 37259\\r\\n129543 203418\\r\\n172646 71760\\r\\n229186 251684\\r\\n203648 229186\\r\\n229186 2878\\r\\n191475 48238\\r\\n288868 261921\\r\\n240038 255418\\r\\n18165 199178\\r\\n168750 279546\\r\\n115777 147788\\r\\n191551 48238\\r\\n281836 200231\\r\\n236824 245834\\r\\n281836 166564\\r\\n269901 120815\\r\\n279799 201662\\r\\n229227 203418\\r\\n71...\", \"output\": [\"12242455\"]}, {\"input\": \"293866\\r\\n82052 185783\\r\\n131 131519\\r\\n199445 59750\\r\\n157309 8039\\r\\n226795 275011\\r\\n17814 272197\\r\\n163085 139119\\r\\n254976 126316\\r\\n111725 209724\\r\\n151686 36208\\r\\n829 270844\\r\\n285550 8041\\r\\n245949 6398\\r\\n35299 128249\\r\\n81922 89011\\r\\n262792 265602\\r\\n25149 273382\\r\\n119624 251627\\r\\n166639 199271\\r\\n69714 61174\\r\\n134186 109577\\r\\n212930 209724\\r\\n189916 65711\\r\\n157596 99912\\r\\n21620 107701\\r\\n36287 119887\\r\\n148217 183423\\r\\n44219 196587\\r\\n97968 9287\\r\\n210741 57614\\r\\n97718 41357\\r\\n173721 114963\\r\\n251142 80928\\r\\n112046 166563\\r\\n10811 195576\\r\\n91327 177017\\r...\", \"output\": [\"630211985\"]}, {\"input\": \"291052\\r\\n180141 167487\\r\\n52276 88619\\r\\n238511 37775\\r\\n172696 32691\\r\\n208136 5256\\r\\n255445 182939\\r\\n165888 105415\\r\\n177846 161586\\r\\n99453 13432\\r\\n22431 37272\\r\\n108301 71350\\r\\n31937 148559\\r\\n161025 223245\\r\\n216091 38395\\r\\n219907 83580\\r\\n244730 73428\\r\\n216461 178269\\r\\n217706 262958\\r\\n244234 192741\\r\\n85681 223441\\r\\n206536 252396\\r\\n166227 108949\\r\\n288307 35292\\r\\n250428 231021\\r\\n280658 49737\\r\\n64009 176373\\r\\n63003 81312\\r\\n112310 209949\\r\\n261295 89822\\r\\n232301 271197\\r\\n37684 290240\\r\\n127657 186532\\r\\n91521 240629\\r\\n274927 199169\\r\\n222488 37386\\r\\n175...\", \"output\": [\"850805329\"]}, {\"input\": \"293769\\r\\n63025 45539\\r\\n205202 283880\\r\\n247246 176200\\r\\n45108 40374\\r\\n283692 46469\\r\\n257217 113182\\r\\n52882 253631\\r\\n113877 272053\\r\\n198984 147259\\r\\n231672 53993\\r\\n291658 82123\\r\\n60529 15207\\r\\n29565 42978\\r\\n131921 19600\\r\\n86973 146764\\r\\n87518 147523\\r\\n145229 138050\\r\\n77165 241406\\r\\n66958 209081\\r\\n35988 19929\\r\\n139984 18011\\r\\n166272 140320\\r\\n235422 69279\\r\\n37674 80624\\r\\n254866 48568\\r\\n221835 231966\\r\\n252317 121653\\r\\n122281 96293\\r\\n24827 193554\\r\\n168318 47702\\r\\n17600 215152\\r\\n60172 50754\\r\\n9025 205573\\r\\n29304 271182\\r\\n98237 70499\\r\\n143396 12316\\r...\", \"output\": [\"546186718\"]}, {\"input\": \"291149\\r\\n168057 248392\\r\\n195341 265660\\r\\n123768 41349\\r\\n130121 180407\\r\\n245926 281446\\r\\n217616 52874\\r\\n90084 137774\\r\\n65318 4837\\r\\n184471 117660\\r\\n200992 189854\\r\\n231504 250471\\r\\n130704 89173\\r\\n148394 270573\\r\\n110402 7208\\r\\n108869 37716\\r\\n111411 2106\\r\\n146627 132189\\r\\n60313 34641\\r\\n44701 269414\\r\\n129897 229737\\r\\n167372 284510\\r\\n68123 144753\\r\\n232251 35146\\r\\n177159 261021\\r\\n69471 5934\\r\\n96058 152456\\r\\n134339 112089\\r\\n277044 51209\\r\\n275103 158536\\r\\n57346 245327\\r\\n175988 205553\\r\\n64625 158514\\r\\n140832 270006\\r\\n230501 155929\\r\\n108416 53759\\r\\n812...\", \"output\": [\"545978533\"]}, {\"input\": \"294643\\r\\n292877 153183\\r\\n107606 113710\\r\\n154311 159711\\r\\n23760 50893\\r\\n125331 201921\\r\\n220436 208047\\r\\n92895 31753\\r\\n88599 274616\\r\\n190224 197389\\r\\n216023 182012\\r\\n145224 225326\\r\\n110105 69339\\r\\n14045 123037\\r\\n134557 278126\\r\\n146192 237736\\r\\n124309 248749\\r\\n28495 117819\\r\\n292160 148063\\r\\n244889 38030\\r\\n29236 178674\\r\\n4248 122375\\r\\n78789 82978\\r\\n233854 72049\\r\\n115342 89822\\r\\n140004 174560\\r\\n275795 551\\r\\n16180 228914\\r\\n36471 43126\\r\\n76169 169825\\r\\n170371 4440\\r\\n168359 141324\\r\\n179144 246606\\r\\n191425 172303\\r\\n257652 218935\\r\\n49861 239580\\r\\n1774...\", \"output\": [\"279779536\"]}, {\"input\": \"294196\\r\\n127503 265006\\r\\n130747 10029\\r\\n38184 81626\\r\\n164326 77790\\r\\n49225 45518\\r\\n105612 153567\\r\\n286191 38138\\r\\n98986 69149\\r\\n288559 25694\\r\\n136102 212712\\r\\n161165 47072\\r\\n30308 161436\\r\\n125729 271778\\r\\n200483 221356\\r\\n213419 155130\\r\\n99092 6542\\r\\n287188 198603\\r\\n225999 60899\\r\\n16558 83015\\r\\n242469 75249\\r\\n163863 198789\\r\\n155260 92264\\r\\n49255 905\\r\\n48595 255325\\r\\n86396 245123\\r\\n250522 229128\\r\\n95234 42822\\r\\n102005 275246\\r\\n5500 230796\\r\\n53974 251543\\r\\n39587 198360\\r\\n135478 54185\\r\\n27774 268065\\r\\n292933 42371\\r\\n102806 73187\\r\\n198109 261814\\r...\", \"output\": [\"614462720\"]}, {\"input\": \"292868\\r\\n91851 79379\\r\\n89176 108063\\r\\n17840 108018\\r\\n56969 252862\\r\\n259475 256652\\r\\n164830 266919\\r\\n286324 292470\\r\\n96586 199827\\r\\n239312 123384\\r\\n109158 43582\\r\\n284118 211719\\r\\n24515 73538\\r\\n264128 103666\\r\\n20641 285582\\r\\n243438 155682\\r\\n12606 78368\\r\\n112755 18285\\r\\n244731 197351\\r\\n118507 266870\\r\\n28122 218131\\r\\n179686 25920\\r\\n47857 32622\\r\\n15221 101604\\r\\n276340 96413\\r\\n79725 102716\\r\\n224300 70735\\r\\n229380 122052\\r\\n136982 225602\\r\\n136906 168915\\r\\n221008 55972\\r\\n35281 58121\\r\\n93770 16562\\r\\n161674 89538\\r\\n204209 32998\\r\\n233039 95379\\r\\n176793 ...\", \"output\": [\"885964686\"]}, {\"input\": \"262143\\r\\n42559 176458\\r\\n42559 13329\\r\\n176458 173545\\r\\n176458 245823\\r\\n13329 169094\\r\\n13329 235968\\r\\n173545 130338\\r\\n173545 65614\\r\\n245823 87852\\r\\n245823 176240\\r\\n169094 227394\\r\\n169094 253680\\r\\n235968 51494\\r\\n235968 156740\\r\\n130338 234563\\r\\n130338 193877\\r\\n65614 56077\\r\\n65614 197447\\r\\n87852 190281\\r\\n87852 127859\\r\\n176240 117673\\r\\n176240 131458\\r\\n227394 217152\\r\\n227394 73100\\r\\n253680 73304\\r\\n253680 145027\\r\\n51494 128224\\r\\n51494 210632\\r\\n156740 236780\\r\\n156740 229503\\r\\n234563 181888\\r\\n234563 163859\\r\\n193877 150386\\r\\n193877 238776\\r\\n56077 3281...\", \"output\": [\"827526041\"]}, {\"input\": \"300000\\r\\n105427 213874\\r\\n105427 63877\\r\\n105427 185039\\r\\n213874 133573\\r\\n213874 290517\\r\\n213874 200712\\r\\n63877 285958\\r\\n63877 263995\\r\\n63877 179850\\r\\n185039 132649\\r\\n185039 106307\\r\\n185039 261091\\r\\n133573 145662\\r\\n133573 135575\\r\\n133573 218847\\r\\n290517 233251\\r\\n290517 274964\\r\\n290517 176311\\r\\n200712 218143\\r\\n200712 18892\\r\\n200712 266547\\r\\n285958 21724\\r\\n285958 160391\\r\\n285958 59187\\r\\n263995 39835\\r\\n263995 36128\\r\\n263995 211787\\r\\n179850 172674\\r\\n179850 142060\\r\\n179850 81698\\r\\n132649 175499\\r\\n132649 272896\\r\\n132649 248373\\r\\n106307 173971\\r\\n106...\", \"output\": [\"453613841\"]}, {\"input\": \"300000\\r\\n258260 202726\\r\\n258260 292475\\r\\n258260 3004\\r\\n258260 90785\\r\\n258260 150294\\r\\n258260 138535\\r\\n258260 256554\\r\\n258260 165034\\r\\n258260 222003\\r\\n258260 154138\\r\\n258260 121482\\r\\n258260 224704\\r\\n258260 73433\\r\\n258260 202772\\r\\n258260 128460\\r\\n258260 155791\\r\\n258260 117875\\r\\n258260 285934\\r\\n258260 245967\\r\\n258260 246603\\r\\n258260 234585\\r\\n258260 5199\\r\\n258260 184463\\r\\n258260 215192\\r\\n258260 108233\\r\\n258260 197411\\r\\n258260 208869\\r\\n258260 84802\\r\\n258260 171351\\r\\n258260 34281\\r\\n258260 207993\\r\\n258260 221053\\r\\n258260 264358\\r\\n258260 3974\\r\\n258...\", \"output\": [\"444892369\"]}, {\"input\": \"300000\\r\\n161886 120273\\r\\n120273 27960\\r\\n27960 226993\\r\\n226993 204503\\r\\n204503 137938\\r\\n137938 7965\\r\\n7965 291955\\r\\n291955 25832\\r\\n25832 262549\\r\\n262549 285223\\r\\n285223 13648\\r\\n13648 222398\\r\\n222398 206511\\r\\n206511 249265\\r\\n249265 77622\\r\\n77622 253274\\r\\n253274 270138\\r\\n270138 123003\\r\\n123003 113076\\r\\n113076 34343\\r\\n34343 139689\\r\\n139689 68295\\r\\n68295 263405\\r\\n263405 91630\\r\\n91630 226825\\r\\n226825 72216\\r\\n72216 173503\\r\\n173503 200078\\r\\n200078 261467\\r\\n261467 36869\\r\\n36869 252709\\r\\n252709 169362\\r\\n169362 187307\\r\\n187307 214264\\r\\n214264 192451\\r\\n...\", \"output\": [\"467594981\"]}, {\"input\": \"300000\\r\\n180743 52849\\r\\n52849 86351\\r\\n86351 31467\\r\\n31467 174768\\r\\n174768 170763\\r\\n170763 71267\\r\\n71267 149003\\r\\n149003 265249\\r\\n265249 161496\\r\\n161496 146490\\r\\n146490 200722\\r\\n200722 283187\\r\\n283187 123784\\r\\n123784 204254\\r\\n204254 180298\\r\\n180298 296027\\r\\n296027 296684\\r\\n296684 277501\\r\\n277501 236592\\r\\n236592 94871\\r\\n94871 167567\\r\\n167567 233014\\r\\n233014 6602\\r\\n6602 8491\\r\\n8491 154262\\r\\n154262 121170\\r\\n121170 191962\\r\\n191962 39213\\r\\n39213 125394\\r\\n125394 8982\\r\\n8982 261818\\r\\n261818 116966\\r\\n116966 272299\\r\\n272299 67403\\r\\n67403 29453\\r\\n29453...\", \"output\": [\"269920023\"]}, {\"input\": \"300000\\r\\n147683 188490\\r\\n188490 26491\\r\\n26491 214025\\r\\n214025 76557\\r\\n76557 251693\\r\\n251693 83302\\r\\n83302 285738\\r\\n285738 69381\\r\\n69381 43648\\r\\n43648 258935\\r\\n258935 242125\\r\\n242125 139703\\r\\n139703 121732\\r\\n121732 261296\\r\\n261296 269227\\r\\n269227 166081\\r\\n166081 112003\\r\\n112003 10408\\r\\n10408 58121\\r\\n58121 157645\\r\\n157645 16954\\r\\n16954 243003\\r\\n243003 200614\\r\\n200614 200927\\r\\n200927 268008\\r\\n268008 18118\\r\\n18118 78572\\r\\n78572 85192\\r\\n85192 248364\\r\\n248364 29983\\r\\n29983 266232\\r\\n266232 134374\\r\\n134374 277962\\r\\n277962 22564\\r\\n22564 264023\\r\\n2640...\", \"output\": [\"912646574\"]}, {\"input\": \"300000\\r\\n6864 75772\\r\\n75772 299100\\r\\n299100 263320\\r\\n263320 15600\\r\\n15600 146470\\r\\n146470 173227\\r\\n173227 255497\\r\\n255497 248916\\r\\n248916 29059\\r\\n29059 5847\\r\\n5847 109749\\r\\n109749 89357\\r\\n89357 238315\\r\\n238315 157117\\r\\n157117 213089\\r\\n213089 257629\\r\\n257629 290056\\r\\n290056 184246\\r\\n184246 191641\\r\\n191641 151263\\r\\n151263 210157\\r\\n210157 185708\\r\\n185708 292310\\r\\n292310 187159\\r\\n187159 278661\\r\\n278661 126950\\r\\n126950 285458\\r\\n285458 273352\\r\\n273352 124775\\r\\n124775 229525\\r\\n229525 100713\\r\\n100713 285708\\r\\n285708 80137\\r\\n80137 256940\\r\\n256940 19...\", \"output\": [\"216418749\"]}, {\"input\": \"300000\\r\\n253389 101588\\r\\n101588 14725\\r\\n14725 241678\\r\\n241678 246471\\r\\n246471 148131\\r\\n148131 57433\\r\\n57433 230372\\r\\n230372 177740\\r\\n177740 278864\\r\\n278864 28078\\r\\n28078 179178\\r\\n179178 124717\\r\\n124717 229715\\r\\n229715 236786\\r\\n236786 159828\\r\\n159828 42259\\r\\n42259 110558\\r\\n110558 152999\\r\\n152999 16381\\r\\n16381 219806\\r\\n219806 150054\\r\\n150054 1289\\r\\n1289 239224\\r\\n239224 121516\\r\\n121516 285976\\r\\n285976 189587\\r\\n189587 240701\\r\\n240701 205671\\r\\n205671 136293\\r\\n136293 27238\\r\\n27238 97970\\r\\n97970 174113\\r\\n174113 118107\\r\\n118107 50793\\r\\n50793 20450\\r...\", \"output\": [\"936058676\"]}, {\"input\": \"300000\\r\\n149712 264096\\r\\n264096 116815\\r\\n116815 107230\\r\\n107230 76893\\r\\n76893 148738\\r\\n148738 108689\\r\\n108689 60014\\r\\n60014 179377\\r\\n179377 217099\\r\\n217099 93509\\r\\n93509 217772\\r\\n217772 206015\\r\\n206015 158971\\r\\n158971 163624\\r\\n163624 188677\\r\\n188677 254534\\r\\n254534 16924\\r\\n16924 187641\\r\\n187641 144918\\r\\n144918 69321\\r\\n69321 141340\\r\\n141340 207647\\r\\n207647 275983\\r\\n275983 288873\\r\\n288873 261886\\r\\n261886 128833\\r\\n128833 223716\\r\\n223716 43797\\r\\n43797 111629\\r\\n111629 11219\\r\\n11219 235587\\r\\n235587 27932\\r\\n27932 3093\\r\\n3093 113787\\r\\n113787 242393...\", \"output\": [\"753453112\"]}, {\"input\": \"300000\\r\\n201098 47086\\r\\n201098 206580\\r\\n47086 30053\\r\\n47086 184630\\r\\n206580 274275\\r\\n206580 192465\\r\\n30053 202916\\r\\n30053 117453\\r\\n184630 148410\\r\\n184630 267164\\r\\n274275 44828\\r\\n274275 139707\\r\\n192465 127690\\r\\n192465 174582\\r\\n202916 98173\\r\\n202916 43469\\r\\n117453 232908\\r\\n117453 54160\\r\\n148410 256445\\r\\n148410 89798\\r\\n267164 94712\\r\\n267164 206970\\r\\n44828 189535\\r\\n44828 247017\\r\\n139707 14428\\r\\n139707 270110\\r\\n127690 216140\\r\\n127690 220471\\r\\n174582 3517\\r\\n174582 186262\\r\\n98173 299965\\r\\n98173 224363\\r\\n43469 158631\\r\\n43469 295054\\r\\n232908 177221\\r...\", \"output\": [\"404404228\"]}, {\"input\": \"300000\\r\\n110406 235856\\r\\n110406 207574\\r\\n110406 179383\\r\\n110406 243478\\r\\n110406 134214\\r\\n235856 181316\\r\\n235856 156153\\r\\n235856 146383\\r\\n235856 278942\\r\\n235856 116999\\r\\n207574 46138\\r\\n207574 278104\\r\\n207574 173975\\r\\n207574 59641\\r\\n207574 167613\\r\\n179383 25225\\r\\n179383 141636\\r\\n179383 45072\\r\\n179383 136399\\r\\n179383 82107\\r\\n243478 243936\\r\\n243478 109830\\r\\n243478 62130\\r\\n243478 177924\\r\\n243478 33360\\r\\n134214 173646\\r\\n134214 289361\\r\\n134214 125333\\r\\n134214 295405\\r\\n134214 172680\\r\\n181316 263063\\r\\n181316 195457\\r\\n181316 194950\\r\\n181316 160522\\r\\n...\", \"output\": [\"602843447\"]}, {\"input\": \"300000\\r\\n234786 291070\\r\\n234786 244505\\r\\n234786 142770\\r\\n234786 99400\\r\\n234786 132208\\r\\n234786 220839\\r\\n234786 30063\\r\\n234786 180998\\r\\n234786 68013\\r\\n234786 6963\\r\\n234786 47190\\r\\n291070 178511\\r\\n291070 103763\\r\\n291070 208791\\r\\n291070 118844\\r\\n291070 266169\\r\\n291070 86483\\r\\n291070 81241\\r\\n291070 144329\\r\\n291070 290993\\r\\n291070 51981\\r\\n291070 193156\\r\\n244505 86214\\r\\n244505 153909\\r\\n244505 140465\\r\\n244505 88356\\r\\n244505 8104\\r\\n244505 107725\\r\\n244505 63835\\r\\n244505 132397\\r\\n244505 189220\\r\\n244505 150956\\r\\n244505 295062\\r\\n142770 107771\\r\\n142770 ...\", \"output\": [\"34208655\"]}, {\"input\": \"300000\\r\\n108813 129725\\r\\n108813 167558\\r\\n108813 87073\\r\\n108813 37889\\r\\n108813 137628\\r\\n108813 275190\\r\\n108813 241384\\r\\n108813 87723\\r\\n108813 178195\\r\\n108813 63340\\r\\n108813 82818\\r\\n108813 280332\\r\\n108813 248795\\r\\n108813 213385\\r\\n108813 143598\\r\\n108813 77653\\r\\n108813 209424\\r\\n108813 23460\\r\\n108813 233867\\r\\n108813 128764\\r\\n108813 5689\\r\\n108813 109643\\r\\n108813 265929\\r\\n108813 177683\\r\\n108813 277135\\r\\n108813 253557\\r\\n108813 188708\\r\\n108813 153448\\r\\n108813 65189\\r\\n108813 30516\\r\\n108813 221102\\r\\n108813 84025\\r\\n108813 244648\\r\\n108813 114898\\r\\n10881...\", \"output\": [\"801065988\"]}, {\"input\": \"300000\\r\\n162512 55070\\r\\n162512 229945\\r\\n162512 78305\\r\\n162512 101753\\r\\n162512 250120\\r\\n162512 184272\\r\\n162512 182542\\r\\n162512 230285\\r\\n162512 187204\\r\\n162512 145329\\r\\n162512 3002\\r\\n162512 95874\\r\\n162512 260202\\r\\n162512 273112\\r\\n162512 50663\\r\\n162512 172558\\r\\n162512 116630\\r\\n162512 184396\\r\\n162512 145117\\r\\n162512 95255\\r\\n162512 59180\\r\\n162512 40901\\r\\n162512 110361\\r\\n162512 291257\\r\\n162512 126525\\r\\n162512 281500\\r\\n162512 223059\\r\\n162512 202505\\r\\n162512 120465\\r\\n162512 174722\\r\\n162512 292473\\r\\n162512 27984\\r\\n162512 279039\\r\\n162512 63271\\r\\n1625...\", \"output\": [\"254205895\"]}, {\"input\": \"300000\\r\\n270311 187299\\r\\n253244 260046\\r\\n33861 279601\\r\\n199109 292644\\r\\n211835 54682\\r\\n4223 206891\\r\\n29623 85455\\r\\n270157 173046\\r\\n73913 49112\\r\\n154333 201690\\r\\n226709 80313\\r\\n131746 235500\\r\\n62902 98750\\r\\n186212 92377\\r\\n281747 204584\\r\\n280161 137785\\r\\n21995 252418\\r\\n92753 270767\\r\\n142493 15864\\r\\n133921 7668\\r\\n122689 74366\\r\\n296881 119052\\r\\n264493 150211\\r\\n87540 182121\\r\\n20124 86866\\r\\n23960 248098\\r\\n142145 199141\\r\\n275532 296067\\r\\n201919 84809\\r\\n276145 221949\\r\\n212739 96639\\r\\n250640 257042\\r\\n175665 241436\\r\\n51210 6501\\r\\n228249 279281\\r\\n24942...\", \"output\": [\"503380073\"]}, {\"input\": \"235068\\r\\n9137 109633\\r\\n181558 36732\\r\\n152068 53971\\r\\n213816 203892\\r\\n74925 40672\\r\\n92959 115884\\r\\n40633 228189\\r\\n198504 175352\\r\\n181790 226886\\r\\n77061 144796\\r\\n215014 10895\\r\\n222078 153141\\r\\n227412 204474\\r\\n152670 143440\\r\\n81907 192001\\r\\n181597 150727\\r\\n70187 78602\\r\\n158089 131560\\r\\n54687 32327\\r\\n210212 168606\\r\\n164952 128825\\r\\n74099 161363\\r\\n15784 194911\\r\\n155256 101151\\r\\n65195 206901\\r\\n114747 114214\\r\\n204363 210426\\r\\n153045 60413\\r\\n97960 93284\\r\\n173821 80786\\r\\n68444 204064\\r\\n27826 69504\\r\\n188183 184837\\r\\n49716 193867\\r\\n203308 7426\\r\\n115334...\", \"output\": [\"634426501\"]}, {\"input\": \"300000\\r\\n12190 55011\\r\\n12190 195983\\r\\n12190 63812\\r\\n12190 56633\\r\\n12190 84426\\r\\n12190 106727\\r\\n12190 253853\\r\\n12190 235272\\r\\n12190 256303\\r\\n12190 54830\\r\\n12190 91832\\r\\n12190 7402\\r\\n12190 196929\\r\\n12190 183785\\r\\n12190 268943\\r\\n12190 168659\\r\\n12190 213141\\r\\n12190 141636\\r\\n12190 192390\\r\\n12190 104377\\r\\n12190 82246\\r\\n12190 128176\\r\\n12190 143704\\r\\n12190 260772\\r\\n12190 21003\\r\\n12190 103408\\r\\n12190 284864\\r\\n12190 290993\\r\\n12190 217057\\r\\n12190 170704\\r\\n12190 83471\\r\\n12190 107302\\r\\n12190 170196\\r\\n12190 241915\\r\\n12190 272385\\r\\n12190 144786\\r\\n12190 2897...\", \"output\": [\"284725069\"]}, {\"input\": \"300000\\r\\n112661 238243\\r\\n112661 173901\\r\\n112661 176203\\r\\n112661 192601\\r\\n112661 173382\\r\\n112661 132685\\r\\n112661 200380\\r\\n112661 181458\\r\\n112661 172109\\r\\n112661 243761\\r\\n112661 139183\\r\\n112661 276828\\r\\n112661 31469\\r\\n112661 163825\\r\\n112661 199754\\r\\n112661 251899\\r\\n112661 163178\\r\\n112661 253521\\r\\n112661 112264\\r\\n112661 142362\\r\\n112661 133555\\r\\n112661 153144\\r\\n112661 71233\\r\\n112661 220555\\r\\n112661 142008\\r\\n112661 149584\\r\\n112661 184523\\r\\n112661 123028\\r\\n112661 252264\\r\\n112661 15375\\r\\n112661 92175\\r\\n112661 219840\\r\\n112661 130233\\r\\n112661 91865...\", \"output\": [\"165967076\"]}, {\"input\": \"300000\\r\\n61408 55209\\r\\n61408 39108\\r\\n61408 207878\\r\\n61408 23814\\r\\n61408 186951\\r\\n61408 209794\\r\\n61408 213584\\r\\n61408 12756\\r\\n61408 266225\\r\\n61408 99522\\r\\n61408 51775\\r\\n61408 269989\\r\\n61408 16140\\r\\n61408 16610\\r\\n61408 176904\\r\\n61408 1816\\r\\n61408 39389\\r\\n61408 13892\\r\\n61408 254523\\r\\n61408 248797\\r\\n61408 264136\\r\\n61408 288568\\r\\n61408 45169\\r\\n61408 205700\\r\\n61408 228679\\r\\n61408 240444\\r\\n61408 91865\\r\\n61408 248265\\r\\n61408 180952\\r\\n61408 180073\\r\\n61408 249520\\r\\n61408 211724\\r\\n61408 93388\\r\\n61408 239999\\r\\n61408 53516\\r\\n61408 247853\\r\\n61408 55982\\r\\n61...\", \"output\": [\"961199473\"]}, {\"input\": \"300000\\r\\n51198 80525\\r\\n51198 111137\\r\\n51198 137455\\r\\n51198 294120\\r\\n51198 123947\\r\\n51198 255\\r\\n51198 178124\\r\\n51198 125853\\r\\n51198 103022\\r\\n51198 61388\\r\\n51198 27636\\r\\n51198 164579\\r\\n51198 23069\\r\\n51198 278377\\r\\n51198 78744\\r\\n51198 264951\\r\\n51198 157670\\r\\n51198 221007\\r\\n51198 168659\\r\\n51198 242312\\r\\n51198 89466\\r\\n51198 156641\\r\\n51198 9738\\r\\n51198 224576\\r\\n51198 235982\\r\\n51198 62942\\r\\n51198 288627\\r\\n51198 99870\\r\\n51198 203381\\r\\n51198 183470\\r\\n51198 214406\\r\\n51198 346\\r\\n51198 129730\\r\\n51198 247250\\r\\n51198 159115\\r\\n51198 167989\\r\\n51198 26498\\r\\n51...\", \"output\": [\"246182726\"]}, {\"input\": \"300000\\r\\n239316 86086\\r\\n239316 187297\\r\\n239316 137256\\r\\n239316 11968\\r\\n239316 248315\\r\\n239316 244921\\r\\n239316 32693\\r\\n239316 210276\\r\\n239316 23667\\r\\n239316 295467\\r\\n239316 260235\\r\\n239316 286993\\r\\n239316 71892\\r\\n239316 2171\\r\\n239316 112201\\r\\n239316 283714\\r\\n239316 256905\\r\\n239316 168548\\r\\n239316 269252\\r\\n239316 135153\\r\\n239316 10800\\r\\n239316 85867\\r\\n239316 231443\\r\\n239316 276728\\r\\n239316 28822\\r\\n239316 228664\\r\\n239316 2232\\r\\n239316 170700\\r\\n239316 196199\\r\\n239316 260764\\r\\n86086 112190\\r\\n86086 115635\\r\\n86086 118549\\r\\n86086 216342\\r\\n86086 231...\", \"output\": [\"789449270\"]}, {\"input\": \"300000\\r\\n120521 87657\\r\\n120521 163007\\r\\n120521 178824\\r\\n120521 240631\\r\\n120521 27394\\r\\n120521 171702\\r\\n120521 56953\\r\\n120521 92153\\r\\n120521 246701\\r\\n120521 97161\\r\\n120521 65096\\r\\n120521 253523\\r\\n120521 29762\\r\\n120521 105041\\r\\n120521 232667\\r\\n120521 166143\\r\\n120521 174405\\r\\n120521 174884\\r\\n120521 90525\\r\\n120521 129443\\r\\n120521 249772\\r\\n120521 271855\\r\\n120521 213179\\r\\n120521 109407\\r\\n120521 283758\\r\\n120521 293564\\r\\n120521 102007\\r\\n120521 246214\\r\\n120521 290602\\r\\n120521 160776\\r\\n120521 180922\\r\\n120521 19843\\r\\n120521 62685\\r\\n120521 76476\\r\\n1205...\", \"output\": [\"513428718\"]}, {\"input\": \"300000\\r\\n18252 280846\\r\\n18252 140140\\r\\n18252 6776\\r\\n18252 137344\\r\\n18252 150949\\r\\n18252 33185\\r\\n18252 15854\\r\\n18252 270592\\r\\n18252 201326\\r\\n18252 257243\\r\\n18252 157136\\r\\n18252 68237\\r\\n18252 213816\\r\\n18252 297481\\r\\n18252 173760\\r\\n18252 101720\\r\\n18252 81547\\r\\n18252 294139\\r\\n18252 118604\\r\\n18252 1944\\r\\n18252 252889\\r\\n18252 214867\\r\\n18252 89429\\r\\n18252 213009\\r\\n18252 276709\\r\\n18252 181312\\r\\n18252 187179\\r\\n18252 10389\\r\\n18252 137212\\r\\n18252 189937\\r\\n18252 11150\\r\\n18252 72623\\r\\n18252 296696\\r\\n18252 33224\\r\\n18252 239838\\r\\n18252 230614\\r\\n18252 23085\\r...\", \"output\": [\"652937273\"]}, {\"input\": \"300000\\r\\n64140 80060\\r\\n64140 274804\\r\\n64140 255465\\r\\n64140 119561\\r\\n64140 22067\\r\\n64140 223103\\r\\n64140 271784\\r\\n64140 171881\\r\\n64140 278232\\r\\n64140 168699\\r\\n64140 182727\\r\\n64140 212229\\r\\n64140 116287\\r\\n64140 282498\\r\\n64140 82890\\r\\n64140 143029\\r\\n64140 184636\\r\\n64140 157099\\r\\n64140 207446\\r\\n64140 108399\\r\\n64140 222850\\r\\n64140 183756\\r\\n64140 86637\\r\\n64140 284397\\r\\n64140 267191\\r\\n64140 161604\\r\\n64140 216749\\r\\n64140 210279\\r\\n64140 177799\\r\\n64140 155685\\r\\n80060 55071\\r\\n274804 19081\\r\\n255465 189567\\r\\n119561 142861\\r\\n22067 103474\\r\\n223103 4322\\r\\n271...\", \"output\": [\"896563433\"]}, {\"input\": \"300000\\r\\n26689 88953\\r\\n26689 1899\\r\\n26689 290977\\r\\n26689 26198\\r\\n26689 60451\\r\\n26689 163729\\r\\n26689 13349\\r\\n26689 31560\\r\\n26689 203714\\r\\n26689 69715\\r\\n26689 63817\\r\\n26689 252357\\r\\n26689 133760\\r\\n26689 51538\\r\\n26689 201606\\r\\n26689 185478\\r\\n26689 160785\\r\\n26689 222792\\r\\n26689 42938\\r\\n26689 249950\\r\\n26689 299248\\r\\n26689 175837\\r\\n26689 87007\\r\\n26689 72038\\r\\n26689 156376\\r\\n26689 11489\\r\\n26689 76075\\r\\n26689 14883\\r\\n26689 118311\\r\\n26689 245186\\r\\n26689 122096\\r\\n26689 113084\\r\\n26689 52380\\r\\n26689 4813\\r\\n26689 64344\\r\\n26689 70307\\r\\n26689 188788\\r\\n26689 ...\", \"output\": [\"536743950\"]}, {\"input\": \"300000\\r\\n59131 34779\\r\\n59131 159773\\r\\n59131 243799\\r\\n59131 211777\\r\\n59131 151085\\r\\n59131 66255\\r\\n59131 35725\\r\\n59131 231836\\r\\n59131 101724\\r\\n59131 50070\\r\\n59131 21196\\r\\n59131 268754\\r\\n59131 190447\\r\\n59131 161586\\r\\n59131 263060\\r\\n59131 66637\\r\\n59131 192551\\r\\n59131 165880\\r\\n59131 261549\\r\\n59131 284103\\r\\n59131 92276\\r\\n59131 235094\\r\\n59131 143665\\r\\n59131 121217\\r\\n59131 249528\\r\\n59131 19059\\r\\n59131 200530\\r\\n59131 273488\\r\\n59131 62442\\r\\n59131 76039\\r\\n59131 150172\\r\\n59131 91846\\r\\n59131 176242\\r\\n59131 149537\\r\\n59131 53586\\r\\n59131 62978\\r\\n59131 33207\\r...\", \"output\": [\"567286724\"]}, {\"input\": \"297913\\r\\n236565 157418\\r\\n87849 213660\\r\\n185618 11494\\r\\n233037 83329\\r\\n255672 48661\\r\\n115481 199003\\r\\n22586 281927\\r\\n170060 224623\\r\\n85230 64082\\r\\n254060 89738\\r\\n151201 241092\\r\\n275882 58422\\r\\n71209 188734\\r\\n221022 16452\\r\\n188867 156019\\r\\n226012 227581\\r\\n268144 107204\\r\\n253004 105504\\r\\n270729 116771\\r\\n39112 209541\\r\\n14984 33604\\r\\n200007 5219\\r\\n33583 974\\r\\n177862 226917\\r\\n203956 179077\\r\\n1450 139355\\r\\n70377 239848\\r\\n205365 282843\\r\\n211468 61854\\r\\n141278 282469\\r\\n87446 4205\\r\\n88667 93003\\r\\n153328 79816\\r\\n5370 218985\\r\\n263565 134481\\r\\n73768 1835...\", \"output\": [\"706948189\"]}, {\"input\": \"292071\\r\\n132820 117642\\r\\n178912 87568\\r\\n209097 55469\\r\\n135177 120868\\r\\n278833 50611\\r\\n124658 163178\\r\\n186352 63481\\r\\n149944 60489\\r\\n267994 75635\\r\\n124516 102318\\r\\n254370 87494\\r\\n205963 262883\\r\\n220694 255207\\r\\n28850 91120\\r\\n67287 1697\\r\\n1357 123990\\r\\n127291 79430\\r\\n235548 288043\\r\\n197248 11762\\r\\n258647 78058\\r\\n24848 289660\\r\\n27373 90939\\r\\n119342 212454\\r\\n237691 215473\\r\\n262010 199357\\r\\n108325 240106\\r\\n130225 169909\\r\\n176898 118968\\r\\n256186 154399\\r\\n214890 121681\\r\\n167670 38700\\r\\n43416 247357\\r\\n147624 204787\\r\\n164978 4093\\r\\n83838 157196\\r\\n106...\", \"output\": [\"465548364\"]}, {\"input\": \"292179\\r\\n131457 247158\\r\\n158377 47881\\r\\n230434 217748\\r\\n201251 11262\\r\\n209485 201195\\r\\n242813 38750\\r\\n139604 257382\\r\\n136626 123271\\r\\n240490 26686\\r\\n222436 162262\\r\\n256779 209103\\r\\n69929 89912\\r\\n69317 110592\\r\\n132101 57243\\r\\n209855 11744\\r\\n36530 102796\\r\\n97721 94490\\r\\n8355 250738\\r\\n91528 91924\\r\\n260250 233748\\r\\n78353 216655\\r\\n79459 36198\\r\\n199215 33076\\r\\n115222 137776\\r\\n82848 202342\\r\\n17199 117238\\r\\n113367 198548\\r\\n44136 1375\\r\\n156844 26941\\r\\n61647 205292\\r\\n260608 63848\\r\\n94958 87359\\r\\n19070 256463\\r\\n131979 29878\\r\\n280908 122812\\r\\n266479 259...\", \"output\": [\"581526955\"]}, {\"input\": \"298881\\r\\n97541 294574\\r\\n298210 212441\\r\\n41987 287064\\r\\n119334 25021\\r\\n6863 210872\\r\\n207340 70111\\r\\n66577 44326\\r\\n94746 25650\\r\\n236499 32360\\r\\n92454 274267\\r\\n148952 195841\\r\\n279947 159023\\r\\n289624 157409\\r\\n261084 35638\\r\\n268185 112174\\r\\n6355 234838\\r\\n124194 13807\\r\\n168922 142525\\r\\n230714 213932\\r\\n223821 9313\\r\\n198169 148834\\r\\n276992 119992\\r\\n191283 114159\\r\\n264471 244128\\r\\n161113 162970\\r\\n253011 165801\\r\\n35501 29477\\r\\n119151 236160\\r\\n212212 112295\\r\\n81522 9296\\r\\n120703 122263\\r\\n30666 112589\\r\\n66685 11849\\r\\n184352 267230\\r\\n174758 51743\\r\\n14693...\", \"output\": [\"406245420\"]}, {\"input\": \"300000\\r\\n80461 188157\\r\\n220394 79379\\r\\n88057 252687\\r\\n49465 74133\\r\\n168692 213734\\r\\n214657 45564\\r\\n287839 122855\\r\\n116584 65612\\r\\n163702 205604\\r\\n123612 60536\\r\\n283824 192740\\r\\n40417 42765\\r\\n147642 231981\\r\\n272412 252087\\r\\n49005 96390\\r\\n64101 283678\\r\\n256062 85750\\r\\n45420 172282\\r\\n60241 109599\\r\\n145571 299498\\r\\n201540 153187\\r\\n10963 260587\\r\\n273552 19209\\r\\n44079 283113\\r\\n3158 131649\\r\\n179184 201022\\r\\n27570 254170\\r\\n111161 227702\\r\\n86147 149161\\r\\n60266 107389\\r\\n141976 61873\\r\\n154356 81324\\r\\n235476 59591\\r\\n237633 220247\\r\\n45315 279123\\r\\n162303...\", \"output\": [\"464931319\"]}, {\"input\": \"300000\\r\\n280310 99123\\r\\n284661 96995\\r\\n162870 105486\\r\\n208714 180240\\r\\n298491 45099\\r\\n146012 225890\\r\\n199917 180688\\r\\n61998 169861\\r\\n273587 143235\\r\\n9128 155699\\r\\n44522 114474\\r\\n78570 93121\\r\\n259454 102791\\r\\n31719 88588\\r\\n79360 143636\\r\\n141376 21183\\r\\n250056 48931\\r\\n249732 288874\\r\\n210873 257007\\r\\n244892 119817\\r\\n19747 207249\\r\\n195684 56964\\r\\n204563 190857\\r\\n1697 29841\\r\\n268589 299600\\r\\n75109 237475\\r\\n253438 87522\\r\\n167871 194791\\r\\n244284 54672\\r\\n283365 291198\\r\\n192623 172581\\r\\n2214 46698\\r\\n235689 291068\\r\\n248256 130699\\r\\n6177 233442\\r\\n14644...\", \"output\": [\"55867492\"]}, {\"input\": \"300000\\r\\n250559 206657\\r\\n236026 148600\\r\\n200188 135367\\r\\n98823 264458\\r\\n23175 144478\\r\\n61036 88583\\r\\n218567 110261\\r\\n122162 16699\\r\\n259988 226942\\r\\n162175 249290\\r\\n65895 116806\\r\\n40256 166059\\r\\n11411 266384\\r\\n72706 291177\\r\\n13456 219498\\r\\n232472 137137\\r\\n290526 10907\\r\\n285091 219243\\r\\n213338 980\\r\\n245480 273718\\r\\n4471 246663\\r\\n97703 122249\\r\\n9609 27874\\r\\n606 272052\\r\\n141166 120334\\r\\n105438 38938\\r\\n83759 66874\\r\\n259283 78282\\r\\n29486 276202\\r\\n299295 18118\\r\\n111160 285167\\r\\n117626 106730\\r\\n97160 132733\\r\\n276015 149652\\r\\n134903 267799\\r\\n108668 5...\", \"output\": [\"229601178\"]}, {\"input\": \"300000\\r\\n218908 166353\\r\\n252861 240502\\r\\n89491 232004\\r\\n116797 298251\\r\\n276406 205646\\r\\n233394 188720\\r\\n231996 152842\\r\\n257250 71321\\r\\n187661 202254\\r\\n235389 292850\\r\\n197886 175278\\r\\n122954 6603\\r\\n30899 235954\\r\\n152912 259774\\r\\n251995 2748\\r\\n132962 136962\\r\\n160891 148133\\r\\n299479 132973\\r\\n19722 241772\\r\\n157698 71552\\r\\n218240 283581\\r\\n278284 164804\\r\\n32111 34418\\r\\n115137 278190\\r\\n25512 25705\\r\\n66732 187048\\r\\n284924 215350\\r\\n269148 250155\\r\\n143431 64183\\r\\n183948 130426\\r\\n297863 19319\\r\\n64987 3386\\r\\n137822 280097\\r\\n283834 232230\\r\\n98998 88436\\r...\", \"output\": [\"315953263\"]}, {\"input\": \"297854\\r\\n183205 172877\\r\\n183205 252364\\r\\n183205 6325\\r\\n271746 215306\\r\\n183205 44284\\r\\n183205 295770\\r\\n90884 183205\\r\\n86303 183205\\r\\n183205 212082\\r\\n183205 224815\\r\\n183205 147811\\r\\n183205 112593\\r\\n138204 183205\\r\\n183205 215094\\r\\n183205 121328\\r\\n183205 89447\\r\\n183205 295100\\r\\n183205 202485\\r\\n201513 183205\\r\\n183205 259803\\r\\n183205 81073\\r\\n26003 183205\\r\\n183205 168532\\r\\n183205 212237\\r\\n183205 157249\\r\\n183205 68011\\r\\n161620 183205\\r\\n183205 209046\\r\\n183205 111289\\r\\n192455 183205\\r\\n279426 183205\\r\\n120130 183205\\r\\n145537 183205\\r\\n183205 116146\\r\\n96...\", \"output\": [\"931372989\"]}, {\"input\": \"296191\\r\\n66416 7743\\r\\n7743 151526\\r\\n17923 7743\\r\\n172856 7743\\r\\n7743 144227\\r\\n7743 69929\\r\\n7743 86863\\r\\n7743 106197\\r\\n7743 221850\\r\\n111730 7743\\r\\n7743 182238\\r\\n7743 239231\\r\\n7743 153281\\r\\n7743 290148\\r\\n280968 7743\\r\\n227330 7743\\r\\n7743 267027\\r\\n10171 7743\\r\\n4574 7743\\r\\n7743 72156\\r\\n7743 269603\\r\\n7743 482\\r\\n7743 171372\\r\\n7743 143703\\r\\n7743 126802\\r\\n166863 7743\\r\\n7743 113849\\r\\n7743 89334\\r\\n114535 7743\\r\\n252025 7743\\r\\n198485 7743\\r\\n150916 253731\\r\\n7743 133372\\r\\n148279 7743\\r\\n7743 128899\\r\\n220531 7743\\r\\n7743 112238\\r\\n120528 7743\\r\\n7743 256978\\r\\n122452...\", \"output\": [\"890809337\"]}, {\"input\": \"295765\\r\\n45904 228468\\r\\n123638 23332\\r\\n109878 79230\\r\\n57772 46455\\r\\n13939 189298\\r\\n2391 257789\\r\\n177405 165155\\r\\n250365 232858\\r\\n130943 189245\\r\\n78810 201225\\r\\n205110 184900\\r\\n59841 47149\\r\\n241833 29818\\r\\n189245 217971\\r\\n131293 138588\\r\\n218855 211707\\r\\n181447 290521\\r\\n76960 114931\\r\\n187523 94258\\r\\n137137 25455\\r\\n204671 253353\\r\\n22492 174555\\r\\n192898 46270\\r\\n242072 52951\\r\\n80959 275571\\r\\n7211 164245\\r\\n169424 1362\\r\\n106834 202624\\r\\n179390 226452\\r\\n277883 198518\\r\\n42459 45048\\r\\n123776 24881\\r\\n207070 80897\\r\\n3589 293633\\r\\n282680 135259\\r\\n14675 1...\", \"output\": [\"978152615\"]}, {\"input\": \"296687\\r\\n167107 271999\\r\\n29014 203201\\r\\n109765 150891\\r\\n91393 117328\\r\\n33587 114660\\r\\n244774 101602\\r\\n174025 291738\\r\\n167107 88325\\r\\n54351 56734\\r\\n136631 20981\\r\\n194838 58267\\r\\n200212 81874\\r\\n44969 259396\\r\\n55551 39290\\r\\n36911 95008\\r\\n184773 208212\\r\\n107788 14368\\r\\n283415 168803\\r\\n155676 272875\\r\\n241446 59331\\r\\n289154 180965\\r\\n88189 206287\\r\\n56727 271050\\r\\n210110 166606\\r\\n265696 239546\\r\\n21993 89052\\r\\n73189 288341\\r\\n262300 38393\\r\\n29464 118403\\r\\n96947 231440\\r\\n27758 264451\\r\\n176256 63301\\r\\n121489 64541\\r\\n160465 122876\\r\\n209289 249040\\r\\n16033...\", \"output\": [\"210836668\"]}, {\"input\": \"296044\\r\\n197136 233403\\r\\n135693 79390\\r\\n206048 15942\\r\\n195766 40572\\r\\n154035 15989\\r\\n233802 57919\\r\\n291658 22165\\r\\n200402 279603\\r\\n177413 8418\\r\\n93685 108098\\r\\n58918 172903\\r\\n281439 167556\\r\\n136943 211195\\r\\n213021 283884\\r\\n277017 7387\\r\\n137857 121129\\r\\n42380 98861\\r\\n16650 123183\\r\\n294237 86448\\r\\n275141 264947\\r\\n188676 229669\\r\\n63563 89070\\r\\n219973 169786\\r\\n221686 151640\\r\\n138461 112915\\r\\n131601 287650\\r\\n132016 165290\\r\\n240684 274627\\r\\n214773 249641\\r\\n163502 213687\\r\\n101350 90352\\r\\n84887 30257\\r\\n174400 227167\\r\\n106806 29904\\r\\n203087 81862\\r\\n1...\", \"output\": [\"103997324\"]}, {\"input\": \"291895\\r\\n220212 90897\\r\\n146631 183809\\r\\n221932 124952\\r\\n7029 221691\\r\\n206422 197410\\r\\n26670 76526\\r\\n13596 6392\\r\\n31715 231475\\r\\n244109 139172\\r\\n121650 239308\\r\\n264893 228043\\r\\n251867 216081\\r\\n263986 30449\\r\\n165602 175187\\r\\n187913 246699\\r\\n135825 13845\\r\\n142088 27599\\r\\n261596 69797\\r\\n104785 124732\\r\\n266240 84569\\r\\n111164 44400\\r\\n10830 133534\\r\\n72137 148630\\r\\n279924 291424\\r\\n48593 273145\\r\\n254939 7739\\r\\n260367 110373\\r\\n5653 229075\\r\\n136037 66037\\r\\n172472 189262\\r\\n253225 119165\\r\\n222436 267017\\r\\n273194 75542\\r\\n144039 5472\\r\\n5319 230610\\r\\n160327...\", \"output\": [\"115345155\"]}, {\"input\": \"297946\\r\\n107418 92751\\r\\n257795 158096\\r\\n191755 46019\\r\\n58213 241209\\r\\n142964 261762\\r\\n41110 223726\\r\\n102836 39425\\r\\n220765 94528\\r\\n121116 297417\\r\\n60778 155020\\r\\n43376 75815\\r\\n231064 76077\\r\\n277149 176492\\r\\n287690 159742\\r\\n167220 82472\\r\\n256265 63683\\r\\n247773 193475\\r\\n29885 176873\\r\\n106803 14327\\r\\n280729 85491\\r\\n199708 20907\\r\\n157505 284178\\r\\n129138 105262\\r\\n234945 199718\\r\\n256737 258703\\r\\n192042 6699\\r\\n9678 236326\\r\\n243751 8519\\r\\n84475 200465\\r\\n38685 64726\\r\\n195985 250957\\r\\n173794 113960\\r\\n16420 17266\\r\\n195353 158231\\r\\n62763 37689\\r\\n111634 ...\", \"output\": [\"332899900\"]}, {\"input\": \"300000\\r\\n54585 162655\\r\\n54585 21224\\r\\n54585 276452\\r\\n54585 295343\\r\\n54585 56853\\r\\n162655 172670\\r\\n162655 267532\\r\\n162655 49539\\r\\n162655 112385\\r\\n162655 158812\\r\\n162655 175732\\r\\n162655 221642\\r\\n162655 147980\\r\\n162655 254489\\r\\n162655 20865\\r\\n21224 41125\\r\\n21224 240587\\r\\n21224 145873\\r\\n21224 153159\\r\\n21224 108394\\r\\n21224 273382\\r\\n21224 81087\\r\\n21224 201993\\r\\n21224 172105\\r\\n21224 224465\\r\\n276452 294700\\r\\n276452 19344\\r\\n276452 269663\\r\\n276452 234092\\r\\n276452 270897\\r\\n276452 17156\\r\\n276452 179410\\r\\n276452 177298\\r\\n276452 186532\\r\\n276452 95458\\r\\n29...\", \"output\": [\"889728316\"]}, {\"input\": \"300000\\r\\n25728 42991\\r\\n25728 272793\\r\\n25728 21859\\r\\n25728 26966\\r\\n25728 197582\\r\\n25728 73901\\r\\n25728 254104\\r\\n25728 268816\\r\\n25728 294542\\r\\n25728 138861\\r\\n25728 30229\\r\\n25728 114007\\r\\n25728 36291\\r\\n25728 49699\\r\\n25728 11316\\r\\n25728 45245\\r\\n25728 125329\\r\\n25728 49730\\r\\n25728 60141\\r\\n25728 34216\\r\\n25728 11356\\r\\n25728 162631\\r\\n25728 88601\\r\\n25728 295915\\r\\n25728 103814\\r\\n25728 61356\\r\\n25728 199525\\r\\n25728 256497\\r\\n25728 12399\\r\\n25728 223819\\r\\n25728 206737\\r\\n25728 290583\\r\\n25728 152541\\r\\n25728 201950\\r\\n25728 31937\\r\\n25728 168983\\r\\n25728 88484\\r\\n257...\", \"output\": [\"490284571\"]}, {\"input\": \"300000\\r\\n230566 122042\\r\\n230566 66294\\r\\n230566 191268\\r\\n230566 196188\\r\\n230566 201806\\r\\n230566 123230\\r\\n230566 144329\\r\\n230566 94286\\r\\n230566 7406\\r\\n230566 290629\\r\\n230566 125323\\r\\n230566 98347\\r\\n230566 110586\\r\\n230566 77562\\r\\n230566 137733\\r\\n230566 107085\\r\\n230566 36623\\r\\n230566 250717\\r\\n230566 199261\\r\\n230566 65767\\r\\n230566 94341\\r\\n230566 7164\\r\\n230566 19106\\r\\n230566 118066\\r\\n230566 26436\\r\\n230566 228636\\r\\n230566 224566\\r\\n230566 155593\\r\\n230566 223789\\r\\n230566 189526\\r\\n230566 222331\\r\\n230566 62124\\r\\n230566 148393\\r\\n230566 110371\\r\\n230566 ...\", \"output\": [\"26114030\"]}]"} {"prob_desc_description":"You are given a binary string $$$s$$$.Find the number of distinct cyclical binary strings of length $$$n$$$ which contain $$$s$$$ as a substring.The cyclical string $$$t$$$ contains $$$s$$$ as a substring if there is some cyclical shift of string $$$t$$$, such that $$$s$$$ is a substring of this cyclical shift of $$$t$$$.For example, the cyclical string \"000111\" contains substrings \"001\", \"01110\" and \"10\", but doesn't contain \"0110\" and \"10110\".Two cyclical strings are called different if they differ from each other as strings. For example, two different strings, which differ from each other by a cyclical shift, are still considered different cyclical strings.","prob_desc_output_spec":"Print the only integer\u00a0\u2014 the number of distinct cyclical binary strings $$$t$$$, which contain $$$s$$$ as a substring.","lang_cluster":"","src_uid":"0034806908c9794086736a2d07fc654c","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["dp","strings"],"prob_desc_created_at":"1536248100","prob_desc_sample_inputs":"[\"2\\n0\", \"4\\n1010\", \"20\\n10101010101010\"]","prob_desc_notes":"NoteIn the first example, there are three cyclical strings, which contain \"0\"\u00a0\u2014 \"00\", \"01\" and \"10\".In the second example, there are only two such strings\u00a0\u2014 \"1010\", \"0101\".","exec_outcome":"","difficulty":2900.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line contains a single integer $$$n$$$ ($$$1 \\le n \\le 40$$$)\u00a0\u2014 the length of the target string $$$t$$$. The next line contains the string $$$s$$$ ($$$1 \\le |s| \\le n$$$)\u00a0\u2014 the string which must be a substring of cyclical string $$$t$$$. String $$$s$$$ contains only characters '0' and '1'.","prob_desc_sample_outputs":"[\"3\", \"2\", \"962\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2\\r\\n0\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"4\\r\\n1010\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"20\\r\\n10101010101010\\r\\n\", \"output\": [\"962\"]}, {\"input\": \"2\\r\\n11\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"5\\r\\n00101\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"10\\r\\n100101\\r\\n\", \"output\": [\"155\"]}, {\"input\": \"4\\r\\n0011\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"7\\r\\n1100\\r\\n\", \"output\": [\"56\"]}, {\"input\": \"8\\r\\n01010001\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"6\\r\\n10\\r\\n\", \"output\": [\"62\"]}, {\"input\": \"17\\r\\n011100101100110\\r\\n\", \"output\": [\"68\"]}, {\"input\": \"22\\r\\n1110011010100111\\r\\n\", \"output\": [\"1408\"]}, {\"input\": \"17\\r\\n1110110111010101\\r\\n\", \"output\": [\"34\"]}, {\"input\": \"11\\r\\n10100000100\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"20\\r\\n10100001011\\r\\n\", \"output\": [\"10230\"]}, {\"input\": \"16\\r\\n101011\\r\\n\", \"output\": [\"15248\"]}, {\"input\": \"33\\r\\n0001100010001100110000\\r\\n\", \"output\": [\"67584\"]}, {\"input\": \"30\\r\\n111001000100\\r\\n\", \"output\": [\"7857600\"]}, {\"input\": \"40\\r\\n1001\\r\\n\", \"output\": [\"1029761794578\"]}, {\"input\": \"31\\r\\n101\\r\\n\", \"output\": [\"2110188507\"]}, {\"input\": \"18\\r\\n001000011010000\\r\\n\", \"output\": [\"144\"]}, {\"input\": \"36\\r\\n110110010000\\r\\n\", \"output\": [\"603021324\"]}, {\"input\": \"40\\r\\n00000111111100110111000010000010101001\\r\\n\", \"output\": [\"160\"]}, {\"input\": \"39\\r\\n000000000000000000000000000000000000001\\r\\n\", \"output\": [\"39\"]}, {\"input\": \"37\\r\\n0101010101010101010101010101010101010\\r\\n\", \"output\": [\"37\"]}, {\"input\": \"31\\r\\n11011101110000011100\\r\\n\", \"output\": [\"63488\"]}, {\"input\": \"34\\r\\n110000100\\r\\n\", \"output\": [\"1121963008\"]}, {\"input\": \"35\\r\\n111111100100100\\r\\n\", \"output\": [\"36696800\"]}, {\"input\": \"20\\r\\n100010000\\r\\n\", \"output\": [\"40840\"]}, {\"input\": \"21\\r\\n01011101001010001\\r\\n\", \"output\": [\"336\"]}, {\"input\": \"11\\r\\n00010\\r\\n\", \"output\": [\"638\"]}, {\"input\": \"16\\r\\n10011000100001\\r\\n\", \"output\": [\"64\"]}, {\"input\": \"39\\r\\n11101001101111001011110111010010111001\\r\\n\", \"output\": [\"78\"]}, {\"input\": \"32\\r\\n10101100\\r\\n\", \"output\": [\"519167992\"]}, {\"input\": \"13\\r\\n111\\r\\n\", \"output\": [\"5435\"]}, {\"input\": \"4\\r\\n01\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"8\\r\\n100\\r\\n\", \"output\": [\"208\"]}, {\"input\": \"9\\r\\n1110\\r\\n\", \"output\": [\"270\"]}, {\"input\": \"1\\r\\n1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"20\\r\\n01100111000\\r\\n\", \"output\": [\"10230\"]}, {\"input\": \"5\\r\\n1\\r\\n\", \"output\": [\"31\"]}, {\"input\": \"38\\r\\n11111010100111100011\\r\\n\", \"output\": [\"9961415\"]}, {\"input\": \"24\\r\\n1101110111000111011\\r\\n\", \"output\": [\"768\"]}, {\"input\": \"6\\r\\n101111\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"39\\r\\n1010001010100100001\\r\\n\", \"output\": [\"40894230\"]}, {\"input\": \"34\\r\\n1111001001101011101101101\\r\\n\", \"output\": [\"17408\"]}, {\"input\": \"35\\r\\n11100110100\\r\\n\", \"output\": [\"585195800\"]}, {\"input\": \"7\\r\\n1111\\r\\n\", \"output\": [\"29\"]}, {\"input\": \"35\\r\\n010100010101011110110101000\\r\\n\", \"output\": [\"8960\"]}, {\"input\": \"18\\r\\n110101110001\\r\\n\", \"output\": [\"1152\"]}, {\"input\": \"10\\r\\n0110101\\r\\n\", \"output\": [\"75\"]}, {\"input\": \"38\\r\\n0111110111100000000000100\\r\\n\", \"output\": [\"311296\"]}, {\"input\": \"32\\r\\n101011001\\r\\n\", \"output\": [\"263480312\"]}, {\"input\": \"39\\r\\n111011011000100\\r\\n\", \"output\": [\"654211584\"]}, {\"input\": \"31\\r\\n00101010000\\r\\n\", \"output\": [\"32331574\"]}, {\"input\": \"35\\r\\n100011111010001011100001\\r\\n\", \"output\": [\"71680\"]}, {\"input\": \"39\\r\\n1010000110\\r\\n\", \"output\": [\"20653344998\"]}, {\"input\": \"34\\r\\n1011010111111001100011110111\\r\\n\", \"output\": [\"2176\"]}, {\"input\": \"37\\r\\n100110110011100100100010110000011\\r\\n\", \"output\": [\"592\"]}, {\"input\": \"40\\r\\n1010100001001010110011000110001\\r\\n\", \"output\": [\"20480\"]}, {\"input\": \"30\\r\\n11110010111010001010111\\r\\n\", \"output\": [\"3840\"]}, {\"input\": \"36\\r\\n100101110110110111100110010011001\\r\\n\", \"output\": [\"288\"]}, {\"input\": \"40\\r\\n01011011110\\r\\n\", \"output\": [\"21354424310\"]}, {\"input\": \"36\\r\\n00001010001000010101111010\\r\\n\", \"output\": [\"36864\"]}, {\"input\": \"40\\r\\n111101001000110000111001110111111110111\\r\\n\", \"output\": [\"80\"]}, {\"input\": \"37\\r\\n1000101000000000011101011111010011\\r\\n\", \"output\": [\"296\"]}, {\"input\": \"31\\r\\n0111111101001100\\r\\n\", \"output\": [\"1015777\"]}, {\"input\": \"35\\r\\n00010000111011\\r\\n\", \"output\": [\"73382400\"]}, {\"input\": \"38\\r\\n11111111111111111111111111111111100000\\r\\n\", \"output\": [\"38\"]}, {\"input\": \"39\\r\\n000000000000000111111111111111111111111\\r\\n\", \"output\": [\"39\"]}, {\"input\": \"36\\r\\n000000000011111111111111111111111111\\r\\n\", \"output\": [\"36\"]}, {\"input\": \"37\\r\\n1111110000000000000000000000000000000\\r\\n\", \"output\": [\"37\"]}, {\"input\": \"37\\r\\n0000000000000000011111111111111111111\\r\\n\", \"output\": [\"37\"]}, {\"input\": \"39\\r\\n101010101010101010101010101010101010101\\r\\n\", \"output\": [\"39\"]}, {\"input\": \"38\\r\\n10101010101010101010101010101010101010\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"37\\r\\n1010101010101010101010101010101010101\\r\\n\", \"output\": [\"37\"]}, {\"input\": \"40\\r\\n0101010101010101010101010101010101010101\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"38\\r\\n00000000000000000000000000000000000000\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"37\\r\\n0011111111111011011111110111011111111\\r\\n\", \"output\": [\"37\"]}, {\"input\": \"35\\r\\n00001000110100100101101111110101111\\r\\n\", \"output\": [\"35\"]}, {\"input\": \"40\\r\\n0000000000100000100000000000000000000000\\r\\n\", \"output\": [\"40\"]}, {\"input\": \"37\\r\\n0000110000100100011101000100000001010\\r\\n\", \"output\": [\"37\"]}, {\"input\": \"40\\r\\n1111111111111011111111101111111111111111\\r\\n\", \"output\": [\"40\"]}, {\"input\": \"38\\r\\n10100000011100111001100101000100001000\\r\\n\", \"output\": [\"38\"]}, {\"input\": \"40\\r\\n1111110111111111111111011111111111111110\\r\\n\", \"output\": [\"40\"]}, {\"input\": \"40\\r\\n0000010010000000000001000110000001010100\\r\\n\", \"output\": [\"40\"]}, {\"input\": \"39\\r\\n100110001010001000000001010000000110100\\r\\n\", \"output\": [\"39\"]}, {\"input\": \"38\\r\\n01011110100111011\\r\\n\", \"output\": [\"79690256\"]}, {\"input\": \"37\\r\\n100110111000011010011010110011101\\r\\n\", \"output\": [\"592\"]}, {\"input\": \"30\\r\\n000000000110001011111011000\\r\\n\", \"output\": [\"240\"]}, {\"input\": \"33\\r\\n101110110010101\\r\\n\", \"output\": [\"8647584\"]}, {\"input\": \"34\\r\\n1101010100001111111\\r\\n\", \"output\": [\"1114095\"]}, {\"input\": \"32\\r\\n01100010110111100111110010\\r\\n\", \"output\": [\"2048\"]}, {\"input\": \"40\\r\\n000010101101010011111101011110010011\\r\\n\", \"output\": [\"640\"]}, {\"input\": \"32\\r\\n0111010100\\r\\n\", \"output\": [\"133105408\"]}, {\"input\": \"31\\r\\n0101100101100000111001\\r\\n\", \"output\": [\"15872\"]}, {\"input\": \"39\\r\\n00111\\r\\n\", \"output\": [\"419341377312\"]}, {\"input\": \"33\\r\\n00111101\\r\\n\", \"output\": [\"1068677566\"]}, {\"input\": \"37\\r\\n1010001011111100110101110\\r\\n\", \"output\": [\"151552\"]}, {\"input\": \"37\\r\\n111000011\\r\\n\", \"output\": [\"9626769261\"]}, {\"input\": \"37\\r\\n011111001111100010001011000001100111\\r\\n\", \"output\": [\"74\"]}, {\"input\": \"40\\r\\n0000\\r\\n\", \"output\": [\"848129718780\"]}, {\"input\": \"40\\r\\n1000\\r\\n\", \"output\": [\"1060965767804\"]}, {\"input\": \"40\\r\\n0100\\r\\n\", \"output\": [\"1029761794578\"]}, {\"input\": \"40\\r\\n1100\\r\\n\", \"output\": [\"1060965767804\"]}, {\"input\": \"40\\r\\n0010\\r\\n\", \"output\": [\"1029761794578\"]}, {\"input\": \"40\\r\\n1010\\r\\n\", \"output\": [\"1000453489698\"]}, {\"input\": \"40\\r\\n0110\\r\\n\", \"output\": [\"1029761794578\"]}, {\"input\": \"40\\r\\n1110\\r\\n\", \"output\": [\"1060965767804\"]}, {\"input\": \"40\\r\\n0001\\r\\n\", \"output\": [\"1060965767804\"]}, {\"input\": \"40\\r\\n0101\\r\\n\", \"output\": [\"1000453489698\"]}, {\"input\": \"40\\r\\n1101\\r\\n\", \"output\": [\"1029761794578\"]}, {\"input\": \"40\\r\\n0011\\r\\n\", \"output\": [\"1060965767804\"]}, {\"input\": \"40\\r\\n1011\\r\\n\", \"output\": [\"1029761794578\"]}, {\"input\": \"40\\r\\n0111\\r\\n\", \"output\": [\"1060965767804\"]}, {\"input\": \"40\\r\\n1111\\r\\n\", \"output\": [\"848129718780\"]}, {\"input\": \"40\\r\\n000\\r\\n\", \"output\": [\"1060965767805\"]}, {\"input\": \"40\\r\\n100\\r\\n\", \"output\": [\"1099282801648\"]}, {\"input\": \"40\\r\\n010\\r\\n\", \"output\": [\"1093624901051\"]}, {\"input\": \"40\\r\\n110\\r\\n\", \"output\": [\"1099282801648\"]}, {\"input\": \"40\\r\\n001\\r\\n\", \"output\": [\"1099282801648\"]}, {\"input\": \"40\\r\\n101\\r\\n\", \"output\": [\"1093624901051\"]}, {\"input\": \"40\\r\\n011\\r\\n\", \"output\": [\"1099282801648\"]}, {\"input\": \"40\\r\\n111\\r\\n\", \"output\": [\"1060965767805\"]}, {\"input\": \"40\\r\\n00\\r\\n\", \"output\": [\"1099282801649\"]}, {\"input\": \"40\\r\\n01\\r\\n\", \"output\": [\"1099511627774\"]}, {\"input\": \"40\\r\\n10\\r\\n\", \"output\": [\"1099511627774\"]}, {\"input\": \"40\\r\\n11\\r\\n\", \"output\": [\"1099282801649\"]}, {\"input\": \"40\\r\\n0\\r\\n\", \"output\": [\"1099511627775\"]}, {\"input\": \"40\\r\\n1\\r\\n\", \"output\": [\"1099511627775\"]}, {\"input\": \"1\\r\\n0\\r\\n\", \"output\": [\"1\"]}]"} {"prob_desc_description":"Masha has three sticks of length $$$a$$$, $$$b$$$ and $$$c$$$ centimeters respectively. In one minute Masha can pick one arbitrary stick and increase its length by one centimeter. She is not allowed to break sticks.What is the minimum number of minutes she needs to spend increasing the stick's length in order to be able to assemble a triangle of positive area. Sticks should be used as triangle's sides (one stick for one side) and their endpoints should be located at triangle's vertices.","prob_desc_output_spec":"Print a single integer\u00a0\u2014 the minimum number of minutes that Masha needs to spend in order to be able to make the triangle of positive area from her sticks.","lang_cluster":"","src_uid":"3dc56bc08606a39dd9ca40a43c452f09","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["geometry","brute force","math"],"prob_desc_created_at":"1539511500","prob_desc_sample_inputs":"[\"3 4 5\", \"2 5 3\", \"100 10 10\"]","prob_desc_notes":"NoteIn the first example, Masha can make a triangle from the sticks without increasing the length of any of them.In the second example, Masha can't make a triangle of positive area from the sticks she has at the beginning, but she can spend one minute to increase the length $$$2$$$ centimeter stick by one and after that form a triangle with sides $$$3$$$, $$$3$$$ and $$$5$$$ centimeters.In the third example, Masha can take $$$33$$$ minutes to increase one of the $$$10$$$ centimeters sticks by $$$33$$$ centimeters, and after that take $$$48$$$ minutes to increase another $$$10$$$ centimeters stick by $$$48$$$ centimeters. This way she can form a triangle with lengths $$$43$$$, $$$58$$$ and $$$100$$$ centimeters in $$$81$$$ minutes. One can show that it is impossible to get a valid triangle faster.","exec_outcome":"","difficulty":800.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The only line contains tree integers $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \\leq a, b, c \\leq 100$$$)\u00a0\u2014 the lengths of sticks Masha possesses.","prob_desc_sample_outputs":"[\"0\", \"1\", \"81\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"3 4 5\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 5 3\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"100 10 10\\r\\n\", \"output\": [\"81\"]}, {\"input\": \"1 1 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"100 100 100\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"100 1 1\\r\\n\", \"output\": [\"99\"]}, {\"input\": \"12 34 56\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"68 1 67\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"100 100 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"100 1 99\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"23 56 33\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"98 12 23\\r\\n\", \"output\": [\"64\"]}, {\"input\": \"88 2 6\\r\\n\", \"output\": [\"81\"]}, {\"input\": \"1 50 87\\r\\n\", \"output\": [\"37\"]}, {\"input\": \"1 50 100\\r\\n\", \"output\": [\"50\"]}, {\"input\": \"1 92 13\\r\\n\", \"output\": [\"79\"]}, {\"input\": \"56 42 87\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"100 100 99\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3 1 1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"14 21 76\\r\\n\", \"output\": [\"42\"]}, {\"input\": \"1 7 35\\r\\n\", \"output\": [\"28\"]}, {\"input\": \"86 43 10\\r\\n\", \"output\": [\"34\"]}, {\"input\": \"2 10 2\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"32 99 10\\r\\n\", \"output\": [\"58\"]}, {\"input\": \"2 3 6\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"4 5 6\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"4 2 7\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"2 5 2\\r\\n\", \"output\": [\"2\"]}]"} {"prob_desc_description":"Hasan loves playing games and has recently discovered a game called TopScore. In this soccer-like game there are $$$p$$$ players doing penalty shoot-outs. Winner is the one who scores the most. In case of ties, one of the top-scorers will be declared as the winner randomly with equal probability.They have just finished the game and now are waiting for the result. But there's a tiny problem! The judges have lost the paper of scores! Fortunately they have calculated sum of the scores before they get lost and also for some of the players they have remembered a lower bound on how much they scored. However, the information about the bounds is private, so Hasan only got to know his bound.According to the available data, he knows that his score is at least $$$r$$$ and sum of the scores is $$$s$$$.Thus the final state of the game can be represented in form of sequence of $$$p$$$ integers $$$a_1, a_2, \\dots, a_p$$$ ($$$0 \\le a_i$$$) \u2014 player's scores. Hasan is player number $$$1$$$, so $$$a_1 \\ge r$$$. Also $$$a_1 + a_2 + \\dots + a_p = s$$$. Two states are considered different if there exists some position $$$i$$$ such that the value of $$$a_i$$$ differs in these states. Once again, Hasan doesn't know the exact scores (he doesn't know his exact score as well). So he considers each of the final states to be equally probable to achieve.Help Hasan find the probability of him winning.It can be shown that it is in the form of $$$\\frac{P}{Q}$$$ where $$$P$$$ and $$$Q$$$ are non-negative integers and $$$Q \\ne 0$$$, $$$P \\le Q$$$. Report the value of $$$P \\cdot Q^{-1} \\pmod {998244353}$$$.","prob_desc_output_spec":"Print a single integer \u2014 the probability of Hasan winning. It can be shown that it is in the form of $$$\\frac{P}{Q}$$$ where $$$P$$$ and $$$Q$$$ are non-negative integers and $$$Q \\ne 0$$$, $$$P \\le Q$$$. Report the value of $$$P \\cdot Q^{-1} \\pmod {998244353}$$$.","lang_cluster":"","src_uid":"609195ef4a970c62a8210dafe118580e","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","probabilities","combinatorics","dp"],"prob_desc_created_at":"1546007700","prob_desc_sample_inputs":"[\"2 6 3\", \"5 20 11\", \"10 30 10\"]","prob_desc_notes":"NoteIn the first example Hasan can score $$$3$$$, $$$4$$$, $$$5$$$ or $$$6$$$ goals. If he scores $$$4$$$ goals or more than he scores strictly more than his only opponent. If he scores $$$3$$$ then his opponent also scores $$$3$$$ and Hasan has a probability of $$$\\frac 1 2$$$ to win the game. Thus, overall he has the probability of $$$\\frac 7 8$$$ to win.In the second example even Hasan's lower bound on goal implies him scoring more than any of his opponents. Thus, the resulting probability is $$$1$$$.","exec_outcome":"","difficulty":2500.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"3 seconds","prob_desc_input_spec":"The only line contains three integers $$$p$$$, $$$s$$$ and $$$r$$$ ($$$1 \\le p \\le 100$$$, $$$0 \\le r \\le s \\le 5000$$$) \u2014 the number of players, the sum of scores of all players and Hasan's score, respectively.","prob_desc_sample_outputs":"[\"124780545\", \"1\", \"85932500\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2 6 3\\r\\n\", \"output\": [\"124780545\"]}, {\"input\": \"5 20 11\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"10 30 10\\r\\n\", \"output\": [\"85932500\"]}, {\"input\": \"100 0 0\\r\\n\", \"output\": [\"828542813\"]}, {\"input\": \"100 1 0\\r\\n\", \"output\": [\"828542813\"]}, {\"input\": \"1 5000 0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 5000 4999\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 4999 0\\r\\n\", \"output\": [\"499122177\"]}, {\"input\": \"83 2813 123\\r\\n\", \"output\": [\"758958584\"]}, {\"input\": \"100 5000 5000\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"100 5000 30\\r\\n\", \"output\": [\"860412292\"]}, {\"input\": \"100 5000 0\\r\\n\", \"output\": [\"828542813\"]}, {\"input\": \"1 0 0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 1 0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 1 0\\r\\n\", \"output\": [\"499122177\"]}, {\"input\": \"45 2315 860\\r\\n\", \"output\": [\"256332294\"]}, {\"input\": \"69 813 191\\r\\n\", \"output\": [\"367363860\"]}, {\"input\": \"93 2364 1182\\r\\n\", \"output\": [\"952630216\"]}, {\"input\": \"21 862 387\\r\\n\", \"output\": [\"910580465\"]}, {\"input\": \"45 886 245\\r\\n\", \"output\": [\"23345522\"]}, {\"input\": \"45 2315 2018\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"69 813 598\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"93 2364 2364\\r\\n\", \"output\": [\"1\"]}]"} {"prob_desc_description":"Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last character of the word to the beginning of the word. He calls this a cyclic shift. He can apply cyclic shift many times. For example, consecutively applying cyclic shift operation to the word \"abracadabra\" Hongcow will get words \"aabracadabr\", \"raabracadab\" and so on.Hongcow is now wondering how many distinct words he can generate by doing the cyclic shift arbitrarily many times. The initial string is also counted.","prob_desc_output_spec":"Output a single integer equal to the number of distinct strings that Hongcow can obtain by applying the cyclic shift arbitrarily many times to the given string.","lang_cluster":"","src_uid":"8909ac99ed4ab2ee4d681ec864c7831e","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["strings","implementation"],"prob_desc_created_at":"1481992500","prob_desc_sample_inputs":"[\"abcd\", \"bbb\", \"yzyz\"]","prob_desc_notes":"NoteFor the first sample, the strings Hongcow can generate are \"abcd\", \"dabc\", \"cdab\", and \"bcda\".For the second sample, no matter how many times Hongcow does the cyclic shift, Hongcow can only generate \"bbb\".For the third sample, the two strings Hongcow can generate are \"yzyz\" and \"zyzy\".","exec_outcome":"","difficulty":900.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line of input will be a single string s (1\u2009\u2264\u2009|s|\u2009\u2264\u200950), the word Hongcow initially learns how to spell. The string s consists only of lowercase English letters ('a'\u2013'z').","prob_desc_sample_outputs":"[\"4\", \"1\", \"2\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"abcd\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"bbb\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"yzyz\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"abcdefghijklmnopqrstuvwxyabcdefghijklmnopqrstuvwxy\\r\\n\", \"output\": [\"25\"]}, {\"input\": \"zclkjadoprqronzclkjadoprqronzclkjadoprqron\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"xyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxy\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"y\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"ervbfotfedpozygoumbmxeaqegouaqqzqerlykhmvxvvlcaos\\r\\n\", \"output\": [\"49\"]}, {\"input\": \"zyzzzyyzyyyzyyzyzyzyzyzzzyyyzzyzyyzzzzzyyyzzzzyzyy\\r\\n\", \"output\": [\"50\"]}, {\"input\": \"zzfyftdezzfyftdezzfyftdezzfyftdezzfyftdezzfyftde\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"yehcqdlllqpuxdsaicyjjxiylahgxbygmsopjbxhtimzkashs\\r\\n\", \"output\": [\"49\"]}, {\"input\": \"yyyyzzzyzzzyzyzyzyyyyyzzyzyzyyyyyzyzyyyzyzzyyzzzz\\r\\n\", \"output\": [\"49\"]}, {\"input\": \"zkqcrhzlzsnwzkqcrhzlzsnwzkqcrhzlzsnwzkqcrhzlzsnw\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"xxyxxyxxyxxyxxyxxyxxyxxyxxyxxyxxyxxyxxyxxyxxyxxy\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"aaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaab\\r\\n\", \"output\": [\"25\"]}, {\"input\": \"aabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaaba\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"pqqpqqpqqpqqpqqpqqpqqpqqpqqpqqpqqppqppqppqppqppq\\r\\n\", \"output\": [\"48\"]}, {\"input\": \"zxkljaqzxkljaqzxkljaqzxkljaqzxrljaqzxkljaqzxkljaq\\r\\n\", \"output\": [\"49\"]}, {\"input\": \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx\\r\\n\", \"output\": [\"50\"]}, {\"input\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz\\r\\n\", \"output\": [\"50\"]}, {\"input\": \"abcddcba\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"aabaabaabaacaabaabaabaacaabaabaabaacaabaabaabaac\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"aabaabcaabaabcdaabaabcaabaabcd\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"ababaababaaababaababaaaababaababaaababaababaaaa\\r\\n\", \"output\": [\"47\"]}, {\"input\": \"ababaababaaababaababaaaababaababaaababaababaaa\\r\\n\", \"output\": [\"23\"]}, {\"input\": \"aaababaab\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"aba\\r\\n\", \"output\": [\"3\"]}]"} {"prob_desc_description":"One day Kefa found n baloons. For convenience, we denote color of i-th baloon as si \u2014 lowercase letter of the Latin alphabet. Also Kefa has k friends. Friend will be upset, If he get two baloons of the same color. Kefa want to give out all baloons to his friends. Help Kefa to find out, can he give out all his baloons, such that no one of his friens will be upset \u2014 print \u00abYES\u00bb, if he can, and \u00abNO\u00bb, otherwise. Note, that Kefa's friend will not upset, if he doesn't get baloons at all.","prob_desc_output_spec":"Answer to the task \u2014 \u00abYES\u00bb or \u00abNO\u00bb in a single line. You can choose the case (lower or upper) for each letter arbitrary.","lang_cluster":"","src_uid":"ceb3807aaffef60bcdbcc9a17a1391be","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force","implementation"],"prob_desc_created_at":"1503068700","prob_desc_sample_inputs":"[\"4 2\\naabb\", \"6 3\\naacaab\"]","prob_desc_notes":"NoteIn the first sample Kefa can give 1-st and 3-rd baloon to the first friend, and 2-nd and 4-th to the second.In the second sample Kefa needs to give to all his friends baloons of color a, but one baloon will stay, thats why answer is \u00abNO\u00bb.","exec_outcome":"","difficulty":900.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line contains two integers n and k (1\u2009\u2264\u2009n,\u2009k\u2009\u2264\u2009100) \u2014 the number of baloons and friends. Next line contains string s \u2014 colors of baloons.","prob_desc_sample_outputs":"[\"YES\", \"NO\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"4 2\\r\\naabb\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"6 3\\r\\naacaab\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"2 2\\r\\nlu\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"5 3\\r\\novvoo\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"36 13\\r\\nbzbzcffczzcbcbzzfzbbfzfzzbfbbcbfccbf\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"81 3\\r\\nooycgmvvrophvcvpoupepqllqttwcocuilvyxbyumdmmfapvpnxhjhxfuagpnntonibicaqjvwfhwxhbv\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"100 100\\r\\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 1\\r\\nnubcvvjvbjgnjsdkajimdcxvewbcytvfkihunycdrlconddlwgzjasjlsrttlrzsumzpyumpveglfqzmaofbshbojmwuwoxxvrod\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"100 13\\r\\nvyldolgryldqrvoldvzvrdrgorlorszddtgqvrlisxxrxdxlqtvtgsrqlzixoyrozxzogqxlsgzdddzqrgitxxritoolzolgrtvl\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"18 6\\r\\njzwtnkvmscqhmdlsxy\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"21 2\\r\\nfscegcqgzesefghhwcexs\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"32 22\\r\\ncduamsptaklqtxlyoutlzepxgyfkvngc\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"49 27\\r\\noxyorfnkzwsfllnyvdhdanppuzrnbxehugvmlkgeymqjlmfxd\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"50 24\\r\\nxxutzjwbggcwvxztttkmzovtmuwttzcbwoztttohzzxghuuthv\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"57 35\\r\\nglxshztrqqfyxthqamagvtmrdparhelnzrqvcwqxjytkbuitovkdxueul\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"75 23\\r\\nittttiiuitutuiiuuututiuttiuiuutuuuiuiuuuuttuuttuutuiiuiuiiuiitttuututuiuuii\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"81 66\\r\\nfeqevfqfebhvubhuuvfuqheuqhbeeuebehuvhffvbqvqvfbqqvvhevqffbqqhvvqhfeehuhqeqhueuqqq\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"93 42\\r\\npqeiafraiavfcteumflpcbpozcomlvpovlzdbldvoopnhdoeqaopzthiuzbzmeieiatthdeqovaqfipqlddllmfcrrnhb\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 53\\r\\nizszyqyndzwzyzgsdagdwdazadiawizinagqqgczaqqnawgijziziawzszdjdcqjdjqiwgadydcnqisaayjiqqsscwwzjzaycwwc\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 14\\r\\nvkrdcqbvkwuckpmnbydmczdxoagdsgtqxvhaxntdcxhjcrjyvukhugoglbmyoaqexgtcfdgemmizoniwtmisqqwcwfusmygollab\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 42\\r\\naaaaaiiiiaiiiaaiaiiaaiiiiiaaaaaiaiiiaiiiiaiiiaaaaaiiiaaaiiaaiiiaiiiaiaaaiaiiiiaaiiiaiiaiaiiaiiiaaaia\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"100 89\\r\\ntjbkmydejporbqhcbztkcumxjjgsrvxpuulbhzeeckkbchpbxwhedrlhjsabcexcohgdzouvsgphjdthpuqrlkgzxvqbuhqxdsmf\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 100\\r\\njhpyiuuzizhubhhpxbbhpyxzhbpjphzppuhiahihiappbhuypyauhizpbibzixjbzxzpbphuiaypyujappuxiyuyaajaxjupbahb\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 3\\r\\nsszoovvzysavsvzsozzvoozvysozsaszayaszasaysszzzysosyayyvzozovavzoyavsooaoyvoozvvozsaosvayyovazzszzssa\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"100 44\\r\\ndluthkxwnorabqsukgnxnvhmsmzilyulpursnxkdsavgemiuizbyzebhyjejgqrvuckhaqtuvdmpziesmpmewpvozdanjyvwcdgo\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 90\\r\\ntljonbnwnqounictqqctgonktiqoqlocgoblngijqokuquoolciqwnctgoggcbojtwjlculoikbggquqncittwnjbkgkgubnioib\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 79\\r\\nykxptzgvbqxlregvkvucewtydvnhqhuggdsyqlvcfiuaiddnrrnstityyehiamrggftsqyduwxpuldztyzgmfkehprrneyvtknmf\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 79\\r\\naagwekyovbviiqeuakbqbqifwavkfkutoriovgfmittulhwojaptacekdirgqoovlleeoqkkdukpadygfwavppohgdrmymmulgci\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 93\\r\\nearrehrehenaddhdnrdddhdahnadndheeennrearrhraharddreaeraddhehhhrdnredanndneheddrraaneerreedhnadnerhdn\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 48\\r\\nbmmaebaebmmmbbmxvmammbvvebvaemvbbaxvbvmaxvvmveaxmbbxaaemxmxvxxxvxbmmxaaaevvaxmvamvvmaxaxavexbmmbmmev\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 55\\r\\nhsavbkehaaesffaeeffakhkhfehbbvbeasahbbbvkesbfvkefeesesevbsvfkbffakvshsbkahfkfakebsvafkbvsskfhfvaasss\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 2\\r\\ncscffcffsccffsfsfffccssfsscfsfsssffcffsscfccssfffcfscfsscsccccfsssffffcfcfsfffcsfsccffscffcfccccfffs\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"100 3\\r\\nzrgznxgdpgfoiifrrrsjfuhvtqxjlgochhyemismjnanfvvpzzvsgajcbsulxyeoepjfwvhkqogiiwqxjkrpsyaqdlwffoockxnc\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"100 5\\r\\njbltyyfjakrjeodqepxpkjideulofbhqzxjwlarufwzwsoxhaexpydpqjvhybmvjvntuvhvflokhshpicbnfgsqsmrkrfzcrswwi\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"100 1\\r\\nfnslnqktlbmxqpvcvnemxcutebdwepoxikifkzaaixzzydffpdxodmsxjribmxuqhueifdlwzytxkklwhljswqvlejedyrgguvah\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"100 21\\r\\nddjenetwgwmdtjbpzssyoqrtirvoygkjlqhhdcjgeurqpunxpupwaepcqkbjjfhnvgpyqnozhhrmhfwararmlcvpgtnopvjqsrka\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 100\\r\\nnjrhiauqlgkkpkuvciwzivjbbplipvhslqgdkfnmqrxuxnycmpheenmnrglotzuyxycosfediqcuadklsnzjqzfxnbjwvfljnlvq\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 100\\r\\nbbbbbbbtbbttbtbbbttbttbtbbttttbbbtbttbbbtbttbtbbttttbbbbbtbbttbtbbtbttbbbtbtbtbtbtbtbbbttbbtbtbtbbtb\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"14 5\\r\\nfssmmsfffmfmmm\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"2 1\\r\\nff\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"2 1\\r\\nhw\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"2 2\\r\\nss\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"1 1\\r\\nl\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 50\\r\\nfffffttttttjjjuuuvvvvvdddxxxxwwwwgggbsssncccczzyyyyyhhhhhkrreeeeeeaaaaaiiillllllllooooqqqqqqmmpppppp\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 50\\r\\nbbbbbbbbgggggggggggaaaaaaaahhhhhhhhhhpppppppppsssssssrrrrrrrrllzzzzzzzeeeeeeekkkkkkkwwwwwwwwjjjjjjjj\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 50\\r\\nwwwwwwwwwwwwwwxxxxxxxxxxxxxxxxxxxxxxxxzzzzzzzzzzzzzzzzzzbbbbbbbbbbbbbbbbbbbbjjjjjjjjjjjjjjjjjjjjjjjj\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 80\\r\\nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 10\\r\\nbbttthhhhiiiiiiijjjjjvvvvpppssssseeeeeeewwwwgggkkkkkkkkmmmddddduuuzzzzllllnnnnnxxyyyffffccraaaaooooq\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"100 20\\r\\nssssssssssbbbbbbbhhhhhhhyyyyyyyzzzzzzzzzzzzcccccxxxxxxxxxxddddmmmmmmmeeeeeeejjjjjjjjjwwwwwwwtttttttt\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"1 2\\r\\na\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"3 1\\r\\nabb\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"2 1\\r\\naa\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"2 1\\r\\nab\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"6 2\\r\\naaaaaa\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"8 4\\r\\naaaaaaaa\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"4 2\\r\\naaaa\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"4 3\\r\\naaaa\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"1 3\\r\\na\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"4 3\\r\\nzzzz\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"4 1\\r\\naaaa\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"3 4\\r\\nabc\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"2 5\\r\\nab\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"2 4\\r\\nab\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"1 10\\r\\na\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"5 2\\r\\nzzzzz\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"53 26\\r\\naaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbb\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"4 1\\r\\nabab\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"4 1\\r\\nabcb\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"4 2\\r\\nabbb\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"5 2\\r\\nabccc\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"2 3\\r\\nab\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"4 3\\r\\nbbbs\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"10 2\\r\\nazzzzzzzzz\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"1 2\\r\\nb\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"1 3\\r\\nb\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"4 5\\r\\nabcd\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"4 6\\r\\naabb\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"5 2\\r\\naaaab\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"3 5\\r\\naaa\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"5 3\\r\\nazzzz\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"4 100\\r\\naabb\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"3 10\\r\\naaa\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"3 4\\r\\naaa\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"12 5\\r\\naaaaabbbbbbb\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"5 2\\r\\naabbb\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"10 5\\r\\nzzzzzzzzzz\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"2 4\\r\\naa\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"1 5\\r\\na\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"10 5\\r\\naaaaaaaaaa\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"6 3\\r\\naaaaaa\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"7 1\\r\\nabcdeee\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"18 3\\r\\naaaaaabbbbbbcccccc\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"8 2\\r\\naabbccdd\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"4 2\\r\\nzzzz\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"4 2\\r\\nabaa\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"3 2\\r\\naaa\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"3 1\\r\\nzzz\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"5 4\\r\\nzzzzz\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"6 2\\r\\naabbbc\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"3 6\\r\\naaa\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"2 1\\r\\nzz\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"10 3\\r\\naaaeeeeeee\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"4 5\\r\\naabb\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"3 1\\r\\naaa\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"5 2\\r\\naazzz\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"6 2\\r\\nabbbbc\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"4 2\\r\\nxxxx\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"6 3\\r\\nzzzzzz\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"3 2\\r\\nabb\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"3 2\\r\\nzzz\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"6 5\\r\\nzzzzzz\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"6 3\\r\\nbcaaaa\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"100 100\\r\\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"3 6\\r\\nabc\\r\\n\", \"output\": [\"YES\"]}]"} {"prob_desc_description":"The Floral Clock has been standing by the side of Mirror Lake for years. Though unable to keep time, it reminds people of the passage of time and the good old days.On the rim of the Floral Clock are 2n flowers, numbered from 1 to 2n clockwise, each of which has a colour among all n possible ones. For each colour, there are exactly two flowers with it, the distance between which either is less than or equal to 2, or equals n. Additionally, if flowers u and v are of the same colour, then flowers opposite to u and opposite to v should be of the same colour as well \u2014 symmetry is beautiful!Formally, the distance between two flowers is 1 plus the number of flowers on the minor arc (or semicircle) between them. Below is a possible arrangement with n\u2009=\u20096 that cover all possibilities. The beauty of an arrangement is defined to be the product of the lengths of flower segments separated by all opposite flowers of the same colour. In other words, in order to compute the beauty, we remove from the circle all flowers that have the same colour as flowers opposite to them. Then, the beauty is the product of lengths of all remaining segments. Note that we include segments of length 0 in this product. If there are no flowers that have the same colour as flower opposite to them, the beauty equals 0. For instance, the beauty of the above arrangement equals 1\u2009\u00d7\u20093\u2009\u00d7\u20091\u2009\u00d7\u20093\u2009=\u20099 \u2014 the segments are {2}, {4,\u20095,\u20096}, {8} and {10,\u200911,\u200912}.While keeping the constraints satisfied, there may be lots of different arrangements. Find out the sum of beauty over all possible arrangements, modulo 998\u2009244\u2009353. Two arrangements are considered different, if a pair (u,\u2009v) (1\u2009\u2264\u2009u,\u2009v\u2009\u2264\u20092n) exists such that flowers u and v are of the same colour in one of them, but not in the other.","prob_desc_output_spec":"Output one integer \u2014 the sum of beauty over all possible arrangements of flowers, modulo 998\u2009244\u2009353.","lang_cluster":"","src_uid":"24fd5cd218f65d4ffb7c5b97b725293e","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["divide and conquer","combinatorics","fft","dp","math"],"prob_desc_created_at":"1504272900","prob_desc_sample_inputs":"[\"3\", \"4\", \"7\", \"15\"]","prob_desc_notes":"NoteWith n\u2009=\u20093, the following six arrangements each have a beauty of 2\u2009\u00d7\u20092\u2009=\u20094. While many others, such as the left one in the figure below, have a beauty of 0. The right one is invalid, since it's asymmetric. ","exec_outcome":"","difficulty":3400.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"7 seconds","prob_desc_input_spec":"The first and only line of input contains a lonely positive integer n (3\u2009\u2264\u2009n\u2009\u2264\u200950\u2009000)\u00a0\u2014 the number of colours present on the Floral Clock.","prob_desc_sample_outputs":"[\"24\", \"4\", \"1316\", \"3436404\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"3\\r\\n\", \"output\": [\"24\"]}, {\"input\": \"4\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"7\\r\\n\", \"output\": [\"1316\"]}, {\"input\": \"15\\r\\n\", \"output\": [\"3436404\"]}, {\"input\": \"10\\r\\n\", \"output\": [\"26200\"]}, {\"input\": \"99\\r\\n\", \"output\": [\"620067986\"]}, {\"input\": \"1317\\r\\n\", \"output\": [\"414025\"]}, {\"input\": \"50000\\r\\n\", \"output\": [\"475800099\"]}, {\"input\": \"5\\r\\n\", \"output\": [\"240\"]}, {\"input\": \"6\\r\\n\", \"output\": [\"204\"]}, {\"input\": \"8\\r\\n\", \"output\": [\"2988\"]}, {\"input\": \"9\\r\\n\", \"output\": [\"6720\"]}, {\"input\": \"11\\r\\n\", \"output\": [\"50248\"]}, {\"input\": \"12\\r\\n\", \"output\": [\"174280\"]}, {\"input\": \"13\\r\\n\", \"output\": [\"436904\"]}, {\"input\": \"14\\r\\n\", \"output\": [\"1140888\"]}, {\"input\": \"16\\r\\n\", \"output\": [\"8348748\"]}, {\"input\": \"17\\r\\n\", \"output\": [\"24631232\"]}, {\"input\": \"18\\r\\n\", \"output\": [\"64575924\"]}, {\"input\": \"19\\r\\n\", \"output\": [\"174658944\"]}, {\"input\": \"20\\r\\n\", \"output\": [\"488230244\"]}, {\"input\": \"33\\r\\n\", \"output\": [\"823529776\"]}, {\"input\": \"39\\r\\n\", \"output\": [\"302870971\"]}, {\"input\": \"89\\r\\n\", \"output\": [\"530141864\"]}, {\"input\": \"144\\r\\n\", \"output\": [\"395837543\"]}, {\"input\": \"233\\r\\n\", \"output\": [\"422271260\"]}, {\"input\": \"396\\r\\n\", \"output\": [\"994574954\"]}, {\"input\": \"418\\r\\n\", \"output\": [\"57956054\"]}, {\"input\": \"431\\r\\n\", \"output\": [\"767293469\"]}, {\"input\": \"831\\r\\n\", \"output\": [\"418821250\"]}, {\"input\": \"985\\r\\n\", \"output\": [\"574051668\"]}, {\"input\": \"998\\r\\n\", \"output\": [\"452930999\"]}, {\"input\": \"1000\\r\\n\", \"output\": [\"945359814\"]}, {\"input\": \"2017\\r\\n\", \"output\": [\"222633425\"]}, {\"input\": \"3939\\r\\n\", \"output\": [\"582943734\"]}, {\"input\": \"5000\\r\\n\", \"output\": [\"148029988\"]}, {\"input\": \"8081\\r\\n\", \"output\": [\"473740780\"]}, {\"input\": \"10000\\r\\n\", \"output\": [\"938538566\"]}, {\"input\": \"10001\\r\\n\", \"output\": [\"552705744\"]}, {\"input\": \"10492\\r\\n\", \"output\": [\"914991759\"]}, {\"input\": \"20178\\r\\n\", \"output\": [\"207394683\"]}, {\"input\": \"23333\\r\\n\", \"output\": [\"259575428\"]}, {\"input\": \"25252\\r\\n\", \"output\": [\"306102706\"]}, {\"input\": \"30000\\r\\n\", \"output\": [\"583465411\"]}, {\"input\": \"35000\\r\\n\", \"output\": [\"520751787\"]}, {\"input\": \"39393\\r\\n\", \"output\": [\"929692433\"]}, {\"input\": \"40404\\r\\n\", \"output\": [\"618777849\"]}, {\"input\": \"45000\\r\\n\", \"output\": [\"672059275\"]}, {\"input\": \"49997\\r\\n\", \"output\": [\"645043850\"]}, {\"input\": \"49999\\r\\n\", \"output\": [\"791828238\"]}]"} {"prob_desc_description":"Where do odds begin, and where do they end? Where does hope emerge, and will they ever break?Given an integer sequence a1,\u2009a2,\u2009...,\u2009an of length n. Decide whether it is possible to divide it into an odd number of non-empty subsegments, the each of which has an odd length and begins and ends with odd numbers.A subsegment is a contiguous slice of the whole sequence. For example, {3,\u20094,\u20095} and {1} are subsegments of sequence {1,\u20092,\u20093,\u20094,\u20095,\u20096}, while {1,\u20092,\u20094} and {7} are not.","prob_desc_output_spec":"Output \"Yes\" if it's possible to fulfill the requirements, and \"No\" otherwise. You can output each letter in any case (upper or lower).","lang_cluster":"","src_uid":"2b8c2deb5d7e49e8e3ededabfd4427db","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["implementation"],"prob_desc_created_at":"1504272900","prob_desc_sample_inputs":"[\"3\\n1 3 5\", \"5\\n1 0 1 5 1\", \"3\\n4 3 1\", \"4\\n3 9 9 3\"]","prob_desc_notes":"NoteIn the first example, divide the sequence into 1 subsegment: {1,\u20093,\u20095} and the requirements will be met.In the second example, divide the sequence into 3 subsegments: {1,\u20090,\u20091}, {5}, {1}.In the third example, one of the subsegments must start with 4 which is an even number, thus the requirements cannot be met.In the fourth example, the sequence can be divided into 2 subsegments: {3,\u20099,\u20099}, {3}, but this is not a valid solution because 2 is an even number.","exec_outcome":"","difficulty":1000.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line of input contains a non-negative integer n (1\u2009\u2264\u2009n\u2009\u2264\u2009100) \u2014 the length of the sequence. The second line contains n space-separated non-negative integers a1,\u2009a2,\u2009...,\u2009an (0\u2009\u2264\u2009ai\u2009\u2264\u2009100) \u2014 the elements of the sequence.","prob_desc_sample_outputs":"[\"Yes\", \"Yes\", \"No\", \"No\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"3\\r\\n1 3 5\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"5\\r\\n1 0 1 5 1\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"3\\r\\n4 3 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"4\\r\\n3 9 9 3\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"1\\r\\n1\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"5\\r\\n100 99 100 99 99\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"100\\r\\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"1\\r\\n0\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"2\\r\\n1 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"2\\r\\n10 10\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"2\\r\\n54 21\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"5\\r\\n0 0 0 0 0\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"5\\r\\n67 92 0 26 43\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"15\\r\\n45 52 35 80 68 80 93 57 47 32 69 23 63 90 43\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"15\\r\\n81 28 0 82 71 64 63 89 87 92 38 30 76 72 36\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"50\\r\\n49 32 17 59 77 98 65 50 85 10 40 84 65 34 52 25 1 31 61 45 48 24 41 14 76 12 33 76 44 86 53 33 92 58 63 93 50 24 31 79 67 50 72 93 2 38 32 14 87 99\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"55\\r\\n65 69 53 66 11 100 68 44 43 17 6 66 24 2 6 6 61 72 91 53 93 61 52 96 56 42 6 8 79 49 76 36 83 58 8 43 2 90 71 49 80 21 75 13 76 54 95 61 58 82 40 33 73 61 46\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"99\\r\\n73 89 51 85 42 67 22 80 75 3 90 0 52 100 90 48 7 15 41 1 54 2 23 62 86 68 2 87 57 12 45 34 68 54 36 49 27 46 22 70 95 90 57 91 90 79 48 89 67 92 28 27 25 37 73 66 13 89 7 99 62 53 48 24 73 82 62 88 26 39 21 86 50 95 26 27 60 6 56 14 27 90 55 80 97 18 37 36 70 2 28 53 36 77 39 79 82 42 69\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"99\\r\\n99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"100\\r\\n61 63 34 45 20 91 31 28 40 27 94 1 73 5 69 10 56 94 80 23 79 99 59 58 13 56 91 59 77 78 88 72 80 72 70 71 63 60 41 41 41 27 83 10 43 14 35 48 0 78 69 29 63 33 42 67 1 74 51 46 79 41 37 61 16 29 82 28 22 14 64 49 86 92 82 55 54 24 75 58 95 31 3 34 26 23 78 91 49 6 30 57 27 69 29 54 42 0 61 83\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"6\\r\\n1 2 2 2 2 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"3\\r\\n1 2 1\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"4\\r\\n1 3 2 3\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"6\\r\\n1 1 1 1 1 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"6\\r\\n1 1 0 0 1 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"4\\r\\n1 4 9 3\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"4\\r\\n1 0 1 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"10\\r\\n1 0 0 1 1 1 1 1 1 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"10\\r\\n9 2 5 7 8 3 1 9 4 9\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"99\\r\\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"6\\r\\n1 2 1 2 2 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"6\\r\\n1 0 1 0 0 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"4\\r\\n1 3 4 7\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"8\\r\\n1 1 1 2 1 1 1 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"3\\r\\n1 1 2\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"5\\r\\n1 2 1 2 1\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"5\\r\\n5 4 4 2 1\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"6\\r\\n1 3 3 3 3 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"7\\r\\n1 2 1 2 2 2 1\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"4\\r\\n1 2 2 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"6\\r\\n1 2 3 4 6 5\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"5\\r\\n1 1 2 2 2\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"5\\r\\n1 0 0 1 1\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"3\\r\\n1 2 4\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"3\\r\\n1 0 2\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"5\\r\\n1 1 1 0 1\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"4\\r\\n3 9 2 3\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"6\\r\\n1 1 1 4 4 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"6\\r\\n1 2 3 5 6 7\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"6\\r\\n1 1 1 2 2 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"6\\r\\n1 1 1 0 0 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"5\\r\\n1 2 2 5 5\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"5\\r\\n1 3 2 4 5\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"8\\r\\n1 2 3 5 7 8 8 5\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"10\\r\\n1 1 1 2 1 1 1 1 1 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"4\\r\\n1 0 0 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"7\\r\\n1 0 1 1 0 0 1\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"7\\r\\n1 4 5 7 6 6 3\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"4\\r\\n2 2 2 2\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"5\\r\\n2 3 4 5 6\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"4\\r\\n1 1 2 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"3\\r\\n1 2 3\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"6\\r\\n1 3 3 2 2 3\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"4\\r\\n1 1 2 3\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"4\\r\\n1 2 3 5\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"5\\r\\n3 4 4 3 3\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"4\\r\\n3 2 2 3\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"6\\r\\n1 1 1 1 2 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"6\\r\\n1 1 2 2 1 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"10\\r\\n3 4 2 4 3 2 2 4 4 3\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"7\\r\\n1 2 4 3 2 4 5\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"28\\r\\n75 51 25 52 13 7 34 29 5 59 68 56 13 2 9 37 59 83 18 32 36 30 20 43 92 76 78 67\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"79\\r\\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 18\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"100\\r\\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\\r\\n\", \"output\": [\"No\", \"NO\"]}]"} {"prob_desc_description":"Nikolay has a lemons, b apples and c pears. He decided to cook a compote. According to the recipe the fruits should be in the ratio 1:\u20092:\u20094. It means that for each lemon in the compote should be exactly 2 apples and exactly 4 pears. You can't crumble up, break up or cut these fruits into pieces. These fruits\u00a0\u2014 lemons, apples and pears\u00a0\u2014 should be put in the compote as whole fruits.Your task is to determine the maximum total number of lemons, apples and pears from which Nikolay can cook the compote. It is possible that Nikolay can't use any fruits, in this case print 0. ","prob_desc_output_spec":"Print the maximum total number of lemons, apples and pears from which Nikolay can cook the compote.","lang_cluster":"","src_uid":"82a4a60eac90765fb62f2a77d2305c01","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","implementation"],"prob_desc_created_at":"1482057300","prob_desc_sample_inputs":"[\"2\\n5\\n7\", \"4\\n7\\n13\", \"2\\n3\\n2\"]","prob_desc_notes":"NoteIn the first example Nikolay can use 1 lemon, 2 apples and 4 pears, so the answer is 1\u2009+\u20092\u2009+\u20094\u2009=\u20097.In the second example Nikolay can use 3 lemons, 6 apples and 12 pears, so the answer is 3\u2009+\u20096\u2009+\u200912\u2009=\u200921.In the third example Nikolay don't have enough pears to cook any compote, so the answer is 0. ","exec_outcome":"","difficulty":800.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line contains the positive integer a (1\u2009\u2264\u2009a\u2009\u2264\u20091000)\u00a0\u2014 the number of lemons Nikolay has. The second line contains the positive integer b (1\u2009\u2264\u2009b\u2009\u2264\u20091000)\u00a0\u2014 the number of apples Nikolay has. The third line contains the positive integer c (1\u2009\u2264\u2009c\u2009\u2264\u20091000)\u00a0\u2014 the number of pears Nikolay has.","prob_desc_sample_outputs":"[\"7\", \"21\", \"0\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2\\r\\n5\\r\\n7\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"4\\r\\n7\\r\\n13\\r\\n\", \"output\": [\"21\"]}, {\"input\": \"2\\r\\n3\\r\\n2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1\\r\\n1\\r\\n1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1\\r\\n2\\r\\n4\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"1000\\r\\n1000\\r\\n1000\\r\\n\", \"output\": [\"1750\"]}, {\"input\": \"1\\r\\n1\\r\\n4\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1\\r\\n2\\r\\n3\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1\\r\\n1000\\r\\n1000\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"1000\\r\\n1\\r\\n1000\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1000\\r\\n2\\r\\n1000\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"1000\\r\\n500\\r\\n1000\\r\\n\", \"output\": [\"1750\"]}, {\"input\": \"1000\\r\\n1000\\r\\n4\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"1000\\r\\n1000\\r\\n3\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"4\\r\\n8\\r\\n12\\r\\n\", \"output\": [\"21\"]}, {\"input\": \"10\\r\\n20\\r\\n40\\r\\n\", \"output\": [\"70\"]}, {\"input\": \"100\\r\\n200\\r\\n399\\r\\n\", \"output\": [\"693\"]}, {\"input\": \"200\\r\\n400\\r\\n800\\r\\n\", \"output\": [\"1400\"]}, {\"input\": \"199\\r\\n400\\r\\n800\\r\\n\", \"output\": [\"1393\"]}, {\"input\": \"201\\r\\n400\\r\\n800\\r\\n\", \"output\": [\"1400\"]}, {\"input\": \"200\\r\\n399\\r\\n800\\r\\n\", \"output\": [\"1393\"]}, {\"input\": \"200\\r\\n401\\r\\n800\\r\\n\", \"output\": [\"1400\"]}, {\"input\": \"200\\r\\n400\\r\\n799\\r\\n\", \"output\": [\"1393\"]}, {\"input\": \"200\\r\\n400\\r\\n801\\r\\n\", \"output\": [\"1400\"]}, {\"input\": \"139\\r\\n252\\r\\n871\\r\\n\", \"output\": [\"882\"]}, {\"input\": \"109\\r\\n346\\r\\n811\\r\\n\", \"output\": [\"763\"]}, {\"input\": \"237\\r\\n487\\r\\n517\\r\\n\", \"output\": [\"903\"]}, {\"input\": \"161\\r\\n331\\r\\n725\\r\\n\", \"output\": [\"1127\"]}, {\"input\": \"39\\r\\n471\\r\\n665\\r\\n\", \"output\": [\"273\"]}, {\"input\": \"9\\r\\n270\\r\\n879\\r\\n\", \"output\": [\"63\"]}, {\"input\": \"137\\r\\n422\\r\\n812\\r\\n\", \"output\": [\"959\"]}, {\"input\": \"15\\r\\n313\\r\\n525\\r\\n\", \"output\": [\"105\"]}, {\"input\": \"189\\r\\n407\\r\\n966\\r\\n\", \"output\": [\"1323\"]}, {\"input\": \"18\\r\\n268\\r\\n538\\r\\n\", \"output\": [\"126\"]}, {\"input\": \"146\\r\\n421\\r\\n978\\r\\n\", \"output\": [\"1022\"]}, {\"input\": \"70\\r\\n311\\r\\n685\\r\\n\", \"output\": [\"490\"]}, {\"input\": \"244\\r\\n405\\r\\n625\\r\\n\", \"output\": [\"1092\"]}, {\"input\": \"168\\r\\n454\\r\\n832\\r\\n\", \"output\": [\"1176\"]}, {\"input\": \"46\\r\\n344\\r\\n772\\r\\n\", \"output\": [\"322\"]}, {\"input\": \"174\\r\\n438\\r\\n987\\r\\n\", \"output\": [\"1218\"]}, {\"input\": \"144\\r\\n387\\r\\n693\\r\\n\", \"output\": [\"1008\"]}, {\"input\": \"22\\r\\n481\\r\\n633\\r\\n\", \"output\": [\"154\"]}, {\"input\": \"196\\r\\n280\\r\\n848\\r\\n\", \"output\": [\"980\"]}, {\"input\": \"190\\r\\n454\\r\\n699\\r\\n\", \"output\": [\"1218\"]}, {\"input\": \"231\\r\\n464\\r\\n928\\r\\n\", \"output\": [\"1617\"]}, {\"input\": \"151\\r\\n308\\r\\n616\\r\\n\", \"output\": [\"1057\"]}, {\"input\": \"88\\r\\n182\\r\\n364\\r\\n\", \"output\": [\"616\"]}, {\"input\": \"12\\r\\n26\\r\\n52\\r\\n\", \"output\": [\"84\"]}, {\"input\": \"204\\r\\n412\\r\\n824\\r\\n\", \"output\": [\"1428\"]}, {\"input\": \"127\\r\\n256\\r\\n512\\r\\n\", \"output\": [\"889\"]}, {\"input\": \"224\\r\\n446\\r\\n896\\r\\n\", \"output\": [\"1561\"]}, {\"input\": \"146\\r\\n291\\r\\n584\\r\\n\", \"output\": [\"1015\"]}, {\"input\": \"83\\r\\n164\\r\\n332\\r\\n\", \"output\": [\"574\"]}, {\"input\": \"20\\r\\n38\\r\\n80\\r\\n\", \"output\": [\"133\"]}, {\"input\": \"198\\r\\n393\\r\\n792\\r\\n\", \"output\": [\"1372\"]}, {\"input\": \"120\\r\\n239\\r\\n480\\r\\n\", \"output\": [\"833\"]}, {\"input\": \"208\\r\\n416\\r\\n831\\r\\n\", \"output\": [\"1449\"]}, {\"input\": \"130\\r\\n260\\r\\n517\\r\\n\", \"output\": [\"903\"]}, {\"input\": \"67\\r\\n134\\r\\n267\\r\\n\", \"output\": [\"462\"]}, {\"input\": \"245\\r\\n490\\r\\n979\\r\\n\", \"output\": [\"1708\"]}, {\"input\": \"182\\r\\n364\\r\\n727\\r\\n\", \"output\": [\"1267\"]}, {\"input\": \"104\\r\\n208\\r\\n413\\r\\n\", \"output\": [\"721\"]}, {\"input\": \"10\\r\\n2\\r\\n100\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"2\\r\\n100\\r\\n100\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"2\\r\\n3\\r\\n8\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"1\\r\\n2\\r\\n8\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"1\\r\\n2\\r\\n200\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"5\\r\\n4\\r\\n16\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"1\\r\\n10\\r\\n10\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"1\\r\\n4\\r\\n8\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"100\\r\\n4\\r\\n1000\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"2\\r\\n6\\r\\n12\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"10\\r\\n7\\r\\n4\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"2\\r\\n10\\r\\n100\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"2\\r\\n3\\r\\n4\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"1\\r\\n2\\r\\n999\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"1\\r\\n10\\r\\n20\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"100\\r\\n18\\r\\n20\\r\\n\", \"output\": [\"35\"]}, {\"input\": \"100\\r\\n1\\r\\n100\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3\\r\\n7\\r\\n80\\r\\n\", \"output\": [\"21\"]}, {\"input\": \"2\\r\\n8\\r\\n24\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"1\\r\\n100\\r\\n100\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"2\\r\\n1\\r\\n8\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"10\\r\\n5\\r\\n23\\r\\n\", \"output\": [\"14\"]}]"} {"prob_desc_description":"A big company decided to launch a new series of rectangular displays, and decided that the display must have exactly n pixels. Your task is to determine the size of the rectangular display \u2014 the number of lines (rows) of pixels a and the number of columns of pixels b, so that: there are exactly n pixels on the display; the number of rows does not exceed the number of columns, it means a\u2009\u2264\u2009b; the difference b\u2009-\u2009a is as small as possible. ","prob_desc_output_spec":"Print two integers\u00a0\u2014 the number of rows and columns on the display. ","lang_cluster":"","src_uid":"f52af273954798a4ae38a1378bfbf77a","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force","math"],"prob_desc_created_at":"1482113100","prob_desc_sample_inputs":"[\"8\", \"64\", \"5\", \"999999\"]","prob_desc_notes":"NoteIn the first example the minimum possible difference equals 2, so on the display should be 2 rows of 4 pixels.In the second example the minimum possible difference equals 0, so on the display should be 8 rows of 8 pixels.In the third example the minimum possible difference equals 4, so on the display should be 1 row of 5 pixels.","exec_outcome":"","difficulty":800.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line contains the positive integer n (1\u2009\u2264\u2009n\u2009\u2264\u2009106)\u00a0\u2014 the number of pixels display should have.","prob_desc_sample_outputs":"[\"2 4\", \"8 8\", \"1 5\", \"999 1001\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"8\\r\\n\", \"output\": [\"2 4\"]}, {\"input\": \"64\\r\\n\", \"output\": [\"8 8\"]}, {\"input\": \"5\\r\\n\", \"output\": [\"1 5\"]}, {\"input\": \"999999\\r\\n\", \"output\": [\"999 1001\"]}, {\"input\": \"716539\\r\\n\", \"output\": [\"97 7387\"]}, {\"input\": \"1\\r\\n\", \"output\": [\"1 1\"]}, {\"input\": \"2\\r\\n\", \"output\": [\"1 2\"]}, {\"input\": \"3\\r\\n\", \"output\": [\"1 3\"]}, {\"input\": \"4\\r\\n\", \"output\": [\"2 2\"]}, {\"input\": \"6\\r\\n\", \"output\": [\"2 3\"]}, {\"input\": \"7\\r\\n\", \"output\": [\"1 7\"]}, {\"input\": \"9\\r\\n\", \"output\": [\"3 3\"]}, {\"input\": \"10\\r\\n\", \"output\": [\"2 5\"]}, {\"input\": \"11\\r\\n\", \"output\": [\"1 11\"]}, {\"input\": \"12\\r\\n\", \"output\": [\"3 4\"]}, {\"input\": \"15\\r\\n\", \"output\": [\"3 5\"]}, {\"input\": \"100\\r\\n\", \"output\": [\"10 10\"]}, {\"input\": \"101\\r\\n\", \"output\": [\"1 101\"]}, {\"input\": \"169\\r\\n\", \"output\": [\"13 13\"]}, {\"input\": \"179\\r\\n\", \"output\": [\"1 179\"]}, {\"input\": \"190\\r\\n\", \"output\": [\"10 19\"]}, {\"input\": \"1000\\r\\n\", \"output\": [\"25 40\"]}, {\"input\": \"10000\\r\\n\", \"output\": [\"100 100\"]}, {\"input\": \"10001\\r\\n\", \"output\": [\"73 137\"]}, {\"input\": \"100000\\r\\n\", \"output\": [\"250 400\"]}, {\"input\": \"100001\\r\\n\", \"output\": [\"11 9091\"]}, {\"input\": \"1000000\\r\\n\", \"output\": [\"1000 1000\"]}, {\"input\": \"999983\\r\\n\", \"output\": [\"1 999983\"]}, {\"input\": \"524288\\r\\n\", \"output\": [\"512 1024\"]}, {\"input\": \"954493\\r\\n\", \"output\": [\"971 983\"]}, {\"input\": \"966289\\r\\n\", \"output\": [\"983 983\"]}, {\"input\": \"944663\\r\\n\", \"output\": [\"961 983\"]}, {\"input\": \"912673\\r\\n\", \"output\": [\"97 9409\"]}, {\"input\": \"732641\\r\\n\", \"output\": [\"679 1079\"]}, {\"input\": \"232897\\r\\n\", \"output\": [\"343 679\"]}, {\"input\": \"16807\\r\\n\", \"output\": [\"49 343\"]}, {\"input\": \"999958\\r\\n\", \"output\": [\"2 499979\"]}, {\"input\": \"990151\\r\\n\", \"output\": [\"1 990151\"]}, {\"input\": \"997002\\r\\n\", \"output\": [\"998 999\"]}, {\"input\": \"20\\r\\n\", \"output\": [\"4 5\"]}, {\"input\": \"20261\\r\\n\", \"output\": [\"1 20261\"]}, {\"input\": \"999123\\r\\n\", \"output\": [\"3 333041\"]}, {\"input\": \"901841\\r\\n\", \"output\": [\"1 901841\"]}]"} {"prob_desc_description":"Pupils decided to go to amusement park. Some of them were with parents. In total, n people came to the park and they all want to get to the most extreme attraction and roll on it exactly once.Tickets for group of x people are sold on the attraction, there should be at least one adult in each group (it is possible that the group consists of one adult). The ticket price for such group is c1\u2009+\u2009c2\u00b7(x\u2009-\u20091)2 (in particular, if the group consists of one person, then the price is c1). All pupils who came to the park and their parents decided to split into groups in such a way that each visitor join exactly one group, and the total price of visiting the most extreme attraction is as low as possible. You are to determine this minimum possible total price. There should be at least one adult in each group. ","prob_desc_output_spec":"Print the minimum price of visiting the most extreme attraction for all pupils and their parents. Each of them should roll on the attraction exactly once.","lang_cluster":"","src_uid":"78d013b01497053b8e321fe7b6ce3760","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["ternary search"],"prob_desc_created_at":"1491406500","prob_desc_sample_inputs":"[\"3 4 1\\n011\", \"4 7 2\\n1101\"]","prob_desc_notes":"NoteIn the first test one group of three people should go to the attraction. Then they have to pay 4\u2009+\u20091\u2009*\u2009(3\u2009-\u20091)2\u2009=\u20098.In the second test it is better to go to the attraction in two groups. The first group should consist of two adults (for example, the first and the second person), the second should consist of one pupil and one adult (the third and the fourth person). Then each group will have a size of two and for each the price of ticket is 7\u2009+\u20092\u2009*\u2009(2\u2009-\u20091)2\u2009=\u20099. Thus, the total price for two groups is 18.","exec_outcome":"","difficulty":2100.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line contains three integers n, c1 and c2 (1\u2009\u2264\u2009n\u2009\u2264\u2009200\u2009000, 1\u2009\u2264\u2009c1,\u2009c2\u2009\u2264\u2009107)\u00a0\u2014 the number of visitors and parameters for determining the ticket prices for a group. The second line contains the string of length n, which consists of zeros and ones. If the i-th symbol of the string is zero, then the i-th visitor is a pupil, otherwise the i-th person is an adult. It is guaranteed that there is at least one adult. It is possible that there are no pupils.","prob_desc_sample_outputs":"[\"8\", \"18\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"3 4 1\\r\\n011\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"4 7 2\\r\\n1101\\r\\n\", \"output\": [\"18\"]}, {\"input\": \"1 2 2\\r\\n1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"2 3 10\\r\\n01\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"5 10 3\\r\\n11100\\r\\n\", \"output\": [\"35\"]}, {\"input\": \"10 2 2\\r\\n1111101111\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"20 3 13\\r\\n01111110011111010101\\r\\n\", \"output\": [\"120\"]}, {\"input\": \"50 13 44\\r\\n11101110100110111100010110001111001001110010111011\\r\\n\", \"output\": [\"1270\"]}, {\"input\": \"100 1000 1000\\r\\n0000010100101100110100101111001111111111100101111100111011110001011110110111111010000000101000111000\\r\\n\", \"output\": [\"100000\"]}, {\"input\": \"1000 10000 10000\\r\\n1111011110111111111111111111011111111001111111111111111111011111111101111111111111101011111111111011111111111111111101111111111011111111101111111111111111111111111111111110111110110111111111111101111110101111111101111111111111111111111110111111011001111011111111111110101101111111101111111101111111101111111111110101111111111111111111011011111101111101111111111111111111111111110111011100111111101111101111101101111111111111110111011111111111111111111111111111111111111111111111011111111011111...\", \"output\": [\"10000000\"]}, {\"input\": \"10000 100 1000000\\r\\n101111011011011111011111100110111001100110101111100100011101011011110110001011001101011010111110101011011101111111111010111101001110111111111010011100110111111110101101111111011010111111101111101100011000101010111101110111111101011110010100111010110011011011101111111111011011010110011010111110111101110010101011011100011110100011101100101010111100111111101111100011000110110001111111110111101110101010111110111101011111111110101001101001100111100110110000011111110001110010001011011101001110...\", \"output\": [\"3759624100\"]}, {\"input\": \"20001 1000 100\\r\\n000100010100111100011011010110111011110111110011000110010010010000110111001000010101111000110110111010101000100111100100101010101010000010111101011000010011111011110001110001110111001000110111110001011100010011001110110100010011101010001010101101000110001000001010011001100010011111001010001101111101110010001011011000101111110001111101010010101101000000100110011100100100001110111001010011110011000111100001011011111011100101100111110010011010111001001011011000111110101011000101010111000111110...\", \"output\": [\"9333800\"]}, {\"input\": \"50000 100 1000\\r\\n100001000000100000101110011001101100001101110010010001000101011000010000000000000000100111001000000100111010000110011011011011011101011100100010000010000001011010010000011100100100000010000000000001000011010011001000110110110100001001001010100011011000110010000011001000001110100100000000111110000110000010010011001111101000000000100001110001011001000011101010010100110110100011110001010000010101000111100001010110011100000100001000001010000000000100100000000110100010100010101111111010010000101...\", \"output\": [\"62539900\"]}, {\"input\": \"99999 10000 10000\\r\\n010010000000000000000001000000000001000100001000001000000010000000000110000000001000100000000000100000000000000000100010000000100000000001001010000000010000000000010110000000000000000001000010000000000000000000000000000001100000000000000100000000000000000000010010000000000000100010000100010000101001000001000001000000110000100000000000000000000000100000000000010000001000000000001000000000101000000000000000000000000000010000000001000010000100001000000100000000000000000000000100000001001000...\", \"output\": [\"6092190000\"]}, {\"input\": \"200000 1234 234123\\r\\n00000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000100000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000001000000000000000000...\", \"output\": [\"1612837280853\"]}, {\"input\": \"200000 123 1242\\r\\n00000010000000000000001000000000010000000000000000000000000000000000010000000000000000000000000000000000000000000000010000000000000000000001100000000000000000000000000000000000000000000000000000000000010000000000000000000000100000000000000000000000000000001000000000000000000000000000000000100000000000000000000010000000000000000100000000101000000000000000000000000000000000000000001000000000000000000000000100010000000100000000000000000000000000000000000100100000000010001001000001000000100000...\", \"output\": [\"4251434880\"]}, {\"input\": \"200000 10000000 10000000\\r\\n00000000000000000000001000000000000000000000001000001010000100100000000000000000001001000000000000000000000000000000000000000100000011010000000000010000000000000000000000000000000010000000000000000100000000000000000000000000000000000000000000010000000100000000000100000000000101000000000000000000100010001000001000000001010010000000000000000001000000000000000000000000000000000000000000000010000000000010000000000000000000000000000000000000000000010000000000000000000000000000000000000...\", \"output\": [\"31778720000000\"]}, {\"input\": \"200000 10000 10000\\r\\n11110111111111111111111111101111111111111111101111111111101111111110111111101111111111111111111111111110111101111111111111011111111111100111111111111101101111111111111111111111111111111111110111111111111111111111101111011011111111111111111111011011111110111110111111111111101111110111111111110111101111111111111111111111110101110111111111111111110111111111111111111011111111101111101111111101101101111111111111111111111111111111111110111111111111111111111111110111001111111111111011111110111...\", \"output\": [\"2000000000\"]}, {\"input\": \"200000 1000 10000000\\r\\n000100001100000000100001100000010011110000001000001000000100001100000100000101000100000001000010100001010000011010010100001001011010000000000000111000011100110001000100001000000000000000001000101110110001001100010101000000000011100110000110100001011100110110000001000010100100000101010000000000000010000000001000000011010101100000110000011110000000000001111011010001101011011011000000100000000000101011010001100001000000011001010000000100011011000001100000000000000100111010001010100010001...\", \"output\": [\"3897475478000\"]}, {\"input\": \"200000 10000000 3\\r\\n111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...\", \"output\": [\"2189709470\"]}, {\"input\": \"200000 10000000 10000000\\r\\n10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\", \"output\": [\"399996000020000000\"]}, {\"input\": \"200000 3 44\\r\\n000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\", \"output\": [\"42909231279\"]}, {\"input\": \"200000 2 44\\r\\n110111111011110111111110111110101110110010101010110111111011100011101111111111011011011101000010110111101110101001111101101110101111111100111100011111111111111111111100001101111011111110111011100110110011011111011101011111010101100111010001111110111111111111011011111111111111101101110011101010101101111011011011001110111100100111111111111001111110111101111111110111111001111111101100111011111111111000110000101111110111101111101111101111011111110010110111101101111111010111110000101111010110101101...\", \"output\": [\"2588662\"]}, {\"input\": \"200000 33 1212\\r\\n111111111111111111111111110110111111111111111111111111111111111111101111111111111111111111110111111111111111111101111111111111111111111111111111111111111111110111111011111111111111110111111111111111111111111101111111111111101111111101111111111111111111110110111111111111111111111111111011111111111111111101111111111101111111110111111111111111111111111111111111111101111111111111111111111111111111111111111111111111111101111111111111101111111111111110111111111111111111111111011111111111111111111...\", \"output\": [\"15754935\"]}, {\"input\": \"200000 123123 45345\\r\\n1111111011101111111111111111111111111111111111111111111111111111111010111111111110111111111111111111111111111111111111111111011111111111111111111111101111111111111111111111111111111111111111111111111111111111111111111111001111011111111111111111111111111110111111111111111111111111111111111011111111111111111111111111111111111111111111110011110111111111011111111111111111111111011111111111111111111101111111111111111111111111011110111111111111111111111111111111110111111111111101111111111111...\", \"output\": [\"16846800000\"]}, {\"input\": \"200000 234531 565456\\r\\n010000000100100000000000001000000000100100000000000000000000000010000000000000000000000000000000000000000100000000000000010000001000000100000000001010010000000010000000100000000000000000000010000000000000000000000000000100010000001000101000000000000000001000000000000001000000000000000000000000000000000000000000000000000000001000000001000000000000100000000000000101001000000010010010011000000001001000001000000010010001000000000001000000000000000000000000000010100001000000010000001100000...\", \"output\": [\"1194827034888\"]}, {\"input\": \"200000 10000000 123434\\r\\n0010111000100000111111000111011010010001100101001011100000001010111000101010110010011000100110001001101000000001110101000001101100000010111111010000001010000110011110100101000010001001100011001000000011100000000110010101010010001000101001110111001100100101001101111001001100100001111000011000110001000111000111101001011010000101011110100011000101100010011001011100101110110111111110010010101001110011011010000010000100110100101010010000000011110000011101001010001111101001001001101011001...\", \"output\": [\"397773019028\"]}, {\"input\": \"200000 10000000 234345\\r\\n0000000100000001000000000010000100000000000000000000000100000001010010000010000000100000000000100000000000100010000001100000100001000000000000101010000000000000000000010000000000000000000010000000000000001000100000000001000100000000000000000000010000000000000000001000000000100100000010000000000001000000000000000001100001000000000011000000000000000000000010000000000000000000001000100000000000000000000000000000100000001000000010000000000000000000001000000000000000000000010000000000000...\", \"output\": [\"552374355975\"]}, {\"input\": \"200000 1000 1203\\r\\n0001000111000000010000100010110000101111000001000100010100001010000000000001110000101000010000000101001000100000110001000001100011000000010010000110000000010001010011000000101000001110100100000101010100000110100000100000000000010100110110010000100000100001000000010000010100000100000101100000010000001011000101010000000000100010000010000000101001001000000000010100010000000000000100100010000001010100000110000100000001010101000100000011001101000001000100011010010010011010000000010010100001100...\", \"output\": [\"498073375\"]}, {\"input\": \"200000 1000000 1000000\\r\\n1110111111111111111111011110101111111111111110111110111111111111111111111111111111111111111111111111111111111111111111111111010111100111110111111011111111111111111111111111111111011011101111111111111111111011110110111111111111111111111111111111111111111111111111101111111111110111111111110111111111011111111110111111111111111111111100111111110111110111111111111111110111111111110111111111111111101111111111111111111111111111111111011111111100110011111111111111111111011111111011111111111...\", \"output\": [\"200000000000\"]}, {\"input\": \"200000 11200 100\\r\\n0000000010000100100100000000100100000000000000000000000000000010000000100000000000000000000000000000000000000000000011000000000000000000000001000101000001000000001110000000010000000100000001001000000000000000000000100000000000000100000010101010000000000000100100000000000001000010000000010010000000000010010000000000000000010110001010010010101010001001110000000000000000000100000110000000000000000000000010000000000010000000000000100001000101000000010000000000100000110000000000011001100001111...\", \"output\": [\"385454600\"]}]"} {"prob_desc_description":"Bomboslav likes to look out of the window in his room and watch lads outside playing famous shell game. The game is played by two persons: operator and player. Operator takes three similar opaque shells and places a ball beneath one of them. Then he shuffles the shells by swapping some pairs and the player has to guess the current position of the ball.Bomboslav noticed that guys are not very inventive, so the operator always swaps the left shell with the middle one during odd moves (first, third, fifth, etc.) and always swaps the middle shell with the right one during even moves (second, fourth, etc.).Let's number shells from 0 to 2 from left to right. Thus the left shell is assigned number 0, the middle shell is 1 and the right shell is 2. Bomboslav has missed the moment when the ball was placed beneath the shell, but he knows that exactly n movements were made by the operator and the ball was under shell x at the end. Now he wonders, what was the initial position of the ball?","prob_desc_output_spec":"Print one integer from 0 to 2\u00a0\u2014 the index of the shell where the ball was initially placed.","lang_cluster":"","src_uid":"7853e03d520cd71571a6079cdfc4c4b0","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","constructive algorithms","implementation"],"prob_desc_created_at":"1487930700","prob_desc_sample_inputs":"[\"4\\n2\", \"1\\n1\"]","prob_desc_notes":"NoteIn the first sample, the ball was initially placed beneath the middle shell and the operator completed four movements. During the first move operator swapped the left shell and the middle shell. The ball is now under the left shell. During the second move operator swapped the middle shell and the right one. The ball is still under the left shell. During the third move operator swapped the left shell and the middle shell again. The ball is again in the middle. Finally, the operators swapped the middle shell and the right shell. The ball is now beneath the right shell. ","exec_outcome":"","difficulty":1000.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"0.5 seconds","prob_desc_input_spec":"The first line of the input contains an integer n (1\u2009\u2264\u2009n\u2009\u2264\u20092\u00b7109)\u00a0\u2014 the number of movements made by the operator. The second line contains a single integer x (0\u2009\u2264\u2009x\u2009\u2264\u20092)\u00a0\u2014 the index of the shell where the ball was found after n movements.","prob_desc_sample_outputs":"[\"1\", \"0\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"4\\r\\n2\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1\\r\\n1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2\\r\\n2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3\\r\\n1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"3\\r\\n2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3\\r\\n0\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"2000000000\\r\\n0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2\\r\\n0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2\\r\\n1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"4\\r\\n0\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"4\\r\\n1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"5\\r\\n0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"5\\r\\n1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"5\\r\\n2\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"6\\r\\n0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"6\\r\\n1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"6\\r\\n2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"7\\r\\n0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"7\\r\\n1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"7\\r\\n2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"100000\\r\\n0\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"100000\\r\\n1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"100000\\r\\n2\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"99999\\r\\n1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"99998\\r\\n1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"99997\\r\\n1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"99996\\r\\n1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"99995\\r\\n1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1999999995\\r\\n0\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1999999995\\r\\n1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1999999995\\r\\n2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1999999996\\r\\n0\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1999999996\\r\\n1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1999999996\\r\\n2\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1999999997\\r\\n0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1999999997\\r\\n1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1999999997\\r\\n2\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1999999998\\r\\n0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1999999998\\r\\n1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1999999998\\r\\n2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1999999999\\r\\n0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1999999999\\r\\n1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1999999999\\r\\n2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"2000000000\\r\\n1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"2000000000\\r\\n2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1234567890\\r\\n0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1234567890\\r\\n1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1234567890\\r\\n2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"123456789\\r\\n0\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"123456789\\r\\n1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"123456789\\r\\n2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"123456790\\r\\n0\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"12\\r\\n2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"32\\r\\n1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"20\\r\\n2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"10\\r\\n1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1\\r\\n0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"76994383\\r\\n1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"25\\r\\n2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1\\r\\n2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"12\\r\\n0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"150\\r\\n2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"15\\r\\n0\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"21\\r\\n2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"18\\r\\n2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"8\\r\\n2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"10\\r\\n0\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"16\\r\\n0\\r\\n\", \"output\": [\"2\"]}]"} {"prob_desc_description":"Let quasi-palindromic number be such number that adding some leading zeros (possible none) to it produces a palindromic string. String t is called a palindrome, if it reads the same from left to right and from right to left.For example, numbers 131 and 2010200 are quasi-palindromic, they can be transformed to strings \"131\" and \"002010200\", respectively, which are palindromes.You are given some integer number x. Check if it's a quasi-palindromic number.","prob_desc_output_spec":"Print \"YES\" if number x is quasi-palindromic. Otherwise, print \"NO\" (without quotes).","lang_cluster":"","src_uid":"d82278932881e3aa997086c909f29051","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force","implementation"],"prob_desc_created_at":"1506006300","prob_desc_sample_inputs":"[\"131\", \"320\", \"2010200\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":900.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line contains one integer number x (1\u2009\u2264\u2009x\u2009\u2264\u2009109). This number is given without any leading zeroes.","prob_desc_sample_outputs":"[\"YES\", \"NO\", \"YES\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"131\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"320\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"2010200\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"1\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"1000000000\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"999999999\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"999999998\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"102000\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"210000000\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"213443120\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"99\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"22002\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"1010\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"1201\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"6460046\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"503435\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"21002\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"101001\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"200102\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"20010002\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"33003\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"100101\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"1021\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"1101\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"10101100\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"101\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"1011\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"11010\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"10110\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"110000\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"2011\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"10020001\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"12505021\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"12310\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"100501\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"11001\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"20020002\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"202002\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"1001\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"1020021\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"60660\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"98809\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"11000000\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"807008\\r\\n\", \"output\": [\"No\", \"NO\"]}]"} {"prob_desc_description":"As you may know, MemSQL has American offices in both San Francisco and Seattle. Being a manager in the company, you travel a lot between the two cities, always by plane.You prefer flying from Seattle to San Francisco than in the other direction, because it's warmer in San Francisco. You are so busy that you don't remember the number of flights you have made in either direction. However, for each of the last n days you know whether you were in San Francisco office or in Seattle office. You always fly at nights, so you never were at both offices on the same day. Given this information, determine if you flew more times from Seattle to San Francisco during the last n days, or not.","prob_desc_output_spec":"Print \"YES\" if you flew more times from Seattle to San Francisco, and \"NO\" otherwise. You can print each letter in any case (upper or lower).","lang_cluster":"","src_uid":"ab8a2070ea758d118b3c09ee165d9517","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["implementation"],"prob_desc_created_at":"1506791100","prob_desc_sample_inputs":"[\"4\\nFSSF\", \"2\\nSF\", \"10\\nFFFFFFFFFF\", \"10\\nSSFFSFFSFF\"]","prob_desc_notes":"NoteIn the first example you were initially at San Francisco, then flew to Seattle, were there for two days and returned to San Francisco. You made one flight in each direction, so the answer is \"NO\".In the second example you just flew from Seattle to San Francisco, so the answer is \"YES\".In the third example you stayed the whole period in San Francisco, so the answer is \"NO\".In the fourth example if you replace 'S' with ones, and 'F' with zeros, you'll get the first few digits of \u03c0 in binary representation. Not very useful information though.","exec_outcome":"","difficulty":800.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line of input contains single integer n (2\u2009\u2264\u2009n\u2009\u2264\u2009100)\u00a0\u2014 the number of days. The second line contains a string of length n consisting of only capital 'S' and 'F' letters. If the i-th letter is 'S', then you were in Seattle office on that day. Otherwise you were in San Francisco. The days are given in chronological order, i.e. today is the last day in this sequence.","prob_desc_sample_outputs":"[\"NO\", \"YES\", \"NO\", \"YES\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"4\\r\\nFSSF\\r\\n\", \"output\": [\"NO\", \"no\"]}, {\"input\": \"2\\r\\nSF\\r\\n\", \"output\": [\"YES\", \"yes\"]}, {\"input\": \"10\\r\\nFFFFFFFFFF\\r\\n\", \"output\": [\"NO\", \"no\"]}, {\"input\": \"10\\r\\nSSFFSFFSFF\\r\\n\", \"output\": [\"YES\", \"yes\"]}, {\"input\": \"20\\r\\nSFSFFFFSSFFFFSSSSFSS\\r\\n\", \"output\": [\"NO\", \"no\"]}, {\"input\": \"20\\r\\nSSFFFFFSFFFFFFFFFFFF\\r\\n\", \"output\": [\"YES\", \"yes\"]}, {\"input\": \"20\\r\\nSSFSFSFSFSFSFSFSSFSF\\r\\n\", \"output\": [\"YES\", \"yes\"]}, {\"input\": \"20\\r\\nSSSSFSFSSFSFSSSSSSFS\\r\\n\", \"output\": [\"NO\", \"no\"]}, {\"input\": \"100\\r\\nFFFSFSFSFSSFSFFSSFFFFFSSSSFSSFFFFSFFFFFSFFFSSFSSSFFFFSSFFSSFSFFSSFSSSFSFFSFSFFSFSFFSSFFSFSSSSFSFSFSS\\r\\n\", \"output\": [\"NO\", \"no\"]}, {\"input\": \"100\\r\\nFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\\r\\n\", \"output\": [\"NO\", \"no\"]}, {\"input\": \"100\\r\\nFFFFFFFFFFFFFFFFFFFFFFFFFFSFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFSFFFFFFFFFFFFFFFFFSS\\r\\n\", \"output\": [\"NO\", \"no\"]}, {\"input\": \"100\\r\\nFFFFFFFFFFFFFSFFFFFFFFFSFSSFFFFFFFFFFFFFFFFFFFFFFSFFSFFFFFSFFFFFFFFSFFFFFFFFFFFFFSFFFFFFFFSFFFFFFFSF\\r\\n\", \"output\": [\"NO\", \"no\"]}, {\"input\": \"100\\r\\nSFFSSFFFFFFSSFFFSSFSFFFFFSSFFFSFFFFFFSFSSSFSFSFFFFSFSSFFFFFFFFSFFFFFSFFFFFSSFFFSFFSFSFFFFSFFSFFFFFFF\\r\\n\", \"output\": [\"YES\", \"yes\"]}, {\"input\": \"100\\r\\nFFFFSSSSSFFSSSFFFSFFFFFSFSSFSFFSFFSSFFSSFSFFFFFSFSFSFSFFFFFFFFFSFSFFSFFFFSFSFFFFFFFFFFFFSFSSFFSSSSFF\\r\\n\", \"output\": [\"NO\", \"no\"]}, {\"input\": \"100\\r\\nFFFFFFFFFFFFSSFFFFSFSFFFSFSSSFSSSSSFSSSSFFSSFFFSFSFSSFFFSSSFFSFSFSSFSFSSFSFFFSFFFFFSSFSFFFSSSFSSSFFS\\r\\n\", \"output\": [\"NO\", \"no\"]}, {\"input\": \"100\\r\\nFFFSSSFSFSSSSFSSFSFFSSSFFSSFSSFFSSFFSFSSSSFFFSFFFSFSFSSSFSSFSFSFSFFSSSSSFSSSFSFSFFSSFSFSSFFSSFSFFSFS\\r\\n\", \"output\": [\"NO\", \"no\"]}, {\"input\": \"100\\r\\nFFSSSSFSSSFSSSSFSSSFFSFSSFFSSFSSSFSSSFFSFFSSSSSSSSSSSSFSSFSSSSFSFFFSSFFFFFFSFSFSSSSSSFSSSFSFSSFSSFSS\\r\\n\", \"output\": [\"NO\", \"no\"]}, {\"input\": \"100\\r\\nSSSFFFSSSSFFSSSSSFSSSSFSSSFSSSSSFSSSSSSSSFSFFSSSFFSSFSSSSFFSSSSSSFFSSSSFSSSSSSFSSSFSSSSSSSFSSSSFSSSS\\r\\n\", \"output\": [\"NO\", \"no\"]}, {\"input\": \"100\\r\\nFSSSSSSSSSSSFSSSSSSSSSSSSSSSSFSSSSSSFSSSSSSSSSSSSSFSSFSSSSSFSSFSSSSSSSSSFFSSSSSFSFSSSFFSSSSSSSSSSSSS\\r\\n\", \"output\": [\"NO\", \"no\"]}, {\"input\": \"100\\r\\nSSSSSSSSSSSSSFSSSSSSSSSSSSFSSSFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSFSSSSSSSSSSSSSSSSFSFSSSSSSSSSSSSSSSSSSFS\\r\\n\", \"output\": [\"NO\", \"no\"]}, {\"input\": \"100\\r\\nSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS\\r\\n\", \"output\": [\"NO\", \"no\"]}, {\"input\": \"100\\r\\nSFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\\r\\n\", \"output\": [\"YES\", \"yes\"]}, {\"input\": \"100\\r\\nSFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFSFSFFFFFFFFFFFSFSFFFFFFFFFFFFFSFFFFFFFFFFFFFFFFFFFFFFFFF\\r\\n\", \"output\": [\"YES\", \"yes\"]}, {\"input\": \"100\\r\\nSFFFFFFFFFFFFSSFFFFSFFFFFFFFFFFFFFFFFFFSFFFSSFFFFSFSFFFSFFFFFFFFFFFFFFFSSFFFFFFFFSSFFFFFFFFFFFFFFSFF\\r\\n\", \"output\": [\"YES\", \"yes\"]}, {\"input\": \"100\\r\\nSFFSSSFFSFSFSFFFFSSFFFFSFFFFFFFFSFSFFFSFFFSFFFSFFFFSFSFFFFFFFSFFFFFFFFFFSFFSSSFFSSFFFFSFFFFSFFFFSFFF\\r\\n\", \"output\": [\"YES\", \"yes\"]}, {\"input\": \"100\\r\\nSFFFSFFFFSFFFSSFFFSFSFFFSFFFSSFSFFFFFSFFFFFFFFSFSFSFFSFFFSFSSFSFFFSFSFFSSFSFSSSFFFFFFSSFSFFSFFFFFFFF\\r\\n\", \"output\": [\"YES\", \"yes\"]}, {\"input\": \"100\\r\\nSSSSFFFFSFFFFFFFSFFFFSFSFFFFSSFFFFFFFFFSFFSSFFFFFFSFSFSSFSSSFFFFFFFSFSFFFSSSFFFFFFFSFFFSSFFFFSSFFFSF\\r\\n\", \"output\": [\"YES\", \"yes\"]}, {\"input\": \"100\\r\\nSSSFSSFFFSFSSSSFSSFSSSSFSSFFFFFSFFSSSSFFSSSFSSSFSSSSFSSSSFSSSSSSSFSFSSFFFSSFFSFFSSSSFSSFFSFSSFSFFFSF\\r\\n\", \"output\": [\"YES\", \"yes\"]}, {\"input\": \"100\\r\\nSFFSFSSSSSSSFFSSSFSSSSFSFSSFFFSSSSSSFSSSSFSSFSSSFSSSSSSSFSSFSFFFSSFSSFSFSFSSSSSSSSSSSSFFFFSSSSSFSFFF\\r\\n\", \"output\": [\"YES\", \"yes\"]}, {\"input\": \"100\\r\\nSSSFSFFSFSFFSSSSSFSSSFSSSFFFSSSSSSSSSFSFSFSSSSFSFSSFFFFFSSSSSSSSSSSSSSSSSSSFFSSSSSFSFSSSSFFSSSSFSSSF\\r\\n\", \"output\": [\"YES\", \"yes\"]}, {\"input\": \"100\\r\\nSSSFSSSSSSSSSSFSSSSFSSSSSSFSSSSSSFSSSSSSSSSSSSSSFSSSFSSSFSSSSSSSSSSSFSSSSSSFSFSSSSFSSSSSSFSSSSSSSSFF\\r\\n\", \"output\": [\"YES\", \"yes\"]}, {\"input\": \"100\\r\\nSSSSSSSSSSSSSSSFSFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSFFSSSSSSSSSFSSSSSSSSSSSSSSSSSF\\r\\n\", \"output\": [\"YES\", \"yes\"]}, {\"input\": \"100\\r\\nSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSF\\r\\n\", \"output\": [\"YES\", \"yes\"]}, {\"input\": \"2\\r\\nSS\\r\\n\", \"output\": [\"NO\", \"no\"]}]"} {"prob_desc_description":"You are given two lists of non-zero digits.Let's call an integer pretty if its (base 10) representation has at least one digit from the first list and at least one digit from the second list. What is the smallest positive pretty integer?","prob_desc_output_spec":"Print the smallest pretty integer.","lang_cluster":"","src_uid":"3a0c1b6d710fd8f0b6daf420255d76ee","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force","implementation"],"prob_desc_created_at":"1508054700","prob_desc_sample_inputs":"[\"2 3\\n4 2\\n5 7 6\", \"8 8\\n1 2 3 4 5 6 7 8\\n8 7 6 5 4 3 2 1\"]","prob_desc_notes":"NoteIn the first example 25, 46, 24567 are pretty, as well as many other integers. The smallest among them is 25. 42 and 24 are not pretty because they don't have digits from the second list.In the second example all integers that have at least one digit different from 9 are pretty. It's obvious that the smallest among them is 1, because it's the smallest positive integer.","exec_outcome":"","difficulty":900.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line contains two integers n and m (1\u2009\u2264\u2009n,\u2009m\u2009\u2264\u20099) \u2014 the lengths of the first and the second lists, respectively. The second line contains n distinct digits a1,\u2009a2,\u2009...,\u2009an (1\u2009\u2264\u2009ai\u2009\u2264\u20099) \u2014 the elements of the first list. The third line contains m distinct digits b1,\u2009b2,\u2009...,\u2009bm (1\u2009\u2264\u2009bi\u2009\u2264\u20099) \u2014 the elements of the second list.","prob_desc_sample_outputs":"[\"25\", \"1\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2 3\\r\\n4 2\\r\\n5 7 6\\r\\n\", \"output\": [\"25\"]}, {\"input\": \"8 8\\r\\n1 2 3 4 5 6 7 8\\r\\n8 7 6 5 4 3 2 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 1\\r\\n9\\r\\n1\\r\\n\", \"output\": [\"19\"]}, {\"input\": \"9 1\\r\\n5 4 2 3 6 1 7 9 8\\r\\n9\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"5 3\\r\\n7 2 5 8 6\\r\\n3 1 9\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"4 5\\r\\n5 2 6 4\\r\\n8 9 1 3 7\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"5 9\\r\\n4 2 1 6 7\\r\\n2 3 4 5 6 7 8 9 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"9 9\\r\\n5 4 3 2 1 6 7 8 9\\r\\n3 2 1 5 4 7 8 9 6\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"9 5\\r\\n2 3 4 5 6 7 8 9 1\\r\\n4 2 1 6 7\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"9 9\\r\\n1 2 3 4 5 6 7 8 9\\r\\n1 2 3 4 5 6 7 8 9\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"9 9\\r\\n1 2 3 4 5 6 7 8 9\\r\\n9 8 7 6 5 4 3 2 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"9 9\\r\\n9 8 7 6 5 4 3 2 1\\r\\n1 2 3 4 5 6 7 8 9\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"9 9\\r\\n9 8 7 6 5 4 3 2 1\\r\\n9 8 7 6 5 4 3 2 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 1\\r\\n8\\r\\n9\\r\\n\", \"output\": [\"89\"]}, {\"input\": \"1 1\\r\\n9\\r\\n8\\r\\n\", \"output\": [\"89\"]}, {\"input\": \"1 1\\r\\n1\\r\\n2\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"1 1\\r\\n2\\r\\n1\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"1 1\\r\\n9\\r\\n9\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"1 1\\r\\n1\\r\\n1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"4 5\\r\\n3 2 4 5\\r\\n1 6 5 9 8\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"3 2\\r\\n4 5 6\\r\\n1 5\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"5 4\\r\\n1 3 5 6 7\\r\\n2 4 3 9\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"5 5\\r\\n1 3 5 7 9\\r\\n2 4 6 8 9\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"2 2\\r\\n1 8\\r\\n2 8\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"5 5\\r\\n5 6 7 8 9\\r\\n1 2 3 4 5\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"5 5\\r\\n1 2 3 4 5\\r\\n1 2 3 4 5\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"5 5\\r\\n1 2 3 4 5\\r\\n2 3 4 5 6\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"2 2\\r\\n1 5\\r\\n2 5\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"4 4\\r\\n1 3 5 8\\r\\n2 4 6 8\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"3 3\\r\\n1 5 3\\r\\n2 5 7\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"3 3\\r\\n3 6 8\\r\\n2 6 9\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"2 2\\r\\n1 4\\r\\n2 4\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"5 3\\r\\n3 4 5 6 7\\r\\n1 5 9\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"4 4\\r\\n1 2 3 4\\r\\n2 5 6 7\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"5 5\\r\\n1 2 3 4 5\\r\\n9 2 1 7 5\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 2\\r\\n1 3\\r\\n2 3\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"3 3\\r\\n3 2 1\\r\\n3 2 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"3 3\\r\\n1 3 5\\r\\n2 3 6\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"3 3\\r\\n5 6 7\\r\\n5 6 7\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"1 2\\r\\n5\\r\\n2 5\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"3 3\\r\\n2 4 9\\r\\n7 8 9\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"3 3\\r\\n1 2 4\\r\\n3 4 5\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"3 2\\r\\n1 4 9\\r\\n2 4\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"3 3\\r\\n3 5 6\\r\\n1 5 9\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"3 2\\r\\n1 2 4\\r\\n3 4\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"2 4\\r\\n8 9\\r\\n1 2 3 9\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"1 2\\r\\n9\\r\\n8 9\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"3 2\\r\\n1 2 4\\r\\n4 2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"2 3\\r\\n4 5\\r\\n1 3 5\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"3 2\\r\\n1 2 3\\r\\n2 3\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"4 3\\r\\n1 3 5 9\\r\\n2 8 9\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"2 2\\r\\n1 9\\r\\n9 2\\r\\n\", \"output\": [\"9\"]}]"} {"prob_desc_description":"Unlucky year in Berland is such a year that its number n can be represented as n\u2009=\u2009xa\u2009+\u2009yb, where a and b are non-negative integer numbers. For example, if x\u2009=\u20092 and y\u2009=\u20093 then the years 4 and 17 are unlucky (4\u2009=\u200920\u2009+\u200931, 17\u2009=\u200923\u2009+\u200932\u2009=\u200924\u2009+\u200930) and year 18 isn't unlucky as there is no such representation for it.Such interval of years that there are no unlucky years in it is called The Golden Age.You should write a program which will find maximum length of The Golden Age which starts no earlier than the year l and ends no later than the year r. If all years in the interval [l,\u2009r] are unlucky then the answer is 0.","prob_desc_output_spec":"Print the maximum length of The Golden Age within the interval [l,\u2009r]. If all years in the interval [l,\u2009r] are unlucky then print 0.","lang_cluster":"","src_uid":"68ca8a8730db27ac2230f9fe9b120f5f","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force","math"],"prob_desc_created_at":"1496675100","prob_desc_sample_inputs":"[\"2 3 1 10\", \"3 5 10 22\", \"2 3 3 5\"]","prob_desc_notes":"NoteIn the first example the unlucky years are 2, 3, 4, 5, 7, 9 and 10. So maximum length of The Golden Age is achived in the intervals [1,\u20091], [6,\u20096] and [8,\u20098].In the second example the longest Golden Age is the interval [15,\u200922].","exec_outcome":"","difficulty":1800.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line contains four integer numbers x, y, l and r (2\u2009\u2264\u2009x,\u2009y\u2009\u2264\u20091018, 1\u2009\u2264\u2009l\u2009\u2264\u2009r\u2009\u2264\u20091018).","prob_desc_sample_outputs":"[\"1\", \"8\", \"0\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2 3 1 10\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"3 5 10 22\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"2 3 3 5\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 2 1 10\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 2 1 1000000\\r\\n\", \"output\": [\"213568\"]}, {\"input\": \"2 2 1 1000000000000000000\\r\\n\", \"output\": [\"144115188075855871\"]}, {\"input\": \"2 3 1 1000000\\r\\n\", \"output\": [\"206415\"]}, {\"input\": \"2 3 1 1000000000000000000\\r\\n\", \"output\": [\"261485717957290893\"]}, {\"input\": \"12345 54321 1 1000000\\r\\n\", \"output\": [\"933334\"]}, {\"input\": \"54321 12345 1 1000000000000000000\\r\\n\", \"output\": [\"976614248345331214\"]}, {\"input\": \"2 3 100000000 1000000000000\\r\\n\", \"output\": [\"188286357653\"]}, {\"input\": \"2 14 732028847861235712 732028847861235712\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"14 2 732028847861235713 732028847861235713\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"3 2 6 7\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"16 5 821690667 821691481\\r\\n\", \"output\": [\"815\"]}, {\"input\": \"1000000000000000000 2 1 1000000000000000000\\r\\n\", \"output\": [\"423539247696576511\"]}, {\"input\": \"2 1000000000000000000 1000000000000000 1000000000000000000\\r\\n\", \"output\": [\"423539247696576511\"]}, {\"input\": \"2 2 1000000000000000000 1000000000000000000\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"3 3 1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 3 626492297402423196 726555387600422608\\r\\n\", \"output\": [\"100063090197999413\"]}, {\"input\": \"4 4 1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"304279187938024110 126610724244348052 78460471576735729 451077737144268785\\r\\n\", \"output\": [\"177668463693676057\"]}, {\"input\": \"510000000000 510000000000 1 1000000000000000000\\r\\n\", \"output\": [\"999998980000000000\"]}, {\"input\": \"2 10000000000000000 1 1000000000000000000\\r\\n\", \"output\": [\"413539247696576512\"]}, {\"input\": \"84826654960259 220116531311479700 375314289098080160 890689132792406667\\r\\n\", \"output\": [\"515374843694326508\"]}, {\"input\": \"1001 9999 1 1000000000000000000\\r\\n\", \"output\": [\"988998989390034998\"]}, {\"input\": \"106561009498593483 3066011339919949 752858505287719337 958026822891358781\\r\\n\", \"output\": [\"205168317603639445\"]}, {\"input\": \"650233444262690661 556292951587380938 715689923804218376 898772439356652923\\r\\n\", \"output\": [\"183082515552434548\"]}, {\"input\": \"4294967297 4294967297 1 1000000000000000000\\r\\n\", \"output\": [\"999999991410065406\"]}, {\"input\": \"1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 2 1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"73429332516742239 589598864615747534 555287238606698050 981268715519611449\\r\\n\", \"output\": [\"318240518387121676\"]}, {\"input\": \"282060925969693883 446418005951342865 709861829378794811 826972744183396568\\r\\n\", \"output\": [\"98493812262359820\"]}, {\"input\": \"97958277744315833 443452631396066615 33878596673318768 306383421710156519\\r\\n\", \"output\": [\"208425143965840685\"]}, {\"input\": \"40975442958818854 7397733549114401 299774870238987084 658001214206968260\\r\\n\", \"output\": [\"358226343967981177\"]}, {\"input\": \"699 700 1 1000\\r\\n\", \"output\": [\"697\"]}, {\"input\": \"483076744475822225 425097332543006422 404961220953110704 826152774360856248\\r\\n\", \"output\": [\"343076029885034022\"]}, {\"input\": \"4294967297 4294967297 1 999999999999999999\\r\\n\", \"output\": [\"999999991410065405\"]}, {\"input\": \"702012794 124925148 2623100012 1000000000000000000\\r\\n\", \"output\": [\"491571744457491660\"]}, {\"input\": \"433333986179614514 1000000000000000000 433333986179614515 726628630292055493\\r\\n\", \"output\": [\"293294644112440978\"]}, {\"input\": \"999999999999999999 364973116927770629 4 4\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"4 2 40 812\\r\\n\", \"output\": [\"191\"]}, {\"input\": \"2 3 1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1556368728 1110129598 120230736 1258235681\\r\\n\", \"output\": [\"989898863\"]}, {\"input\": \"7 9 164249007852879073 459223650245359577\\r\\n\", \"output\": [\"229336748650748455\"]}, {\"input\": \"324693328712373699 541961409169732375 513851377473048715 873677521504257312\\r\\n\", \"output\": [\"324693328712373697\"]}, {\"input\": \"370083000139673112 230227213530985315 476750241623737312 746365058930029530\\r\\n\", \"output\": [\"146054845259371103\"]}, {\"input\": \"4 3 584 899\\r\\n\", \"output\": [\"146\"]}, {\"input\": \"4 3 286 581\\r\\n\", \"output\": [\"161\"]}, {\"input\": \"304045744870965151 464630021384225732 142628934177558000 844155070300317027\\r\\n\", \"output\": [\"304045744870965149\"]}, {\"input\": \"195627622825327857 666148746663834172 1 1000000000000000000\\r\\n\", \"output\": [\"470521123838506314\"]}, {\"input\": \"459168731438725410 459955118458373596 410157890472128901 669197645706452507\\r\\n\", \"output\": [\"209242527248078910\"]}, {\"input\": \"999999999999999999 999999999999999999 1 1000000000000000000\\r\\n\", \"output\": [\"999999999999999997\"]}, {\"input\": \"752299248283963354 680566564599126819 73681814274367577 960486443362068685\\r\\n\", \"output\": [\"606884750324759243\"]}, {\"input\": \"20373217421623606 233158243228114207 97091516440255589 395722640217125926\\r\\n\", \"output\": [\"142191179567388113\"]}, {\"input\": \"203004070900 20036005000 1 1000000000000000000\\r\\n\", \"output\": [\"999999776959924100\"]}, {\"input\": \"565269817339236857 318270460838647700 914534538271870694 956123707310168659\\r\\n\", \"output\": [\"41589169038297966\"]}, {\"input\": \"2 5 330 669\\r\\n\", \"output\": [\"131\"]}, {\"input\": \"9 9 91 547\\r\\n\", \"output\": [\"385\"]}, {\"input\": \"9 4 866389615074294253 992899492208527253\\r\\n\", \"output\": [\"126509877134233001\"]}, {\"input\": \"3037000500 3037000500 1 1000000000000000000\\r\\n\", \"output\": [\"999999993925999000\"]}, {\"input\": \"4294967297 4294967297 12 1000000000000000000\\r\\n\", \"output\": [\"999999991410065406\"]}, {\"input\": \"5 3 78510497842978003 917156799600023483\\r\\n\", \"output\": [\"238418579101562499\"]}, {\"input\": \"749206377024033575 287723056504284448 387669391392789697 931234393488075794\\r\\n\", \"output\": [\"361536985631243879\"]}, {\"input\": \"999999999999999999 454135 1000000000000000000 1000000000000000000\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"759826429841877401 105086867783910112 667080043736858072 797465019478234768\\r\\n\", \"output\": [\"92746386105019330\"]}, {\"input\": \"1000000000000000000 1000000000000000000 5 7\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"440968000218771383 43378854522801881 169393324037146024 995429539593716237\\r\\n\", \"output\": [\"511082684852142973\"]}, {\"input\": \"15049917793417622 113425474361704411 87565655389309185 803955352361026671\\r\\n\", \"output\": [\"675479960205904638\"]}, {\"input\": \"4 6 264626841724745187 925995096479842591\\r\\n\", \"output\": [\"369878143059623936\"]}, {\"input\": \"4294967297 4294967297 13 1000000000000000000\\r\\n\", \"output\": [\"999999991410065406\"]}, {\"input\": \"315729630349763416 22614591055604717 66895291338255006 947444311481017774\\r\\n\", \"output\": [\"609100090075649641\"]}, {\"input\": \"3 10 173 739\\r\\n\", \"output\": [\"386\"]}, {\"input\": \"161309010783040325 128259041753158864 5843045875031294 854024306926137845\\r\\n\", \"output\": [\"564456254389938656\"]}, {\"input\": \"239838434825939759 805278168279318096 202337849919104640 672893754916863788\\r\\n\", \"output\": [\"433055320090924028\"]}, {\"input\": \"9 9 435779695685310822 697902619874412541\\r\\n\", \"output\": [\"262122924189101720\"]}, {\"input\": \"967302429573451368 723751675006196376 143219686319239751 266477897142546404\\r\\n\", \"output\": [\"123258210823306654\"]}, {\"input\": \"10 8 139979660652061677 941135332855173888\\r\\n\", \"output\": [\"697020144779318016\"]}, {\"input\": \"4294967297 1000000000000000000 4294967296 17179869184\\r\\n\", \"output\": [\"12884901886\"]}, {\"input\": \"100914030314340517 512922595840756536 812829791042966971 966156272123068006\\r\\n\", \"output\": [\"153326481080101036\"]}, {\"input\": \"288230376151711744 288230376151711744 1 1000000000000000000\\r\\n\", \"output\": [\"423539247696576512\"]}, {\"input\": \"6 9 681 750\\r\\n\", \"output\": [\"49\"]}, {\"input\": \"880356874212472951 178538501711453307 162918237570625233 224969951233811739\\r\\n\", \"output\": [\"46431449522358431\"]}, {\"input\": \"2 7 405373082004080437 771991379629433514\\r\\n\", \"output\": [\"153172782079203571\"]}, {\"input\": \"10 11 10 11\\r\\n\", \"output\": [\"1\"]}]"} {"prob_desc_description":"Captain Bill the Hummingbird and his crew recieved an interesting challenge offer. Some stranger gave them a map, potion of teleportation and said that only this potion might help them to reach the treasure. Bottle with potion has two values x and y written on it. These values define four moves which can be performed using the potion: Map shows that the position of Captain Bill the Hummingbird is (x1,\u2009y1) and the position of the treasure is (x2,\u2009y2).You task is to tell Captain Bill the Hummingbird whether he should accept this challenge or decline. If it is possible for Captain to reach the treasure using the potion then output \"YES\", otherwise \"NO\" (without quotes).The potion can be used infinite amount of times.","prob_desc_output_spec":"Print \"YES\" if it is possible for Captain to reach the treasure using the potion, otherwise print \"NO\" (without quotes).","lang_cluster":"","src_uid":"1c80040104e06c9f24abfcfe654a851f","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","number theory","implementation"],"prob_desc_created_at":"1497539100","prob_desc_sample_inputs":"[\"0 0 0 6\\n2 3\", \"1 1 3 6\\n1 5\"]","prob_desc_notes":"NoteIn the first example there exists such sequence of moves: \u2014 the first type of move \u2014 the third type of move ","exec_outcome":"","difficulty":1200.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line contains four integer numbers x1,\u2009y1,\u2009x2,\u2009y2 (\u2009-\u2009105\u2009\u2264\u2009x1,\u2009y1,\u2009x2,\u2009y2\u2009\u2264\u2009105) \u2014 positions of Captain Bill the Hummingbird and treasure respectively. The second line contains two integer numbers x,\u2009y (1\u2009\u2264\u2009x,\u2009y\u2009\u2264\u2009105) \u2014 values on the potion bottle.","prob_desc_sample_outputs":"[\"YES\", \"NO\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"0 0 0 6\\r\\n2 3\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"1 1 3 6\\r\\n1 5\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"5 4 6 -10\\r\\n1 1\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"6 -3 -7 -7\\r\\n1 2\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"2 -5 -8 8\\r\\n2 1\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"70 -81 -17 80\\r\\n87 23\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"41 366 218 -240\\r\\n3456 1234\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"-61972 -39646 -42371 -24854\\r\\n573 238\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"-84870 -42042 94570 98028\\r\\n8972 23345\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"-58533 -50999 -1007 -59169\\r\\n8972 23345\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"-100000 -100000 100000 100000\\r\\n100000 100000\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"-100000 -100000 100000 100000\\r\\n1 1\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"5 2 5 3\\r\\n1 1\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"5 5 5 5\\r\\n5 5\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"0 0 1000 1000\\r\\n1 1\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"0 0 0 1\\r\\n1 1\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"1 1 4 4\\r\\n2 2\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"100000 100000 99999 99999\\r\\n100000 100000\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"1 1 1 6\\r\\n1 5\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"2 9 4 0\\r\\n2 3\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"0 0 0 9\\r\\n2 3\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"14 88 14 88\\r\\n100 500\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"-1 0 3 0\\r\\n4 4\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"0 0 8 9\\r\\n2 3\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"-2 5 7 -6\\r\\n1 1\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"3 7 -8 8\\r\\n2 2\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"-4 -8 -6 -1\\r\\n1 3\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"0 8 6 2\\r\\n1 1\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"-5 -2 -8 -2\\r\\n1 1\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"1 4 -5 0\\r\\n1 1\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"8 -4 4 -7\\r\\n1 2\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"5 2 2 4\\r\\n2 2\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"2 0 -4 6\\r\\n1 2\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"-2 6 -5 -4\\r\\n1 2\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"-6 5 10 6\\r\\n2 4\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"3 -7 1 -8\\r\\n1 2\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"4 1 4 -4\\r\\n9 4\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"9 -3 -9 -3\\r\\n2 2\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"-6 -6 -10 -5\\r\\n6 7\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"-5 -2 2 2\\r\\n1 7\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"9 0 8 1\\r\\n7 10\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"-1 6 -7 -6\\r\\n6 4\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"2 2 -3 -3\\r\\n3 1\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"2 -6 7 2\\r\\n2 1\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"-6 2 -7 -7\\r\\n1 2\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"-5 -5 -1 -5\\r\\n2 2\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"0 5 3 -6\\r\\n2 2\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"0 -6 2 -1\\r\\n1 1\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"-6 6 -5 -4\\r\\n1 2\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"7 -7 1 -7\\r\\n2 2\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"99966 -99952 -99966 99923\\r\\n1 1\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"99921 99980 -99956 -99907\\r\\n3 4\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"100000 100000 -100000 -100000\\r\\n1 1\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"1 0 2 0\\r\\n5 1\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"-3 0 -8 0\\r\\n7 2\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"-9 4 -5 -1\\r\\n8 2\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"-99999 -100000 100000 100000\\r\\n1 1\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"0 0 -100 -100\\r\\n2 2\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"9 -5 -3 -2\\r\\n1 4\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"1 -10 -10 5\\r\\n7 5\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"6 -9 -1 -9\\r\\n1 9\\r\\n\", \"output\": [\"NO\"]}]"} {"prob_desc_description":"Okabe needs bananas for one of his experiments for some strange reason. So he decides to go to the forest and cut banana trees.Consider the point (x,\u2009y) in the 2D plane such that x and y are integers and 0\u2009\u2264\u2009x,\u2009y. There is a tree in such a point, and it has x\u2009+\u2009y bananas. There are no trees nor bananas in other points. Now, Okabe draws a line with equation . Okabe can select a single rectangle with axis aligned sides with all points on or under the line and cut all the trees in all points that are inside or on the border of this rectangle and take their bananas. Okabe's rectangle can be degenerate; that is, it can be a line segment or even a point.Help Okabe and find the maximum number of bananas he can get if he chooses the rectangle wisely.Okabe is sure that the answer does not exceed 1018. You can trust him.","prob_desc_output_spec":"Print the maximum number of bananas Okabe can get from the trees he cuts.","lang_cluster":"","src_uid":"9300f1c07dd36e0cf7e6cb7911df4cf2","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force","math"],"prob_desc_created_at":"1498401300","prob_desc_sample_inputs":"[\"1 5\", \"2 3\"]","prob_desc_notes":"Note The graph above corresponds to sample test 1. The optimal rectangle is shown in red and has 30 bananas.","exec_outcome":"","difficulty":1300.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line of input contains two space-separated integers m and b (1\u2009\u2264\u2009m\u2009\u2264\u20091000, 1\u2009\u2264\u2009b\u2009\u2264\u200910000).","prob_desc_sample_outputs":"[\"30\", \"25\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"1 5\\r\\n\", \"output\": [\"30\"]}, {\"input\": \"2 3\\r\\n\", \"output\": [\"25\"]}, {\"input\": \"4 6\\r\\n\", \"output\": [\"459\"]}, {\"input\": \"6 3\\r\\n\", \"output\": [\"171\"]}, {\"input\": \"1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"10 1\\r\\n\", \"output\": [\"55\"]}, {\"input\": \"20 10\\r\\n\", \"output\": [\"40326\"]}, {\"input\": \"1000 10000\\r\\n\", \"output\": [\"74133360011484445\"]}, {\"input\": \"139 9252\\r\\n\", \"output\": [\"1137907933561080\"]}, {\"input\": \"859 8096\\r\\n\", \"output\": [\"29032056230649780\"]}, {\"input\": \"987 4237\\r\\n\", \"output\": [\"5495451829240878\"]}, {\"input\": \"411 3081\\r\\n\", \"output\": [\"366755153481948\"]}, {\"input\": \"539 9221\\r\\n\", \"output\": [\"16893595018603386\"]}, {\"input\": \"259 770\\r\\n\", \"output\": [\"2281741798549\"]}, {\"input\": \"387 5422\\r\\n\", \"output\": [\"1771610559998400\"]}, {\"input\": \"515 1563\\r\\n\", \"output\": [\"75233740231341\"]}, {\"input\": \"939 407\\r\\n\", \"output\": [\"4438222781916\"]}, {\"input\": \"518 6518\\r\\n\", \"output\": [\"5511730799718825\"]}, {\"input\": \"646 1171\\r\\n\", \"output\": [\"49802404050106\"]}, {\"input\": \"70 7311\\r\\n\", \"output\": [\"142915220249910\"]}, {\"input\": \"494 6155\\r\\n\", \"output\": [\"4221391613846823\"]}, {\"input\": \"918 7704\\r\\n\", \"output\": [\"28569727339126165\"]}, {\"input\": \"46 3844\\r\\n\", \"output\": [\"9007500020760\"]}, {\"input\": \"174 2688\\r\\n\", \"output\": [\"43730657099581\"]}, {\"input\": \"894 4637\\r\\n\", \"output\": [\"5909849585253250\"]}, {\"input\": \"22 3481\\r\\n\", \"output\": [\"1548544125646\"]}, {\"input\": \"446 5030\\r\\n\", \"output\": [\"1878390629993745\"]}, {\"input\": \"440 8704\\r\\n\", \"output\": [\"9470470760118060\"]}, {\"input\": \"569 7548\\r\\n\", \"output\": [\"10326205017481606\"]}, {\"input\": \"289 6393\\r\\n\", \"output\": [\"1620061541812350\"]}, {\"input\": \"417 1045\\r\\n\", \"output\": [\"14758909519725\"]}, {\"input\": \"841 7185\\r\\n\", \"output\": [\"19452619774222875\"]}, {\"input\": \"969 6030\\r\\n\", \"output\": [\"15265318959845745\"]}, {\"input\": \"393 4874\\r\\n\", \"output\": [\"1327174123029975\"]}, {\"input\": \"817 3719\\r\\n\", \"output\": [\"2546859449982016\"]}, {\"input\": \"945 2563\\r\\n\", \"output\": [\"1115613396515835\"]}, {\"input\": \"369 4511\\r\\n\", \"output\": [\"927715710215505\"]}, {\"input\": \"555 3594\\r\\n\", \"output\": [\"1061060598862891\"]}]"} {"prob_desc_description":"Holidays have finished. Thanks to the help of the hacker Leha, Noora managed to enter the university of her dreams which is located in a town Pavlopolis. It's well known that universities provide students with dormitory for the period of university studies. Consequently Noora had to leave Vi\u010dkopolis and move to Pavlopolis. Thus Leha was left completely alone in a quiet town Vi\u010dkopolis. He almost even fell into a depression from boredom!Leha came up with a task for himself to relax a little. He chooses two integers A and B and then calculates the greatest common divisor of integers \"A factorial\" and \"B factorial\". Formally the hacker wants to find out GCD(A!,\u2009B!). It's well known that the factorial of an integer x is a product of all positive integers less than or equal to x. Thus x!\u2009=\u20091\u00b72\u00b73\u00b7...\u00b7(x\u2009-\u20091)\u00b7x. For example 4!\u2009=\u20091\u00b72\u00b73\u00b74\u2009=\u200924. Recall that GCD(x,\u2009y) is the largest positive integer q that divides (without a remainder) both x and y.Leha has learned how to solve this task very effective. You are able to cope with it not worse, aren't you?","prob_desc_output_spec":"Print a single integer denoting the greatest common divisor of integers A! and B!.","lang_cluster":"","src_uid":"7bf30ceb24b66d91382e97767f9feeb6","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","number theory","implementation"],"prob_desc_created_at":"1499011500","prob_desc_sample_inputs":"[\"4 3\"]","prob_desc_notes":"NoteConsider the sample.4!\u2009=\u20091\u00b72\u00b73\u00b74\u2009=\u200924. 3!\u2009=\u20091\u00b72\u00b73\u2009=\u20096. The greatest common divisor of integers 24 and 6 is exactly 6.","exec_outcome":"","difficulty":800.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first and single line contains two integers A and B (1\u2009\u2264\u2009A,\u2009B\u2009\u2264\u2009109,\u2009min(A,\u2009B)\u2009\u2264\u200912).","prob_desc_sample_outputs":"[\"6\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"4 3\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"10 399603090\\r\\n\", \"output\": [\"3628800\"]}, {\"input\": \"6 973151934\\r\\n\", \"output\": [\"720\"]}, {\"input\": \"2 841668075\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"7 415216919\\r\\n\", \"output\": [\"5040\"]}, {\"input\": \"3 283733059\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"11 562314608\\r\\n\", \"output\": [\"39916800\"]}, {\"input\": \"3 990639260\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"11 859155400\\r\\n\", \"output\": [\"39916800\"]}, {\"input\": \"1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"5 3\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"1 4\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"5 4\\r\\n\", \"output\": [\"24\"]}, {\"input\": \"1 12\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"9 7\\r\\n\", \"output\": [\"5040\"]}, {\"input\": \"2 3\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"6 11\\r\\n\", \"output\": [\"720\"]}, {\"input\": \"6 7\\r\\n\", \"output\": [\"720\"]}, {\"input\": \"11 11\\r\\n\", \"output\": [\"39916800\"]}, {\"input\": \"4 999832660\\r\\n\", \"output\": [\"24\"]}, {\"input\": \"7 999228288\\r\\n\", \"output\": [\"5040\"]}, {\"input\": \"11 999257105\\r\\n\", \"output\": [\"39916800\"]}, {\"input\": \"11 999286606\\r\\n\", \"output\": [\"39916800\"]}, {\"input\": \"3 999279109\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"999632727 11\\r\\n\", \"output\": [\"39916800\"]}, {\"input\": \"999625230 7\\r\\n\", \"output\": [\"5040\"]}, {\"input\": \"999617047 3\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"999646548 7\\r\\n\", \"output\": [\"5040\"]}, {\"input\": \"999639051 3\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"12 12\\r\\n\", \"output\": [\"479001600\"]}, {\"input\": \"12 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1213 5\\r\\n\", \"output\": [\"120\"]}, {\"input\": \"8 9\\r\\n\", \"output\": [\"40320\"]}, {\"input\": \"12 9\\r\\n\", \"output\": [\"362880\"]}, {\"input\": \"12 1000000000\\r\\n\", \"output\": [\"479001600\"]}, {\"input\": \"1000000000 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"12 13\\r\\n\", \"output\": [\"479001600\"]}, {\"input\": \"2 29845\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"10 21\\r\\n\", \"output\": [\"3628800\"]}, {\"input\": \"12 20\\r\\n\", \"output\": [\"479001600\"]}, {\"input\": \"15 12\\r\\n\", \"output\": [\"479001600\"]}, {\"input\": \"1000000000 12\\r\\n\", \"output\": [\"479001600\"]}, {\"input\": \"11 30\\r\\n\", \"output\": [\"39916800\"]}, {\"input\": \"17 12\\r\\n\", \"output\": [\"479001600\"]}, {\"input\": \"4 19\\r\\n\", \"output\": [\"24\"]}, {\"input\": \"12 15\\r\\n\", \"output\": [\"479001600\"]}, {\"input\": \"20 6\\r\\n\", \"output\": [\"720\"]}, {\"input\": \"10 20\\r\\n\", \"output\": [\"3628800\"]}, {\"input\": \"10 10\\r\\n\", \"output\": [\"3628800\"]}, {\"input\": \"22 12\\r\\n\", \"output\": [\"479001600\"]}, {\"input\": \"20 12\\r\\n\", \"output\": [\"479001600\"]}, {\"input\": \"12 23\\r\\n\", \"output\": [\"479001600\"]}, {\"input\": \"12 22\\r\\n\", \"output\": [\"479001600\"]}, {\"input\": \"18 3\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"14 10\\r\\n\", \"output\": [\"3628800\"]}, {\"input\": \"14 12\\r\\n\", \"output\": [\"479001600\"]}, {\"input\": \"8 3\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"5 5\\r\\n\", \"output\": [\"120\"]}]"} {"prob_desc_description":"One day Petya was solving a very interesting problem. But although he used many optimization techniques, his solution still got Time limit exceeded verdict. Petya conducted a thorough analysis of his program and found out that his function for finding maximum element in an array of n positive integers was too slow. Desperate, Petya decided to use a somewhat unexpected optimization using parameter k, so now his function contains the following code:int fast_max(int n, int a[]) { int ans = 0; int offset = 0; for (int i = 0; i < n; ++i) if (ans < a[i]) { ans = a[i]; offset = 0; } else { offset = offset + 1; if (offset == k) return ans; } return ans;}That way the function iteratively checks array elements, storing the intermediate maximum, and if after k consecutive iterations that maximum has not changed, it is returned as the answer.Now Petya is interested in fault rate of his function. He asked you to find the number of permutations of integers from 1 to n such that the return value of his function on those permutations is not equal to n. Since this number could be very big, output the answer modulo 109\u2009+\u20097.","prob_desc_output_spec":"Output the answer to the problem modulo 109\u2009+\u20097.","lang_cluster":"","src_uid":"0644605611a2cd10ab3a9f12f18d7ae4","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["dp","combinatorics","math"],"prob_desc_created_at":"1510502700","prob_desc_sample_inputs":"[\"5 2\", \"5 3\", \"6 3\"]","prob_desc_notes":"NotePermutations from second example: [4,\u20091,\u20092,\u20093,\u20095], [4,\u20091,\u20093,\u20092,\u20095], [4,\u20092,\u20091,\u20093,\u20095], [4,\u20092,\u20093,\u20091,\u20095], [4,\u20093,\u20091,\u20092,\u20095], [4,\u20093,\u20092,\u20091,\u20095].","exec_outcome":"","difficulty":2400.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The only line contains two integers n and k (1\u2009\u2264\u2009n,\u2009k\u2009\u2264\u2009106), separated by a space\u00a0\u2014 the length of the permutations and the parameter k.","prob_desc_sample_outputs":"[\"22\", \"6\", \"84\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"5 2\\r\\n\", \"output\": [\"22\"]}, {\"input\": \"5 3\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"6 3\\r\\n\", \"output\": [\"84\"]}, {\"input\": \"5 10\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"3 2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3 3\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"4 1\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"4 2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"4 3\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"4 4\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"5 1\\r\\n\", \"output\": [\"55\"]}, {\"input\": \"5 4\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"5 5\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1000000 500000\\r\\n\", \"output\": [\"900097839\"]}, {\"input\": \"1000000 1000000\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1000000 1\\r\\n\", \"output\": [\"131797017\"]}, {\"input\": \"1 1000000\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"959139 199252\\r\\n\", \"output\": [\"770937198\"]}, {\"input\": \"9859 748096\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"125987 264237\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"209411 813081\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"325539 329221\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"376259 910770\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"492387 235422\\r\\n\", \"output\": [\"249147139\"]}, {\"input\": \"608515 751563\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"691939 300407\\r\\n\", \"output\": [\"700547157\"]}, {\"input\": \"30518 196518\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"146646 521171\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"230070 37311\\r\\n\", \"output\": [\"993306535\"]}, {\"input\": \"313494 586155\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"396918 167704\\r\\n\", \"output\": [\"943821934\"]}, {\"input\": \"513046 683844\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"629174 232688\\r\\n\", \"output\": [\"831745227\"]}, {\"input\": \"679894 524637\\r\\n\", \"output\": [\"655418678\"]}, {\"input\": \"796022 73481\\r\\n\", \"output\": [\"883548575\"]}, {\"input\": \"879446 655030\\r\\n\", \"output\": [\"563982505\"]}, {\"input\": \"405440 588704\\r\\n\", \"output\": [\"0\"]}]"} {"prob_desc_description":"Ivan has a robot which is situated on an infinite grid. Initially the robot is standing in the starting cell (0,\u20090). The robot can process commands. There are four types of commands it can perform: U \u2014 move from the cell (x,\u2009y) to (x,\u2009y\u2009+\u20091); D \u2014 move from (x,\u2009y) to (x,\u2009y\u2009-\u20091); L \u2014 move from (x,\u2009y) to (x\u2009-\u20091,\u2009y); R \u2014 move from (x,\u2009y) to (x\u2009+\u20091,\u2009y). Ivan entered a sequence of n commands, and the robot processed it. After this sequence the robot ended up in the starting cell (0,\u20090), but Ivan doubts that the sequence is such that after performing it correctly the robot ends up in the same cell. He thinks that some commands were ignored by robot. To acknowledge whether the robot is severely bugged, he needs to calculate the maximum possible number of commands that were performed correctly. Help Ivan to do the calculations!","prob_desc_output_spec":"Print the maximum possible number of commands from the sequence the robot could perform to end up in the starting cell.","lang_cluster":"","src_uid":"b9fa2bb8001bd064ede531a5281cfd8a","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["greedy"],"prob_desc_created_at":"1510239900","prob_desc_sample_inputs":"[\"4\\nLDUR\", \"5\\nRRRUU\", \"6\\nLLRRRR\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":1000.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line contains one number n \u2014 the length of sequence of commands entered by Ivan (1\u2009\u2264\u2009n\u2009\u2264\u2009100). The second line contains the sequence itself \u2014 a string consisting of n characters. Each character can be U, D, L or R.","prob_desc_sample_outputs":"[\"4\", \"0\", \"4\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"4\\r\\nLDUR\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"5\\r\\nRRRUU\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"6\\r\\nLLRRRR\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"88\\r\\nLLUUULRDRRURDDLURRLRDRLLRULRUUDDLLLLRRDDURDURRLDURRLDRRRUULDDLRRRDDRRLUULLURDURUDDDDDLDR\\r\\n\", \"output\": [\"76\"]}, {\"input\": \"89\\r\\nLDLLLDRDUDURRRRRUDULDDDLLUDLRLRLRLDLDUULRDUDLRRDLUDLURRDDRRDLDUDUUURUUUDRLUDUDLURDLDLLDDU\\r\\n\", \"output\": [\"80\"]}, {\"input\": \"90\\r\\nRRRDUULLLRDUUDDRLDLRLUDURDRDUUURUURDDRRRURLDDDUUDRLLLULURDRDRURLDRRRRUULDULDDLLLRRLRDLLLLR\\r\\n\", \"output\": [\"84\"]}, {\"input\": \"91\\r\\nRLDRLRRLLDLULULLURULLRRULUDUULLUDULDUULURUDRUDUURDULDUDDUUUDRRUUDLLRULRULURLDRDLDRURLLLRDDD\\r\\n\", \"output\": [\"76\"]}, {\"input\": \"92\\r\\nRLRDDLULRLLUURRDDDLDDDLDDUURRRULLRDULDULLLUUULDUDLRLRRDRDRDDULDRLUDRDULDRURUDUULLRDRRLLDRLRR\\r\\n\", \"output\": [\"86\"]}, {\"input\": \"93\\r\\nRLLURLULRURDDLUURLUDDRDLUURLRDLRRRDUULLRDRRLRLDURRDLLRDDLLLDDDLDRRURLLDRUDULDDRRULRRULRLDRDLR\\r\\n\", \"output\": [\"84\"]}, {\"input\": \"94\\r\\nRDULDDDLULRDRUDRUUDUUDRRRULDRRUDURUULRDUUDLULLLUDURRDRDLUDRULRRRULUURUDDDDDUDLLRDLDRLLRUUURLUL\\r\\n\", \"output\": [\"86\"]}, {\"input\": \"95\\r\\nRDLUUULLUURDDRLDLLRRRULRLRDULULRULRUDURLULDDDRLURLDRULDUDUUULLRDDURUULULLDDLDRDRLLLURLRDLLDDDDU\\r\\n\", \"output\": [\"86\"]}, {\"input\": \"96\\r\\nRDDRLRLLDDULRLRURUDLRLDUDRURLLUUDLLURDLRRUURDRRUDRURLLDLLRDURDURLRLUDURULLLRDUURULUUULRRURRDLURL\\r\\n\", \"output\": [\"84\"]}, {\"input\": \"97\\r\\nRURDDLRLLRULUDURDLRLLUUDURRLLUDLLLDUDRUULDRUUURURULRDLDRRLLUUUDLLLDDLLLLRLLDUDRRDLLUDLRURUDULRLUR\\r\\n\", \"output\": [\"82\"]}, {\"input\": \"98\\r\\nRUDURLULLDDLLRDLLRDDLLLLRLDDDDRRRDDRRURLDRLLRUUUDLUUUDDDUDRUURLURUUDUUDRULRRULLRRLRULLULDLUURLULRD\\r\\n\", \"output\": [\"92\"]}, {\"input\": \"99\\r\\nRRULLDULRRDRULLDUDRUDDDRLLUUDRDDUDURLDDRUUDRRUUURRRURDDLDUURDLRLURRDDLUDDLUDURDRUDDURLURURLRUDRURLD\\r\\n\", \"output\": [\"86\"]}, {\"input\": \"100\\r\\nUDRLRRLLRRLRRRDDLLDDDLULLDDLURUURUULUDDDRDDLLRDLLUURLRDRLRRLRLLLULDUDDUURRLRDULDRDURRRRRRULDRRDLDRRL\\r\\n\", \"output\": [\"88\"]}, {\"input\": \"1\\r\\nU\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"5\\r\\nUUULD\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1\\r\\nD\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"5\\r\\nURLUL\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"5\\r\\nDDDRU\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"2\\r\\nLR\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"8\\r\\nDDRDLDUR\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"6\\r\\nLLLLUD\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"13\\r\\nRRRLLLLLLLLLL\\r\\n\", \"output\": [\"6\"]}]"} {"prob_desc_description":"You are given an array a consisting of n integers, and additionally an integer m. You have to choose some sequence of indices b1,\u2009b2,\u2009...,\u2009bk (1\u2009\u2264\u2009b1\u2009<\u2009b2\u2009<\u2009...\u2009<\u2009bk\u2009\u2264\u2009n) in such a way that the value of is maximized. Chosen sequence can be empty.Print the maximum possible value of .","prob_desc_output_spec":"Print the maximum possible value of .","lang_cluster":"","src_uid":"d3a8a3e69a55936ee33aedd66e5b7f4a","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["bitmasks","meet-in-the-middle","divide and conquer"],"prob_desc_created_at":"1510239900","prob_desc_sample_inputs":"[\"4 4\\n5 2 4 1\", \"3 20\\n199 41 299\"]","prob_desc_notes":"NoteIn the first example you can choose a sequence b\u2009=\u2009{1,\u20092}, so the sum is equal to 7 (and that's 3 after taking it modulo 4).In the second example you can choose a sequence b\u2009=\u2009{3}.","exec_outcome":"","difficulty":1800.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line contains two integers n and m (1\u2009\u2264\u2009n\u2009\u2264\u200935, 1\u2009\u2264\u2009m\u2009\u2264\u2009109). The second line contains n integers a1, a2, ..., an (1\u2009\u2264\u2009ai\u2009\u2264\u2009109).","prob_desc_sample_outputs":"[\"3\", \"19\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"4 4\\r\\n5 2 4 1\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"3 20\\r\\n199 41 299\\r\\n\", \"output\": [\"19\"]}, {\"input\": \"5 10\\r\\n47 100 49 2 56\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"5 1000\\r\\n38361 75847 14913 11499 8297\\r\\n\", \"output\": [\"917\"]}, {\"input\": \"10 10\\r\\n48 33 96 77 67 59 35 15 14 86\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"10 1000\\r\\n16140 63909 7177 99953 35627 40994 29288 7324 44476 36738\\r\\n\", \"output\": [\"999\"]}, {\"input\": \"30 10\\r\\n99 44 42 36 43 82 99 99 10 79 97 84 5 78 37 45 87 87 11 11 79 66 47 100 8 50 27 98 32 27\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"30 1000\\r\\n81021 18939 94456 90340 76840 78808 27921 71826 99382 1237 93435 35153 71691 25508 96732 23778 49073 60025 95231 88719 61650 50925 34416 73600 7295 14654 78340 72871 17324 77484\\r\\n\", \"output\": [\"999\"]}, {\"input\": \"35 10\\r\\n86 66 98 91 61 71 14 58 49 92 13 97 13 22 98 83 85 29 85 41 51 16 76 17 75 25 71 10 87 11 9 34 3 6 4\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"35 1000\\r\\n33689 27239 14396 26525 30455 13710 37039 80789 26268 1236 89916 87557 90571 13710 59152 99417 39577 40675 25931 14900 86611 46223 7105 64074 41238 59169 81308 70534 99894 10332 72983 85414 73848 68378 98404\\r\\n\", \"output\": [\"999\"]}, {\"input\": \"35 1000000000\\r\\n723631245 190720106 931659134 503095294 874181352 712517040 800614682 904895364 256863800 39366772 763190862 770183843 774794919 55669976 329106527 513566505 207828535 258356470 816288168 657823769 5223226 865258331 655737365 278677545 880429272 718852999 810522025 229560899 544602508 195068526 878937336 739178504 474601895 54057210 432282541\\r\\n\", \"output\": [\"999999999\"]}, {\"input\": \"35 982451653\\r\\n27540278 680344696 757828533 487257472 581415866 897315944 104006244 109795853 24393319 840585536 643747159 864374693 675946278 27492061 172462571 484550119 801174500 94160579 818984382 53253720 966692115 811281559 154162995 890236127 799613478 611617443 787587569 606421577 91876376 464150101 671199076 108388038 342311910 974681791 862530363\\r\\n\", \"output\": [\"982451652\"]}, {\"input\": \"15 982451653\\r\\n384052103 7482105 882228352 582828798 992251028 892163214 687253903 951043841 277531875 402248542 499362766 919046434 350763964 288775999 982610665\\r\\n\", \"output\": [\"982368704\"]}, {\"input\": \"35 1000000000\\r\\n513 9778 5859 8149 297 7965 7152 917 243 4353 7248 4913 9403 6199 2930 7461 3888 1898 3222 9424 3960 1902 2933 5268 2650 1687 5319 5065 8450 141 4219 2586 2176 1118 9635\\r\\n\", \"output\": [\"158921\"]}, {\"input\": \"35 982451653\\r\\n5253 7912 3641 7428 6138 9613 9059 6352 9070 89 9030 1686 3098 7852 3316 8158 7497 5804 130 6201 235 64 3451 6104 4148 3446 6059 6802 7466 8781 1636 8291 8874 8924 5997\\r\\n\", \"output\": [\"197605\"]}, {\"input\": \"15 982451653\\r\\n7975 7526 1213 2318 209 7815 4153 1853 6651 2880 4535 587 8022 3365 5491\\r\\n\", \"output\": [\"64593\"]}, {\"input\": \"35 1730970\\r\\n141538 131452 93552 3046 119468 8282 166088 33782 36462 25246 178798 81434 180900 15102 175898 157782 155254 166352 60772 75162 102326 104854 181138 58618 123800 54458 157516 20658 25084 155276 194920 16680 15148 188292 88802\\r\\n\", \"output\": [\"1730968\"]}, {\"input\": \"35 346194136\\r\\n89792 283104 58936 184528 194768 253076 304368 140216 220836 69196 274604 68988 300412 242588 25328 183488 81712 374964 377696 317872 146208 147400 346276 14356 90432 347556 35452 119348 311320 126112 113200 98936 189500 363424 320164\\r\\n\", \"output\": [\"6816156\"]}, {\"input\": \"35 129822795\\r\\n379185 168630 1047420 892020 180690 1438200 168330 1328610 933930 936360 1065225 351990 1079190 681510 1336020 814590 365820 1493580 495825 809745 309585 190320 1148640 146790 1008900 365655 947265 1314060 1048770 1463535 1233420 969330 1324530 944130 1457160\\r\\n\", \"output\": [\"29838960\"]}, {\"input\": \"35 106920170\\r\\n36941450 53002950 90488020 66086895 77577045 16147985 26130825 84977690 87374560 59007480 61416705 100977415 43291920 56833000 12676230 50531950 5325005 54745005 105536410 76922230 9031505 121004870 104634495 16271535 55819890 47603815 85830185 65938635 33074335 40289655 889560 19829775 31653510 120671285 37843365\\r\\n\", \"output\": [\"106907815\"]}, {\"input\": \"35 200000000\\r\\n75420000 93400000 70560000 93860000 183600000 143600000 61780000 145000000 99360000 14560000 109280000 22040000 141220000 14360000 55140000 78580000 96940000 62400000 173220000 40420000 139600000 30100000 141640000 64780000 186080000 159220000 137780000 133640000 83560000 51280000 139100000 133020000 99460000 35900000 78980000\\r\\n\", \"output\": [\"199980000\"]}, {\"input\": \"4 1\\r\\n435 124 324 2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 12\\r\\n13\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 1000000000\\r\\n1000000000\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"7 19\\r\\n8 1 4 8 8 7 3\\r\\n\", \"output\": [\"18\"]}, {\"input\": \"6 7\\r\\n1 1 1 1 1 6\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"3 5\\r\\n1 2 3\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"4 36\\r\\n22 9 24 27\\r\\n\", \"output\": [\"33\"]}, {\"input\": \"2 8\\r\\n7 1\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"2 12\\r\\n8 7\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"4 10\\r\\n11 31 12 3\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"2 8\\r\\n2 7\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"4 19\\r\\n16 20 19 21\\r\\n\", \"output\": [\"18\"]}, {\"input\": \"3 4\\r\\n9 16 11\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"2 3\\r\\n3 7\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 20\\r\\n4 3\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"3 299\\r\\n100 100 200\\r\\n\", \"output\": [\"200\"]}]"} {"prob_desc_description":"Amr loves Geometry. One day he came up with a very interesting problem.Amr has a circle of radius r and center in point (x,\u2009y). He wants the circle center to be in new position (x',\u2009y').In one step Amr can put a pin to the border of the circle in a certain point, then rotate the circle around that pin by any angle and finally remove the pin.Help Amr to achieve his goal in minimum number of steps.","prob_desc_output_spec":"Output a single integer \u2014 minimum number of steps required to move the center of the circle to the destination point.","lang_cluster":"","src_uid":"698da80c7d24252b57cca4e4f0ca7031","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["geometry","math"],"prob_desc_created_at":"1422028800","prob_desc_sample_inputs":"[\"2 0 0 0 4\", \"1 1 1 4 4\", \"4 5 6 5 6\"]","prob_desc_notes":"NoteIn the first sample test the optimal way is to put a pin at point (0,\u20092) and rotate the circle by 180 degrees counter-clockwise (or clockwise, no matter).","exec_outcome":"","difficulty":1400.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"Input consists of 5 space-separated integers r, x, y, x' y' (1\u2009\u2264\u2009r\u2009\u2264\u2009105, \u2009-\u2009105\u2009\u2264\u2009x,\u2009y,\u2009x',\u2009y'\u2009\u2264\u2009105), circle radius, coordinates of original center of the circle and coordinates of destination center of the circle respectively.","prob_desc_sample_outputs":"[\"1\", \"3\", \"0\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2 0 0 0 4\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 1 1 4 4\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"4 5 6 5 6\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"10 20 0 40 0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"9 20 0 40 0\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"5 -1 -6 -5 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"99125 26876 -21414 14176 17443\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"8066 7339 19155 -90534 -60666\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"100000 -100000 -100000 100000 100000\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"10 20 0 41 0\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"25 -64 -6 -56 64\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"125 455 450 439 721\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"5 6 3 7 2\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"24 130 14786 3147 2140\\r\\n\", \"output\": [\"271\"]}, {\"input\": \"125 -363 176 93 330\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1 14 30 30 14\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"25 96 13 7 2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"4 100000 -100000 100000 -100000\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 3 4 2 5\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 -3 3 2 6\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"2 7 20 13 -5\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"1 1 1 1 4\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"249 -54242 -30537 -45023 -89682\\r\\n\", \"output\": [\"121\"]}, {\"input\": \"4 100000 -100000 100000 -99999\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"97741 23818 78751 97583 26933\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"56767 -29030 51625 79823 -56297\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"98260 13729 74998 23701 9253\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"67377 -80131 -90254 -57320 14102\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 100000 100000 100000 -100000\\r\\n\", \"output\": [\"100000\"]}, {\"input\": \"19312 19470 82059 58064 62231\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"67398 -68747 -79056 -34193 29400\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"91099 37184 -71137 75650 -3655\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"46456 -2621 -23623 -98302 -99305\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"100 100000 -100000 100000 -99999\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 100000 -100000 100000 -100000\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"8 0 0 0 32\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"100000 100000 1 -100000 0\\r\\n\", \"output\": [\"2\"]}]"} {"prob_desc_description":"Drazil is playing a math game with Varda.Let's define for positive integer x as a product of factorials of its digits. For example, .First, they choose a decimal number a consisting of n digits that contains at least one digit larger than 1. This number may possibly start with leading zeroes. Then they should find maximum positive number x satisfying following two conditions:1. x doesn't contain neither digit 0 nor digit 1.2. = .Help friends find such number.","prob_desc_output_spec":"Output a maximum possible integer satisfying the conditions above. There should be no zeroes and ones in this number decimal representation.","lang_cluster":"","src_uid":"60dbfc7a65702ae8bd4a587db1e06398","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["greedy","math","sortings","dp","implementation"],"prob_desc_created_at":"1424190900","prob_desc_sample_inputs":"[\"4\\n1234\", \"3\\n555\"]","prob_desc_notes":"NoteIn the first case, ","exec_outcome":"","difficulty":1400.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line contains an integer n (1\u2009\u2264\u2009n\u2009\u2264\u200915) \u2014 the number of digits in a. The second line contains n digits of a. There is at least one digit in a that is larger than 1. Number a may possibly contain leading zeroes.","prob_desc_sample_outputs":"[\"33222\", \"555\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"4\\r\\n1234\\r\\n\", \"output\": [\"33222\"]}, {\"input\": \"3\\r\\n555\\r\\n\", \"output\": [\"555\"]}, {\"input\": \"15\\r\\n012345781234578\\r\\n\", \"output\": [\"7777553333222222222222\"]}, {\"input\": \"1\\r\\n8\\r\\n\", \"output\": [\"7222\"]}, {\"input\": \"10\\r\\n1413472614\\r\\n\", \"output\": [\"75333332222222\"]}, {\"input\": \"8\\r\\n68931246\\r\\n\", \"output\": [\"77553333332222222\"]}, {\"input\": \"7\\r\\n4424368\\r\\n\", \"output\": [\"75333332222222222\"]}, {\"input\": \"6\\r\\n576825\\r\\n\", \"output\": [\"7755532222\"]}, {\"input\": \"5\\r\\n97715\\r\\n\", \"output\": [\"7775332\"]}, {\"input\": \"3\\r\\n915\\r\\n\", \"output\": [\"75332\"]}, {\"input\": \"2\\r\\n26\\r\\n\", \"output\": [\"532\"]}, {\"input\": \"1\\r\\n4\\r\\n\", \"output\": [\"322\"]}, {\"input\": \"15\\r\\n028745260720699\\r\\n\", \"output\": [\"7777755533333332222222222\"]}, {\"input\": \"13\\r\\n5761790121605\\r\\n\", \"output\": [\"7775555333322\"]}, {\"input\": \"10\\r\\n3312667105\\r\\n\", \"output\": [\"755533332\"]}, {\"input\": \"1\\r\\n7\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"15\\r\\n989898989898989\\r\\n\", \"output\": [\"777777777777777333333333333333322222222222222222222222222222\"]}, {\"input\": \"15\\r\\n000000000000007\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"15\\r\\n999999999999990\\r\\n\", \"output\": [\"77777777777777333333333333333333333333333322222222222222\"]}, {\"input\": \"1\\r\\n2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1\\r\\n3\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"1\\r\\n5\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"1\\r\\n6\\r\\n\", \"output\": [\"53\"]}, {\"input\": \"1\\r\\n9\\r\\n\", \"output\": [\"7332\"]}, {\"input\": \"2\\r\\n09\\r\\n\", \"output\": [\"7332\"]}, {\"input\": \"13\\r\\n1337251172966\\r\\n\", \"output\": [\"777555333333222\"]}, {\"input\": \"15\\r\\n987654329876543\\r\\n\", \"output\": [\"777777555533333333332222222222222\"]}, {\"input\": \"9\\r\\n234567899\\r\\n\", \"output\": [\"777755333333322222222\"]}, {\"input\": \"2\\r\\n99\\r\\n\", \"output\": [\"77333322\"]}, {\"input\": \"2\\r\\n66\\r\\n\", \"output\": [\"5533\"]}, {\"input\": \"3\\r\\n999\\r\\n\", \"output\": [\"777333333222\"]}, {\"input\": \"5\\r\\n99999\\r\\n\", \"output\": [\"77777333333333322222\"]}, {\"input\": \"9\\r\\n123456789\\r\\n\", \"output\": [\"77755333332222222\"]}, {\"input\": \"9\\r\\n987654321\\r\\n\", \"output\": [\"77755333332222222\"]}, {\"input\": \"3\\r\\n666\\r\\n\", \"output\": [\"555333\"]}, {\"input\": \"6\\r\\n555777\\r\\n\", \"output\": [\"777555\"]}, {\"input\": \"10\\r\\n1234567899\\r\\n\", \"output\": [\"777755333333322222222\"]}, {\"input\": \"4\\r\\n6666\\r\\n\", \"output\": [\"55553333\"]}, {\"input\": \"4\\r\\n9754\\r\\n\", \"output\": [\"775333222\"]}, {\"input\": \"2\\r\\n95\\r\\n\", \"output\": [\"75332\"]}, {\"input\": \"14\\r\\n11122233344455\\r\\n\", \"output\": [\"55333333222222222\"]}, {\"input\": \"12\\r\\n836544897832\\r\\n\", \"output\": [\"77777553333333222222222222222\"]}]"} {"prob_desc_description":"Let's define the permutation of length n as an array p\u2009=\u2009[p1,\u2009p2,\u2009...,\u2009pn] consisting of n distinct integers from range from 1 to n. We say that this permutation maps value 1 into the value p1, value 2 into the value p2 and so on.Kyota Ootori has just learned about cyclic representation of a permutation. A cycle is a sequence of numbers such that each element of this sequence is being mapped into the next element of this sequence (and the last element of the cycle is being mapped into the first element of the cycle). The cyclic representation is a representation of p as a collection of cycles forming p. For example, permutation p\u2009=\u2009[4,\u20091,\u20096,\u20092,\u20095,\u20093] has a cyclic representation that looks like (142)(36)(5) because 1 is replaced by 4, 4 is replaced by 2, 2 is replaced by 1, 3 and 6 are swapped, and 5 remains in place. Permutation may have several cyclic representations, so Kyoya defines the standard cyclic representation of a permutation as follows. First, reorder the elements within each cycle so the largest element is first. Then, reorder all of the cycles so they are sorted by their first element. For our example above, the standard cyclic representation of [4,\u20091,\u20096,\u20092,\u20095,\u20093] is (421)(5)(63).Now, Kyoya notices that if we drop the parenthesis in the standard cyclic representation, we get another permutation! For instance, [4,\u20091,\u20096,\u20092,\u20095,\u20093] will become [4,\u20092,\u20091,\u20095,\u20096,\u20093].Kyoya notices that some permutations don't change after applying operation described above at all. He wrote all permutations of length n that do not change in a list in lexicographic order. Unfortunately, his friend Tamaki Suoh lost this list. Kyoya wishes to reproduce the list and he needs your help. Given the integers n and k, print the permutation that was k-th on Kyoya's list.","prob_desc_output_spec":"Print n space-separated integers, representing the permutation that is the answer for the question. ","lang_cluster":"","src_uid":"e03c6d3bb8cf9119530668765691a346","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["greedy","combinatorics","binary search","constructive algorithms","math","implementation"],"prob_desc_created_at":"1435163400","prob_desc_sample_inputs":"[\"4 3\", \"10 1\"]","prob_desc_notes":"NoteThe standard cycle representation is (1)(32)(4), which after removing parenthesis gives us the original permutation. The first permutation on the list would be [1,\u20092,\u20093,\u20094], while the second permutation would be [1,\u20092,\u20094,\u20093].","exec_outcome":"","difficulty":1900.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line will contain two integers n, k (1\u2009\u2264\u2009n\u2009\u2264\u200950, 1\u2009\u2264\u2009k\u2009\u2264\u2009min{1018,\u2009l} where l is the length of the Kyoya's list).","prob_desc_sample_outputs":"[\"1 3 2 4\", \"1 2 3 4 5 6 7 8 9 10\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"4 3\\r\\n\", \"output\": [\"1 3 2 4\"]}, {\"input\": \"10 1\\r\\n\", \"output\": [\"1 2 3 4 5 6 7 8 9 10\"]}, {\"input\": \"1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"50 1\\r\\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\"]}, {\"input\": \"10 57\\r\\n\", \"output\": [\"2 1 3 4 5 6 7 8 10 9\"]}, {\"input\": \"50 20365011074\\r\\n\", \"output\": [\"2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 20 19 22 21 24 23 26 25 28 27 30 29 32 31 34 33 36 35 38 37 40 39 42 41 44 43 46 45 48 47 50 49\"]}, {\"input\": \"20 9999\\r\\n\", \"output\": [\"2 1 4 3 5 7 6 8 9 10 11 13 12 14 15 17 16 18 19 20\"]}, {\"input\": \"49 12586269025\\r\\n\", \"output\": [\"2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 20 19 22 21 24 23 26 25 28 27 30 29 32 31 34 33 36 35 38 37 40 39 42 41 44 43 46 45 48 47 49\"]}, {\"input\": \"49 1\\r\\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\"]}, {\"input\": \"10 89\\r\\n\", \"output\": [\"2 1 4 3 6 5 8 7 10 9\"]}, {\"input\": \"10 1\\r\\n\", \"output\": [\"1 2 3 4 5 6 7 8 9 10\"]}, {\"input\": \"5 8\\r\\n\", \"output\": [\"2 1 4 3 5\"]}, {\"input\": \"5 1\\r\\n\", \"output\": [\"1 2 3 4 5\"]}, {\"input\": \"25 121393\\r\\n\", \"output\": [\"2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 20 19 22 21 24 23 25\"]}, {\"input\": \"25 1\\r\\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\"]}, {\"input\": \"1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 2\\r\\n\", \"output\": [\"2 1\"]}, {\"input\": \"3 3\\r\\n\", \"output\": [\"2 1 3\"]}, {\"input\": \"4 2\\r\\n\", \"output\": [\"1 2 4 3\"]}, {\"input\": \"5 8\\r\\n\", \"output\": [\"2 1 4 3 5\"]}, {\"input\": \"6 10\\r\\n\", \"output\": [\"2 1 3 4 6 5\"]}, {\"input\": \"7 20\\r\\n\", \"output\": [\"2 1 4 3 5 7 6\"]}, {\"input\": \"8 24\\r\\n\", \"output\": [\"2 1 3 4 5 7 6 8\"]}, {\"input\": \"9 1\\r\\n\", \"output\": [\"1 2 3 4 5 6 7 8 9\"]}, {\"input\": \"10 24\\r\\n\", \"output\": [\"1 2 4 3 5 6 7 9 8 10\"]}, {\"input\": \"11 77\\r\\n\", \"output\": [\"1 3 2 5 4 6 7 8 9 10 11\"]}, {\"input\": \"12 101\\r\\n\", \"output\": [\"1 3 2 4 5 6 8 7 10 9 11 12\"]}, {\"input\": \"13 240\\r\\n\", \"output\": [\"2 1 3 4 5 6 7 8 10 9 11 13 12\"]}, {\"input\": \"14 356\\r\\n\", \"output\": [\"1 3 2 5 4 6 8 7 10 9 12 11 14 13\"]}, {\"input\": \"15 463\\r\\n\", \"output\": [\"1 3 2 4 5 7 6 9 8 11 10 12 13 15 14\"]}, {\"input\": \"16 747\\r\\n\", \"output\": [\"1 3 2 4 5 7 6 9 8 11 10 12 13 14 15 16\"]}, {\"input\": \"17 734\\r\\n\", \"output\": [\"1 2 4 3 5 6 8 7 10 9 11 12 13 14 15 16 17\"]}, {\"input\": \"18 1809\\r\\n\", \"output\": [\"1 3 2 4 5 6 8 7 10 9 11 12 14 13 16 15 18 17\"]}, {\"input\": \"19 859\\r\\n\", \"output\": [\"1 2 3 4 6 5 8 7 9 10 11 12 14 13 15 16 18 17 19\"]}, {\"input\": \"20 491\\r\\n\", \"output\": [\"1 2 3 4 5 6 8 7 9 11 10 12 14 13 15 16 18 17 19 20\"]}, {\"input\": \"21 14921\\r\\n\", \"output\": [\"2 1 3 5 4 7 6 9 8 10 11 12 13 15 14 16 18 17 19 20 21\"]}, {\"input\": \"22 731\\r\\n\", \"output\": [\"1 2 3 4 5 6 7 9 8 10 11 13 12 14 16 15 18 17 19 21 20 22\"]}, {\"input\": \"23 45599\\r\\n\", \"output\": [\"2 1 4 3 6 5 8 7 9 10 11 13 12 15 14 16 18 17 20 19 21 22 23\"]}, {\"input\": \"24 47430\\r\\n\", \"output\": [\"2 1 3 4 5 6 7 8 10 9 11 12 13 14 16 15 17 19 18 21 20 22 24 23\"]}, {\"input\": \"25 58467\\r\\n\", \"output\": [\"1 3 2 4 6 5 7 8 9 11 10 12 13 15 14 16 17 19 18 20 21 22 23 24 25\"]}, {\"input\": \"26 168988\\r\\n\", \"output\": [\"2 1 4 3 5 6 7 8 9 10 12 11 13 15 14 16 17 18 19 20 21 23 22 24 26 25\"]}, {\"input\": \"27 298209\\r\\n\", \"output\": [\"2 1 4 3 5 7 6 9 8 10 12 11 14 13 15 16 17 19 18 21 20 22 24 23 25 27 26\"]}, {\"input\": \"28 77078\\r\\n\", \"output\": [\"1 2 3 5 4 6 7 8 9 10 11 13 12 14 16 15 17 18 20 19 22 21 23 24 25 27 26 28\"]}, {\"input\": \"29 668648\\r\\n\", \"output\": [\"2 1 3 5 4 6 8 7 9 10 12 11 13 14 15 16 17 19 18 20 22 21 23 25 24 26 27 29 28\"]}, {\"input\": \"30 582773\\r\\n\", \"output\": [\"1 3 2 4 5 6 8 7 10 9 11 13 12 14 15 16 17 19 18 20 21 23 22 25 24 26 28 27 29 30\"]}, {\"input\": \"31 1899100\\r\\n\", \"output\": [\"2 1 4 3 5 6 7 8 10 9 11 13 12 15 14 16 17 19 18 21 20 23 22 24 26 25 28 27 29 31 30\"]}, {\"input\": \"32 1314567\\r\\n\", \"output\": [\"1 2 4 3 6 5 8 7 9 11 10 13 12 14 16 15 18 17 19 20 22 21 23 24 25 26 27 28 30 29 32 31\"]}, {\"input\": \"33 1811927\\r\\n\", \"output\": [\"1 2 4 3 5 7 6 9 8 10 11 13 12 15 14 16 18 17 19 21 20 22 23 24 25 26 27 28 29 31 30 32 33\"]}, {\"input\": \"34 2412850\\r\\n\", \"output\": [\"1 2 4 3 5 6 7 9 8 10 11 13 12 14 16 15 18 17 19 20 21 22 23 25 24 26 28 27 29 31 30 32 34 33\"]}, {\"input\": \"35 706065\\r\\n\", \"output\": [\"1 2 3 4 5 6 8 7 9 11 10 13 12 15 14 16 18 17 20 19 21 23 22 25 24 27 26 28 29 31 30 32 33 35 34\"]}, {\"input\": \"36 7074882\\r\\n\", \"output\": [\"1 2 4 3 5 7 6 8 9 10 11 12 13 14 16 15 18 17 19 20 22 21 23 25 24 26 27 28 30 29 32 31 33 34 35 36\"]}, {\"input\": \"37 27668397\\r\\n\", \"output\": [\"2 1 3 4 5 7 6 9 8 11 10 13 12 15 14 16 18 17 19 21 20 23 22 24 25 26 28 27 30 29 32 31 34 33 35 36 37\"]}, {\"input\": \"38 23790805\\r\\n\", \"output\": [\"1 2 4 3 6 5 8 7 10 9 11 12 14 13 15 16 18 17 20 19 21 22 24 23 25 27 26 29 28 31 30 32 33 34 36 35 38 37\"]}, {\"input\": \"39 68773650\\r\\n\", \"output\": [\"2 1 3 4 5 6 8 7 10 9 12 11 13 15 14 16 17 19 18 20 21 23 22 24 26 25 28 27 29 31 30 32 33 34 35 36 37 39 38\"]}, {\"input\": \"40 43782404\\r\\n\", \"output\": [\"1 2 4 3 5 6 7 9 8 10 12 11 14 13 15 16 17 18 20 19 21 22 23 25 24 26 28 27 29 31 30 32 34 33 36 35 37 39 38 40\"]}, {\"input\": \"41 130268954\\r\\n\", \"output\": [\"1 3 2 4 6 5 7 8 10 9 11 12 13 14 16 15 17 19 18 20 21 23 22 25 24 26 27 28 30 29 31 32 34 33 35 36 37 38 39 41 40\"]}, {\"input\": \"42 40985206\\r\\n\", \"output\": [\"1 2 3 4 6 5 7 8 9 10 11 13 12 15 14 16 17 18 19 21 20 22 24 23 25 26 28 27 29 30 31 33 32 35 34 36 37 39 38 40 42 41\"]}, {\"input\": \"43 193787781\\r\\n\", \"output\": [\"1 2 4 3 5 6 8 7 9 10 12 11 13 14 16 15 17 18 19 20 21 22 24 23 25 26 27 28 29 30 31 32 33 35 34 36 38 37 39 40 41 43 42\"]}, {\"input\": \"44 863791309\\r\\n\", \"output\": [\"2 1 3 4 6 5 8 7 10 9 12 11 13 14 15 16 18 17 19 20 21 22 23 24 26 25 27 29 28 31 30 32 34 33 36 35 38 37 40 39 41 42 44 43\"]}, {\"input\": \"45 1817653076\\r\\n\", \"output\": [\"2 1 4 3 6 5 8 7 9 11 10 12 14 13 16 15 18 17 19 20 22 21 24 23 25 27 26 29 28 30 32 31 34 33 35 36 38 37 39 40 42 41 43 44 45\"]}, {\"input\": \"46 1176411936\\r\\n\", \"output\": [\"1 3 2 4 5 6 7 8 10 9 11 12 13 14 16 15 17 18 19 21 20 22 23 25 24 27 26 29 28 31 30 32 34 33 35 37 36 38 40 39 41 42 43 44 46 45\"]}, {\"input\": \"47 4199125763\\r\\n\", \"output\": [\"2 1 4 3 5 6 7 8 10 9 12 11 13 14 16 15 18 17 20 19 22 21 23 24 25 27 26 28 30 29 31 32 33 34 36 35 38 37 39 40 41 43 42 44 45 46 47\"]}, {\"input\": \"48 4534695914\\r\\n\", \"output\": [\"1 3 2 5 4 6 8 7 10 9 12 11 14 13 15 17 16 18 19 21 20 23 22 25 24 26 27 28 29 30 31 32 33 34 36 35 37 38 40 39 41 43 42 44 46 45 47 48\"]}, {\"input\": \"49 3790978105\\r\\n\", \"output\": [\"1 2 4 3 5 7 6 8 9 11 10 12 13 15 14 16 17 18 19 21 20 22 24 23 25 27 26 28 30 29 31 33 32 35 34 37 36 38 39 41 40 42 44 43 45 47 46 48 49\"]}, {\"input\": \"50 5608642004\\r\\n\", \"output\": [\"1 2 4 3 5 6 8 7 9 10 11 13 12 15 14 17 16 18 20 19 22 21 23 24 25 26 28 27 30 29 31 32 33 34 35 36 38 37 40 39 42 41 44 43 45 46 47 48 50 49\"]}]"} {"prob_desc_description":"You are given three sticks with positive integer lengths of a,\u2009b, and c centimeters. You can increase length of some of them by some positive integer number of centimeters (different sticks can be increased by a different length), but in total by at most l centimeters. In particular, it is allowed not to increase the length of any stick.Determine the number of ways to increase the lengths of some sticks so that you can form from them a non-degenerate (that is, having a positive area) triangle. Two ways are considered different, if the length of some stick is increased by different number of centimeters in them.","prob_desc_output_spec":"Print a single integer \u2014 the number of ways to increase the sizes of the sticks by the total of at most l centimeters, so that you can make a non-degenerate triangle from it.","lang_cluster":"","src_uid":"185ff90a8b0ae0e2b75605f772589410","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","combinatorics","brute force","dp","implementation"],"prob_desc_created_at":"1440261000","prob_desc_sample_inputs":"[\"1 1 1 2\", \"1 2 3 1\", \"10 2 1 7\"]","prob_desc_notes":"NoteIn the first sample test you can either not increase any stick or increase any two sticks by 1 centimeter.In the second sample test you can increase either the first or the second stick by one centimeter. Note that the triangle made from the initial sticks is degenerate and thus, doesn't meet the conditions.","exec_outcome":"","difficulty":2100.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The single line contains 4 integers a,\u2009b,\u2009c,\u2009l (1\u2009\u2264\u2009a,\u2009b,\u2009c\u2009\u2264\u20093\u00b7105, 0\u2009\u2264\u2009l\u2009\u2264\u20093\u00b7105).","prob_desc_sample_outputs":"[\"4\", \"2\", \"0\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"1 1 1 2\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"1 2 3 1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"10 2 1 7\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 2 1 5\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"10 15 17 10\\r\\n\", \"output\": [\"281\"]}, {\"input\": \"5 5 5 10000\\r\\n\", \"output\": [\"41841675001\"]}, {\"input\": \"5 7 30 100\\r\\n\", \"output\": [\"71696\"]}, {\"input\": \"5 5 5 300000\\r\\n\", \"output\": [\"1125157500250001\"]}, {\"input\": \"4 2 5 28\\r\\n\", \"output\": [\"1893\"]}, {\"input\": \"2 7 8 4\\r\\n\", \"output\": [\"25\"]}, {\"input\": \"85 50 17 89\\r\\n\", \"output\": [\"68620\"]}, {\"input\": \"17 28 19 5558\\r\\n\", \"output\": [\"7396315389\"]}, {\"input\": \"5276 8562 1074 8453\\r\\n\", \"output\": [\"49093268246\"]}, {\"input\": \"9133 7818 3682 82004\\r\\n\", \"output\": [\"38306048676255\"]}, {\"input\": \"81780 54799 231699 808\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"53553 262850 271957 182759\\r\\n\", \"output\": [\"834977070873802\"]}, {\"input\": \"300000 300000 300000 300000\\r\\n\", \"output\": [\"4500090000549998\"]}, {\"input\": \"1 1 300000 300000\\r\\n\", \"output\": [\"599999\"]}, {\"input\": \"300000 300000 1 300000\\r\\n\", \"output\": [\"2250045000350001\"]}, {\"input\": \"300000 300000 1 24234\\r\\n\", \"output\": [\"1186319275394\"]}, {\"input\": \"1 1 1 300000\\r\\n\", \"output\": [\"1125022500250001\"]}, {\"input\": \"3 5 7 300000\\r\\n\", \"output\": [\"1125157499050009\"]}, {\"input\": \"63 5 52 78\\r\\n\", \"output\": [\"46502\"]}, {\"input\": \"2 42 49 93\\r\\n\", \"output\": [\"72542\"]}, {\"input\": \"61 100 3 8502\\r\\n\", \"output\": [\"27050809786\"]}, {\"input\": \"30 918 702 591\\r\\n\", \"output\": [\"14315560\"]}, {\"input\": \"98406 37723 3 257918\\r\\n\", \"output\": [\"1154347569149860\"]}, {\"input\": \"552 250082 77579 278985\\r\\n\", \"output\": [\"596240712378446\"]}, {\"input\": \"183808 8 8 294771\\r\\n\", \"output\": [\"622921327009564\"]}, {\"input\": \"2958 4133 233463 259655\\r\\n\", \"output\": [\"65797591388150\"]}, {\"input\": \"300000 200000 100000 1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"300000 200000 100000 0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"100000 300000 100000 100000\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"100000 300000 100000 100001\\r\\n\", \"output\": [\"100002\"]}, {\"input\": \"100000 300000 100000 100002\\r\\n\", \"output\": [\"200005\"]}, {\"input\": \"100000 300000 100000 100003\\r\\n\", \"output\": [\"400012\"]}, {\"input\": \"100000 300000 100000 100010\\r\\n\", \"output\": [\"3000195\"]}, {\"input\": \"100000 300000 100000 100100\\r\\n\", \"output\": [\"255131325\"]}, {\"input\": \"100000 300000 199999 0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"100000 300000 200001 0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"3 1 29 1\\r\\n\", \"output\": [\"0\"]}]"} {"prob_desc_description":"One day Vasya the Hipster decided to count how many socks he had. It turned out that he had a red socks and b blue socks.According to the latest fashion, hipsters should wear the socks of different colors: a red one on the left foot, a blue one on the right foot.Every day Vasya puts on new socks in the morning and throws them away before going to bed as he doesn't want to wash them.Vasya wonders, what is the maximum number of days when he can dress fashionable and wear different socks, and after that, for how many days he can then wear the same socks until he either runs out of socks or cannot make a single pair from the socks he's got.Can you help him?","prob_desc_output_spec":"Print two space-separated integers \u2014 the maximum number of days when Vasya can wear different socks and the number of days when he can wear the same socks until he either runs out of socks or cannot make a single pair from the socks he's got. Keep in mind that at the end of the day Vasya throws away the socks that he's been wearing on that day.","lang_cluster":"","src_uid":"775766790e91e539c1cfaa5030e5b955","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","implementation"],"prob_desc_created_at":"1443430800","prob_desc_sample_inputs":"[\"3 1\", \"2 3\", \"7 3\"]","prob_desc_notes":"NoteIn the first sample Vasya can first put on one pair of different socks, after that he has two red socks left to wear on the second day.","exec_outcome":"","difficulty":800.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The single line of the input contains two positive integers a and b (1\u2009\u2264\u2009a,\u2009b\u2009\u2264\u2009100) \u2014 the number of red and blue socks that Vasya's got.","prob_desc_sample_outputs":"[\"1 1\", \"2 0\", \"3 2\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"3 1\\r\\n\", \"output\": [\"1 1\", \"1 1\", \"1\\r\\n1\"]}, {\"input\": \"2 3\\r\\n\", \"output\": [\"2 0\", \"2 0\", \"2\\r\\n0\"]}, {\"input\": \"7 3\\r\\n\", \"output\": [\"3\\r\\n2\", \"3 2\", \"3 2\"]}, {\"input\": \"100 100\\r\\n\", \"output\": [\"100 0\", \"100 0\", \"100\\r\\n0\"]}, {\"input\": \"4 10\\r\\n\", \"output\": [\"4\\r\\n3\", \"4 3\", \"4 3\"]}, {\"input\": \"6 10\\r\\n\", \"output\": [\"6\\r\\n2\", \"6 2\", \"6 2\"]}, {\"input\": \"6 11\\r\\n\", \"output\": [\"6\\r\\n2\", \"6 2\", \"6 2\"]}, {\"input\": \"10 40\\r\\n\", \"output\": [\"10\\r\\n15\", \"10 15\", \"10 15\"]}, {\"input\": \"11 56\\r\\n\", \"output\": [\"11 22\", \"11\\r\\n22\", \"11 22\"]}, {\"input\": \"34 30\\r\\n\", \"output\": [\"30\\r\\n2\", \"30 2\", \"30 2\"]}, {\"input\": \"33 33\\r\\n\", \"output\": [\"33 0\", \"33\\r\\n0\", \"33 0\"]}, {\"input\": \"100 45\\r\\n\", \"output\": [\"45\\r\\n27\", \"45 27\", \"45 27\"]}, {\"input\": \"100 23\\r\\n\", \"output\": [\"23 38\", \"23\\r\\n38\", \"23 38\"]}, {\"input\": \"45 12\\r\\n\", \"output\": [\"12 16\", \"12 16\", \"12\\r\\n16\"]}, {\"input\": \"1 1\\r\\n\", \"output\": [\"1 0\", \"1\\r\\n0\", \"1 0\"]}, {\"input\": \"1 100\\r\\n\", \"output\": [\"1 49\", \"1 49\", \"1\\r\\n49\"]}, {\"input\": \"100 1\\r\\n\", \"output\": [\"1 49\", \"1 49\", \"1\\r\\n49\"]}, {\"input\": \"68 59\\r\\n\", \"output\": [\"59 4\", \"59\\r\\n4\", \"59 4\"]}, {\"input\": \"45 99\\r\\n\", \"output\": [\"45\\r\\n27\", \"45 27\", \"45 27\"]}, {\"input\": \"99 100\\r\\n\", \"output\": [\"99 0\", \"99 0\", \"99\\r\\n0\"]}, {\"input\": \"100 98\\r\\n\", \"output\": [\"98 1\", \"98\\r\\n1\", \"98 1\"]}, {\"input\": \"59 12\\r\\n\", \"output\": [\"12 23\", \"12 23\", \"12\\r\\n23\"]}, {\"input\": \"86 4\\r\\n\", \"output\": [\"4 41\", \"4\\r\\n41\", \"4 41\"]}, {\"input\": \"68 21\\r\\n\", \"output\": [\"21 23\", \"21 23\", \"21\\r\\n23\"]}, {\"input\": \"100 11\\r\\n\", \"output\": [\"11 44\", \"11\\r\\n44\", \"11 44\"]}, {\"input\": \"100 10\\r\\n\", \"output\": [\"10 45\", \"10\\r\\n45\", \"10 45\"]}, {\"input\": \"15 45\\r\\n\", \"output\": [\"15\\r\\n15\", \"15 15\", \"15 15\"]}, {\"input\": \"11 32\\r\\n\", \"output\": [\"11\\r\\n10\", \"11 10\", \"11 10\"]}, {\"input\": \"34 96\\r\\n\", \"output\": [\"34\\r\\n31\", \"34 31\", \"34 31\"]}, {\"input\": \"89 89\\r\\n\", \"output\": [\"89 0\", \"89 0\", \"89\\r\\n0\"]}]"} {"prob_desc_description":"A monster is attacking the Cyberland!Master Yang, a braver, is going to beat the monster. Yang and the monster each have 3 attributes: hitpoints (HP), offensive power (ATK) and defensive power (DEF).During the battle, every second the monster's HP decrease by max(0,\u2009ATKY\u2009-\u2009DEFM), while Yang's HP decreases by max(0,\u2009ATKM\u2009-\u2009DEFY), where index Y denotes Master Yang and index M denotes monster. Both decreases happen simultaneously Once monster's HP\u2009\u2264\u20090 and the same time Master Yang's HP\u2009>\u20090, Master Yang wins.Master Yang can buy attributes from the magic shop of Cyberland: h bitcoins per HP, a bitcoins per ATK, and d bitcoins per DEF.Now Master Yang wants to know the minimum number of bitcoins he can spend in order to win.","prob_desc_output_spec":"The only output line should contain an integer, denoting the minimum bitcoins Master Yang should spend in order to win.","lang_cluster":"","src_uid":"bf8a133154745e64a547de6f31ddc884","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force","binary search","implementation"],"prob_desc_created_at":"1416590400","prob_desc_sample_inputs":"[\"1 2 1\\n1 100 1\\n1 100 100\", \"100 100 100\\n1 1 1\\n1 1 1\"]","prob_desc_notes":"NoteFor the first sample, prices for ATK and DEF are extremely high. Master Yang can buy 99 HP, then he can beat the monster with 1 HP left.For the second sample, Master Yang is strong enough to beat the monster, so he doesn't need to buy anything.","exec_outcome":"","difficulty":1800.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line contains three integers HPY,\u2009ATKY,\u2009DEFY, separated by a space, denoting the initial HP, ATK and DEF of Master Yang. The second line contains three integers HPM,\u2009ATKM,\u2009DEFM, separated by a space, denoting the HP, ATK and DEF of the monster. The third line contains three integers h,\u2009a,\u2009d, separated by a space, denoting the price of 1\u00a0HP, 1\u00a0ATK and 1\u00a0DEF. All numbers in input are integer and lie between 1 and 100 inclusively.","prob_desc_sample_outputs":"[\"99\", \"0\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"1 2 1\\r\\n1 100 1\\r\\n1 100 100\\r\\n\", \"output\": [\"99\"]}, {\"input\": \"100 100 100\\r\\n1 1 1\\r\\n1 1 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"50 80 92\\r\\n41 51 56\\r\\n75 93 12\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"76 63 14\\r\\n89 87 35\\r\\n20 15 56\\r\\n\", \"output\": [\"915\"]}, {\"input\": \"12 59 66\\r\\n43 15 16\\r\\n12 18 66\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"51 89 97\\r\\n18 25 63\\r\\n22 91 74\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"72 16 49\\r\\n5 21 84\\r\\n48 51 88\\r\\n\", \"output\": [\"3519\"]}, {\"input\": \"74 89 5\\r\\n32 76 99\\r\\n62 95 36\\r\\n\", \"output\": [\"3529\"]}, {\"input\": \"39 49 78\\r\\n14 70 41\\r\\n3 33 23\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"11 82 51\\r\\n90 84 72\\r\\n98 98 43\\r\\n\", \"output\": [\"1376\"]}, {\"input\": \"65 6 5\\r\\n70 78 51\\r\\n88 55 78\\r\\n\", \"output\": [\"7027\"]}, {\"input\": \"14 61 87\\r\\n11 78 14\\r\\n5 84 92\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 28 47\\r\\n31 60 38\\r\\n14 51 77\\r\\n\", \"output\": [\"1562\"]}, {\"input\": \"99 32 20\\r\\n89 72 74\\r\\n1 100 39\\r\\n\", \"output\": [\"5478\"]}, {\"input\": \"1 10 29\\r\\n1 1 43\\r\\n1 1 100\\r\\n\", \"output\": [\"34\"]}, {\"input\": \"1 1 100\\r\\n1 1 1\\r\\n100 1 100\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"79 1 1\\r\\n1 1 10\\r\\n1 1 100\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"10 10 100\\r\\n1 100 100\\r\\n10 100 90\\r\\n\", \"output\": [\"9100\"]}, {\"input\": \"10 10 100\\r\\n1 10 1\\r\\n1 1 100\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 100 1\\r\\n1 1 1\\r\\n1 1 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"11 1 1\\r\\n100 1 1\\r\\n100 1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 100 100\\r\\n1 1 1\\r\\n87 100 43\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"10 100 1\\r\\n1 100 100\\r\\n100 1 9\\r\\n\", \"output\": [\"811\"]}, {\"input\": \"10 100 55\\r\\n100 100 1\\r\\n1 1 1\\r\\n\", \"output\": [\"37\"]}, {\"input\": \"11 1 1\\r\\n10 1 10\\r\\n100 50 1\\r\\n\", \"output\": [\"500\"]}, {\"input\": \"10 100 1\\r\\n100 1 1\\r\\n1 100 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 10 10\\r\\n1 10 100\\r\\n1 1 61\\r\\n\", \"output\": [\"91\"]}, {\"input\": \"1 1 1\\r\\n1 1 1\\r\\n1 1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 1 1\\r\\n1 1 1\\r\\n100 100 100\\r\\n\", \"output\": [\"100\"]}, {\"input\": \"1 1 1\\r\\n100 100 100\\r\\n100 100 100\\r\\n\", \"output\": [\"19900\"]}, {\"input\": \"100 100 100\\r\\n100 100 100\\r\\n100 100 100\\r\\n\", \"output\": [\"100\"]}, {\"input\": \"1 1 1\\r\\n1 1 100\\r\\n100 100 1\\r\\n\", \"output\": [\"10000\"]}, {\"input\": \"50 100 51\\r\\n100 100 100\\r\\n1 100 100\\r\\n\", \"output\": [\"1384\"]}, {\"input\": \"1 1 1\\r\\n100 100 100\\r\\n1 2 3\\r\\n\", \"output\": [\"496\"]}, {\"input\": \"100 1 1\\r\\n100 100 100\\r\\n100 1 100\\r\\n\", \"output\": [\"199\"]}, {\"input\": \"1 100 1\\r\\n100 100 100\\r\\n1 100 100\\r\\n\", \"output\": [\"1990\"]}, {\"input\": \"100 100 1\\r\\n100 100 100\\r\\n1 100 100\\r\\n\", \"output\": [\"1891\"]}, {\"input\": \"1 1 1\\r\\n100 100 100\\r\\n1 100 100\\r\\n\", \"output\": [\"11890\"]}, {\"input\": \"20 1 1\\r\\n100 100 100\\r\\n1 100 100\\r\\n\", \"output\": [\"11871\"]}, {\"input\": \"25 38 49\\r\\n84 96 42\\r\\n3 51 92\\r\\n\", \"output\": [\"1692\"]}, {\"input\": \"2 1 1\\r\\n100 2 100\\r\\n100 1 100\\r\\n\", \"output\": [\"199\"]}, {\"input\": \"1 97 1\\r\\n100 99 98\\r\\n1 51 52\\r\\n\", \"output\": [\"1498\"]}, {\"input\": \"1 1 1\\r\\n100 100 100\\r\\n1 1 100\\r\\n\", \"output\": [\"298\"]}, {\"input\": \"1 100 1\\r\\n100 100 99\\r\\n1 100 100\\r\\n\", \"output\": [\"1890\"]}, {\"input\": \"100 1 1\\r\\n100 100 100\\r\\n1 100 100\\r\\n\", \"output\": [\"11791\"]}]"} {"prob_desc_description":"Vasya decided to learn to play chess. Classic chess doesn't seem interesting to him, so he plays his own sort of chess.The queen is the piece that captures all squares on its vertical, horizontal and diagonal lines. If the cell is located on the same vertical, horizontal or diagonal line with queen, and the cell contains a piece of the enemy color, the queen is able to move to this square. After that the enemy's piece is removed from the board. The queen cannot move to a cell containing an enemy piece if there is some other piece between it and the queen. There is an n\u2009\u00d7\u2009n chessboard. We'll denote a cell on the intersection of the r-th row and c-th column as (r,\u2009c). The square (1,\u20091) contains the white queen and the square (1,\u2009n) contains the black queen. All other squares contain green pawns that don't belong to anyone.The players move in turns. The player that moves first plays for the white queen, his opponent plays for the black queen.On each move the player has to capture some piece with his queen (that is, move to a square that contains either a green pawn or the enemy queen). The player loses if either he cannot capture any piece during his move or the opponent took his queen during the previous move. Help Vasya determine who wins if both players play with an optimal strategy on the board n\u2009\u00d7\u2009n.","prob_desc_output_spec":"On the first line print the answer to problem \u2014 string \"white\" or string \"black\", depending on who wins if the both players play optimally. If the answer is \"white\", then you should also print two integers r and c representing the cell (r,\u2009c), where the first player should make his first move to win. If there are multiple such cells, print the one with the minimum r. If there are still multiple squares, print the one with the minimum c.","lang_cluster":"","src_uid":"52e07d176aa1d370788f94ee2e61df93","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["games","math","constructive algorithms"],"prob_desc_created_at":"1417618800","prob_desc_sample_inputs":"[\"2\", \"3\"]","prob_desc_notes":"NoteIn the first sample test the white queen can capture the black queen at the first move, so the white player wins.In the second test from the statement if the white queen captures the green pawn located on the central vertical line, then it will be captured by the black queen during the next move. So the only move for the white player is to capture the green pawn located at (2,\u20091). Similarly, the black queen doesn't have any other options but to capture the green pawn located at (2,\u20093), otherwise if it goes to the middle vertical line, it will be captured by the white queen.During the next move the same thing happens \u2014 neither the white, nor the black queen has other options rather than to capture green pawns situated above them. Thus, the white queen ends up on square (3,\u20091), and the black queen ends up on square (3,\u20093). In this situation the white queen has to capture any of the green pawns located on the middle vertical line, after that it will be captured by the black queen. Thus, the player who plays for the black queen wins.","exec_outcome":"","difficulty":1700.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The input contains a single number n (2\u2009\u2264\u2009n\u2009\u2264\u2009109) \u2014 the size of the board.","prob_desc_sample_outputs":"[\"white\\n1 2\", \"black\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2\\r\\n\", \"output\": [\"white\\n1 2\", \"white\\r\\n1 2\"]}, {\"input\": \"3\\r\\n\", \"output\": [\"black\"]}, {\"input\": \"4\\r\\n\", \"output\": [\"white\\n1 2\", \"white\\r\\n1 2\"]}, {\"input\": \"6\\r\\n\", \"output\": [\"white\\n1 2\", \"white\\r\\n1 2\"]}, {\"input\": \"10\\r\\n\", \"output\": [\"white\\n1 2\", \"white\\r\\n1 2\"]}, {\"input\": \"16\\r\\n\", \"output\": [\"white\\n1 2\", \"white\\r\\n1 2\"]}, {\"input\": \"100\\r\\n\", \"output\": [\"white\\n1 2\", \"white\\r\\n1 2\"]}, {\"input\": \"10006\\r\\n\", \"output\": [\"white\\n1 2\", \"white\\r\\n1 2\"]}, {\"input\": \"99966246\\r\\n\", \"output\": [\"white\\n1 2\", \"white\\r\\n1 2\"]}, {\"input\": \"1000000000\\r\\n\", \"output\": [\"white\\n1 2\", \"white\\r\\n1 2\"]}, {\"input\": \"999999999\\r\\n\", \"output\": [\"black\"]}, {\"input\": \"999999997\\r\\n\", \"output\": [\"black\"]}, {\"input\": \"900001\\r\\n\", \"output\": [\"black\"]}, {\"input\": \"775681\\r\\n\", \"output\": [\"black\"]}, {\"input\": \"666666\\r\\n\", \"output\": [\"white\\n1 2\", \"white\\r\\n1 2\"]}, {\"input\": \"12345\\r\\n\", \"output\": [\"black\"]}, {\"input\": \"111111\\r\\n\", \"output\": [\"black\"]}, {\"input\": \"346367\\r\\n\", \"output\": [\"black\"]}, {\"input\": \"13\\r\\n\", \"output\": [\"black\"]}, {\"input\": \"11\\r\\n\", \"output\": [\"black\"]}, {\"input\": \"9\\r\\n\", \"output\": [\"black\"]}, {\"input\": \"7\\r\\n\", \"output\": [\"black\"]}, {\"input\": \"5\\r\\n\", \"output\": [\"black\"]}, {\"input\": \"19\\r\\n\", \"output\": [\"black\"]}, {\"input\": \"939698497\\r\\n\", \"output\": [\"black\"]}, {\"input\": \"999999996\\r\\n\", \"output\": [\"white\\n1 2\", \"white\\r\\n1 2\"]}]"} {"prob_desc_description":"It's tough to be a superhero. And it's twice as tough to resist the supervillain who is cool at math. Suppose that you're an ordinary Batman in an ordinary city of Gotham. Your enemy Joker mined the building of the city administration and you only have several minutes to neutralize the charge. To do that you should enter the cancel code on the bomb control panel.However, that mad man decided to give you a hint. This morning the mayor found a playing card under his pillow. There was a line written on the card:The bomb has a note saying \"J(x)\u2009=\u2009A\", where A is some positive integer. You suspect that the cancel code is some integer x that meets the equation J(x)\u2009=\u2009A. Now in order to decide whether you should neutralize the bomb or run for your life, you've got to count how many distinct positive integers x meet this equation.","prob_desc_output_spec":"Print the number of solutions of the equation J(x)\u2009=\u2009A.","lang_cluster":"","src_uid":"1f68bd6f8b40e45a5bd360b03a264ef4","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","number theory","hashing","dp","dfs and similar"],"prob_desc_created_at":"1430668800","prob_desc_sample_inputs":"[\"3\", \"24\"]","prob_desc_notes":"NoteRecord x|n means that number n divides number x. is defined as the largest positive integer that divides both a and b.In the first sample test the only suitable value of x is 2. Then J(2)\u2009=\u20091\u2009+\u20092.In the second sample test the following values of x match: x\u2009=\u200914, J(14)\u2009=\u20091\u2009+\u20092\u2009+\u20097\u2009+\u200914\u2009=\u200924 x\u2009=\u200915, J(15)\u2009=\u20091\u2009+\u20093\u2009+\u20095\u2009+\u200915\u2009=\u200924 x\u2009=\u200923, J(23)\u2009=\u20091\u2009+\u200923\u2009=\u200924 ","exec_outcome":"","difficulty":2600.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The single line of the input contains a single integer A (1\u2009\u2264\u2009A\u2009\u2264\u20091012).","prob_desc_sample_outputs":"[\"1\", \"3\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"3\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"24\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"4\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"5\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"6\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"7\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"8\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"9\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"10\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"11\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"12\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"13\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"14\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"15\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"16\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"17\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"18\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"19\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"20\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"100\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"10000\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"1000000\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"1000000000000\\r\\n\", \"output\": [\"227\"]}, {\"input\": \"123456789876\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"963761198400\\r\\n\", \"output\": [\"100049\"]}, {\"input\": \"642507465600\\r\\n\", \"output\": [\"102634\"]}, {\"input\": \"481880599200\\r\\n\", \"output\": [\"38983\"]}, {\"input\": \"321253732800\\r\\n\", \"output\": [\"48603\"]}, {\"input\": \"293318625600\\r\\n\", \"output\": [\"99409\"]}, {\"input\": \"200560490130\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"988440062610\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"999999999989\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"999999999988\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"999999999990\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"999960000396\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"999961000378\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"999962000360\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"999961000374\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"999962000357\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"999963000340\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"999962000352\\r\\n\", \"output\": [\"90\"]}, {\"input\": \"999963000336\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"999964000320\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"549755813888\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"549755813887\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"549755813889\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"743008370688\\r\\n\", \"output\": [\"7606\"]}, {\"input\": \"743012742140\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"802632499200\\r\\n\", \"output\": [\"248276\"]}, {\"input\": \"330225942528\\r\\n\", \"output\": [\"5397\"]}, {\"input\": \"349479567360\\r\\n\", \"output\": [\"311891\"]}, {\"input\": \"698959134720\\r\\n\", \"output\": [\"399998\"]}, {\"input\": \"390949000000\\r\\n\", \"output\": [\"403\"]}, {\"input\": \"781898000000\\r\\n\", \"output\": [\"673\"]}, {\"input\": \"655274188800\\r\\n\", \"output\": [\"702440\"]}, {\"input\": \"873698918400\\r\\n\", \"output\": [\"804116\"]}, {\"input\": \"86204582016\\r\\n\", \"output\": [\"414\"]}, {\"input\": \"924458\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"7882\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"91306\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"207434\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"290858\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"374282\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"457706\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"573834\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"624554\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"569088\\r\\n\", \"output\": [\"79\"]}, {\"input\": \"685216\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"768640\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"852064\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"935488\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"51616\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"102336\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"218464\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"301888\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"418016\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"944011\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"965667225600\\r\\n\", \"output\": [\"906098\"]}, {\"input\": \"804722688000\\r\\n\", \"output\": [\"941359\"]}, {\"input\": \"747242496000\\r\\n\", \"output\": [\"942082\"]}, {\"input\": \"871782912000\\r\\n\", \"output\": [\"996234\"]}, {\"input\": \"75246796800\\r\\n\", \"output\": [\"133237\"]}]"} {"prob_desc_description":"Limak is a little polar bear. He has n balls, the i-th ball has size ti.Limak wants to give one ball to each of his three friends. Giving gifts isn't easy\u00a0\u2014 there are two rules Limak must obey to make friends happy: No two friends can get balls of the same size. No two friends can get balls of sizes that differ by more than 2. For example, Limak can choose balls with sizes 4, 5 and 3, or balls with sizes 90, 91 and 92. But he can't choose balls with sizes 5, 5 and 6 (two friends would get balls of the same size), and he can't choose balls with sizes 30, 31 and 33 (because sizes 30 and 33 differ by more than 2).Your task is to check whether Limak can choose three balls that satisfy conditions above.","prob_desc_output_spec":"Print \"YES\" (without quotes) if Limak can choose three balls of distinct sizes, such that any two of them differ by no more than 2. Otherwise, print \"NO\" (without quotes).","lang_cluster":"","src_uid":"d6c876a84c7b92141710be5d76536eab","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force","implementation","sortings"],"prob_desc_created_at":"1458376500","prob_desc_sample_inputs":"[\"4\\n18 55 16 17\", \"6\\n40 41 43 44 44 44\", \"8\\n5 972 3 4 1 4 970 971\"]","prob_desc_notes":"NoteIn the first sample, there are 4 balls and Limak is able to choose three of them to satisfy the rules. He must must choose balls with sizes 18, 16 and 17.In the second sample, there is no way to give gifts to three friends without breaking the rules.In the third sample, there is even more than one way to choose balls: Choose balls with sizes 3, 4 and 5. Choose balls with sizes 972, 970, 971. ","exec_outcome":"","difficulty":900.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line of the input contains one integer n (3\u2009\u2264\u2009n\u2009\u2264\u200950)\u00a0\u2014 the number of balls Limak has. The second line contains n integers t1,\u2009t2,\u2009...,\u2009tn (1\u2009\u2264\u2009ti\u2009\u2264\u20091000) where ti denotes the size of the i-th ball.","prob_desc_sample_outputs":"[\"YES\", \"NO\", \"YES\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"4\\r\\n18 55 16 17\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"6\\r\\n40 41 43 44 44 44\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"8\\r\\n5 972 3 4 1 4 970 971\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"3\\r\\n959 747 656\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"4\\r\\n1 2 2 3\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"50\\r\\n998 30 384 289 505 340 872 223 663 31 929 625 864 699 735 589 676 399 745 635 963 381 75 97 324 612 597 797 103 382 25 894 219 458 337 572 201 355 294 275 278 311 586 573 965 704 936 237 715 543\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"50\\r\\n941 877 987 982 966 979 984 810 811 909 872 980 957 897 845 995 924 905 984 914 824 840 868 910 815 808 872 858 883 952 823 835 860 874 959 972 931 867 866 987 982 837 800 921 887 910 982 980 828 869\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"3\\r\\n408 410 409\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"3\\r\\n903 902 904\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"3\\r\\n399 400 398\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"3\\r\\n450 448 449\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"3\\r\\n390 389 388\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"3\\r\\n438 439 440\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"11\\r\\n488 688 490 94 564 615 641 170 489 517 669\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"24\\r\\n102 672 983 82 720 501 81 721 982 312 207 897 159 964 611 956 118 984 37 271 596 403 772 954\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"36\\r\\n175 551 70 479 875 480 979 32 465 402 640 116 76 687 874 678 359 785 753 401 978 629 162 963 886 641 39 845 132 930 2 372 478 947 407 318\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"6\\r\\n10 79 306 334 304 305\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"34\\r\\n787 62 26 683 486 364 684 891 846 801 969 837 359 800 836 359 471 637 732 91 841 836 7 799 959 405 416 841 737 803 615 483 323 365\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"30\\r\\n860 238 14 543 669 100 428 789 576 484 754 274 849 850 586 377 711 386 510 408 520 693 23 477 266 851 728 711 964 73\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"11\\r\\n325 325 324 324 324 325 325 324 324 324 324\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"7\\r\\n517 517 518 517 518 518 518\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"20\\r\\n710 710 711 711 711 711 710 710 710 710 711 710 710 710 710 710 710 711 711 710\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"48\\r\\n29 30 29 29 29 30 29 30 30 30 30 29 30 30 30 29 29 30 30 29 30 29 29 30 29 30 29 30 30 29 30 29 29 30 30 29 29 30 30 29 29 30 30 30 29 29 30 29\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"7\\r\\n880 880 514 536 881 881 879\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"15\\r\\n377 432 262 376 261 375 377 262 263 263 261 376 262 262 375\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"32\\r\\n305 426 404 961 426 425 614 304 404 425 615 403 303 304 615 303 305 405 427 614 403 303 425 615 404 304 427 403 206 616 405 404\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"41\\r\\n115 686 988 744 762 519 745 519 518 83 85 115 520 44 687 686 685 596 988 687 989 988 114 745 84 519 519 746 988 84 745 744 115 114 85 115 520 746 745 116 987\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"47\\r\\n1 2 483 28 7 109 270 651 464 162 353 521 224 989 721 499 56 69 197 716 313 446 580 645 828 197 100 138 789 499 147 677 384 711 783 937 300 543 540 93 669 604 739 122 632 822 116\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"31\\r\\n1 2 1 373 355 692 750 920 578 666 615 232 141 129 663 929 414 704 422 559 568 731 354 811 532 618 39 879 292 602 995\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"50\\r\\n5 38 41 4 15 40 27 39 20 3 44 47 30 6 36 29 35 12 19 26 10 2 21 50 11 46 48 49 17 16 33 13 32 28 31 18 23 34 7 14 24 45 9 37 1 8 42 25 43 22\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"50\\r\\n967 999 972 990 969 978 963 987 954 955 973 970 959 981 995 983 986 994 979 957 965 982 992 977 953 975 956 961 993 997 998 958 980 962 960 951 996 991 1000 966 971 988 976 968 989 984 974 964 985 952\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"50\\r\\n850 536 761 506 842 898 857 723 583 637 536 943 895 929 890 612 832 633 696 731 553 880 710 812 665 877 915 636 711 540 748 600 554 521 813 796 568 513 543 809 798 820 928 504 999 646 907 639 550 911\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"3\\r\\n3 1 2\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"3\\r\\n500 999 1000\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"10\\r\\n101 102 104 105 107 109 110 112 113 115\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"50\\r\\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"50\\r\\n1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"3\\r\\n1000 999 998\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"49\\r\\n343 322 248 477 53 156 245 493 209 141 370 66 229 184 434 137 276 472 216 456 147 180 140 114 493 323 393 262 380 314 222 124 98 441 129 346 48 401 347 460 122 125 114 106 189 260 374 165 456\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"20\\r\\n1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"3\\r\\n999 999 1000\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"9\\r\\n2 4 5 13 25 100 200 300 400\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"9\\r\\n1 1 1 2 2 2 3 3 3\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"3\\r\\n1 1 2\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"3\\r\\n998 999 1000\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"12\\r\\n1 1 1 1 1 1 1 1 1 2 2 4\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"4\\r\\n4 3 4 5\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"6\\r\\n1 1 1 2 2 2\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"3\\r\\n2 3 2\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"5\\r\\n10 5 6 3 2\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"3\\r\\n1 2 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"3\\r\\n1 2 3\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"4\\r\\n998 999 1000 1000\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"5\\r\\n2 3 9 9 4\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"4\\r\\n1 2 4 4\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"3\\r\\n1 1 1\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"3\\r\\n2 2 3\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"7\\r\\n1 2 2 2 4 5 6\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"5\\r\\n1 3 10 3 10\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"3\\r\\n1 2 2\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"4\\r\\n1000 1000 999 998\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"3\\r\\n5 3 7\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"6\\r\\n1 1 2 2 3 3\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"9\\r\\n6 6 6 5 5 5 4 4 4\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"7\\r\\n5 6 6 6 7 7 7\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"5\\r\\n2 3 3 3 4\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"5\\r\\n2 1 2 1 3\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"3\\r\\n1 2 7\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"3\\r\\n1000 1000 1000\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"5\\r\\n1 100 2 100 3\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"5\\r\\n5 4 6 5 5\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"12\\r\\n1 1 1 1 2 2 2 2 3 3 3 3\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"5\\r\\n9 9 1 2 3\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"6\\r\\n1 2 3 1 2 3\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"7\\r\\n1 1 1 1 2 3 3\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"3\\r\\n13 13 13\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"3\\r\\n42 42 42\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"8\\r\\n1 1 1 1 2 2 2 2\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"6\\r\\n1 1 1 1 2 3\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"6\\r\\n1 1 2 2 6 6\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"6\\r\\n1 2 5 5 5 5\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"9\\r\\n1 2 3 1 2 3 1 2 3\\r\\n\", \"output\": [\"YES\", \"Yes\"]}, {\"input\": \"4\\r\\n1 2 1 100\\r\\n\", \"output\": [\"No\", \"NO\"]}, {\"input\": \"5\\r\\n1 1 2 2 3\\r\\n\", \"output\": [\"YES\", \"Yes\"]}]"} {"prob_desc_description":"Buses run between the cities A and B, the first one is at 05:00 AM and the last one departs not later than at 11:59 PM. A bus from the city A departs every a minutes and arrives to the city B in a ta minutes, and a bus from the city B departs every b minutes and arrives to the city A in a tb minutes.The driver Simion wants to make his job diverse, so he counts the buses going towards him. Simion doesn't count the buses he meet at the start and finish.You know the time when Simion departed from the city A to the city B. Calculate the number of buses Simion will meet to be sure in his counting.","prob_desc_output_spec":"Print the only integer z \u2014 the number of buses Simion will meet on the way. Note that you should not count the encounters in cities A and B.","lang_cluster":"","src_uid":"1c4cf1c3cb464a483511a8a61f8685a7","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["implementation"],"prob_desc_created_at":"1461164400","prob_desc_sample_inputs":"[\"10 30\\n10 35\\n05:20\", \"60 120\\n24 100\\n13:00\"]","prob_desc_notes":"NoteIn the first example Simion departs form the city A at 05:20 AM and arrives to the city B at 05:50 AM. He will meet the first 5 buses from the city B that departed in the period [05:00 AM - 05:40 AM]. Also Simion will meet a bus in the city B at 05:50 AM, but he will not count it.Also note that the first encounter will be between 05:26 AM and 05:27 AM (if we suggest that the buses are go with the sustained speed).","exec_outcome":"","difficulty":1600.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line contains two integers a,\u2009ta (1\u2009\u2264\u2009a,\u2009ta\u2009\u2264\u2009120) \u2014 the frequency of the buses from the city A to the city B and the travel time. Both values are given in minutes. The second line contains two integers b,\u2009tb (1\u2009\u2264\u2009b,\u2009tb\u2009\u2264\u2009120) \u2014 the frequency of the buses from the city B to the city A and the travel time. Both values are given in minutes. The last line contains the departure time of Simion from the city A in the format hh:mm. It is guaranteed that there are a bus from the city A at that time. Note that the hours and the minutes are given with exactly two digits.","prob_desc_sample_outputs":"[\"5\", \"9\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"10 30\\r\\n10 35\\r\\n05:20\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"60 120\\r\\n24 100\\r\\n13:00\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"30 60\\r\\n60 60\\r\\n22:30\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"30 60\\r\\n10 60\\r\\n23:30\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"5 45\\r\\n4 60\\r\\n21:00\\r\\n\", \"output\": [\"26\"]}, {\"input\": \"1 1\\r\\n1 1\\r\\n10:28\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"4 1\\r\\n5 4\\r\\n18:40\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"8 8\\r\\n1 1\\r\\n13:24\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"20 4\\r\\n1 20\\r\\n06:20\\r\\n\", \"output\": [\"23\"]}, {\"input\": \"15 24\\r\\n23 6\\r\\n21:15\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"30 19\\r\\n21 4\\r\\n10:30\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"31 15\\r\\n36 25\\r\\n07:04\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"24 3\\r\\n54 9\\r\\n18:12\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"18 69\\r\\n62 54\\r\\n08:00\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"33 58\\r\\n70 78\\r\\n22:36\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"68 34\\r\\n84 78\\r\\n10:40\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"15 14\\r\\n32 65\\r\\n05:45\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"40 74\\r\\n100 42\\r\\n05:40\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"65 49\\r\\n24 90\\r\\n07:10\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"1 1\\r\\n1 1\\r\\n23:59\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"23 118\\r\\n118 20\\r\\n23:24\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3 88\\r\\n17 38\\r\\n22:33\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"3 1\\r\\n2 3\\r\\n05:03\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 1\\r\\n3 2\\r\\n08:44\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 3\\r\\n1 2\\r\\n21:43\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"2 28\\r\\n2 12\\r\\n05:12\\r\\n\", \"output\": [\"19\"]}, {\"input\": \"60 120\\r\\n17 120\\r\\n23:00\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"1 55\\r\\n1 54\\r\\n23:59\\r\\n\", \"output\": [\"54\"]}, {\"input\": \"66 75\\r\\n1 82\\r\\n06:06\\r\\n\", \"output\": [\"141\"]}, {\"input\": \"1 90\\r\\n1 88\\r\\n23:59\\r\\n\", \"output\": [\"88\"]}, {\"input\": \"1 120\\r\\n1 100\\r\\n23:59\\r\\n\", \"output\": [\"100\"]}]"} {"prob_desc_description":"There are three friend living on the straight line Ox in Lineland. The first friend lives at the point x1, the second friend lives at the point x2, and the third friend lives at the point x3. They plan to celebrate the New Year together, so they need to meet at one point. What is the minimum total distance they have to travel in order to meet at some point and celebrate the New Year?It's guaranteed that the optimal answer is always integer.","prob_desc_output_spec":"Print one integer\u00a0\u2014 the minimum total distance the friends need to travel in order to meet together.","lang_cluster":"","src_uid":"7bffa6e8d2d21bbb3b7f4aec109b3319","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","implementation","sortings"],"prob_desc_created_at":"1475494500","prob_desc_sample_inputs":"[\"7 1 4\", \"30 20 10\"]","prob_desc_notes":"NoteIn the first sample, friends should meet at the point 4. Thus, the first friend has to travel the distance of 3 (from the point 7 to the point 4), the second friend also has to travel the distance of 3 (from the point 1 to the point 4), while the third friend should not go anywhere because he lives at the point 4.","exec_outcome":"","difficulty":800.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line of the input contains three distinct integers x1, x2 and x3 (1\u2009\u2264\u2009x1,\u2009x2,\u2009x3\u2009\u2264\u2009100)\u00a0\u2014 the coordinates of the houses of the first, the second and the third friends respectively. ","prob_desc_sample_outputs":"[\"6\", \"20\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"7 1 4\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"30 20 10\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"1 4 100\\r\\n\", \"output\": [\"99\"]}, {\"input\": \"100 1 91\\r\\n\", \"output\": [\"99\"]}, {\"input\": \"1 45 100\\r\\n\", \"output\": [\"99\"]}, {\"input\": \"1 2 3\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"71 85 88\\r\\n\", \"output\": [\"17\"]}, {\"input\": \"30 38 99\\r\\n\", \"output\": [\"69\"]}, {\"input\": \"23 82 95\\r\\n\", \"output\": [\"72\"]}, {\"input\": \"22 41 47\\r\\n\", \"output\": [\"25\"]}, {\"input\": \"9 94 77\\r\\n\", \"output\": [\"85\"]}, {\"input\": \"1 53 51\\r\\n\", \"output\": [\"52\"]}, {\"input\": \"25 97 93\\r\\n\", \"output\": [\"72\"]}, {\"input\": \"42 53 51\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"81 96 94\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"21 5 93\\r\\n\", \"output\": [\"88\"]}, {\"input\": \"50 13 75\\r\\n\", \"output\": [\"62\"]}, {\"input\": \"41 28 98\\r\\n\", \"output\": [\"70\"]}, {\"input\": \"69 46 82\\r\\n\", \"output\": [\"36\"]}, {\"input\": \"87 28 89\\r\\n\", \"output\": [\"61\"]}, {\"input\": \"44 45 40\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"86 97 68\\r\\n\", \"output\": [\"29\"]}, {\"input\": \"43 92 30\\r\\n\", \"output\": [\"62\"]}, {\"input\": \"16 70 1\\r\\n\", \"output\": [\"69\"]}, {\"input\": \"40 46 19\\r\\n\", \"output\": [\"27\"]}, {\"input\": \"71 38 56\\r\\n\", \"output\": [\"33\"]}, {\"input\": \"82 21 80\\r\\n\", \"output\": [\"61\"]}, {\"input\": \"75 8 35\\r\\n\", \"output\": [\"67\"]}, {\"input\": \"75 24 28\\r\\n\", \"output\": [\"51\"]}, {\"input\": \"78 23 56\\r\\n\", \"output\": [\"55\"]}, {\"input\": \"85 31 10\\r\\n\", \"output\": [\"75\"]}, {\"input\": \"76 50 9\\r\\n\", \"output\": [\"67\"]}, {\"input\": \"95 37 34\\r\\n\", \"output\": [\"61\"]}, {\"input\": \"84 61 35\\r\\n\", \"output\": [\"49\"]}, {\"input\": \"87 85 37\\r\\n\", \"output\": [\"50\"]}, {\"input\": \"1 3 2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"4 2 6\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"6 9 3\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"12 4 8\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"15 10 5\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"1 50 17\\r\\n\", \"output\": [\"49\"]}, {\"input\": \"10 5 15\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"8 1 9\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"3 5 4\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"2 1 3\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1 8 2\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"1 100 2\\r\\n\", \"output\": [\"99\"]}, {\"input\": \"1 4 6\\r\\n\", \"output\": [\"5\"]}]"} {"prob_desc_description":"A new airplane SuperPuperJet has an infinite number of rows, numbered with positive integers starting with 1 from cockpit to tail. There are six seats in each row, denoted with letters from 'a' to 'f'. Seats 'a', 'b' and 'c' are located to the left of an aisle (if one looks in the direction of the cockpit), while seats 'd', 'e' and 'f' are located to the right. Seats 'a' and 'f' are located near the windows, while seats 'c' and 'd' are located near the aisle. \u00a0It's lunch time and two flight attendants have just started to serve food. They move from the first rows to the tail, always maintaining a distance of two rows from each other because of the food trolley. Thus, at the beginning the first attendant serves row 1 while the second attendant serves row 3. When both rows are done they move one row forward: the first attendant serves row 2 while the second attendant serves row 4. Then they move three rows forward and the first attendant serves row 5 while the second attendant serves row 7. Then they move one row forward again and so on.Flight attendants work with the same speed: it takes exactly 1 second to serve one passenger and 1 second to move one row forward. Each attendant first serves the passengers on the seats to the right of the aisle and then serves passengers on the seats to the left of the aisle (if one looks in the direction of the cockpit). Moreover, they always serve passengers in order from the window to the aisle. Thus, the first passenger to receive food in each row is located in seat 'f', and the last one\u00a0\u2014 in seat 'c'. Assume that all seats are occupied.Vasya has seat s in row n and wants to know how many seconds will pass before he gets his lunch.","prob_desc_output_spec":"Print one integer\u00a0\u2014 the number of seconds Vasya has to wait until he gets his lunch.","lang_cluster":"","src_uid":"069d0cb9b7c798a81007fb5b63fa0f45","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","implementation"],"prob_desc_created_at":"1477148700","prob_desc_sample_inputs":"[\"1f\", \"2d\", \"4a\", \"5e\"]","prob_desc_notes":"NoteIn the first sample, the first flight attendant serves Vasya first, so Vasya gets his lunch after 1 second.In the second sample, the flight attendants will spend 6 seconds to serve everyone in the rows 1 and 3, then they will move one row forward in 1 second. As they first serve seats located to the right of the aisle in order from window to aisle, Vasya has to wait 3 more seconds. The total is 6\u2009+\u20091\u2009+\u20093\u2009=\u200910.","exec_outcome":"","difficulty":1200.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The only line of input contains a description of Vasya's seat in the format ns, where n (1\u2009\u2264\u2009n\u2009\u2264\u20091018) is the index of the row and s is the seat in this row, denoted as letter from 'a' to 'f'. The index of the row and the seat are not separated by a space.","prob_desc_sample_outputs":"[\"1\", \"10\", \"11\", \"18\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"1f\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2d\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"4a\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"5e\\r\\n\", \"output\": [\"18\"]}, {\"input\": \"2c\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"1b\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"1000000000000000000d\\r\\n\", \"output\": [\"3999999999999999994\"]}, {\"input\": \"999999999999999997a\\r\\n\", \"output\": [\"3999999999999999988\"]}, {\"input\": \"1c\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"1d\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"1e\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1a\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"2a\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"2b\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"2e\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"2f\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"3a\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"3b\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"3c\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"3d\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"3e\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"3f\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"4b\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"4c\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"4d\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"4e\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"4f\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"999999997a\\r\\n\", \"output\": [\"3999999988\"]}, {\"input\": \"999999997b\\r\\n\", \"output\": [\"3999999989\"]}, {\"input\": \"999999997c\\r\\n\", \"output\": [\"3999999990\"]}, {\"input\": \"999999997d\\r\\n\", \"output\": [\"3999999987\"]}, {\"input\": \"999999997e\\r\\n\", \"output\": [\"3999999986\"]}, {\"input\": \"999999997f\\r\\n\", \"output\": [\"3999999985\"]}, {\"input\": \"999999998a\\r\\n\", \"output\": [\"3999999995\"]}, {\"input\": \"999999998b\\r\\n\", \"output\": [\"3999999996\"]}, {\"input\": \"999999998c\\r\\n\", \"output\": [\"3999999997\"]}, {\"input\": \"999999998d\\r\\n\", \"output\": [\"3999999994\"]}, {\"input\": \"999999998e\\r\\n\", \"output\": [\"3999999993\"]}, {\"input\": \"999999998f\\r\\n\", \"output\": [\"3999999992\"]}, {\"input\": \"999999999a\\r\\n\", \"output\": [\"3999999988\"]}, {\"input\": \"999999999b\\r\\n\", \"output\": [\"3999999989\"]}, {\"input\": \"999999999c\\r\\n\", \"output\": [\"3999999990\"]}, {\"input\": \"999999999d\\r\\n\", \"output\": [\"3999999987\"]}, {\"input\": \"999999999e\\r\\n\", \"output\": [\"3999999986\"]}, {\"input\": \"999999999f\\r\\n\", \"output\": [\"3999999985\"]}, {\"input\": \"1000000000a\\r\\n\", \"output\": [\"3999999995\"]}, {\"input\": \"1000000000b\\r\\n\", \"output\": [\"3999999996\"]}, {\"input\": \"1000000000c\\r\\n\", \"output\": [\"3999999997\"]}, {\"input\": \"1000000000d\\r\\n\", \"output\": [\"3999999994\"]}, {\"input\": \"1000000000e\\r\\n\", \"output\": [\"3999999993\"]}, {\"input\": \"1000000000f\\r\\n\", \"output\": [\"3999999992\"]}, {\"input\": \"100000b\\r\\n\", \"output\": [\"399996\"]}, {\"input\": \"100000f\\r\\n\", \"output\": [\"399992\"]}, {\"input\": \"100001d\\r\\n\", \"output\": [\"400003\"]}, {\"input\": \"100001e\\r\\n\", \"output\": [\"400002\"]}, {\"input\": \"100001f\\r\\n\", \"output\": [\"400001\"]}, {\"input\": \"100002a\\r\\n\", \"output\": [\"400011\"]}, {\"input\": \"100002b\\r\\n\", \"output\": [\"400012\"]}, {\"input\": \"100002d\\r\\n\", \"output\": [\"400010\"]}, {\"input\": \"1231273a\\r\\n\", \"output\": [\"4925092\"]}, {\"input\": \"82784f\\r\\n\", \"output\": [\"331128\"]}, {\"input\": \"88312c\\r\\n\", \"output\": [\"353245\"]}, {\"input\": \"891237e\\r\\n\", \"output\": [\"3564946\"]}, {\"input\": \"999999999999999997b\\r\\n\", \"output\": [\"3999999999999999989\"]}, {\"input\": \"999999999999999997c\\r\\n\", \"output\": [\"3999999999999999990\"]}, {\"input\": \"999999999999999997d\\r\\n\", \"output\": [\"3999999999999999987\"]}, {\"input\": \"999999999999999997e\\r\\n\", \"output\": [\"3999999999999999986\"]}, {\"input\": \"999999999999999997f\\r\\n\", \"output\": [\"3999999999999999985\"]}, {\"input\": \"999999999999999998a\\r\\n\", \"output\": [\"3999999999999999995\"]}, {\"input\": \"999999999999999998b\\r\\n\", \"output\": [\"3999999999999999996\"]}, {\"input\": \"999999999999999998c\\r\\n\", \"output\": [\"3999999999999999997\"]}, {\"input\": \"999999999999999998d\\r\\n\", \"output\": [\"3999999999999999994\"]}, {\"input\": \"999999999999999998e\\r\\n\", \"output\": [\"3999999999999999993\"]}, {\"input\": \"999999999999999998f\\r\\n\", \"output\": [\"3999999999999999992\"]}, {\"input\": \"999999999999999999a\\r\\n\", \"output\": [\"3999999999999999988\"]}, {\"input\": \"999999999999999999b\\r\\n\", \"output\": [\"3999999999999999989\"]}, {\"input\": \"999999999999999999c\\r\\n\", \"output\": [\"3999999999999999990\"]}, {\"input\": \"999999999999999999d\\r\\n\", \"output\": [\"3999999999999999987\"]}, {\"input\": \"1000000000000000000a\\r\\n\", \"output\": [\"3999999999999999995\"]}, {\"input\": \"1000000000000000000e\\r\\n\", \"output\": [\"3999999999999999993\"]}, {\"input\": \"1000000000000000000f\\r\\n\", \"output\": [\"3999999999999999992\"]}, {\"input\": \"1000000000000000000c\\r\\n\", \"output\": [\"3999999999999999997\"]}, {\"input\": \"97a\\r\\n\", \"output\": [\"388\"]}, {\"input\": \"6f\\r\\n\", \"output\": [\"24\"]}, {\"input\": \"7f\\r\\n\", \"output\": [\"17\"]}, {\"input\": \"7e\\r\\n\", \"output\": [\"18\"]}, {\"input\": \"999999999999999992c\\r\\n\", \"output\": [\"3999999999999999965\"]}, {\"input\": \"7a\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"8f\\r\\n\", \"output\": [\"24\"]}, {\"input\": \"999999999999999992a\\r\\n\", \"output\": [\"3999999999999999963\"]}, {\"input\": \"999999999999999992b\\r\\n\", \"output\": [\"3999999999999999964\"]}, {\"input\": \"999999999999999992c\\r\\n\", \"output\": [\"3999999999999999965\"]}, {\"input\": \"999999999999999992d\\r\\n\", \"output\": [\"3999999999999999962\"]}, {\"input\": \"999999999999999992e\\r\\n\", \"output\": [\"3999999999999999961\"]}, {\"input\": \"999999999999999992f\\r\\n\", \"output\": [\"3999999999999999960\"]}, {\"input\": \"999999999999999993a\\r\\n\", \"output\": [\"3999999999999999972\"]}, {\"input\": \"999999999999999993b\\r\\n\", \"output\": [\"3999999999999999973\"]}, {\"input\": \"999999999999999993c\\r\\n\", \"output\": [\"3999999999999999974\"]}, {\"input\": \"999999999999999993d\\r\\n\", \"output\": [\"3999999999999999971\"]}, {\"input\": \"999999999999999993e\\r\\n\", \"output\": [\"3999999999999999970\"]}, {\"input\": \"999999999999999993f\\r\\n\", \"output\": [\"3999999999999999969\"]}, {\"input\": \"999999999999999994a\\r\\n\", \"output\": [\"3999999999999999979\"]}, {\"input\": \"999999999999999994b\\r\\n\", \"output\": [\"3999999999999999980\"]}, {\"input\": \"999999999999999994c\\r\\n\", \"output\": [\"3999999999999999981\"]}, {\"input\": \"999999999999999994d\\r\\n\", \"output\": [\"3999999999999999978\"]}, {\"input\": \"999999999999999994e\\r\\n\", \"output\": [\"3999999999999999977\"]}, {\"input\": \"999999999999999994f\\r\\n\", \"output\": [\"3999999999999999976\"]}, {\"input\": \"999999999999999995a\\r\\n\", \"output\": [\"3999999999999999972\"]}, {\"input\": \"999999999999999995b\\r\\n\", \"output\": [\"3999999999999999973\"]}, {\"input\": \"999999999999999995c\\r\\n\", \"output\": [\"3999999999999999974\"]}, {\"input\": \"999999999999999995d\\r\\n\", \"output\": [\"3999999999999999971\"]}, {\"input\": \"999999999999999995e\\r\\n\", \"output\": [\"3999999999999999970\"]}, {\"input\": \"999999999999999995f\\r\\n\", \"output\": [\"3999999999999999969\"]}, {\"input\": \"10a\\r\\n\", \"output\": [\"43\"]}, {\"input\": \"11f\\r\\n\", \"output\": [\"33\"]}, {\"input\": \"681572647b\\r\\n\", \"output\": [\"2726290581\"]}, {\"input\": \"23f\\r\\n\", \"output\": [\"81\"]}, {\"input\": \"123a\\r\\n\", \"output\": [\"484\"]}, {\"input\": \"999999888888777777a\\r\\n\", \"output\": [\"3999999555555111108\"]}]"} {"prob_desc_description":"The year 2015 is almost over.Limak is a little polar bear. He has recently learnt about the binary system. He noticed that the passing year has exactly one zero in its representation in the binary system\u00a0\u2014 201510\u2009=\u2009111110111112. Note that he doesn't care about the number of zeros in the decimal representation.Limak chose some interval of years. He is going to count all years from this interval that have exactly one zero in the binary representation. Can you do it faster?Assume that all positive integers are always written without leading zeros.","prob_desc_output_spec":"Print one integer\u00a0\u2013 the number of years Limak will count in his chosen interval.","lang_cluster":"","src_uid":"581f61b1f50313bf4c75833cefd4d022","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force","bitmasks","implementation"],"prob_desc_created_at":"1451487900","prob_desc_sample_inputs":"[\"5 10\", \"2015 2015\", \"100 105\", \"72057594000000000 72057595000000000\"]","prob_desc_notes":"NoteIn the first sample Limak's interval contains numbers 510\u2009=\u20091012, 610\u2009=\u20091102, 710\u2009=\u20091112, 810\u2009=\u200910002, 910\u2009=\u200910012 and 1010\u2009=\u200910102. Two of them (1012 and 1102) have the described property.","exec_outcome":"","difficulty":1300.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The only line of the input contains two integers a and b (1\u2009\u2264\u2009a\u2009\u2264\u2009b\u2009\u2264\u20091018)\u00a0\u2014 the first year and the last year in Limak's interval respectively.","prob_desc_sample_outputs":"[\"2\", \"1\", \"0\", \"26\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"5 10\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"2015 2015\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"100 105\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"72057594000000000 72057595000000000\\r\\n\", \"output\": [\"26\"]}, {\"input\": \"1 100\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"1000000000000000000 1000000000000000000\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 1000000000000000000\\r\\n\", \"output\": [\"1712\"]}, {\"input\": \"1 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 2\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 3\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 4\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 5\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1 6\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"1 7\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"2 2\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 3\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 4\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 5\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"2 6\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"2 7\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"3 3\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3 4\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3 5\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"3 6\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"3 7\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"4 4\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"4 5\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"4 6\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"4 7\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"5 5\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"5 6\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"5 7\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"6 6\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"6 7\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"7 7\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 8\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"6 8\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"7 8\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"8 8\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 1022\\r\\n\", \"output\": [\"45\"]}, {\"input\": \"1 1023\\r\\n\", \"output\": [\"45\"]}, {\"input\": \"1 1024\\r\\n\", \"output\": [\"45\"]}, {\"input\": \"1 1025\\r\\n\", \"output\": [\"45\"]}, {\"input\": \"1 1026\\r\\n\", \"output\": [\"45\"]}, {\"input\": \"509 1022\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"510 1022\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"511 1022\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"512 1022\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"513 1022\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"509 1023\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"510 1023\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"511 1023\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"512 1023\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"513 1023\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"509 1024\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"510 1024\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"511 1024\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"512 1024\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"513 1024\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"509 1025\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"510 1025\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"511 1025\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"512 1025\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"513 1025\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"1 1000000000\\r\\n\", \"output\": [\"408\"]}, {\"input\": \"10000000000 70000000000000000\\r\\n\", \"output\": [\"961\"]}, {\"input\": \"1 935829385028502935\\r\\n\", \"output\": [\"1712\"]}, {\"input\": \"500000000000000000 1000000000000000000\\r\\n\", \"output\": [\"58\"]}, {\"input\": \"500000000000000000 576460752303423488\\r\\n\", \"output\": [\"57\"]}, {\"input\": \"576460752303423488 1000000000000000000\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"999999999999999999 1000000000000000000\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1124800395214847 36011204832919551\\r\\n\", \"output\": [\"257\"]}, {\"input\": \"1124800395214847 36011204832919550\\r\\n\", \"output\": [\"256\"]}, {\"input\": \"1124800395214847 36011204832919552\\r\\n\", \"output\": [\"257\"]}, {\"input\": \"1124800395214846 36011204832919551\\r\\n\", \"output\": [\"257\"]}, {\"input\": \"1124800395214848 36011204832919551\\r\\n\", \"output\": [\"256\"]}, {\"input\": \"1 287104476244869119\\r\\n\", \"output\": [\"1603\"]}, {\"input\": \"1 287104476244869118\\r\\n\", \"output\": [\"1602\"]}, {\"input\": \"1 287104476244869120\\r\\n\", \"output\": [\"1603\"]}, {\"input\": \"492581209243647 1000000000000000000\\r\\n\", \"output\": [\"583\"]}, {\"input\": \"492581209243646 1000000000000000000\\r\\n\", \"output\": [\"583\"]}, {\"input\": \"492581209243648 1000000000000000000\\r\\n\", \"output\": [\"582\"]}, {\"input\": \"1099444518911 1099444518911\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1099444518910 1099444518911\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1099444518911 1099444518912\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1099444518910 1099444518912\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"864691128455135231 864691128455135231\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"864691128455135231 864691128455135232\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"864691128455135230 864691128455135232\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"864691128455135230 864691128455135231\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"864691128455135231 1000000000000000000\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"864691128455135232 1000000000000000000\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"864691128455135230 1000000000000000000\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"576460752303423487 576460752303423487\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 576460752303423487\\r\\n\", \"output\": [\"1711\"]}, {\"input\": \"1 576460752303423486\\r\\n\", \"output\": [\"1711\"]}, {\"input\": \"2 1000000000000000000\\r\\n\", \"output\": [\"1712\"]}, {\"input\": \"3 1000000000000000000\\r\\n\", \"output\": [\"1711\"]}, {\"input\": \"4 1000000000000000000\\r\\n\", \"output\": [\"1711\"]}, {\"input\": \"5 1000000000000000000\\r\\n\", \"output\": [\"1711\"]}, {\"input\": \"6 1000000000000000000\\r\\n\", \"output\": [\"1710\"]}]"} {"prob_desc_description":"Your friend recently gave you some slimes for your birthday. You have n slimes all initially with value 1.You are going to play a game with these slimes. Initially, you put a single slime by itself in a row. Then, you will add the other n\u2009-\u20091 slimes one by one. When you add a slime, you place it at the right of all already placed slimes. Then, while the last two slimes in the row have the same value v, you combine them together to create a slime with value v\u2009+\u20091.You would like to see what the final state of the row is after you've added all n slimes. Please print the values of the slimes in the row from left to right.","prob_desc_output_spec":"Output a single line with k integers, where k is the number of slimes in the row after you've finished the procedure described in the problem statement. The i-th of these numbers should be the value of the i-th slime from the left.","lang_cluster":"","src_uid":"757cd804aba01dc4bc108cb0722f68dc","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["implementation"],"prob_desc_created_at":"1454087400","prob_desc_sample_inputs":"[\"1\", \"2\", \"3\", \"8\"]","prob_desc_notes":"NoteIn the first sample, we only have a single slime with value 1. The final state of the board is just a single slime with value 1.In the second sample, we perform the following steps:Initially we place a single slime in a row by itself. Thus, row is initially 1.Then, we will add another slime. The row is now 1 1. Since two rightmost slimes have the same values, we should replace these slimes with one with value 2. Thus, the final state of the board is 2.In the third sample, after adding the first two slimes, our row is 2. After adding one more slime, the row becomes 2 1.In the last sample, the steps look as follows: 1 2 2 1 3 3 1 3 2 3 2 1 4 ","exec_outcome":"","difficulty":800.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line of the input will contain a single integer, n (1\u2009\u2264\u2009n\u2009\u2264\u2009100\u2009000).","prob_desc_sample_outputs":"[\"1\", \"2\", \"2 1\", \"4\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"3\\r\\n\", \"output\": [\"2 1\", \"2 1\"]}, {\"input\": \"8\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"100000\\r\\n\", \"output\": [\"17 16 11 10 8 6\", \"17 16 11 10 8 6\"]}, {\"input\": \"12345\\r\\n\", \"output\": [\"14 13 6 5 4 1\", \"14 13 6 5 4 1\"]}, {\"input\": \"32\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"70958\\r\\n\", \"output\": [\"17 13 11 9 6 4 3 2\", \"17 13 11 9 6 4 3 2\"]}, {\"input\": \"97593\\r\\n\", \"output\": [\"17 15 14 13 12 11 9 6 5 4 1\", \"17 15 14 13 12 11 9 6 5 4 1\"]}, {\"input\": \"91706\\r\\n\", \"output\": [\"17 15 14 11 10 6 5 4 2\", \"17 15 14 11 10 6 5 4 2\"]}, {\"input\": \"85371\\r\\n\", \"output\": [\"17 15 12 11 9 7 6 5 4 2 1\", \"17 15 12 11 9 7 6 5 4 2 1\"]}, {\"input\": \"97205\\r\\n\", \"output\": [\"17 15 14 13 12 10 9 8 6 5 3 1\", \"17 15 14 13 12 10 9 8 6 5 3 1\"]}, {\"input\": \"34768\\r\\n\", \"output\": [\"16 11 10 9 8 7 5\", \"16 11 10 9 8 7 5\"]}, {\"input\": \"12705\\r\\n\", \"output\": [\"14 13 9 8 6 1\", \"14 13 9 8 6 1\"]}, {\"input\": \"30151\\r\\n\", \"output\": [\"15 14 13 11 9 8 7 3 2 1\", \"15 14 13 11 9 8 7 3 2 1\"]}, {\"input\": \"4974\\r\\n\", \"output\": [\"13 10 9 7 6 4 3 2\", \"13 10 9 7 6 4 3 2\"]}, {\"input\": \"32728\\r\\n\", \"output\": [\"15 14 13 12 11 10 9 8 7 5 4\", \"15 14 13 12 11 10 9 8 7 5 4\"]}, {\"input\": \"8192\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"65536\\r\\n\", \"output\": [\"17\"]}, {\"input\": \"32\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"256\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"4096\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"33301\\r\\n\", \"output\": [\"16 10 5 3 1\", \"16 10 5 3 1\"]}, {\"input\": \"16725\\r\\n\", \"output\": [\"15 9 7 5 3 1\", \"15 9 7 5 3 1\"]}, {\"input\": \"149\\r\\n\", \"output\": [\"8 5 3 1\", \"8 5 3 1\"]}, {\"input\": \"16277\\r\\n\", \"output\": [\"14 13 12 11 10 9 8 5 3 1\", \"14 13 12 11 10 9 8 5 3 1\"]}, {\"input\": \"99701\\r\\n\", \"output\": [\"17 16 11 9 7 6 5 3 1\", \"17 16 11 9 7 6 5 3 1\"]}]"} {"prob_desc_description":"You are given an alphabet consisting of n letters, your task is to make a string of the maximum possible length so that the following conditions are satisfied: the i-th letter occurs in the string no more than ai times; the number of occurrences of each letter in the string must be distinct for all the letters that occurred in the string at least once. ","prob_desc_output_spec":"Print a single integer \u2014 the maximum length of the string that meets all the requirements.","lang_cluster":"","src_uid":"3c4b2d1c9440515bc3002eddd2b89f6f","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["greedy","sortings"],"prob_desc_created_at":"1454605500","prob_desc_sample_inputs":"[\"3\\n2 5 5\", \"3\\n1 1 2\"]","prob_desc_notes":"NoteFor convenience let's consider an alphabet consisting of three letters: \"a\", \"b\", \"c\". In the first sample, some of the optimal strings are: \"cccaabbccbb\", \"aabcbcbcbcb\". In the second sample some of the optimal strings are: \"acc\", \"cbc\".","exec_outcome":"","difficulty":1100.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line of the input contains a single integer n (2\u2009\u2009\u2264\u2009\u2009n\u2009\u2009\u2264\u2009\u200926)\u00a0\u2014 the number of letters in the alphabet. The next line contains n integers ai (1\u2009\u2264\u2009ai\u2009\u2264\u2009109)\u00a0\u2014 i-th of these integers gives the limitation on the number of occurrences of the i-th character in the string.","prob_desc_sample_outputs":"[\"11\", \"3\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"3\\r\\n2 5 5\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"3\\r\\n1 1 2\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"2\\r\\n1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"3\\r\\n1 1000000000 2\\r\\n\", \"output\": [\"1000000003\"]}, {\"input\": \"26\\r\\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\\r\\n\", \"output\": [\"25999999675\"]}, {\"input\": \"2\\r\\n559476582 796461544\\r\\n\", \"output\": [\"1355938126\"]}, {\"input\": \"2\\r\\n257775227 621811272\\r\\n\", \"output\": [\"879586499\"]}, {\"input\": \"10\\r\\n876938317 219479349 703839299 977218449 116819315 752405530 393874852 286326991 592978634 155758306\\r\\n\", \"output\": [\"5075639042\"]}, {\"input\": \"26\\r\\n72 49 87 47 94 96 36 91 43 11 19 83 36 38 10 93 95 81 4 96 60 38 97 37 36 41\\r\\n\", \"output\": [\"1478\"]}, {\"input\": \"26\\r\\n243 364 768 766 633 535 502 424 502 283 592 877 137 891 837 990 681 898 831 487 595 604 747 856 805 688\\r\\n\", \"output\": [\"16535\"]}, {\"input\": \"26\\r\\n775 517 406 364 548 951 680 984 466 141 960 513 660 849 152 250 176 601 199 370 971 554 141 224 724 543\\r\\n\", \"output\": [\"13718\"]}, {\"input\": \"26\\r\\n475 344 706 807 925 813 974 166 578 226 624 591 419 894 574 909 544 597 170 990 893 785 399 172 792 748\\r\\n\", \"output\": [\"16115\"]}, {\"input\": \"26\\r\\n130 396 985 226 487 671 188 706 106 649 38 525 210 133 298 418 953 431 577 69 12 982 264 373 283 266\\r\\n\", \"output\": [\"10376\"]}, {\"input\": \"26\\r\\n605 641 814 935 936 547 524 702 133 674 173 102 318 620 248 523 77 718 318 635 322 362 306 86 8 442\\r\\n\", \"output\": [\"11768\"]}, {\"input\": \"26\\r\\n220 675 725 888 725 654 546 806 379 182 604 667 734 394 889 731 572 193 850 651 844 734 163 671 820 887\\r\\n\", \"output\": [\"16202\"]}, {\"input\": \"26\\r\\n1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000\\r\\n\", \"output\": [\"25675\"]}, {\"input\": \"26\\r\\n1001 1001 1000 1000 1001 1000 1001 1001 1001 1000 1000 1001 1001 1000 1000 1000 1000 1001 1000 1001 1001 1000 1001 1001 1001 1000\\r\\n\", \"output\": [\"25701\"]}, {\"input\": \"26\\r\\n1000 1001 1000 1001 1000 1001 1001 1000 1001 1002 1002 1000 1001 1000 1000 1000 1001 1002 1001 1000 1000 1001 1000 1002 1001 1002\\r\\n\", \"output\": [\"25727\"]}, {\"input\": \"26\\r\\n1003 1002 1002 1003 1000 1000 1000 1003 1000 1001 1003 1003 1000 1002 1002 1002 1001 1003 1000 1001 1000 1001 1001 1000 1003 1003\\r\\n\", \"output\": [\"25753\"]}, {\"input\": \"26\\r\\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\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"26\\r\\n8717 9417 1409 7205 3625 6247 8626 9486 464 4271 1698 8449 4551 1528 7456 9198 4886 2889 7534 506 7867 9410 1635 4955 2580 2580\\r\\n\", \"output\": [\"137188\"]}, {\"input\": \"26\\r\\n197464663 125058028 622449215 11119637 587496049 703992162 219591040 965159268 229879004 278894000 841629744 616893922 218779915 362575332 844188865 342411376 369680019 43823059 921419789 999588082 943769007 35365522 301907919 758302419 427454397 807507709\\r\\n\", \"output\": [\"12776400142\"]}, {\"input\": \"26\\r\\n907247856 970380443 957324066 929910532 947150618 944189007 998282297 988343406 981298600 943026596 953932265 972691398 950024048 923033790 996423650 972134755 946404759 918183059 902987271 965507679 906967700 982106487 933997242 972594441 977736332 928874832\\r\\n\", \"output\": [\"24770753129\"]}, {\"input\": \"26\\r\\n999999061 999999688 999999587 999999429 999999110 999999563 999999120 999999111 999999794 999999890 999999004 999999448 999999770 999999543 999999460 999999034 999999361 999999305 999999201 999999778 999999432 999999844 999999133 999999342 999999600 999999319\\r\\n\", \"output\": [\"25999984927\"]}, {\"input\": \"3\\r\\n587951561 282383259 612352726\\r\\n\", \"output\": [\"1482687546\"]}, {\"input\": \"4\\r\\n111637338 992238139 787658714 974622806\\r\\n\", \"output\": [\"2866156997\"]}, {\"input\": \"5\\r\\n694257603 528073418 726928894 596328666 652863391\\r\\n\", \"output\": [\"3198451972\"]}, {\"input\": \"6\\r\\n217943380 532900593 902234882 513005821 369342573 495810412\\r\\n\", \"output\": [\"3031237661\"]}, {\"input\": \"7\\r\\n446656860 478792281 77541870 429682977 85821755 826122363 563802405\\r\\n\", \"output\": [\"2908420511\"]}, {\"input\": \"8\\r\\n29278125 778590752 252847858 51388836 802299938 215370803 901540149 242074772\\r\\n\", \"output\": [\"3273391233\"]}, {\"input\": \"9\\r\\n552962902 724482439 133182550 673093696 518779120 604618242 534250189 847695567 403066553\\r\\n\", \"output\": [\"4992131258\"]}, {\"input\": \"10\\r\\n600386086 862479376 284190454 781950823 672077209 5753052 145701234 680334621 497013634 35429365\\r\\n\", \"output\": [\"4565315854\"]}, {\"input\": \"11\\r\\n183007351 103343359 164525146 698627979 388556391 926007595 483438978 580927711 659384363 201890880 920750904\\r\\n\", \"output\": [\"5310460657\"]}, {\"input\": \"12\\r\\n706692128 108170535 339831134 320333838 810063277 20284739 821176722 481520801 467848308 604388203 881959821 874133307\\r\\n\", \"output\": [\"6436402813\"]}, {\"input\": \"13\\r\\n525349200 54062222 810108418 237010994 821513756 409532178 158915465 87142595 630219037 770849718 843168738 617993222 504443485\\r\\n\", \"output\": [\"6470309028\"]}, {\"input\": \"14\\r\\n812998169 353860693 690443110 153688149 537992938 798779618 791624505 282706982 733654279 468319337 568341847 597888944 649703235 667623671\\r\\n\", \"output\": [\"8107625477\"]}, {\"input\": \"15\\r\\n336683946 299752380 865749098 775393009 959499824 893055762 365399057 419335880 896025008 575845364 529550764 341748859 30999793 464432689 19445239\\r\\n\", \"output\": [\"7772916672\"]}, {\"input\": \"16\\r\\n860368723 540615364 41056086 692070164 970950302 282304201 998108096 24957674 999460249 37279175 490759681 26673285 412295352 671298115 627182888 90740349\\r\\n\", \"output\": [\"7766119704\"]}, {\"input\": \"17\\r\\n148018692 545442539 980325266 313776023 687429485 376580345 40875544 925549764 161831978 144805202 451968598 475560904 262583806 468107133 60900936 281546097 912565045\\r\\n\", \"output\": [\"7237867357\"]}, {\"input\": \"18\\r\\n966674765 786305522 860659958 935480883 108937371 60800080 673584584 826142855 560238516 606238013 413177515 455456626 643879364 969943855 963609881 177380550 544192822 864797474\\r\\n\", \"output\": [\"11417500634\"]}, {\"input\": \"19\\r\\n490360541 496161402 330938242 852158038 120387849 686083328 247359135 431764649 427637949 8736336 843378328 435352349 494167818 766752874 161292122 368186298 470791896 813444279 170758124\\r\\n\", \"output\": [\"8615711557\"]}, {\"input\": \"20\\r\\n654616375 542649443 729213190 188364665 238384327 726353863 974350390 526804424 601329631 886592063 734805196 275562411 861801362 374466292 119830901 403120565 670982545 63210795 130397643 601611646\\r\\n\", \"output\": [\"10304447727\"]}, {\"input\": \"21\\r\\n942265343 252505322 904519178 810069524 954862509 115602302 548124942 132426218 999736168 584061682 696014113 960485837 712089816 581331718 317512142 593926314 302610323 716885305 477125514 813997503 535631456\\r\\n\", \"output\": [\"12951783229\"]}, {\"input\": \"22\\r\\n465951120 788339601 784853870 726746679 376370396 504849742 180834982 33019308 867135601 455551901 657223030 940381560 93386374 378140736 161286599 548696254 934237100 75589518 764917898 731412064 205669368 630662937\\r\\n\", \"output\": [\"11305256638\"]}, {\"input\": \"23\\r\\n989635897 498195481 255132154 643423835 387820874 894097181 223601429 228583694 265543138 153021520 618431947 684241474 943673829 174949754 358967839 444530707 801900686 965299835 347682577 648826625 406714384 129525158 958578251\\r\\n\", \"output\": [\"12022378269\"]}, {\"input\": \"24\\r\\n277285866 739058464 135466846 265129694 104300056 519381429 856310469 834204489 132942572 260547547 343605057 664137197 619941683 676786476 497713592 635336455 138557168 618975345 635474960 861212482 76752297 923357675 517046816 274123722\\r\\n\", \"output\": [\"11607648357\"]}, {\"input\": \"25\\r\\n95942939 979921447 310772834 181806850 525806942 613657573 194049213 734797579 531349109 721980358 304813974 113025815 470230137 473595494 695394833 590106396 770183946 567622150 218239639 778627043 41761505 127248600 134450869 860350034 901937574\\r\\n\", \"output\": [\"11937672853\"]}, {\"input\": \"26\\r\\n619627716 984748623 486078822 98484005 537257421 2906012 62795060 635390669 103777246 829506385 971050595 92921538 851525695 680460920 893076074 780912144 401811723 221297659 269996214 991012900 242806521 626109821 987889730 682613155 209557740 806895799\\r\\n\", \"output\": [\"14070510187\"]}, {\"input\": \"26\\r\\n10 1 20 2 23 3 14 6 7 13 26 21 11 8 16 25 12 15 19 9 17 22 24 18 5 4\\r\\n\", \"output\": [\"351\"]}, {\"input\": \"3\\r\\n1 1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"5\\r\\n5 3 3 3 1\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"5\\r\\n2 2 2 2 2\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"10\\r\\n10 10 10 10 10 10 10 10 1 1\\r\\n\", \"output\": [\"53\"]}, {\"input\": \"10\\r\\n100 100 10 10 10 10 10 1 1 1\\r\\n\", \"output\": [\"240\"]}, {\"input\": \"6\\r\\n5 3 3 3 3 1\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"4\\r\\n4 3 2 1\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"5\\r\\n1 1 1 1 1\\r\\n\", \"output\": [\"1\"]}]"} {"prob_desc_description":"Famous Brazil city Rio de Janeiro holds a tennis tournament and Ostap Bender doesn't want to miss this event. There will be n players participating, and the tournament will follow knockout rules from the very first game. That means, that if someone loses a game he leaves the tournament immediately.Organizers are still arranging tournament grid (i.e. the order games will happen and who is going to play with whom) but they have already fixed one rule: two players can play against each other only if the number of games one of them has already played differs by no more than one from the number of games the other one has already played. Of course, both players had to win all their games in order to continue participating in the tournament.Tournament hasn't started yet so the audience is a bit bored. Ostap decided to find out what is the maximum number of games the winner of the tournament can take part in (assuming the rule above is used). However, it is unlikely he can deal with this problem without your help.","prob_desc_output_spec":"Print the maximum number of games in which the winner of the tournament can take part.","lang_cluster":"","src_uid":"3d3432b4f7c6a3b901161fa24b415b14","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["greedy","combinatorics","constructive algorithms","dp","math","dfs and similar"],"prob_desc_created_at":"1480264500","prob_desc_sample_inputs":"[\"2\", \"3\", \"4\", \"10\"]","prob_desc_notes":"NoteIn all samples we consider that player number 1 is the winner.In the first sample, there would be only one game so the answer is 1.In the second sample, player 1 can consequently beat players 2 and 3. In the third sample, player 1 can't play with each other player as after he plays with players 2 and 3 he can't play against player 4, as he has 0 games played, while player 1 already played 2. Thus, the answer is 2 and to achieve we make pairs (1,\u20092) and (3,\u20094) and then clash the winners.","exec_outcome":"","difficulty":1600.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The only line of the input contains a single integer n (2\u2009\u2264\u2009n\u2009\u2264\u20091018)\u00a0\u2014 the number of players to participate in the tournament.","prob_desc_sample_outputs":"[\"1\", \"2\", \"2\", \"4\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"3\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"4\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"10\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"1000\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"2500\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"690000\\r\\n\", \"output\": [\"27\"]}, {\"input\": \"3000000000\\r\\n\", \"output\": [\"45\"]}, {\"input\": \"123456789123456789\\r\\n\", \"output\": [\"81\"]}, {\"input\": \"5\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"143\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"144\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"145\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"232\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"233\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"234\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"679891637638612257\\r\\n\", \"output\": [\"84\"]}, {\"input\": \"679891637638612258\\r\\n\", \"output\": [\"85\"]}, {\"input\": \"679891637638612259\\r\\n\", \"output\": [\"85\"]}, {\"input\": \"1000000000000000000\\r\\n\", \"output\": [\"85\"]}, {\"input\": \"10235439547\\r\\n\", \"output\": [\"47\"]}, {\"input\": \"1240723548\\r\\n\", \"output\": [\"43\"]}, {\"input\": \"92353046212453\\r\\n\", \"output\": [\"66\"]}, {\"input\": \"192403205846532\\r\\n\", \"output\": [\"68\"]}, {\"input\": \"13925230525389\\r\\n\", \"output\": [\"62\"]}, {\"input\": \"12048230592523\\r\\n\", \"output\": [\"62\"]}, {\"input\": \"19204385325853\\r\\n\", \"output\": [\"63\"]}, {\"input\": \"902353283921\\r\\n\", \"output\": [\"56\"]}, {\"input\": \"793056859214355\\r\\n\", \"output\": [\"70\"]}, {\"input\": \"982045466234565\\r\\n\", \"output\": [\"71\"]}, {\"input\": \"126743950353465\\r\\n\", \"output\": [\"67\"]}, {\"input\": \"12405430465\\r\\n\", \"output\": [\"47\"]}, {\"input\": \"10238439257768\\r\\n\", \"output\": [\"61\"]}, {\"input\": \"1728493055346\\r\\n\", \"output\": [\"58\"]}, {\"input\": \"927553829046\\r\\n\", \"output\": [\"56\"]}, {\"input\": \"62735129403\\r\\n\", \"output\": [\"51\"]}, {\"input\": \"71624823950223\\r\\n\", \"output\": [\"65\"]}, {\"input\": \"8902353464851212\\r\\n\", \"output\": [\"75\"]}, {\"input\": \"61824012598535\\r\\n\", \"output\": [\"65\"]}, {\"input\": \"1294902504603347\\r\\n\", \"output\": [\"71\"]}, {\"input\": \"6\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"7\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"8\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"9\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"11\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"12\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"13\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"14\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"15\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"16\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"17\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"18\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"19\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"20\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"21\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"22\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"23\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"355687428096000\\r\\n\", \"output\": [\"69\"]}, {\"input\": \"576460752303423488\\r\\n\", \"output\": [\"84\"]}, {\"input\": \"32212254719\\r\\n\", \"output\": [\"49\"]}, {\"input\": \"26388279066623\\r\\n\", \"output\": [\"63\"]}, {\"input\": \"618473717761\\r\\n\", \"output\": [\"56\"]}, {\"input\": \"262406072477\\r\\n\", \"output\": [\"54\"]}]"} {"prob_desc_description":"Calvin the robot lies in an infinite rectangular grid. Calvin's source code contains a list of n commands, each either 'U', 'R', 'D', or 'L'\u00a0\u2014 instructions to move a single square up, right, down, or left, respectively. How many ways can Calvin execute a non-empty contiguous substrings of commands and return to the same square he starts in? Two substrings are considered different if they have different starting or ending indices.","prob_desc_output_spec":"Print a single integer\u00a0\u2014 the number of contiguous substrings that Calvin can execute and return to his starting square.","lang_cluster":"","src_uid":"7bd5521531950e2de9a7b0904353184d","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force","implementation"],"prob_desc_created_at":"1455384900","prob_desc_sample_inputs":"[\"6\\nURLLDR\", \"4\\nDLUU\", \"7\\nRLRLRLR\"]","prob_desc_notes":"NoteIn the first case, the entire source code works, as well as the \"RL\" substring in the second and third characters.Note that, in the third case, the substring \"LR\" appears three times, and is therefore counted three times to the total result.","exec_outcome":"","difficulty":1000.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line of the input contains a single positive integer, n (1\u2009\u2264\u2009n\u2009\u2264\u2009200)\u00a0\u2014 the number of commands. The next line contains n characters, each either 'U', 'R', 'D', or 'L'\u00a0\u2014 Calvin's source code.","prob_desc_sample_outputs":"[\"2\", \"0\", \"12\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"6\\r\\nURLLDR\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"4\\r\\nDLUU\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"7\\r\\nRLRLRLR\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"1\\r\\nR\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"100\\r\\nURDLURDLURDLURDLURDLURDLURDLURDLURDLURDLURDLURDLURDLURDLURDLURDLURDLURDLURDLURDLURDLURDLURDLURDLURDL\\r\\n\", \"output\": [\"1225\"]}, {\"input\": \"200\\r\\nLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\\r\\n\", \"output\": [\"100\"]}, {\"input\": \"20\\r\\nLDURLDURRLRUDLRRUDLU\\r\\n\", \"output\": [\"29\"]}, {\"input\": \"140\\r\\nDLDLULULDRDDDLLUDRRDLLUULLDDLDLUURLDLDRDUDDLRRDURUUUUURLDUDDLLRRLLDRRRDDDDDUDUULLURRDLDULUDLLUUDRRLUDULUDUDULULUURURRDUURRDLULLURUDDDDRDRDRD\\r\\n\", \"output\": [\"125\"]}, {\"input\": \"194\\r\\nULLLDLLDRUUDURRULLRLUUURDRLLURDUDDUDLULRLDRUDURLDLRDLLLLUDDRRRULULULUDDULRURURLLDLDLDRUDUUDULRULDDRRLRDRULLDRULLLLRRDDLLLLULDRLUULRUUULDUUDLDLDUUUDDLDDRULDRRLUURRULLDULRRDLLRDURDLUUDUDLLUDDULDDD\\r\\n\", \"output\": [\"282\"]}, {\"input\": \"200\\r\\nDDDURLLUUULUDDURRDLLDDLLRLUULUULDDDLRRDLRRDUDURDUDRRLLDRDUDDLDDRDLURRRLLRDRRLLLRDDDRDRRLLRRLULRUULRLDLUDRRRDDUUURLLUDRLDUDRLLRLRRLUDLRULDUDDRRLLRLURDLRUDDDURLRDUDUUURLLULULRDRLDLDRURDDDLLRUDDRDUDDDLRU\\r\\n\", \"output\": [\"408\"]}, {\"input\": \"197\\r\\nDUUDUDUDUDUUDUUDUUUDDDDUUUDUUUDUUUUUDUUUDDUDDDUUDUDDDUUDDUUUUUUUDUDDDDDUUUUUDDDDDDUUUUDDUDDUDDDUDUUUDUUDUDUDUUUDUDDDDUUDDUDDDDUDDDUDUUUDUUDUUUDDDDUUUDUUDDUUUUUDDDDUUDUUDDDDUDDUUDUUUDDDDUDUUUDDDUUDU\\r\\n\", \"output\": [\"1995\"]}, {\"input\": \"200\\r\\nLLLLRLLRLLRRRRLLRRLRRLRRRLLLRRLRRRRLLRRLLRRRLRLRLRRLLRLLRRLLLRRRRLRLLRLLLRLLLRRLLLRLRLRRRRRRRLRRRLRLRLLLLRLRRRRRLRRLRLLLLRLLLRRLRRLLRLRLLLRRLLRRLRRRRRLRLRRLRLLRLLLLRLRRRLRRLRLLRLRRLRRRRRLRRLLLRRRRRLLR\\r\\n\", \"output\": [\"1368\"]}, {\"input\": \"184\\r\\nUUUDDUDDDDDUDDDDUDDUUUUUDDDUUDDUDUUDUUUDDUDDDDDDDDDDUDUDDUUDDDUUDDUDUDDDUUDUDUUUUDDUDUUUDDUDUUUUDUUDDUUDUUUDUDUDDUDUDDDUUDDDDUUUUUDDDUDUDUDUDUDUUUDUDDUUDDUDUUDUDUUUDUUDDDDUDDDDUDUUDUUD\\r\\n\", \"output\": [\"1243\"]}, {\"input\": \"187\\r\\nRLLRLRRLLRRLRRRRLLRLLRLLLLRRRLLLRLLLLRRLRLRRRRRRLLRRLRLLRRRLLRRLLLRRLRRLRLLLLRRRRLRRLLRRLRRRRLLLLRRLRLRLRRRRRLLRLRLRLRLRLRLLLRLLLLLRRRLLRLRRRLLLRRLLLLLRLLRLLLRRRLLLRRLRRRLLLRRLRLLRRLRLRLR\\r\\n\", \"output\": [\"1501\"]}, {\"input\": \"190\\r\\nUULLLUUULLLULLUULUUUUULUUULLULLULUULLUULLUUULULUULLUULLUUULULLLLLLULLLLLULUULLULLULLLUULUULLLUUUULLLLUUULLUUULLLULULUULULLUULULULUUULLUUUULLUUULULUULLLLULLLLLUULLUULULLULUUUUUULULLLULLUULUUU\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"46\\r\\nULUURRRRLDRDRDDDURRRLLLDDULLRRRRRLUDDLRDRULLLL\\r\\n\", \"output\": [\"23\"]}, {\"input\": \"70\\r\\nUUDRLDRDRUDLLURURULRDULRRDULDUDDRUULLDDDDDRLLRDURRDULRDLRUUUDDLRUURRLD\\r\\n\", \"output\": [\"86\"]}, {\"input\": \"198\\r\\nURLLUDRDUUDRDLLRURULLRRLRRUULRLULUUDRRURLRUURRDRUUDRLRURLLULRDDDDDRDDRRRLRUDULLDDLLLUDRLDRUDRDLDUULLUUUULULLRLDDRDURDRURLULDRURLLDDULURULDLUUUUULDLURRLLDLULLDULRUURRLDLLUUURDLDDUDUULRLUDULLULDRDRLRL\\r\\n\", \"output\": [\"160\"]}, {\"input\": \"22\\r\\nDUDDDURURUDURRUDRDULUL\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"200\\r\\nUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUD\\r\\n\", \"output\": [\"10000\"]}, {\"input\": \"4\\r\\nRRDR\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"6\\r\\nUULLLL\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2\\r\\nDU\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"6\\r\\nUURRRR\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"101\\r\\nRDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD\\r\\n\", \"output\": [\"0\"]}]"} {"prob_desc_description":"Two positive integers a and b have a sum of s and a bitwise XOR of x. How many possible values are there for the ordered pair (a,\u2009b)?","prob_desc_output_spec":"Print a single integer, the number of solutions to the given conditions. If no solutions exist, print 0.","lang_cluster":"","src_uid":"18410980789b14c128dd6adfa501aea5","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","constructive algorithms","dp","implementation"],"prob_desc_created_at":"1456683000","prob_desc_sample_inputs":"[\"9 5\", \"3 3\", \"5 2\"]","prob_desc_notes":"NoteIn the first sample, we have the following solutions: (2,\u20097), (3,\u20096), (6,\u20093), (7,\u20092).In the second sample, the only solutions are (1,\u20092) and (2,\u20091).","exec_outcome":"","difficulty":1700.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line of the input contains two integers s and x (2\u2009\u2264\u2009s\u2009\u2264\u20091012, 0\u2009\u2264\u2009x\u2009\u2264\u20091012), the sum and bitwise xor of the pair of positive integers, respectively.","prob_desc_sample_outputs":"[\"4\", \"2\", \"0\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"9 5\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"3 3\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"5 2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"6 0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"549755813887 549755813887\\r\\n\", \"output\": [\"549755813886\"]}, {\"input\": \"2 0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"433864631347 597596794426\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"80 12\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"549755813888 549755813886\\r\\n\", \"output\": [\"274877906944\"]}, {\"input\": \"643057379466 24429729346\\r\\n\", \"output\": [\"2048\"]}, {\"input\": \"735465350041 356516240229\\r\\n\", \"output\": [\"32768\"]}, {\"input\": \"608032203317 318063018433\\r\\n\", \"output\": [\"4096\"]}, {\"input\": \"185407964720 148793115916\\r\\n\", \"output\": [\"16384\"]}, {\"input\": \"322414792152 285840263184\\r\\n\", \"output\": [\"4096\"]}, {\"input\": \"547616456703 547599679487\\r\\n\", \"output\": [\"68719476736\"]}, {\"input\": \"274861129991 274861129463\\r\\n\", \"output\": [\"34359738368\"]}, {\"input\": \"549688705887 549688703839\\r\\n\", \"output\": [\"34359738368\"]}, {\"input\": \"412182675455 412182609919\\r\\n\", \"output\": [\"68719476736\"]}, {\"input\": \"552972910589 546530328573\\r\\n\", \"output\": [\"17179869184\"]}, {\"input\": \"274869346299 274869346299\\r\\n\", \"output\": [\"8589934590\"]}, {\"input\": \"341374319077 341374319077\\r\\n\", \"output\": [\"134217726\"]}, {\"input\": \"232040172650 232040172650\\r\\n\", \"output\": [\"65534\"]}, {\"input\": \"322373798090 322373798090\\r\\n\", \"output\": [\"1048574\"]}, {\"input\": \"18436 18436\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"137707749376 137707749376\\r\\n\", \"output\": [\"30\"]}, {\"input\": \"9126813696 9126813696\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"419432708 419432708\\r\\n\", \"output\": [\"62\"]}, {\"input\": \"1839714 248080\\r\\n\", \"output\": [\"128\"]}, {\"input\": \"497110 38\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"1420572 139928\\r\\n\", \"output\": [\"64\"]}, {\"input\": \"583545 583545\\r\\n\", \"output\": [\"4094\"]}, {\"input\": \"33411 33411\\r\\n\", \"output\": [\"30\"]}, {\"input\": \"66068 66068\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"320 320\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1530587 566563\\r\\n\", \"output\": [\"256\"]}, {\"input\": \"1988518 108632\\r\\n\", \"output\": [\"128\"]}, {\"input\": \"915425594051 155160267299\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"176901202458 21535662096\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"865893190664 224852444148\\r\\n\", \"output\": [\"32768\"]}, {\"input\": \"297044970199 121204864\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"241173201018 236676464482\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1582116 139808\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1707011 656387\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"169616 132704\\r\\n\", \"output\": [\"32\"]}, {\"input\": \"2160101 553812\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1322568 271816\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"228503520839 471917524248\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"32576550340 504864993495\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"910648542843 537125462055\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"751720572344 569387893618\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"629791564846 602334362179\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1000000000000 1000000000000\\r\\n\", \"output\": [\"8190\"]}, {\"input\": \"1000000000000 999999999999\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1000000000000 4\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1000000000000 4096\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"3 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2097152 0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"40 390\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"22212 39957\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"128 36\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"14 4\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"6 2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"43 18467\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"7 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"7 5\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"251059 79687\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"17 7\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"4 6\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 4\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3 7\\r\\n\", \"output\": [\"0\"]}]"} {"prob_desc_description":"For his computer science class, Jacob builds a model tree with sticks and balls containing n nodes in the shape of a tree. Jacob has spent ai minutes building the i-th ball in the tree.Jacob's teacher will evaluate his model and grade Jacob based on the effort he has put in. However, she does not have enough time to search his whole tree to determine this; Jacob knows that she will examine the first k nodes in a DFS-order traversal of the tree. She will then assign Jacob a grade equal to the minimum ai she finds among those k nodes.Though Jacob does not have enough time to rebuild his model, he can choose the root node that his teacher starts from. Furthermore, he can rearrange the list of neighbors of each node in any order he likes. Help Jacob find the best grade he can get on this assignment.A DFS-order traversal is an ordering of the nodes of a rooted tree, built by a recursive DFS-procedure initially called on the root of the tree. When called on a given node v, the procedure does the following: Print v. Traverse the list of neighbors of the node v in order and iteratively call DFS-procedure on each one. Do not call DFS-procedure on node u if you came to node v directly from u. ","prob_desc_output_spec":"Print a single integer\u00a0\u2014 the maximum grade Jacob can get by picking the right root of the tree and rearranging the list of neighbors.","lang_cluster":"","src_uid":"4fb83b890e472f86045981e1743ddaac","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["dfs and similar","graphs","greedy","binary search"],"prob_desc_created_at":"1456683000","prob_desc_sample_inputs":"[\"5 3\\n3 6 1 4 2\\n1 2\\n2 4\\n2 5\\n1 3\", \"4 2\\n1 5 5 5\\n1 2\\n1 3\\n1 4\"]","prob_desc_notes":"NoteIn the first sample, Jacob can root the tree at node 2 and order 2's neighbors in the order 4, 1, 5 (all other nodes have at most two neighbors). The resulting preorder traversal is 2, 4, 1, 3, 5, and the minimum ai of the first 3 nodes is 3.In the second sample, it is clear that any preorder traversal will contain node 1 as either its first or second node, so Jacob cannot do better than a grade of 1.","exec_outcome":"","difficulty":2600.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"7 seconds","prob_desc_input_spec":"The first line of the input contains two positive integers, n and k (2\u2009\u2264\u2009n\u2009\u2264\u2009200\u2009000, 1\u2009\u2264\u2009k\u2009\u2264\u2009n)\u00a0\u2014 the number of balls in Jacob's tree and the number of balls the teacher will inspect. The second line contains n integers, ai (1\u2009\u2264\u2009ai\u2009\u2264\u20091\u2009000\u2009000), the time Jacob used to build the i-th ball. Each of the next n\u2009-\u20091 lines contains two integers ui, vi (1\u2009\u2264\u2009ui,\u2009vi\u2009\u2264\u2009n, ui\u2009\u2260\u2009vi) representing a connection in Jacob's tree between balls ui and vi.","prob_desc_sample_outputs":"[\"3\", \"1\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"5 3\\r\\n3 6 1 4 2\\r\\n1 2\\r\\n2 4\\r\\n2 5\\r\\n1 3\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"4 2\\r\\n1 5 5 5\\r\\n1 2\\r\\n1 3\\r\\n1 4\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 1\\r\\n1 100000\\r\\n2 1\\r\\n\", \"output\": [\"100000\"]}, {\"input\": \"2 2\\r\\n1 1000000\\r\\n1 2\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"10 4\\r\\n104325 153357 265088 777795 337716 557321 702646 734430 464449 744072\\r\\n9 4\\r\\n8 1\\r\\n10 7\\r\\n8 6\\r\\n7 9\\r\\n8 2\\r\\n3 5\\r\\n8 3\\r\\n10 8\\r\\n\", \"output\": [\"557321\"]}, {\"input\": \"10 3\\r\\n703660 186846 317819 628672 74457 58472 247014 480113 252764 860936\\r\\n10 6\\r\\n7 4\\r\\n10 9\\r\\n9 5\\r\\n6 3\\r\\n6 2\\r\\n7 1\\r\\n10 7\\r\\n10 8\\r\\n\", \"output\": [\"252764\"]}, {\"input\": \"10 10\\r\\n794273 814140 758469 932911 607860 683826 987442 652494 952171 698608\\r\\n1 3\\r\\n3 8\\r\\n2 7\\r\\n2 1\\r\\n2 9\\r\\n3 10\\r\\n6 4\\r\\n9 6\\r\\n3 5\\r\\n\", \"output\": [\"607860\"]}, {\"input\": \"200000 100000\\r\\n187144 606401 449471 587589 112357 126153 841833 925667 678740 17633 467422 267674 904062 847788 541842 629 275042 289091 218561 379227 149799 611714 52366 74773 960225 265175 358488 322244 877381 375698 708220 166529 452200 796447 842640 278151 574788 450410 566912 803359 705782 665118 302531 273623 937531 611932 676010 421130 448997 258600 597525 737369 848737 756671 690505 585516 903849 704562 969441 785714 936999 987842 471078 982790 782238 377387 340479 472409 777743 232071 357193 76419...\", \"output\": [\"81235\"]}, {\"input\": \"200000 3598\\r\\n897421 716664 387168 767272 417874 425082 217919 987791 74676 663310 19237 407095 339428 725175 355792 263613 283851 786636 600751 628691 571265 359162 540007 564990 247063 410047 660497 566552 351054 62640 678905 993103 858398 68596 823777 870052 530160 356294 52412 181230 718244 310071 293939 129493 70604 365865 312483 381271 776111 47381 667677 449734 252999 464838 465573 462279 168387 317276 873972 277972 24902 8843 179574 272891 845030 221273 781901 331742 22318 442147 470156 823473 98076...\", \"output\": [\"15268\"]}, {\"input\": \"200000 58071\\r\\n258566 357419 902429 357188 942321 543127 143184 613940 563668 922775 517244 819681 845816 418954 184067 5270 369783 962438 224604 394897 325185 627283 337103 633669 835034 418670 252346 812249 695002 685640 686735 390952 645356 124997 614995 422527 497871 742526 865377 871459 483096 869759 373221 860104 41966 818121 216226 796122 290317 372945 724269 492728 928772 786687 613807 190068 628855 20401 746022 99604 667613 187637 497572 672724 215810 156498 655951 613666 371527 9024 85216 568481 8...\", \"output\": [\"28249\"]}, {\"input\": \"200000 100000\\r\\n611962 863918 548951 769053 219850 249741 755065 103806 258004 663795 908199 107022 873603 161976 807435 435278 153581 508335 7023 597032 941247 277174 42891 388549 366718 563805 957966 574159 988170 255996 281562 429316 226996 209136 303891 863756 702314 124711 664852 50867 398013 146950 747112 84901 689576 286049 906196 900620 502403 768580 98621 470700 174397 400039 910579 844591 494921 286257 673737 184519 715233 368807 542124 954749 510735 417230 154357 113010 235832 553916 688631 22350...\", \"output\": [\"193151\"]}, {\"input\": \"200000 100000\\r\\n645220 947759 589508 943733 602803 993069 137743 721507 113794 199765 59848 64308 767099 915821 331127 314588 776121 215657 943046 545031 902714 136906 235703 719982 558814 702848 338011 239913 913122 367046 732426 499354 428484 529606 835151 148365 59098 281538 83112 195945 824355 521889 822613 505215 432026 201262 285814 571042 765373 355117 908723 648817 768500 390168 105489 25006 852482 437711 827316 726643 719163 837265 527071 702064 52574 467854 854072 338685 825617 698090 582503 57835...\", \"output\": [\"500002\"]}, {\"input\": \"200000 100000\\r\\n286982 236983 568805 655833 953642 238015 614691 602728 187364 681014 917799 369016 40551 734503 4142 868813 655175 865374 569834 734306 397350 51403 261779 40155 706427 502088 953368 26729 21272 80873 687427 879237 92959 69941 652831 362886 240212 939282 137038 415255 929408 984378 456950 330149 170674 778688 930424 237393 740938 281034 228110 25823 87822 439409 813127 670602 267670 256516 653343 718338 648460 514298 195928 250720 910643 919233 66264 975927 433565 776741 820129 919541 31665...\", \"output\": [\"488186\"]}, {\"input\": \"200000 100000\\r\\n133352 81586 560467 743207 434118 840761 366218 837518 888517 333685 565399 308712 670299 622186 594555 377318 19898 563767 418600 406489 539096 449834 746108 561801 236836 906795 800884 613164 693035 83883 453662 583481 192751 835324 938256 129056 53760 284003 425458 648501 914203 792965 466172 455405 876095 395316 349085 390219 458537 234086 369246 323756 966100 38093 943900 25626 90677 695642 112654 260990 254880 618079 643826 199028 60211 479992 800763 785221 409734 314722 78064 803932 9...\", \"output\": [\"26058\"]}, {\"input\": \"200000 100000\\r\\n620592 737090 620902 845084 529598 211719 190410 651275 283622 557052 466555 640473 425457 966571 972125 859026 754530 693380 489803 483418 89000 722774 336690 762026 208389 912647 721094 387708 187182 488770 172486 12918 732523 790628 577028 249517 252871 909053 633641 750001 902527 618880 97986 189420 975459 170787 971237 299707 768588 154978 181285 927429 601768 185871 911947 333210 273196 157531 807599 693695 195624 613806 876344 997738 330723 803697 384935 943217 394598 163894 170156 19...\", \"output\": [\"500007\"]}, {\"input\": \"200000 85731\\r\\n126534 78641 203627 110188 833143 735256 336932 275608 39484 197628 507932 464482 581753 237529 870184 737798 857753 523147 214948 342757 561288 502741 48559 475074 141174 64221 45421 203398 630106 262061 976132 953020 244525 39604 47647 463062 636651 998723 300846 297894 278614 142353 549156 469670 397746 340344 900280 9777 376586 680181 397924 375367 191786 203755 499881 948749 781026 28385 361417 645066 412234 174719 685964 454828 694968 521749 764604 587841 715979 540629 98472 331518 6564...\", \"output\": [\"72\"]}, {\"input\": \"200000 94428\\r\\n344961 834433 308846 758383 263352 420791 455848 80919 869400 34549 840811 407983 426241 519279 900455 46340 712205 168494 757178 631160 271619 108428 494138 873026 663077 319417 703280 800426 477411 580666 782807 369678 120358 463588 690209 41441 44102 586341 796594 150374 896148 519484 246563 473337 225169 760380 574592 411078 806133 742925 440523 134288 653225 100331 135287 833516 471053 393445 582253 469571 340403 428255 324618 78164 489186 657360 169183 518191 108500 371333 245872 602299...\", \"output\": [\"85\"]}, {\"input\": \"200000 91280\\r\\n246402 489397 32059 702329 672311 484722 327412 287738 246701 78457 483211 382648 840988 197172 954434 604596 756397 674781 907596 705157 809216 283205 930898 194643 687399 113935 30514 993308 412201 374770 641978 574641 924544 84730 751282 594298 182875 361415 241103 553390 248861 268620 806593 760156 5020 137681 309222 594854 574627 783794 974420 132224 398704 31199 790803 193013 398198 67034 971808 698594 858268 837051 628076 392954 230077 682543 127835 781184 440039 834357 89862 214864 92...\", \"output\": [\"104\"]}, {\"input\": \"200000 32673\\r\\n669747 7684 457782 26041 769257 993977 280080 754870 350535 601596 215767 183463 61770 306196 901376 361627 34819 879740 469529 172951 1050 753185 320833 202709 668422 554663 814891 867391 981398 277733 249631 705976 857003 867172 777337 836307 215611 837539 14696 387610 168144 297814 316848 127304 389575 32099 670761 775247 562002 624164 240061 251412 769718 639719 110830 950126 63758 342001 739854 875178 12294 685879 506884 268810 657120 446883 940878 549441 945139 282261 374010 266360 2079...\", \"output\": [\"512\"]}, {\"input\": \"200000 72007\\r\\n182994 483771 434495 962988 223475 853879 188396 628790 904550 648272 565640 264013 566881 24427 519763 647857 243151 709573 949698 708602 324878 781997 732093 19792 508850 74375 109600 150898 214784 399498 237950 41520 500851 72963 782937 441713 662651 538384 111212 899630 768377 434278 520353 720245 820997 618380 664603 492391 195560 670877 539182 917562 391394 372618 918242 831287 112549 560086 498355 789373 949592 539800 537876 987132 642389 130492 832935 630523 115307 682754 459462 64987...\", \"output\": [\"99\"]}, {\"input\": \"200000 45514\\r\\n273942 397419 347210 907638 345046 847798 4037 641123 177010 684049 203496 337900 917000 345221 524399 110093 187351 551903 688061 718211 270276 946288 617305 708114 853591 981838 352363 891586 352763 826833 929987 668958 526017 703382 877139 203636 229533 243712 716144 498008 884136 918194 422228 475872 415196 372438 411167 748585 948571 661209 570194 555153 798121 219244 272594 922875 607277 647045 945003 278670 411252 307164 829578 750006 448366 567790 428226 929442 708847 66238 159368 906...\", \"output\": [\"451151\"]}, {\"input\": \"200000 112357\\r\\n871436 859544 189872 122896 797648 913830 577415 462395 498209 402742 467733 417814 962290 646410 846679 46463 621863 282747 187325 510441 161758 54132 922093 199831 166435 460725 608702 565285 817402 127377 958718 581184 850969 777392 450733 29800 726059 113934 751936 197429 586382 193402 514015 347536 482390 126360 461031 367349 105288 767775 421224 418168 520736 770652 330535 324220 43275 127789 204126 65021 129581 259463 531576 386824 882397 323185 12181 918014 674212 530183 299852 71573...\", \"output\": [\"198351\"]}, {\"input\": \"200000 162463\\r\\n134260 43209 320553 277680 617762 936449 60133 845727 78900 82807 627713 329116 59360 899602 679614 648297 853137 165965 314256 760284 836198 897209 86497 956959 904944 29432 584589 21807 823736 941892 647589 162526 336246 621990 736364 973010 527579 462207 3613 754307 176840 353666 287267 330048 541077 957880 53919 465515 269451 446203 754853 282296 189098 173627 329663 442482 715492 255420 427241 370743 765152 7958 955155 799927 175480 733556 995875 882488 987771 404821 835952 539157 68996...\", \"output\": [\"71\"]}, {\"input\": \"200000 31008\\r\\n259434 992416 379446 591646 892646 541950 622651 765428 306196 715362 861713 243793 547449 553662 240413 428505 215165 160968 483817 296433 614059 52409 638372 374983 770228 33292 854047 662023 535468 481029 193872 941991 957836 340391 728275 713884 844015 881533 225444 483043 228565 228626 533286 729529 83746 139193 867487 655523 518176 895493 421497 141479 471929 801234 72067 590353 119550 351739 218414 862448 144227 555425 780625 516246 83968 46955 911462 437979 92113 475200 561418 311322 ...\", \"output\": [\"448226\"]}, {\"input\": \"200000 190042\\r\\n481211 822427 848843 991062 366872 451957 753778 961795 202823 460931 386785 684607 832529 3872 521260 7680 174646 756669 139421 952912 287080 877725 511024 673483 527502 210711 904853 24869 384002 547736 485170 168610 707732 675998 225822 694044 855364 532349 294951 945793 769227 950686 209613 967571 526355 850107 814340 3430 850299 318053 929014 272805 701652 465214 950975 276237 290278 927039 215087 931503 794028 857011 434380 354931 907731 855482 746701 305936 840576 899976 809440 849685...\", \"output\": [\"16\"]}, {\"input\": \"200000 174817\\r\\n138793 757430 623265 643303 546109 25472 912228 328323 155823 920126 674665 300973 120982 669084 177398 141136 243722 627943 880855 117054 328105 214354 108570 923561 596500 459506 142739 108523 668527 801218 924313 645503 119652 536864 233159 221253 757793 702734 602940 619202 453397 451186 580123 427165 406135 895766 24204 666148 621567 176553 47929 853189 154603 664380 91858 738517 734716 133253 63626 446733 652086 608735 373463 419655 168035 605768 595446 991685 73425 886627 636196 40938...\", \"output\": [\"8\"]}, {\"input\": \"200000 177360\\r\\n786549 362943 545828 148923 945791 649175 776139 602247 577433 553162 438795 846023 895255 96754 910858 779188 687120 954635 603506 669870 907231 133620 249454 370869 378275 671217 957360 219632 154111 605611 238702 216106 107867 959150 190368 279440 685473 877865 525764 535988 608256 211634 119899 529229 434157 875712 817321 370549 43229 274927 960120 199082 874701 276479 308694 353805 490042 668245 769170 760294 265513 406969 41155 335518 137312 136727 322113 304387 285163 356798 979818 39...\", \"output\": [\"7\"]}, {\"input\": \"200000 91658\\r\\n450429 42508 498735 342960 70842 551841 638272 66251 236822 239834 411642 362712 515523 273466 811482 665526 34280 573785 179537 628822 265376 870241 342978 60285 680760 465044 195336 598982 73652 596419 941934 652317 588874 759448 609653 307908 178213 97870 305937 42322 827555 323635 609708 206510 387096 224109 453410 156953 495241 794674 105540 648098 641266 720462 935445 152559 217729 16033 495952 12346 504856 355742 868447 960850 422991 191054 760421 363158 99119 226443 282166 30014 78796...\", \"output\": [\"26\"]}, {\"input\": \"200000 11720\\r\\n826082 867986 866666 778742 782047 160325 962519 48662 703530 379821 956504 445181 916649 744237 403094 714910 236711 579885 635933 767605 880081 759191 21852 227900 456441 52507 562793 284599 235478 921131 926331 506729 280194 937791 507950 364572 748475 75539 656066 744542 88802 459236 28957 819454 295615 120695 655556 890579 837435 583634 444454 974901 513508 704513 365009 126274 980269 862290 758843 149979 166507 785113 399290 439012 373657 928429 397516 61511 130773 35753 550673 219122 1...\", \"output\": [\"2957\"]}, {\"input\": \"200000 176558\\r\\n423076 295153 12252 939274 115683 603606 167226 156512 741783 664438 527129 676992 140661 652436 932341 12937 610339 269833 114113 208107 918011 709633 447839 876973 718092 654330 841833 643432 424537 714184 800940 107146 932184 550932 623272 102036 980211 661528 886673 532956 627211 60324 367121 12172 378352 510109 814787 318625 49322 341240 49658 440877 610164 67523 944504 971733 281147 762397 977271 893267 94627 487737 556260 96437 623362 23903 35102 46236 71331 650283 679868 551934 90925...\", \"output\": [\"22\"]}, {\"input\": \"200000 104309\\r\\n917682 406102 11717 111909 434645 580252 437109 119012 736961 932887 351686 690891 321121 650383 752869 393396 557121 858062 623458 18811 309718 391396 929969 565251 509492 510244 653866 649647 777109 537701 43466 779688 560473 298689 939632 190493 162496 157977 431584 618559 102066 406095 279939 380801 782775 704138 831909 564830 733120 207926 247862 379410 254172 546369 890634 893216 796163 136863 308313 90379 382543 749703 563583 487261 803710 725557 531709 291235 120114 200614 396150 397...\", \"output\": [\"74\"]}, {\"input\": \"200000 56656\\r\\n532133 182590 461815 368570 458304 753725 618737 740427 453767 895020 46736 124563 599213 994561 364056 85739 210792 896474 461203 538514 316789 683446 285263 10858 158737 591673 885915 124089 728065 467181 206670 16298 16971 740860 612992 601417 130171 27639 876751 60235 954911 189586 948700 928131 716171 33061 650635 357806 81302 600812 368519 583336 455067 754632 14075 555573 12089 499581 100890 575673 287956 682802 304664 246592 102865 919220 341230 955063 556382 556274 786010 919921 6525...\", \"output\": [\"314\"]}, {\"input\": \"200000 130949\\r\\n471341 941038 561268 842605 333481 675025 312718 128636 801428 474939 181978 498083 661683 219254 184492 166026 196172 976236 553565 150721 370091 101934 712779 68025 628190 341488 835799 684361 90170 788362 355365 421866 678227 611896 765151 179772 965895 824091 735731 128383 220661 753719 354832 39259 742590 549107 871405 859096 764939 915740 12291 998759 176198 761313 753294 837015 71263 442136 366415 194720 245192 534200 557325 256860 414586 114909 156495 714761 695790 310024 295779 3325...\", \"output\": [\"55\"]}, {\"input\": \"200000 187670\\r\\n604670 3155 244305 661903 901142 492002 134150 775755 764685 309148 25764 329077 508255 400885 313411 268846 110619 278231 326603 238534 328101 364254 659003 207365 940084 523546 365987 765030 148693 181200 477865 499670 724006 392570 624904 190393 604892 6018 874957 365734 346429 557451 703833 536742 824871 543400 456033 146169 880711 288995 36401 330000 306979 79288 271204 326036 610961 26903 526190 776862 510333 882917 206867 378813 199911 250875 317997 50163 122723 811558 150633 202616 3...\", \"output\": [\"5\"]}, {\"input\": \"200000 121532\\r\\n654085 355540 339702 768012 369802 131348 14055 254610 554890 195677 53135 811044 515630 118734 333640 275170 206372 806249 678579 76818 740763 562132 780466 812057 754506 155674 380717 329798 910569 755048 936206 751879 707125 244752 786116 792242 409457 255497 808324 264510 282720 144300 663875 302087 969100 863673 243389 211533 541506 858064 799794 673973 472148 843129 848355 549063 267285 575196 360537 48494 646176 353802 799583 869499 394834 382514 451587 352355 755659 994348 822041 703...\", \"output\": [\"39\"]}, {\"input\": \"200000 87352\\r\\n947626 741657 324422 77702 361553 760300 407773 142538 692077 829825 372131 445287 761917 266395 12738 919705 469176 78927 51224 51504 571972 453575 740920 301646 179776 205184 517801 313004 394107 658507 250085 624980 798202 146959 24988 595816 130294 802117 878255 199706 942171 480699 867637 144562 967883 134866 967033 161036 868121 502080 470329 838487 636175 584719 761513 951639 539432 502684 794990 258595 907670 907737 340644 410855 565117 843787 610905 718052 898678 575628 191951 64939 ...\", \"output\": [\"119\"]}, {\"input\": \"200000 126534\\r\\n423239 792793 757554 35179 394490 689665 758762 672842 379337 867512 806012 865031 763783 598540 839968 697533 951426 846773 275793 449533 807833 334833 441487 44183 845001 819501 762053 688541 513777 631454 176769 675823 746768 37888 946899 150228 755189 197758 897929 892065 966859 807058 940187 913234 922709 743555 305511 740216 655151 915732 717715 264829 611583 809236 713094 937094 710618 932706 664966 643644 982285 280009 948938 582779 442814 923068 600965 872967 926811 667453 22343 814...\", \"output\": [\"591533\"]}, {\"input\": \"200000 144961\\r\\n962670 939130 190710 918889 718688 87060 686334 714237 264244 871240 726153 805386 632835 346917 899460 899091 894185 800456 394200 876205 317636 190377 848893 200013 859520 952732 962845 735862 814216 324521 836952 325449 606844 889301 916823 821196 796999 776607 951236 239568 926437 803477 351947 860604 755872 834801 899921 796585 945308 669340 858196 938165 847275 937268 477093 613693 588776 797759 650791 127136 23878 747032 3560 751419 802748 718510 596579 618457 844477 560615 333205 974...\", \"output\": [\"600001\"]}, {\"input\": \"200000 46402\\r\\n782907 435902 102064 219454 981001 866532 856227 922917 39372 114992 971414 474317 660047 437953 477041 333655 404376 493355 519852 35753 439306 880292 321421 893028 288501 40076 418228 455770 85139 221135 600638 472194 245623 246285 385842 376914 174873 413114 541998 77638 245083 699246 756070 54123 467779 483479 72537 984796 499351 194017 972539 196414 971542 591273 135333 566557 91097 556500 810069 446559 417871 975010 91098 543070 523770 138773 416693 403016 809624 340423 206144 377199 35...\", \"output\": [\"490109\"]}, {\"input\": \"200000 69747\\r\\n577748 522433 805334 506228 55861 439137 48215 35329 370302 233351 150760 413524 219356 306403 753822 241233 656311 600195 154340 66810 244230 203598 533467 882747 225414 561580 118303 710948 112227 535120 177023 161671 79409 640268 67863 892884 780638 409273 91796 737928 90864 609259 517151 248688 424822 542483 662461 886845 466756 181083 293819 91884 68485 662744 995624 374377 788335 87997 386295 471227 128379 188273 915113 162330 201635 6339 446475 950821 47368 684966 595998 744178 382216 ...\", \"output\": [\"285550\"]}, {\"input\": \"200000 182994\\r\\n994723 971092 854201 843786 101297 872451 871139 539672 918071 909577 892942 632774 899189 877297 600476 767769 964655 882320 865400 912919 657893 746382 773388 762218 930342 905638 893779 808971 484296 605539 979438 868789 819509 696667 696062 443675 957886 868120 479235 640366 960185 672854 919142 894960 760890 630408 916153 926290 717892 913090 917749 890372 665639 852024 668448 814865 718734 927544 675683 930060 882009 873066 640163 676786 865389 732238 854785 969684 838471 931916 723691...\", \"output\": [\"121452\"]}, {\"input\": \"200000 73942\\r\\n408182 520671 703410 432120 653893 123317 588889 837132 191975 146052 454058 563209 819666 58397 723406 843764 812793 584716 439754 136518 22114 206789 117769 300466 414753 984747 720098 579619 208175 161842 278722 617409 908083 923447 181475 684486 747589 599275 249706 577343 238236 445352 363613 765524 372349 623194 485189 582913 867444 193197 778524 687587 760491 59858 815107 972579 894094 94541 681043 387828 7118 142138 805550 130188 751115 320191 680127 509222 43796 299823 860841 175932 ...\", \"output\": [\"600005\"]}, {\"input\": \"200000 71436\\r\\n153165 333066 238380 939782 32824 154202 288298 990497 538798 45413 790060 85057 101741 695812 268181 836293 786486 727099 400392 698181 314817 427822 312908 615578 524662 712176 89684 133351 90416 565521 85073 235782 612345 819333 727398 904068 963838 733833 995193 30263 423788 768871 537805 701212 755908 58903 860132 298931 401361 938873 79081 57225 732766 776731 671127 521304 732224 33283 237622 83125 917800 281726 246521 812827 145794 829110 697048 986702 725769 527670 820500 440917 17849...\", \"output\": [\"600007\"]}, {\"input\": \"200000 134260\\r\\n20197 858597 800419 731700 836834 841725 192633 954630 801035 937250 546348 862913 742716 646634 116906 856208 746016 359653 966793 857015 738306 104842 783438 778938 956868 796787 754357 668646 353114 783151 922073 947983 629789 809296 503807 598720 963854 257632 930276 736441 872532 288930 715966 243753 223313 387401 714353 161550 865383 594004 492551 654474 991492 692058 220652 887237 884105 929464 737347 287606 782610 898180 961479 653958 943983 987986 978585 695938 291140 688995 854102 ...\", \"output\": [\"600004\"]}, {\"input\": \"200000 59434\\r\\n752520 356143 257310 861786 193993 400455 365822 99796 324828 108883 525204 700047 405228 360574 901858 185216 308307 492683 862410 825408 158471 323964 25690 176657 138202 815143 978989 290386 181908 822750 524941 185395 25637 616678 108743 651284 737890 590472 217026 214484 335889 380288 228829 961956 228251 267900 362604 138571 29657 997084 926476 969132 421352 524312 598130 141972 787356 451873 118141 376779 206620 388290 380376 289199 624772 223212 740044 385606 518195 414821 572497 7798...\", \"output\": [\"600002\"]}, {\"input\": \"200000 81211\\r\\n947835 922165 662089 933134 8468 921502 348574 508917 954515 783383 951846 985227 800550 831225 860750 469357 532682 233139 812039 915369 180932 254606 511355 575501 207188 470313 668807 898789 584823 131015 536534 904517 679501 673383 344579 102123 828601 307543 475347 499744 607124 737490 655486 390026 799315 106616 638042 811739 218373 168637 791550 662331 318321 51216 758383 47533 817304 938926 54216 792643 950872 681777 673563 880722 48036 580649 481519 94667 965882 175853 780081 704756 ...\", \"output\": [\"600004\"]}, {\"input\": \"200000 138793\\r\\n577177 922066 315400 289916 806019 270338 651288 491472 882734 660752 933956 775057 63173 737684 530182 761436 761175 515329 166795 696219 913510 649197 720168 866790 639584 626074 996190 223583 929663 665882 527580 615708 983226 615290 641665 39687 658890 856089 499872 264855 634421 923217 269266 881252 778364 721600 835041 826406 735868 826746 932077 788686 463273 835316 637730 934723 832978 347003 111512 737240 891495 797766 627479 622617 849191 590854 859365 708040 817822 143103 773069 1...\", \"output\": [\"600007\"]}, {\"input\": \"200000 186549\\r\\n658088 854977 601285 879745 730637 603215 993329 616212 761595 726365 986286 927359 603983 742553 760803 613636 906823 714242 804486 903305 794440 708820 804728 767115 754175 938217 641305 742580 677375 616406 944302 844663 852810 840717 625447 744878 855308 888657 700877 968135 910358 739627 833560 690827 749683 793171 708389 319508 887368 666961 919137 930584 830714 806657 734956 745848 991596 942391 12711 731376 986132 716637 605884 917756 915803 917095 844070 710145 974821 615696 986688 ...\", \"output\": [\"600002\"]}, {\"input\": \"200000 50429\\r\\n190833 67335 181508 885501 359948 611322 352314 285894 555686 66931 464746 306103 541572 456775 461185 107473 849650 123771 159177 418441 288729 480555 35409 786425 988801 586696 6067 608201 428525 698806 519198 345792 148304 552566 843826 984772 39759 528889 117805 882471 300870 424110 197345 221887 56109 347980 61200 681111 432579 220319 838565 767676 684314 115244 311696 510958 193028 848840 659106 661882 331438 409926 697484 257727 33067 537285 673499 117195 31289 104732 268484 311866 250...\", \"output\": [\"599974\"]}, {\"input\": \"200000 26082\\r\\n30260 383974 344943 416798 542583 64907 298313 215511 56608 414071 447783 762796 478365 171730 107720 140356 582196 878285 599417 255920 98773 341082 188440 211294 356485 61357 48218 183236 649510 353837 170160 21444 53418 309484 591480 322452 16606 553946 934626 44572 101190 802429 206910 734503 366821 221661 43425 846276 591877 582261 585293 339077 354814 968897 392587 60212 528815 411337 389975 21043 72874 185094 521666 325611 982082 206521 533732 541617 341008 580224 897580 646744 166549 ...\", \"output\": [\"600014\"]}, {\"input\": \"200000 23076\\r\\n508356 503379 576712 446667 588148 97145 12125 924817 476776 68462 703485 430906 147993 486111 389890 441752 184163 347545 161594 136650 422025 801372 598562 536788 928153 243118 367357 516134 185886 296256 372279 142562 276503 417401 537636 561440 159707 340464 491623 3793 30863 254034 21011 449201 444809 508076 484542 599745 853775 36334 422655 658032 250827 522657 417691 477879 582779 930600 230978 172308 149193 83768 212299 290719 551495 525594 277704 347425 388383 81148 477981 28248 1678...\", \"output\": [\"512957\"]}, {\"input\": \"200000 117682\\r\\n412179 829719 973358 759836 629008 640819 298548 864350 670077 610366 638465 333507 275767 661853 428934 563598 915637 738552 188344 109447 61282 628171 1653 564432 991237 825398 496694 593262 316157 943838 232186 987169 803120 78039 475373 478497 914836 764701 756063 227473 550814 880883 793959 825644 688387 675560 215485 682554 912946 263451 218252 708718 442638 918193 898282 176122 965353 981274 740598 762840 945170 194607 882951 978383 86029 616029 208181 449908 877864 957472 768417 5574...\", \"output\": [\"600004\"]}, {\"input\": \"200000 132133\\r\\n173987 835741 983631 131772 741251 595390 711345 3740 880538 414238 787379 540397 498631 894962 436476 994047 940986 803545 844660 541734 475688 821077 926491 324840 661346 751871 989217 908314 879803 149534 198103 349491 958582 263969 22939 831743 446660 768192 962250 889167 975522 679103 796802 837764 739737 496586 670037 249303 628505 711861 101561 776006 697526 499692 348956 721133 618371 563228 348738 739350 683884 117413 784714 122272 543999 905405 172522 796624 153347 137200 256880 84...\", \"output\": [\"600005\"]}, {\"input\": \"200000 71341\\r\\n899110 258694 455446 68806 43475 619129 955936 155992 964011 365626 479300 148145 477517 709580 92159 570447 385264 529675 945008 446458 924946 207954 830463 734478 569609 259644 238996 815024 130191 107150 246369 954324 369060 423171 820466 91158 242115 160850 884844 307207 487721 816399 504998 539086 259922 145898 47142 340903 157414 70701 555991 603762 481426 628511 1896 803875 741596 341457 525971 666000 807283 160682 360934 842851 381286 940528 325701 516562 999847 287691 479319 873097 4...\", \"output\": [\"600010\"]}, {\"input\": \"200000 4670\\r\\n265134 556990 438012 33534 257904 238294 258309 339932 172637 543531 289680 376332 408976 428530 276428 121116 80452 76221 2594 76604 103030 261369 454870 436775 566457 94329 305948 145104 236838 437199 475908 263863 346650 561501 71603 197027 215797 214874 480207 504777 367912 565505 184243 264624 830109 10943 271708 787065 469388 177882 110198 427489 431092 168777 124567 112318 179301 21673 301187 292934 25605 584605 27797 52236 586993 414485 427094 484101 207336 247367 366067 535408 68581 5...\", \"output\": [\"589258\"]}, {\"input\": \"200000 54085\\r\\n452278 241173 650325 248275 2811 589668 789824 467926 534142 967045 869326 500354 103305 582509 960103 270014 793286 454636 668573 417797 885966 646670 932124 294634 405159 398135 565114 986543 410471 107774 461131 277652 619381 157620 491253 797367 971275 128097 361746 224434 866065 626699 221215 422196 102340 470254 303506 192278 280870 480765 635540 690059 837426 87215 620232 578637 490605 886408 284853 57634 99796 232098 433433 57788 635527 304517 563845 239544 237632 924358 307758 970864...\", \"output\": [\"450080\"]}, {\"input\": \"200000 147626\\r\\n911646 969651 650116 915560 768769 722349 76593 938309 601090 544516 998339 919278 527731 626259 960268 954199 832490 668969 208346 908804 670789 943265 982341 355175 641755 324185 934050 673192 789017 745184 869301 734564 615064 697675 50522 890759 641081 919881 643688 416521 905005 693579 779225 899221 652853 767411 978264 992138 273128 985746 908026 638785 861978 804034 633910 873097 960912 862966 990338 934089 318990 182807 770548 812815 783299 520019 402072 869929 882275 686096 808582 7...\", \"output\": [\"599590\"]}, {\"input\": \"200000 87860\\r\\n307636 791788 94134 803845 991606 834480 874171 333031 294556 118226 43891 804336 782822 855243 381139 902721 704287 697131 877904 430407 669720 301892 590109 296346 315631 502493 367352 881697 359035 55445 488278 570087 57341 981113 253999 477917 347632 51559 290575 322422 487032 622314 19305 910854 86595 63078 693956 441871 67911 253914 465179 782521 429562 826230 592836 39552 883251 149248 123532 195137 769492 290236 779875 26777 185022 580995 116450 611361 30819 16100 491803 128327 444662...\", \"output\": [\"600001\"]}, {\"input\": \"200000 79894\\r\\n642838 821977 383878 715589 202349 383178 461354 376174 756776 250750 813793 831502 268591 878248 179346 994851 599440 729789 890000 581701 452846 138588 15191 314745 392643 201459 944751 921247 416974 248784 996910 476486 9316 956948 241608 9280 396160 24852 168397 442530 613410 944794 584220 807278 499910 631952 30914 864959 398998 169382 188058 678026 265208 924223 524538 412871 644407 828315 423980 542891 273649 661102 768710 731070 923265 147426 43444 17046 544201 502808 691311 737135 84...\", \"output\": [\"600003\"]}, {\"input\": \"200000 199963\\r\\n932574 899853 965176 675922 965215 735983 990896 970922 964517 614719 958222 720223 890905 804826 642678 798872 902779 877971 931841 619671 862965 822153 908632 645524 729505 890114 697749 733471 808531 636875 734179 652088 814748 759713 708285 748672 680095 757778 890693 754425 630222 825543 799334 851889 975834 919607 948150 611328 847422 843103 892685 637076 948430 842795 627730 657098 986985 879857 857724 951278 910893 835661 620459 718662 632930 815807 790117 768350 856104 673211 847285...\", \"output\": [\"600002\"]}, {\"input\": \"200000 164907\\r\\n721979 801225 447788 916554 722214 710542 841795 863439 709668 618815 953358 651116 831142 637454 727119 678790 773655 981608 786852 917761 697610 861180 623803 299959 746755 944201 877401 781590 802936 875942 892965 487478 198619 653722 868210 833798 863785 944501 163128 998745 701039 974187 716116 734712 695699 926433 607967 928025 937864 772348 848033 4648 886012 990274 739299 912145 855704 720161 855196 668270 837527 642118 957420 683822 870041 837009 716459 319143 801537 909286 929279 9...\", \"output\": [\"220323\"]}, {\"input\": \"200000 156992\\r\\n902159 393809 523142 828944 910538 670821 778213 600806 732853 646810 957557 89812 753852 871589 989010 184834 901856 847849 75222 982514 941694 856411 991825 794225 724516 731072 969214 753304 642190 700113 322720 466774 638870 646996 736731 792045 686758 906283 911841 986189 780336 919621 669000 950207 766104 670213 644829 829430 489841 785822 911398 566907 852140 810788 32409 286835 891243 263833 835154 277128 373761 809052 796696 889079 930643 658284 880791 773067 816191 877857 687132 86...\", \"output\": [\"599997\"]}, {\"input\": \"200000 73848\\r\\n179828 766170 38444 251060 495258 376039 462901 536323 648205 73986 978461 732364 682910 13857 783914 119907 472393 538303 158316 816459 959561 476216 348561 127926 868326 134362 421745 700901 109615 278269 259832 368443 561839 52040 669518 410283 64688 232374 352163 850114 960772 438072 68514 935028 583328 602551 287634 81713 833180 248025 561723 114796 951652 731038 339342 919203 131723 131911 734920 395185 194845 929087 600228 251708 101611 251647 325768 909005 612945 895985 549328 924462 ...\", \"output\": [\"600002\"]}, {\"input\": \"200000 32002\\r\\n599492 990536 207170 315097 378604 166912 453662 153328 590241 74209 589558 481579 373420 633900 213196 855188 295936 368162 713880 96016 79162 96061 169673 35102 484700 25191 491572 804447 961007 446169 134100 116404 513720 77288 940678 440423 413245 327395 202821 287812 119486 85101 284792 48298 9794 177183 742596 41828 636586 387895 248187 207083 510365 159046 754328 422164 313542 517192 349966 594782 163150 736818 513876 699970 969941 205026 231835 129015 7866 932543 116290 195704 45249 3...\", \"output\": [\"600011\"]}, {\"input\": \"200000 189070\\r\\n695085 830686 770591 751242 881000 976100 852026 843387 750474 758479 910733 705074 737497 912282 733235 872040 692744 842947 879634 978435 690873 924284 801492 888459 995306 936977 686218 858884 647197 795723 718378 643577 915879 14256 110200 767892 747944 662851 915618 674793 670712 891426 986957 636276 943336 809864 969225 602490 710279 871196 636848 977690 778861 422287 702159 696928 708406 880379 702708 912324 776560 703059 923503 603328 828668 631619 826457 956505 910635 230852 733427 ...\", \"output\": [\"600002\"]}, {\"input\": \"200000 150409\\r\\n810973 667204 941114 767816 945021 862390 91184 845225 620474 752092 781869 942420 688465 774423 876258 913218 784678 760040 614035 731479 298105 168595 479598 718104 923247 656638 909056 862621 609836 908290 697157 490267 708023 891034 336039 970075 845719 682945 748628 966138 71558 861337 946322 987955 985126 752867 774231 427279 994348 686493 456743 896930 710846 706658 844363 609641 108829 877460 452578 762681 938897 727953 834353 522106 181657 703674 270174 920847 653487 971882 396748 7...\", \"output\": [\"600001\"]}, {\"input\": \"200000 9608\\r\\n226617 481349 287276 88643 969650 135579 183843 493484 336647 218436 527505 131731 514347 2319 801910 247870 538384 415683 362466 49383 98254 524660 251024 30080 354313 510342 518441 978486 748268 174220 292540 493958 521640 696621 442222 206388 137834 322290 299305 552408 175556 13490 13655 38963 481433 282768 581768 353475 57247 117346 542698 73721 178095 166060 177934 572450 368960 387643 106281 212001 131345 57125 378214 569470 65980 385231 145529 892089 819852 63890 461491 33661 130607 55...\", \"output\": [\"526905\"]}, {\"input\": \"200000 127930\\r\\n895944 934205 238521 810240 875129 967169 730163 107386 484627 826132 712351 772236 939252 596 798789 256645 814754 603177 606129 75262 910740 31820 813006 927211 828106 970960 932055 543364 266677 650043 605828 679797 106432 643620 875831 947417 642675 832196 601108 717193 128604 842942 637835 721503 572335 805270 98446 600232 919853 502071 696563 835408 424533 717674 301921 7293 716702 943338 878050 992931 476287 729074 765471 625163 888861 758567 515497 743417 320941 691751 446357 487537 ...\", \"output\": [\"493790\"]}, {\"input\": \"200000 50570\\r\\n826971 49175 933482 482321 705136 485487 358996 28501 302483 398502 98261 105054 825661 70829 295514 936527 244456 793265 306420 93500 965893 315718 439883 291008 73358 219343 95891 116393 479032 565281 439380 968574 671526 387184 537510 799022 443038 853752 15659 592212 614835 148875 909645 189428 519973 283686 84431 196990 232832 20073 70101 49298 380378 593437 966114 35435 73444 454865 686120 761808 357207 118347 152984 298322 90388 513833 549443 360669 585765 193147 168743 397309 586227 5...\", \"output\": [\"355198\"]}]"} {"prob_desc_description":"The numbers of all offices in the new building of the Tax Office of IT City will have lucky numbers.Lucky number is a number that consists of digits 7 and 8 only. Find the maximum number of offices in the new building of the Tax Office given that a door-plate can hold a number not longer than n digits.","prob_desc_output_spec":"Output one integer \u2014 the maximum number of offices, than can have unique lucky numbers not longer than n digits.","lang_cluster":"","src_uid":"f1b43baa14d4c262ba616d892525dfde","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"64 megabytes","file_name":"prog_syn_val.jsonl","tags":["combinatorics","math"],"prob_desc_created_at":"1455807600","prob_desc_sample_inputs":"[\"2\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":1100.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"0.5 seconds","prob_desc_input_spec":"The only line of input contains one integer n (1\u2009\u2264\u2009n\u2009\u2264\u200955) \u2014 the maximum length of a number that a door-plate can hold.","prob_desc_sample_outputs":"[\"6\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"3\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"5\\r\\n\", \"output\": [\"62\"]}, {\"input\": \"12\\r\\n\", \"output\": [\"8190\"]}, {\"input\": \"34\\r\\n\", \"output\": [\"34359738366\"]}, {\"input\": \"43\\r\\n\", \"output\": [\"17592186044414\"]}, {\"input\": \"49\\r\\n\", \"output\": [\"1125899906842622\"]}, {\"input\": \"54\\r\\n\", \"output\": [\"36028797018963966\"]}, {\"input\": \"55\\r\\n\", \"output\": [\"72057594037927934\"]}]"} {"prob_desc_description":"Vasya started working in a machine vision company of IT City. Vasya's team creates software and hardware for identification of people by their face.One of the project's know-how is a camera rotating around its optical axis on shooting. People see an eye-catching gadget \u2014 a rotating camera \u2014 come up to it to see it better, look into it. And the camera takes their photo at that time. What could be better for high quality identification?But not everything is so simple. The pictures from camera appear rotated too (on clockwise camera rotation frame the content becomes rotated counter-clockwise). But the identification algorithm can work only with faces that are just slightly deviated from vertical.Vasya was entrusted to correct the situation \u2014 to rotate a captured image so that image would be minimally deviated from vertical. Requirements were severe. Firstly, the picture should be rotated only on angle divisible by 90 degrees to not lose a bit of information about the image. Secondly, the frames from the camera are so huge and FPS is so big that adequate rotation speed is provided by hardware FPGA solution only. And this solution can rotate only by 90 degrees clockwise. Of course, one can apply 90 degrees turn several times but for the sake of performance the number of turns should be minimized.Help Vasya implement the program that by the given rotation angle of the camera can determine the minimum number of 90 degrees clockwise turns necessary to get a picture in which up direction deviation from vertical is minimum.The next figure contains frames taken from an unrotated camera, then from rotated 90 degrees clockwise, then from rotated 90 degrees counter-clockwise. Arrows show direction to \"true up\". The next figure shows 90 degrees clockwise turn by FPGA hardware. ","prob_desc_output_spec":"Output one integer \u2014 the minimum required number of 90 degrees clockwise turns.","lang_cluster":"","src_uid":"509db9cb6156b692557ba874a09f150e","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"64 megabytes","file_name":"prog_syn_val.jsonl","tags":["geometry","math"],"prob_desc_created_at":"1455807600","prob_desc_sample_inputs":"[\"60\", \"-60\"]","prob_desc_notes":"NoteWhen the camera is rotated 60 degrees counter-clockwise (the second example), an image from it is rotated 60 degrees clockwise. One 90 degrees clockwise turn of the image result in 150 degrees clockwise total rotation and deviation from \"true up\" for one turn is 150 degrees. Two 90 degrees clockwise turns of the image result in 240 degrees clockwise total rotation and deviation from \"true up\" for two turns is 120 degrees because 240 degrees clockwise equal to 120 degrees counter-clockwise. Three 90 degrees clockwise turns of the image result in 330 degrees clockwise total rotation and deviation from \"true up\" for three turns is 30 degrees because 330 degrees clockwise equal to 30 degrees counter-clockwise.From 60, 150, 120 and 30 degrees deviations the smallest is 30, and it it achieved in three 90 degrees clockwise turns.","exec_outcome":"","difficulty":1800.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"0.5 seconds","prob_desc_input_spec":"The only line of the input contains one integer x (\u2009-\u20091018\u2009\u2264\u2009x\u2009\u2264\u20091018) \u2014 camera angle in degrees. Positive value denotes clockwise camera rotation, negative \u2014 counter-clockwise.","prob_desc_sample_outputs":"[\"1\", \"3\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"60\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"-60\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"44\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"45\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"46\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"134\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"135\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"136\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"224\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"225\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"226\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"227\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"313\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"314\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"315\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"316\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"358\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"359\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"360\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"361\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"999999999999999340\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"999999999999999325\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"999999999999999326\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"999999999999999415\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"999999999999999416\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"999999999999999504\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"999999999999999505\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"999999999999999506\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"999999999999999594\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"999999999999999595\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"999999999999999596\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"999999999999999639\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"999999999999999640\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"6678504591813508\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"201035370138545377\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"441505850043460771\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"252890591709237675\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"272028913373922389\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"141460527912396122\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"479865961765156498\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"-44\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"-45\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"-46\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"-134\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"-135\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"-136\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"-224\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"-225\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"-226\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"-227\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"-313\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"-314\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"-315\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"-316\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"-358\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"-359\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"-360\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"-361\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"-999999999999999340\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"-999999999999999325\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"-999999999999999326\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"-999999999999999415\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"-999999999999999416\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"-999999999999999504\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"-999999999999999505\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"-999999999999999506\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"-999999999999999594\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"-999999999999999595\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"-999999999999999596\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"-999999999999999639\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"-999999999999999640\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"-6678504591813508\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"-201035370138545377\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"-441505850043460771\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"-252890591709237675\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"-272028913373922389\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"-141460527912396122\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"-479865961765156498\\r\\n\", \"output\": [\"2\"]}]"} {"prob_desc_description":"There are n people, sitting in a line at the table. For each person we know that he always tells either the truth or lies.Little Serge asked them: how many of you always tell the truth? Each of the people at the table knows everything (who is an honest person and who is a liar) about all the people at the table. The honest people are going to say the correct answer, the liars are going to say any integer from 1 to n, which is not the correct answer. Every liar chooses his answer, regardless of the other liars, so two distinct liars may give distinct answer.Serge does not know any information about the people besides their answers to his question. He took a piece of paper and wrote n integers a1,\u2009a2,\u2009...,\u2009an, where ai is the answer of the i-th person in the row. Given this sequence, Serge determined that exactly k people sitting at the table apparently lie.Serge wonders, how many variants of people's answers (sequences of answers a of length n) there are where one can say that exactly k people sitting at the table apparently lie. As there can be rather many described variants of answers, count the remainder of dividing the number of the variants by 777777777.","prob_desc_output_spec":"Print a single integer \u2014 the answer to the problem modulo 777777777.","lang_cluster":"","src_uid":"cfe19131644e5925e32084a581e23286","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["dp"],"prob_desc_created_at":"1355671800","prob_desc_sample_inputs":"[\"1 1\", \"2 1\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":2700.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line contains two integers n, k, (1\u2009\u2264\u2009k\u2009\u2264\u2009n\u2009\u2264\u200928). It is guaranteed that n \u2014 is the power of number 2.","prob_desc_sample_outputs":"[\"0\", \"2\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"1 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"2 2\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"4 1\\r\\n\", \"output\": [\"32\"]}, {\"input\": \"4 2\\r\\n\", \"output\": [\"30\"]}, {\"input\": \"4 3\\r\\n\", \"output\": [\"80\"]}, {\"input\": \"4 4\\r\\n\", \"output\": [\"109\"]}, {\"input\": \"256 1\\r\\n\", \"output\": [\"412133651\"]}, {\"input\": \"128 39\\r\\n\", \"output\": [\"93337440\"]}, {\"input\": \"8 5\\r\\n\", \"output\": [\"1757896\"]}, {\"input\": \"1 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"32 26\\r\\n\", \"output\": [\"44684703\"]}, {\"input\": \"16 15\\r\\n\", \"output\": [\"569389279\"]}, {\"input\": \"64 29\\r\\n\", \"output\": [\"582889860\"]}, {\"input\": \"256 184\\r\\n\", \"output\": [\"337388940\"]}, {\"input\": \"4 3\\r\\n\", \"output\": [\"80\"]}, {\"input\": \"4 3\\r\\n\", \"output\": [\"80\"]}, {\"input\": \"64 9\\r\\n\", \"output\": [\"459185405\"]}, {\"input\": \"256 188\\r\\n\", \"output\": [\"106017282\"]}, {\"input\": \"128 39\\r\\n\", \"output\": [\"93337440\"]}, {\"input\": \"4 4\\r\\n\", \"output\": [\"109\"]}, {\"input\": \"4 2\\r\\n\", \"output\": [\"30\"]}, {\"input\": \"64 57\\r\\n\", \"output\": [\"67309914\"]}, {\"input\": \"8 8\\r\\n\", \"output\": [\"7593125\"]}, {\"input\": \"4 1\\r\\n\", \"output\": [\"32\"]}, {\"input\": \"32 29\\r\\n\", \"output\": [\"612549793\"]}, {\"input\": \"2 2\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"8 4\\r\\n\", \"output\": [\"415870\"]}, {\"input\": \"4 2\\r\\n\", \"output\": [\"30\"]}, {\"input\": \"128 11\\r\\n\", \"output\": [\"175889805\"]}, {\"input\": \"16 12\\r\\n\", \"output\": [\"515619293\"]}, {\"input\": \"32 19\\r\\n\", \"output\": [\"628771752\"]}, {\"input\": \"1 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"16 15\\r\\n\", \"output\": [\"569389279\"]}, {\"input\": \"16 9\\r\\n\", \"output\": [\"472062098\"]}, {\"input\": \"32 30\\r\\n\", \"output\": [\"519860281\"]}, {\"input\": \"32 10\\r\\n\", \"output\": [\"360252438\"]}, {\"input\": \"128 119\\r\\n\", \"output\": [\"530767740\"]}, {\"input\": \"8 6\\r\\n\", \"output\": [\"1897056\"]}, {\"input\": \"8 5\\r\\n\", \"output\": [\"1757896\"]}, {\"input\": \"1 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"128 81\\r\\n\", \"output\": [\"710035809\"]}, {\"input\": \"256 197\\r\\n\", \"output\": [\"494437752\"]}, {\"input\": \"64 56\\r\\n\", \"output\": [\"291740751\"]}, {\"input\": \"4 4\\r\\n\", \"output\": [\"109\"]}, {\"input\": \"4 3\\r\\n\", \"output\": [\"80\"]}, {\"input\": \"256 35\\r\\n\", \"output\": [\"191720088\"]}, {\"input\": \"64 30\\r\\n\", \"output\": [\"129676638\"]}, {\"input\": \"1 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"16 11\\r\\n\", \"output\": [\"117354594\"]}, {\"input\": \"64 11\\r\\n\", \"output\": [\"554790222\"]}, {\"input\": \"1 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"4 3\\r\\n\", \"output\": [\"80\"]}, {\"input\": \"256 74\\r\\n\", \"output\": [\"747135963\"]}, {\"input\": \"32 1\\r\\n\", \"output\": [\"261086313\"]}, {\"input\": \"64 6\\r\\n\", \"output\": [\"509425833\"]}, {\"input\": \"4 2\\r\\n\", \"output\": [\"30\"]}, {\"input\": \"8 1\\r\\n\", \"output\": [\"6824\"]}, {\"input\": \"2 1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"256 205\\r\\n\", \"output\": [\"353120823\"]}, {\"input\": \"256 192\\r\\n\", \"output\": [\"612152037\"]}, {\"input\": \"8 7\\r\\n\", \"output\": [\"4898872\"]}, {\"input\": \"256 21\\r\\n\", \"output\": [\"706116537\"]}, {\"input\": \"256 127\\r\\n\", \"output\": [\"708023862\"]}, {\"input\": \"8 5\\r\\n\", \"output\": [\"1757896\"]}, {\"input\": \"128 103\\r\\n\", \"output\": [\"254706039\"]}, {\"input\": \"8 8\\r\\n\", \"output\": [\"7593125\"]}, {\"input\": \"128 74\\r\\n\", \"output\": [\"27702486\"]}, {\"input\": \"16 16\\r\\n\", \"output\": [\"391464593\"]}, {\"input\": \"64 16\\r\\n\", \"output\": [\"383350905\"]}, {\"input\": \"32 14\\r\\n\", \"output\": [\"342079395\"]}, {\"input\": \"128 31\\r\\n\", \"output\": [\"739707108\"]}, {\"input\": \"4 1\\r\\n\", \"output\": [\"32\"]}, {\"input\": \"32 19\\r\\n\", \"output\": [\"628771752\"]}, {\"input\": \"4 3\\r\\n\", \"output\": [\"80\"]}, {\"input\": \"64 49\\r\\n\", \"output\": [\"156006018\"]}, {\"input\": \"1 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"64 56\\r\\n\", \"output\": [\"291740751\"]}, {\"input\": \"16 8\\r\\n\", \"output\": [\"428982705\"]}, {\"input\": \"8 2\\r\\n\", \"output\": [\"59808\"]}, {\"input\": \"4 4\\r\\n\", \"output\": [\"109\"]}, {\"input\": \"2 2\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"4 3\\r\\n\", \"output\": [\"80\"]}, {\"input\": \"16 5\\r\\n\", \"output\": [\"33900006\"]}, {\"input\": \"32 13\\r\\n\", \"output\": [\"647490480\"]}, {\"input\": \"64 22\\r\\n\", \"output\": [\"374020479\"]}, {\"input\": \"64 32\\r\\n\", \"output\": [\"135769095\"]}, {\"input\": \"8 5\\r\\n\", \"output\": [\"1757896\"]}, {\"input\": \"2 1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"256 208\\r\\n\", \"output\": [\"580966092\"]}, {\"input\": \"8 3\\r\\n\", \"output\": [\"147224\"]}, {\"input\": \"64 13\\r\\n\", \"output\": [\"703150560\"]}, {\"input\": \"2 2\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"4 2\\r\\n\", \"output\": [\"30\"]}, {\"input\": \"64 20\\r\\n\", \"output\": [\"104256117\"]}, {\"input\": \"32 22\\r\\n\", \"output\": [\"20119449\"]}, {\"input\": \"256 128\\r\\n\", \"output\": [\"569195676\"]}, {\"input\": \"256 256\\r\\n\", \"output\": [\"51933421\"]}]"} {"prob_desc_description":"There have recently been elections in the zoo. Overall there were 7 main political parties: one of them is the Little Elephant Political Party, 6 other parties have less catchy names.Political parties find their number in the ballot highly important. Overall there are m possible numbers: 1,\u20092,\u2009...,\u2009m. Each of these 7 parties is going to be assigned in some way to exactly one number, at that, two distinct parties cannot receive the same number.The Little Elephant Political Party members believe in the lucky digits 4 and 7. They want to evaluate their chances in the elections. For that, they need to find out, how many correct assignments are there, such that the number of lucky digits in the Little Elephant Political Party ballot number is strictly larger than the total number of lucky digits in the ballot numbers of 6 other parties. Help the Little Elephant Political Party, calculate this number. As the answer can be rather large, print the remainder from dividing it by 1000000007 (109\u2009+\u20097).","prob_desc_output_spec":"In a single line print a single integer \u2014 the answer to the problem modulo 1000000007 (109\u2009+\u20097).","lang_cluster":"","src_uid":"656ed7b1b80de84d65a253e5d14d62a9","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force","math","combinatorics","dp"],"prob_desc_created_at":"1356190200","prob_desc_sample_inputs":"[\"7\", \"8\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":1900.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"A single line contains a single positive integer m (7\u2009\u2264\u2009m\u2009\u2264\u2009109) \u2014 the number of possible numbers in the ballot.","prob_desc_sample_outputs":"[\"0\", \"1440\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"7\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"8\\r\\n\", \"output\": [\"1440\"]}, {\"input\": \"47\\r\\n\", \"output\": [\"907362803\"]}, {\"input\": \"10\\r\\n\", \"output\": [\"40320\"]}, {\"input\": \"9\\r\\n\", \"output\": [\"10080\"]}, {\"input\": \"11\\r\\n\", \"output\": [\"120960\"]}, {\"input\": \"25\\r\\n\", \"output\": [\"139536000\"]}, {\"input\": \"74\\r\\n\", \"output\": [\"257814864\"]}, {\"input\": \"128\\r\\n\", \"output\": [\"879893164\"]}, {\"input\": \"1000000000\\r\\n\", \"output\": [\"14594961\"]}, {\"input\": \"458754\\r\\n\", \"output\": [\"667496909\"]}, {\"input\": \"987549745\\r\\n\", \"output\": [\"206294274\"]}, {\"input\": \"15478459\\r\\n\", \"output\": [\"638813679\"]}, {\"input\": \"674810014\\r\\n\", \"output\": [\"550536983\"]}, {\"input\": \"245\\r\\n\", \"output\": [\"528398086\"]}, {\"input\": \"1000\\r\\n\", \"output\": [\"193577116\"]}, {\"input\": \"10000\\r\\n\", \"output\": [\"726889821\"]}, {\"input\": \"100000\\r\\n\", \"output\": [\"459307763\"]}, {\"input\": \"1000000\\r\\n\", \"output\": [\"638519268\"]}, {\"input\": \"100000000\\r\\n\", \"output\": [\"133127802\"]}, {\"input\": \"10000000\\r\\n\", \"output\": [\"994715261\"]}, {\"input\": \"54785\\r\\n\", \"output\": [\"118850209\"]}, {\"input\": \"68745844\\r\\n\", \"output\": [\"739902866\"]}, {\"input\": \"545794012\\r\\n\", \"output\": [\"829479797\"]}, {\"input\": \"301542785\\r\\n\", \"output\": [\"763583849\"]}, {\"input\": \"794512405\\r\\n\", \"output\": [\"90508418\"]}, {\"input\": \"30\\r\\n\", \"output\": [\"581454720\"]}, {\"input\": \"40\\r\\n\", \"output\": [\"771100852\"]}, {\"input\": \"44\\r\\n\", \"output\": [\"359621144\"]}, {\"input\": \"42\\r\\n\", \"output\": [\"831345485\"]}]"} {"prob_desc_description":"Dima and Anya love playing different games. Now Dima has imagined a new game that he wants to play with Anya.Dima writes n pairs of integers on a piece of paper (li,\u2009ri) (1\u2009\u2264\u2009li\u2009<\u2009ri\u2009\u2264\u2009p). Then players take turns. On his turn the player can do the following actions: choose the number of the pair i (1\u2009\u2264\u2009i\u2009\u2264\u2009n), such that ri\u2009-\u2009li\u2009>\u20092; replace pair number i by pair or by pair . Notation \u230ax\u230b means rounding down to the closest integer. The player who can't make a move loses.Of course, Dima wants Anya, who will move first, to win. That's why Dima should write out such n pairs of integers (li,\u2009ri) (1\u2009\u2264\u2009li\u2009<\u2009ri\u2009\u2264\u2009p), that if both players play optimally well, the first one wins. Count the number of ways in which Dima can do it. Print the remainder after dividing the answer by number 1000000007\u00a0(109\u2009+\u20097).Two ways are considered distinct, if the ordered sequences of the written pairs are distinct.","prob_desc_output_spec":"In a single line print the remainder after dividing the answer to the problem by number 1000000007\u00a0(109\u2009+\u20097).","lang_cluster":"","src_uid":"c03b6379e9d186874ac3d97c6968fbd0","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["games","dp"],"prob_desc_created_at":"1360769400","prob_desc_sample_inputs":"[\"2 2\", \"4 4\", \"100 1000\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":2600.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line contains two integers n, p (1\u2009\u2264\u2009n\u2009\u2264\u20091000,\u20091\u2009\u2264\u2009p\u2009\u2264\u2009109). The numbers are separated by a single space.","prob_desc_sample_outputs":"[\"0\", \"520\", \"269568947\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2 2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"4 4\\r\\n\", \"output\": [\"520\"]}, {\"input\": \"100 1000\\r\\n\", \"output\": [\"269568947\"]}, {\"input\": \"2 8\\r\\n\", \"output\": [\"490\"]}, {\"input\": \"5 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"10 5\\r\\n\", \"output\": [\"216185807\"]}, {\"input\": \"9 9\\r\\n\", \"output\": [\"719488449\"]}, {\"input\": \"3 5\\r\\n\", \"output\": [\"552\"]}, {\"input\": \"6 6\\r\\n\", \"output\": [\"8070484\"]}, {\"input\": \"2 8\\r\\n\", \"output\": [\"490\"]}, {\"input\": \"962 1470546\\r\\n\", \"output\": [\"328714137\"]}, {\"input\": \"943 26239573\\r\\n\", \"output\": [\"974583365\"]}, {\"input\": \"392 56984809\\r\\n\", \"output\": [\"712359417\"]}, {\"input\": \"154 3615545\\r\\n\", \"output\": [\"367576652\"]}, {\"input\": \"422 69042089\\r\\n\", \"output\": [\"667402747\"]}, {\"input\": \"896 18341523\\r\\n\", \"output\": [\"678908486\"]}, {\"input\": \"772 21564523\\r\\n\", \"output\": [\"306664512\"]}, {\"input\": \"913 75016434\\r\\n\", \"output\": [\"921346799\"]}, {\"input\": \"36 83987483\\r\\n\", \"output\": [\"926044206\"]}, {\"input\": \"812 50090227\\r\\n\", \"output\": [\"608714476\"]}, {\"input\": \"674 70617625\\r\\n\", \"output\": [\"460280412\"]}, {\"input\": \"712 94041605\\r\\n\", \"output\": [\"213840765\"]}, {\"input\": \"548 2908329\\r\\n\", \"output\": [\"19475477\"]}, {\"input\": \"758 57655784\\r\\n\", \"output\": [\"280962474\"]}, {\"input\": \"724 68159990\\r\\n\", \"output\": [\"103564821\"]}, {\"input\": \"779 37379061\\r\\n\", \"output\": [\"703004414\"]}, {\"input\": \"191 530497\\r\\n\", \"output\": [\"271739403\"]}, {\"input\": \"107 80835681\\r\\n\", \"output\": [\"410989771\"]}, {\"input\": \"265 21597009\\r\\n\", \"output\": [\"298439147\"]}, {\"input\": \"806 6923811\\r\\n\", \"output\": [\"497709154\"]}, {\"input\": \"371 30342101\\r\\n\", \"output\": [\"967521198\"]}, {\"input\": \"102 86546365\\r\\n\", \"output\": [\"329533568\"]}, {\"input\": \"630 4012333\\r\\n\", \"output\": [\"792227055\"]}, {\"input\": \"955 22071041\\r\\n\", \"output\": [\"939711836\"]}, {\"input\": \"967 2755057\\r\\n\", \"output\": [\"286009469\"]}, {\"input\": \"309 49646417\\r\\n\", \"output\": [\"862961049\"]}, {\"input\": \"627 62695452\\r\\n\", \"output\": [\"936496657\"]}, {\"input\": \"539 33557677\\r\\n\", \"output\": [\"932232256\"]}, {\"input\": \"930 79942654\\r\\n\", \"output\": [\"863722490\"]}, {\"input\": \"1000 100000000\\r\\n\", \"output\": [\"92326252\"]}, {\"input\": \"1000 200000000\\r\\n\", \"output\": [\"503494344\"]}, {\"input\": \"1000 199999999\\r\\n\", \"output\": [\"690144838\"]}, {\"input\": \"997 150000000\\r\\n\", \"output\": [\"200022425\"]}, {\"input\": \"750 199999900\\r\\n\", \"output\": [\"888244974\"]}, {\"input\": \"1000 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1000 1000000000\\r\\n\", \"output\": [\"317623986\"]}, {\"input\": \"750 1000000000\\r\\n\", \"output\": [\"324554228\"]}, {\"input\": \"4 1000000000\\r\\n\", \"output\": [\"433920973\"]}, {\"input\": \"1 1000000000\\r\\n\", \"output\": [\"327451602\"]}, {\"input\": \"1000 999999000\\r\\n\", \"output\": [\"474176509\"]}]"} {"prob_desc_description":"Vova, the Ultimate Thule new shaman, wants to build a pipeline. As there are exactly n houses in Ultimate Thule, Vova wants the city to have exactly n pipes, each such pipe should be connected to the water supply. A pipe can be connected to the water supply if there's water flowing out of it. Initially Vova has only one pipe with flowing water. Besides, Vova has several splitters.A splitter is a construction that consists of one input (it can be connected to a water pipe) and x output pipes. When a splitter is connected to a water pipe, water flows from each output pipe. You can assume that the output pipes are ordinary pipes. For example, you can connect water supply to such pipe if there's water flowing out from it. At most one splitter can be connected to any water pipe. The figure shows a 4-output splitter Vova has one splitter of each kind: with 2, 3, 4, ..., k outputs. Help Vova use the minimum number of splitters to build the required pipeline or otherwise state that it's impossible.Vova needs the pipeline to have exactly n pipes with flowing out water. Note that some of those pipes can be the output pipes of the splitters.","prob_desc_output_spec":"Print a single integer \u2014 the minimum number of splitters needed to build the pipeline. If it is impossible to build a pipeline with the given splitters, print -1.","lang_cluster":"","src_uid":"83bcfe32db302fbae18e8a95d89cf411","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","binary search"],"prob_desc_created_at":"1364025600","prob_desc_sample_inputs":"[\"4 3\", \"5 5\", \"8 4\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":1700.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"0.4 seconds","prob_desc_input_spec":"The first line contains two space-separated integers n and k (1\u2009\u2264\u2009n\u2009\u2264\u20091018, 2\u2009\u2264\u2009k\u2009\u2264\u2009109). Please, do not use the %lld specifier to read or write 64-bit integers in \u0421++. It is preferred to use the cin, cout streams or the %I64d specifier.","prob_desc_sample_outputs":"[\"2\", \"1\", \"-1\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"4 3\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"5 5\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"8 4\\r\\n\", \"output\": [\"-1\"]}, {\"input\": \"1000000000000000000 1000000000\\r\\n\", \"output\": [\"-1\"]}, {\"input\": \"499999998500000001 1000000000\\r\\n\", \"output\": [\"999955279\"]}, {\"input\": \"499999998500000000 1000000000\\r\\n\", \"output\": [\"999955279\"]}, {\"input\": \"499999999500000000 1000000000\\r\\n\", \"output\": [\"999999998\"]}, {\"input\": \"499999999500000001 1000000000\\r\\n\", \"output\": [\"999999999\"]}, {\"input\": \"525 34\\r\\n\", \"output\": [\"25\"]}, {\"input\": \"223265034477 726990\\r\\n\", \"output\": [\"440662\"]}, {\"input\": \"15597035789572051 185473109\\r\\n\", \"output\": [\"128849771\"]}, {\"input\": \"499999999500000002 1000000000\\r\\n\", \"output\": [\"-1\"]}, {\"input\": \"1 1000000000\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1000000000 2\\r\\n\", \"output\": [\"-1\"]}, {\"input\": \"462498979 204468265\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"2107921 542531\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"131 49\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"20171878992939541 200857557\\r\\n\", \"output\": [\"200853401\"]}, {\"input\": \"399812655947 894219\\r\\n\", \"output\": [\"893030\"]}, {\"input\": \"93 17\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"1000000000 999999999\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"100000000000000000 1000000000\\r\\n\", \"output\": [\"105572810\"]}]"} {"prob_desc_description":"Special Agent Smart Beaver works in a secret research department of ABBYY. He's been working there for a long time and is satisfied with his job, as it allows him to eat out in the best restaurants and order the most expensive and exotic wood types there. The content special agent has got an important task: to get the latest research by British scientists on the English Language. These developments are encoded and stored in a large safe. The Beaver's teeth are strong enough, so the authorities assured that upon arriving at the place the beaver won't have any problems with opening the safe.And he finishes his aspen sprig and leaves for this important task. Of course, the Beaver arrived at the location without any problems, but alas. He can't open the safe with his strong and big teeth. At this point, the Smart Beaver get a call from the headquarters and learns that opening the safe with the teeth is not necessary, as a reliable source has sent the following information: the safe code consists of digits and has no leading zeroes. There also is a special hint, which can be used to open the safe. The hint is string s with the following structure: if si = \"?\", then the digit that goes i-th in the safe code can be anything (between 0 to 9, inclusively); if si is a digit (between 0 to 9, inclusively), then it means that there is digit si on position i in code; if the string contains letters from \"A\" to \"J\", then all positions with the same letters must contain the same digits and the positions with distinct letters must contain distinct digits. The length of the safe code coincides with the length of the hint. For example, hint \"?JGJ9\" has such matching safe code variants: \"51919\", \"55959\", \"12329\", \"93539\" and so on, and has wrong variants such as: \"56669\", \"00111\", \"03539\" and \"13666\".After receiving such information, the authorities change the plan and ask the special agents to work quietly and gently and not to try to open the safe by mechanical means, and try to find the password using the given hint.At a special agent school the Smart Beaver was the fastest in his platoon finding codes for such safes, but now he is not in that shape: the years take their toll ... Help him to determine the number of possible variants of the code to the safe, matching the given hint. After receiving this information, and knowing his own speed of entering codes, the Smart Beaver will be able to determine whether he will have time for tonight's show \"Beavers are on the trail\" on his favorite TV channel, or he should work for a sleepless night...","prob_desc_output_spec":"Print the number of codes that match the given hint.","lang_cluster":"","src_uid":"d3c10d1b1a17ad018359e2dab80d2b82","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["greedy"],"prob_desc_created_at":"1371042000","prob_desc_sample_inputs":"[\"AJ\", \"1?AA\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":1100.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line contains string s \u2014 the hint to the safe code. String s consists of the following characters: ?, 0-9, A-J. It is guaranteed that the first character of string s doesn't equal to character 0. The input limits for scoring 30 points are (subproblem A1): 1\u2009\u2264\u2009|s|\u2009\u2264\u20095. The input limits for scoring 100 points are (subproblems A1+A2): 1\u2009\u2264\u2009|s|\u2009\u2264\u2009105. Here |s| means the length of string s.","prob_desc_sample_outputs":"[\"81\", \"100\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"AJ\\r\\n\", \"output\": [\"81\"]}, {\"input\": \"1?AA\\r\\n\", \"output\": [\"100\"]}, {\"input\": \"?\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"7\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"A\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"BBB?\\r\\n\", \"output\": [\"90\"]}, {\"input\": \"BC??\\r\\n\", \"output\": [\"8100\"]}, {\"input\": \"CC\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"CB?\\r\\n\", \"output\": [\"810\"]}, {\"input\": \"B??C?\\r\\n\", \"output\": [\"81000\"]}, {\"input\": \"BB?C?\\r\\n\", \"output\": [\"8100\"]}, {\"input\": \"?BCB?\\r\\n\", \"output\": [\"8100\"]}, {\"input\": \"?C\\r\\n\", \"output\": [\"90\"]}, {\"input\": \"??C?C\\r\\n\", \"output\": [\"9000\"]}, {\"input\": \"???2\\r\\n\", \"output\": [\"900\"]}, {\"input\": \"9???\\r\\n\", \"output\": [\"1000\"]}, {\"input\": \"GJH2?\\r\\n\", \"output\": [\"6480\"]}, {\"input\": \"7I9G4\\r\\n\", \"output\": [\"90\"]}, {\"input\": \"JG50?\\r\\n\", \"output\": [\"810\"]}, {\"input\": \"CDEFG\\r\\n\", \"output\": [\"27216\"]}, {\"input\": \"?1????4?1?6?12H1?6?9??F0?H??F3?9F50I???I?5?J832?8J4H57F???44??828??4?F???79H?59?I??2?F4???3?269?????4F?E1??E?9??5??85???H3??6I388?722???8F1H1??2?F?HJ?6?H????5??75??69?H14092218FG6??4?1F?F6??0?I??082?5IJ1EGI427H??J?808?J?99?J??????H130E?HGJE8F???0EF?2?13II...\", \"output\": [\"136080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"8774???G?G8IIGI11?8??58?4??87?H3?0?I3875??HJ2?68GHH1???70II??JJ24853?I4246HG723???H7JJ2????H55?IIII6I??30?8?28476347?H??H????I38??4?I???76H3?428?2JJ6675??49??440?HH47???61IGJ?0J2??3??3?8??J72H??I?I??J?H38???G7?5??2?I31?HH?J?2??78?67930?JJH807?J7?5I0?6?4G?...\", \"output\": [\"504000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"?750?9?464J?1C?J08???84?61?G211?364B9?6?H14??????J?C1CH36?8?B4?E??8???402915?4C???9?97??2B??D?89???5?6???3?JE?AB?4??83????0DC?I?BE?F0????026??I3??6B?609??F?G2?ABIH?D2?F??I?9G?7IC?9??GB??24?B57?4?71?74???CGF246?????4??56HD??J1??CH63?CB?5?1D??F?7FH8?590?D?H...\", \"output\": [\"326592000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"27???A?FAA??????A?????B????????????64?E7?????????????????????F?????C?2??????????D???5???2?A??D?????????????????2???????????9??9?3D???7???????D????D??1?????C?????C?????D?????????4????????????????E8???4C????????C?????????B?????9F?0???????CC??73??8??5???3???...\", \"output\": [\"604800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"??4?5????C??????6?D??4?2???0???????A??B?????????????F???B?????H37F?????9?????2????????????????4?????????B???F0?0????????FF490?????0???????????2?????G??????7????F????4?????C?????????F???2F?????????????0?C??6?????8????B???7???????G????????0??????D????????1?...\", \"output\": [\"326592000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????...\", \"output\": [\"900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"IAEAJGBGJGHGGFFBCFJIDFHEHADJAFDGGFADGDGHGGBAICFIEEDEGGGIECEIBHHBHCDIEJJJFDEEJJIJFCFGIEEIBCEFGJBBBACJBEEDDJDICJFHHJGAAHFDBGHBHAFBJHDFCGADAAIEHJCIJAAFJGBFEAEEDFCGIFFHIEJFIHGJAEFBJGBFAIHHHGHGICDGBCGHFAHDGHCAACJGBDGHCIHJGGBAADEJEEHBCECHDBEBIAGBBCCBIJFEBJFDGJG...\", \"output\": [\"3265920\"]}, {\"input\": \"888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888...\", \"output\": [\"1\"]}, {\"input\": \"IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...\", \"output\": [\"9\"]}, {\"input\": \"1023456789??????????????????????????????????????ABCDIFGHIJ\\r\\n\", \"output\": [\"362880000000000000000000000000000000000000000\"]}, {\"input\": \"?1????4?1?6?12H1?6?9??F0?H??F3?9F50I???I?5?J832?8J4H57F???44??828??4?F???79H?59?I??2?F4???3?269?????4F?E1??E?9??5??85???H3??6I388?722???8F1H1??2?F?HJ?6?H????5??75??69?H14092218FG6??4?1F?F6??0?I??082?5IJ1EGI427H??J?808?J?99?J??????H130E?HGJE8F???0EF?2?13II13J?33F222??I????H???HF?5EE??EI54??I???026??31?GG8I2?0??F?H?4F???3E?42I??751??IE2?19I6GHJ7G6??0I?5?J??9E7F0????J1?F8H?8F11?11GH??20839F?I??5?8?7?J?5?6????568?51?15714J?67?HE?EF6?J?0IHJ??2??55??6?74?5?6F6?6?88?5J4E1F544?F??4?9?91??J????1FI??E?J9H47?3I?F9I35...\", \"output\": [\"1360800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"8774???G?G8IIGI11?8??58?4??87?H3?0?I3875??HJ2?68GHH1???70II??JJ24853?I4246HG723???H7JJ2????H55?IIII6I??30?8?28476347?H??H????I38??4?I???76H3?428?2JJ6675??49??440?HH47???61IGJ?0J2??3??3?8??J72H??I?I??J?H38???G7?5??2?I31?HH?J?2??78?67930?JJH807?J7?5I0?6?4G?G?63?65??GJ689GGIH???4?7J?0?939?0G3??1G?7?4?8H5355???08J??G?7??641??J?I83??992HI6?8?G7I01J?G?00??0H8??84??G01I?90?9???I?27?67??75IHH19I?3H93HI??J?4?G?G44JIJ?????91????JG4J57H23H?421I8?J01H7?8?H?0???G?G?33GHII?J7J?H01?JI29?4?32??91JJ????0?J77J2I?13H??7HI?I9...\", \"output\": [\"5040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"?750?9?464J?1C?J08???84?61?G211?364B9?6?H14??????J?C1CH36?8?B4?E??8???402915?4C???9?97??2B??D?89???5?6???3?JE?AB?4??83????0DC?I?BE?F0????026??I3??6B?609??F?G2?ABIH?D2?F??I?9G?7IC?9??GB??24?B57?4?71?74???CGF246?????4??56HD??J1??CH63?CB?5?1D??F?7FH8?590?D?H??E51??C?9??905?D???69?G0?3?6???6?6??1HF?G?5320?AE2?8?J7632B91B?F?5?1043CA82?F1?9?EB??647C??C?32G42E4D??F17D??2D?5?C?H3?276?6C8H8I???0A?1?841?5812??C???JB91H?2??FI6?A188?D?D86?F?8??75EI??7?6????3????BC1024???6??DG7?2?86DJ??83JH7708?A??4A908G2?E??7H7???5???...\", \"output\": [\"3265920000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"27???A?FAA??????A?????B????????????64?E7?????????????????????F?????C?2??????????D???5???2?A??D?????????????????2???????????9??9?3D???7???????D????D??1?????C?????C?????D?????????4????????????????E8???4C????????C?????????B?????9F?0???????CC??73??8??5???3???7???G????6???F4????6??3??????D??5E????????E??E???5??7?G????????D????????????????????F????????F?????D???7?????????C???0??B??????????????2????????????????6???3?9?3??????6???????B????????C7?2?0???37?9?F??????????1G???????????A???6?????????9A?G????????????????...\", \"output\": [\"6048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"??4?5????C??????6?D??4?2???0???????A??B?????????????F???B?????H37F?????9?????2????????????????4?????????B???F0?0????????FF490?????0???????????2?????G??????7????F????4?????C?????????F???2F?????????????0?C??6?????8????B???7???????G????????0??????D????????1??1?????????E??1??6?1?????1AG??????0?????????63???68E???????64???0?????F?G?????4???????????????0???????????8?????B?????????9??0??H??2????????C???72???0??6????C???????F????????G?G?E????6?H???I????????B?????5?????????8??A??????C???A???????B???????????I9H?9???...\", \"output\": [\"3265920000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????...\", \"output\": [\"9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"IAEAJGBGJGHGGFFBCFJIDFHEHADJAFDGGFADGDGHGGBAICFIEEDEGGGIECEIBHHBHCDIEJJJFDEEJJIJFCFGIEEIBCEFGJBBBACJBEEDDJDICJFHHJGAAHFDBGHBHAFBJHDFCGADAAIEHJCIJAAFJGBFEAEEDFCGIFFHIEJFIHGJAEFBJGBFAIHHHGHGICDGBCGHFAHDGHCAACJGBDGHCIHJGGBAADEJEEHBCECHDBEBIAGBBCCBIJFEBJFDGJGABFAIJAEBHGDJJDGGDGIGFIHHGFJEFHHCAJJADIFJDHBHCHHEFCDEEABIHFEGJJCEFIDBEHDEIAECHJIDHFFGHDIAEHGCCGJFDGHJCHGGBDJGBIAHJHGHHDJCIAAJDDIFCAJEHHHHJBFHFIABGEHIEHDAGJHHFDDCBIHEBIEEHAEBJFFFEJGFIJJFBIBCFHFEHIICGBFHCBHCIHIGHFGIEEJJIJCHCGEFFCIDDDGAFECEBHHHIGBHDAEIAABAAGG...\", \"output\": [\"3265920\"]}, {\"input\": \"8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888...\", \"output\": [\"1\"]}, {\"input\": \"IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...\", \"output\": [\"9\"]}, {\"input\": \"C?\\r\\n\", \"output\": [\"90\"]}, {\"input\": \"B?\\r\\n\", \"output\": [\"90\"]}, {\"input\": \"CB\\r\\n\", \"output\": [\"81\"]}, {\"input\": \"?BB\\r\\n\", \"output\": [\"90\"]}, {\"input\": \"BC?\\r\\n\", \"output\": [\"810\"]}, {\"input\": \"??8\\r\\n\", \"output\": [\"90\"]}, {\"input\": \"???\\r\\n\", \"output\": [\"900\"]}, {\"input\": \"5???\\r\\n\", \"output\": [\"1000\"]}, {\"input\": \"?3?2\\r\\n\", \"output\": [\"90\"]}, {\"input\": \"3??\\r\\n\", \"output\": [\"100\"]}, {\"input\": \"????\\r\\n\", \"output\": [\"9000\"]}, {\"input\": \"5??\\r\\n\", \"output\": [\"100\"]}, {\"input\": \"IG5IJ\\r\\n\", \"output\": [\"648\"]}, {\"input\": \"?J?5?\\r\\n\", \"output\": [\"9000\"]}, {\"input\": \"?H2?H\\r\\n\", \"output\": [\"900\"]}, {\"input\": \"IJ?GH\\r\\n\", \"output\": [\"45360\"]}, {\"input\": \"H1I??\\r\\n\", \"output\": [\"8100\"]}, {\"input\": \"I?GI?\\r\\n\", \"output\": [\"8100\"]}, {\"input\": \"HH???\\r\\n\", \"output\": [\"9000\"]}, {\"input\": \"??JG?\\r\\n\", \"output\": [\"81000\"]}, {\"input\": \"?2???C?5?5?0?3?3G49H?H14132CF6?D??7?3D?D6H6???DE3?88414?2?6HE?H??81H?J7??IGH4G?C59D??0?6363DJ0?D9?C29?094??23?41???62??C17?96?11?8?26?419??2?194?J7?94??378H????6901??E2?G?722I7?7?96?????989?J4??32?I7D8?4FG77?IJ3?1??????H9?94E6F??J???F1J2??E??60?HHI?F?471?...\", \"output\": [\"163296000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"796H?7E5??F?0G?93?73H894?J5EEGI?1??7943?8E?5E8JE??2?E?78F8?18?231J6H1??6?H9J???I?52?7???92?????JFJ9J?9?5HE28E7E?E?229H8EHG?EI??4875??92G045?J?0?7GE373621???0I8?446??F4?289??6?6H?39I??E?JF?5G?3???71E?61??????8??65?467??7JJ7G0?5?5FG90?4I6?H?1?????8127?J680?...\", \"output\": [\"151200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"?6G?I08?G00I7????9509?F??I9IF?F08?I?8???85?H?88?177486?1?G?J?42???????07271H?G??7F8?9??37IIJ2?1??778527?01?26?4?G40J?3?02?86J??7?80G8?26??IFG?6H???F?1745??7?G4???9J39?JIF??G35?90GG9F??0?19?4G7???31960??????J3??594?I29?IF246I9?28??12?50?0??H?16H0??G?35??23...\", \"output\": [\"272160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"??2??DE????6?????????CBD????????????2D???????B0A???????66?????????????EC?????????0C???????????????????????????E???????1B?E?0?B??3?B??C???5????????????A?D?AA????E????????????0??D??D????????7?????5C?????????5???8E???????????????????????????C??E?2???????????...\", \"output\": [\"272160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"??????2???1???5???6?1?7AD???A????????????????6??????C1?21?????????????E?4????????0D??0????E?????????2?????2?C1???066???????D????3????????????7??????D???0??38??????B???????????????3??9????2?E???????????E???B?9??????????????????????E??D????????5???74?????3?...\", \"output\": [\"272160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"2???A???????????????D?E??7??????E???????????B???????A????5??????????????????????C??5?1?????D????5???6?9?5E??33?????????A?????????????2?????D???BD???????ED6?A??9???C???52???4?????8??????????C?????8?????????D??????9???2?????????????????????A????C???????E??C...\", \"output\": [\"302400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"683518584817155800581733502183471419884762910500563251171403448372507607270991810945774198062987617292394627405262368593806289433518654446500968400317067123455418793207776509503349948443782620144198357524313988451973763706283591138341956921343546630685508...\", \"output\": [\"1\"]}, {\"input\": \"????I21?J507?05715II?J?JJ??3I9I?2?I7?44I??I8JI2999????27?1II9????654I4I65??4?422I?6JI?459?531J1??4?4JI4????184??70???0I????607????7?J9?8J9II?715?9J??1I051??3II?5?J5I76I?J???IJJ?J7J355??24?2?4J8IJ1J??IJ1I?I?I4?2JI0I?4I???3J?J8933?66?J6JI6077438?48?????14?0...\", \"output\": [\"810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"???9??I?9302J?97??II04????I3I9?H?J??J?F2?3?9???0H9?J95???F?F5??27?721???2?6???2?5?6?IH???H?1?7?8?878HJ30IG?8H2?267HGG??82?F?9??3??57FI??J6H???219F5??G0?7J?1H0HJ???6?67385??5?GJ0J1J?G1J477???JF?6?HF5?J??309HG?J39H?3???I??0?727F?HH?5J?3?H8?9?27H60?92??G?5H?...\", \"output\": [\"272160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"?9?H6787H??H?G?22G447414?????1J?0?G???2?IGH01575?9?E?1??1?997?9??207C9?1?E?75C?811?F??1?0?1F??H0B?HD0?I?4?1??0?0BG??0C?4?B?I0?6D?5EF???BC383J?00?5D13??73FBB?1?F??I5?1??47??205???I???D?461??F?07???3?4??33G??9?E3?D??3???8??70?2?7B?48?HG7268J34?????C8?3?2??1...\", \"output\": [\"326592000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"7??9?06?2???3?I??1175???08EIF??7?JI17???J330??E?5??8?76857IEF2G79E5F?4?????H0?I?8E2?51GI?I402050H??E???0??JI1?0?2I?E?3?41??JFH?8GI8I8?55691?4???83????1??FH?797817H514?39?1?53????EJH72?JGE7?I65I?4E?0537??7JH56J???1I?84FHF?3?52GG?1EIG4G?6GF???63HH2?8G?8EH?4...\", \"output\": [\"151200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}, {\"input\": \"?????????????????????????????????????????????????????6????????????????????????????F???????????????????4??????6????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????6????????????????????...\", \"output\": [\"326592000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...\"]}]"} {"prob_desc_description":"Smart Beaver is careful about his appearance and pays special attention to shoes so he has a huge number of pairs of shoes from the most famous brands of the forest. He's trying to handle his shoes carefully so that each pair stood side by side. But by the end of the week because of his very active lifestyle in his dressing room becomes a mess.Smart Beaver from ABBYY is not only the brightest beaver in the area, but he also is the most domestically oriented. For example, on Mondays the Smart Beaver cleans everything in his home.It's Monday morning. Smart Beaver does not want to spend the whole day cleaning, besides, there is much in to do and it\u2019s the gym day, so he wants to clean up as soon as possible. Now the floors are washed, the dust is wiped off \u2014 it\u2019s time to clean up in the dressing room. But as soon as the Smart Beaver entered the dressing room, all plans for the day were suddenly destroyed: chaos reigned there and it seemed impossible to handle, even in a week. Give our hero some hope: tell him what is the minimum number of shoes need to change the position to make the dressing room neat.The dressing room is rectangular and is divided into n\u2009\u00d7\u2009m equal squares, each square contains exactly one shoe. Each pair of shoes has a unique number that is integer from 1 to , more formally, a square with coordinates (i,\u2009j) contains an integer number of the pair which is lying on it. The Smart Beaver believes that the dressing room is neat only when each pair of sneakers lies together. We assume that the pair of sneakers in squares (i1,\u2009j1) and (i2,\u2009j2) lies together if |i1\u2009-\u2009i2|\u2009+\u2009|j1\u2009-\u2009j2|\u2009=\u20091.","prob_desc_output_spec":"Print exactly one integer \u2014 the minimum number of the sneakers that need to change their location.","lang_cluster":"","src_uid":"1f0e8bbd5bf4fcdea927fbb505a8949b","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["flows"],"prob_desc_created_at":"1371042000","prob_desc_sample_inputs":"[\"2 3\\n1 1 2\\n2 3 3\", \"3 4\\n1 3 2 6\\n2 1 5 6\\n4 4 5 3\"]","prob_desc_notes":"Note The second sample. ","exec_outcome":"","difficulty":2200.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"4 seconds","prob_desc_input_spec":"The first line contains two space-separated integers n and m. They correspond to the dressing room size. Next n lines contain m space-separated integers each. Those numbers describe the dressing room. Each number corresponds to a snicker. It is guaranteed that: n\u00b7m is even. All numbers, corresponding to the numbers of pairs of shoes in the dressing room, will lie between 1 and . Each number from 1 to will occur exactly twice. The input limits for scoring 30 points are (subproblem C1): 2\u2009\u2264\u2009n,\u2009m\u2009\u2264\u20098. The input limits for scoring 100 points are (subproblems C1+C2): 2\u2009\u2264\u2009n,\u2009m\u2009\u2264\u200980. ","prob_desc_sample_outputs":"[\"2\", \"4\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2 3\\r\\n1 1 2\\r\\n2 3 3\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"3 4\\r\\n1 3 2 6\\r\\n2 1 5 6\\r\\n4 4 5 3\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"2 2\\r\\n1 2\\r\\n1 2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 2\\r\\n1 1\\r\\n2 2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 2\\r\\n2 1\\r\\n1 2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"3 4\\r\\n1 1 6 6\\r\\n2 2 4 4\\r\\n3 3 5 5\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3 4\\r\\n5 3 3 2\\r\\n6 1 4 2\\r\\n6 1 5 4\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"5 4\\r\\n9 9 10 10\\r\\n7 7 5 5\\r\\n2 2 3 3\\r\\n1 1 8 8\\r\\n4 4 6 6\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"4 5\\r\\n7 9 9 10 10\\r\\n7 5 5 3 3\\r\\n8 1 1 2 2\\r\\n8 6 6 4 4\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"5 4\\r\\n6 4 4 3\\r\\n10 8 5 1\\r\\n10 6 5 2\\r\\n9 2 7 7\\r\\n9 8 1 3\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"5 6\\r\\n7 12 1 15 3 2\\r\\n3 10 14 4 6 6\\r\\n5 11 13 8 2 9\\r\\n5 14 7 13 4 10\\r\\n11 1 12 15 9 8\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"6 5\\r\\n8 12 12 15 7\\r\\n3 4 11 10 9\\r\\n15 14 2 13 10\\r\\n3 5 2 11 6\\r\\n1 5 14 1 13\\r\\n9 7 8 6 4\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"6 6\\r\\n6 9 9 5 5 14\\r\\n15 15 11 18 2 10\\r\\n17 14 18 4 8 10\\r\\n17 3 1 13 8 13\\r\\n16 3 1 7 7 11\\r\\n16 4 6 2 12 12\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"6 6\\r\\n2 10 10 12 18 7\\r\\n2 14 9 12 18 7\\r\\n3 3 9 16 6 6\\r\\n4 11 11 16 15 15\\r\\n4 13 1 14 17 17\\r\\n8 8 1 5 5 13\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"6 7\\r\\n15 15 20 7 18 18 3\\r\\n7 16 16 12 19 19 3\\r\\n13 5 5 12 9 2 2\\r\\n13 14 4 10 9 11 14\\r\\n20 6 8 10 17 11 1\\r\\n1 6 8 4 17 21 21\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"8 6\\r\\n19 19 15 11 5 5\\r\\n14 14 7 15 17 21\\r\\n16 4 8 22 24 21\\r\\n9 23 8 3 9 6\\r\\n2 10 10 13 3 6\\r\\n2 11 17 18 12 20\\r\\n13 7 1 18 12 20\\r\\n4 16 1 23 24 22\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"8 8\\r\\n8 8 32 32 20 20 15 15\\r\\n14 14 7 7 9 9 2 2\\r\\n23 23 4 4 26 26 13 13\\r\\n18 18 12 12 10 10 19 19\\r\\n1 1 24 24 21 21 3 3\\r\\n6 6 28 28 22 22 29 29\\r\\n16 16 31 31 11 11 27 27\\r\\n25 25 5 5 17 17 30 30\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"8 8\\r\\n19 22 3 22 11 31 10 13\\r\\n20 20 6 24 12 8 8 13\\r\\n32 10 17 30 21 27 21 5\\r\\n32 7 15 31 26 26 28 4\\r\\n30 7 15 5 25 12 1 16\\r\\n17 23 28 16 2 27 1 23\\r\\n29 9 9 6 2 19 29 4\\r\\n3 25 18 18 14 14 24 11\\r\\n\", \"output\": [\"21\"]}, {\"input\": \"8 8\\r\\n29 26 26 2 12 12 6 27\\r\\n4 4 29 2 5 13 1 16\\r\\n21 25 11 18 18 13 1 28\\r\\n19 9 9 21 24 17 7 7\\r\\n10 10 32 32 15 17 16 3\\r\\n31 24 6 30 15 20 28 27\\r\\n22 30 23 23 14 20 5 19\\r\\n11 25 31 3 14 22 8 8\\r\\n\", \"output\": [\"19\"]}, {\"input\": \"8 8\\r\\n1 1 31 17 19 19 11 27\\r\\n28 6 18 21 21 30 27 2\\r\\n20 20 18 17 8 30 28 2\\r\\n15 15 10 10 8 29 22 3\\r\\n23 13 16 7 7 29 25 3\\r\\n23 13 32 5 6 25 26 26\\r\\n12 12 32 14 14 9 9 24\\r\\n22 11 16 4 4 31 5 24\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"8 8\\r\\n9 32 32 8 8 30 16 25\\r\\n9 10 10 4 4 26 17 30\\r\\n21 24 24 11 5 26 27 15\\r\\n21 20 20 31 14 14 27 15\\r\\n28 25 2 3 1 23 23 31\\r\\n28 11 2 3 1 29 22 13\\r\\n7 6 6 19 19 29 22 13\\r\\n7 12 12 17 16 5 18 18\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"8 8\\r\\n18 1 1 25 28 28 31 31\\r\\n18 19 19 13 24 24 4 4\\r\\n3 7 7 13 16 12 14 6\\r\\n3 26 26 17 9 12 14 6\\r\\n8 27 27 17 9 10 10 25\\r\\n8 5 30 23 23 5 20 15\\r\\n30 32 21 11 2 22 20 15\\r\\n16 32 21 11 2 22 29 29\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"10 10\\r\\n32 29 37 6 6 49 49 17 15 7\\r\\n32 9 37 44 33 46 46 17 15 7\\r\\n41 13 45 11 23 47 1 24 24 31\\r\\n28 13 11 2 2 30 41 35 14 31\\r\\n28 36 40 40 43 30 10 35 14 42\\r\\n38 38 50 50 43 34 3 22 22 10\\r\\n8 8 42 16 16 39 3 1 18 12\\r\\n48 48 12 33 23 45 21 27 18 19\\r\\n25 36 4 4 20 20 21 27 34 19\\r\\n25 29 9 47 39 44 5 5 26 26\\r\\n\", \"output\": [\"19\"]}, {\"input\": \"16 18\\r\\n141 141 51 3 3 43 80 111 111 76 53 43 132 69 7 2 2 99\\r\\n4 95 95 34 16 52 85 85 63 76 53 71 114 69 99 73 38 38\\r\\n49 87 133 133 31 52 4 136 63 102 129 81 81 68 68 84 55 55\\r\\n84 87 124 122 122 59 20 90 101 101 129 19 80 106 17 109 83 104\\r\\n64 136 124 116 108 108 15 90 72 30 83 74 74 16 92 82 139 70\\r\\n64 21 88 116 123 50 15 121 72 30 143 140 134 134 92 132 139 70\\r\\n142 21 88 104 22 22 25 25 26 62 107 140 37 143 46 119 18 18\\r\\n103 120 131 131 97 35 138 138 26 62 107 45 45 121 46 119 142 29\\r\\n103 120 93 93 97 42 ...\", \"output\": [\"61\"]}, {\"input\": \"24 20\\r\\n151 151 197 197 126 126 225 225 77 77 59 59 117 117 152 152 173 173 218 218\\r\\n21 21 206 206 223 223 48 48 147 147 235 235 228 228 195 195 121 121 162 162\\r\\n97 97 39 39 217 217 19 19 85 85 90 90 202 202 230 230 6 6 189 189\\r\\n115 115 146 146 99 99 188 188 184 184 143 143 2 2 112 112 60 60 211 211\\r\\n14 14 145 145 168 168 159 159 174 174 213 213 233 233 176 176 86 86 134 134\\r\\n37 37 38 38 208 208 89 89 131 131 183 183 30 30 1 1 24 24 63 63\\r\\n221 221 120 120 44 44 83 83 105 105 106 106 219 219 53 53 80 80 234 ...\", \"output\": [\"0\"]}, {\"input\": \"26 26\\r\\n180 86 86 334 307 307 85 76 114 240 235 235 291 71 264 264 187 179 56 33 33 212 69 263 51 25\\r\\n117 88 88 181 90 210 85 76 114 162 162 197 69 46 46 105 61 165 165 65 285 212 3 287 287 25\\r\\n14 52 55 55 90 24 24 59 59 227 247 197 17 163 257 159 11 47 218 218 182 37 37 274 274 58\\r\\n279 52 205 28 271 174 323 332 331 227 236 98 17 12 63 63 11 47 265 128 182 259 148 62 62 210\\r\\n23 23 205 211 271 174 16 42 42 16 236 93 311 273 268 224 305 109 110 128 44 245 148 252 29 49\\r\\n116 330 171 171 204 3 305 118 155 273 1...\", \"output\": [\"162\"]}, {\"input\": \"26 26\\r\\n220 316 37 17 291 170 310 63 327 321 52 188 106 52 315 200 23 184 85 116 73 10 216 274 173 309\\r\\n184 91 280 5 126 225 257 234 265 155 110 84 208 208 320 308 276 237 306 315 60 220 66 133 259 174\\r\\n179 282 4 301 133 287 201 221 21 252 113 218 182 337 256 287 18 76 53 74 112 324 253 19 40 152\\r\\n6 7 19 147 249 232 28 223 114 192 283 325 251 120 14 163 135 300 313 124 332 267 8 150 179 292\\r\\n47 16 77 102 198 289 22 190 331 206 321 277 171 9 159 265 254 272 65 13 326 330 175 130 105 174\\r\\n83 338 98 331 38 318...\", \"output\": [\"337\"]}, {\"input\": \"26 26\\r\\n170 226 60 304 61 153 288 288 33 147 270 224 262 209 209 40 40 9 9 174 265 166 281 236 84 84\\r\\n109 255 119 85 294 153 162 269 33 246 4 289 262 228 117 257 165 239 210 173 277 203 254 236 111 111\\r\\n56 245 266 85 294 142 129 129 335 42 42 289 259 228 154 110 165 239 138 138 146 272 79 79 60 89\\r\\n301 133 231 217 217 142 82 178 335 189 285 115 267 93 98 58 77 287 35 116 146 22 164 186 68 151\\r\\n301 126 177 240 313 21 49 178 333 243 143 291 70 296 184 278 261 287 195 302 302 191 238 186 271 271\\r\\n273 204 177 1...\", \"output\": [\"203\"]}, {\"input\": \"30 30\\r\\n268 303 439 446 446 418 418 144 77 135 258 307 114 387 325 297 144 82 60 176 363 113 314 382 336 59 274 88 440 237\\r\\n161 160 160 183 395 401 111 69 74 135 126 307 7 67 67 253 253 226 226 325 189 56 241 382 263 263 316 316 419 235\\r\\n48 401 102 183 170 448 227 69 243 244 244 312 161 37 213 30 350 41 236 404 341 87 87 152 19 397 112 331 331 245\\r\\n371 81 102 204 52 448 301 232 232 188 30 312 106 106 109 157 392 98 236 176 296 292 205 205 389 355 355 29 107 228\\r\\n163 158 158 381 187 237 301 442 327 293 293 4...\", \"output\": [\"278\"]}, {\"input\": \"30 31\\r\\n308 308 103 103 295 295 343 343 149 149 122 122 376 376 188 188 141 141 234 234 209 209 440 440 201 201 107 107 439 439 422\\r\\n77 77 278 278 408 408 265 265 132 132 178 178 266 266 134 134 459 459 369 369 220 220 65 65 101 101 20 20 130 130 422\\r\\n105 105 36 36 283 283 212 212 62 62 7 7 34 34 432 432 414 414 303 303 264 264 207 207 225 225 235 235 394 394 325\\r\\n8 8 35 35 59 59 184 184 56 56 3 3 285 285 164 164 346 346 407 407 277 277 12 12 378 378 344 344 352 352 325\\r\\n333 333 240 240 276 276 257 257 435 ...\", \"output\": [\"0\"]}, {\"input\": \"30 30\\r\\n92 373 290 307 398 74 230 59 374 62 110 45 40 382 68 351 254 445 275 105 352 54 135 91 341 23 100 99 443 80\\r\\n129 255 365 2 379 39 62 342 407 230 144 364 293 20 200 194 90 32 35 181 424 164 409 196 199 86 403 44 250 84\\r\\n66 44 208 385 111 108 196 93 65 168 189 237 421 122 140 314 299 222 385 334 191 381 104 319 285 248 83 331 337 224\\r\\n368 193 51 364 145 330 102 323 392 437 107 34 430 430 309 6 41 59 244 204 235 42 142 99 374 250 130 383 444 49\\r\\n206 343 244 215 372 246 249 249 207 419 166 231 80 427 36...\", \"output\": [\"448\"]}, {\"input\": \"30 30\\r\\n296 136 79 285 285 362 273 228 228 419 262 222 21 261 261 22 339 339 227 155 415 105 17 180 168 172 101 152 197 209\\r\\n112 386 310 324 188 427 44 76 342 342 293 293 21 361 450 82 190 130 130 213 174 53 17 180 231 392 317 134 134 10\\r\\n132 386 55 55 417 417 363 76 30 30 303 351 351 45 99 99 184 225 225 213 280 53 279 32 113 113 317 92 437 437\\r\\n132 9 281 208 208 79 425 175 253 363 46 24 24 45 19 282 258 221 221 255 444 227 215 40 236 234 234 92 176 80\\r\\n57 116 336 381 220 220 425 198 253 360 187 325 286 28...\", \"output\": [\"216\"]}, {\"input\": \"30 30\\r\\n417 417 152 375 374 374 215 215 337 337 110 7 235 73 160 130 323 276 222 449 449 198 352 343 343 190 317 317 248 32\\r\\n142 397 397 375 55 55 149 43 43 368 110 340 340 73 160 130 98 276 58 315 96 96 352 439 166 62 261 261 440 198\\r\\n142 105 226 226 173 10 149 410 410 368 111 22 378 378 367 367 98 274 58 315 207 24 255 439 168 62 402 318 440 213\\r\\n411 132 129 129 134 134 169 13 13 329 168 117 117 144 380 445 445 311 311 221 207 24 255 429 429 178 178 318 296 213\\r\\n411 132 370 370 172 77 169 211 332 329 247 ...\", \"output\": [\"150\"]}, {\"input\": \"30 30\\r\\n319 319 254 156 209 158 32 237 352 17 324 324 29 29 274 210 210 115 294 294 326 38 423 423 103 103 160 160 262 262\\r\\n198 100 254 156 209 158 118 118 352 17 83 269 258 258 223 251 7 115 427 427 326 38 44 28 320 320 361 12 12 305\\r\\n222 100 195 280 280 292 218 218 226 226 83 269 343 343 223 251 386 386 383 383 33 53 53 28 37 37 90 90 54 54\\r\\n214 214 195 354 233 292 178 179 444 444 304 56 56 199 199 176 260 117 177 70 70 25 297 47 47 219 72 187 187 367\\r\\n35 35 418 354 233 257 178 179 263 263 304 93 73 253 1...\", \"output\": [\"98\"]}, {\"input\": \"36 36\\r\\n257 257 490 592 50 289 136 225 591 11 298 630 55 538 606 638 640 110 110 1 397 153 137 3 479 105 398 374 591 469 563 277 568 568 204 204\\r\\n579 526 27 404 58 387 414 139 414 296 444 630 82 82 428 78 449 55 645 519 37 9 467 363 95 160 138 48 283 469 243 243 310 445 383 189\\r\\n228 625 226 365 298 51 75 32 178 646 304 63 352 352 361 268 349 554 121 60 577 262 182 534 534 80 355 473 392 551 213 434 308 610 104 463\\r\\n267 633 14 453 126 471 604 32 178 101 594 544 220 215 472 606 360 554 104 162 254 380 380 403...\", \"output\": [\"528\"]}, {\"input\": \"36 36\\r\\n257 257 490 278 191 591 458 81 52 246 602 630 616 224 101 529 104 110 110 191 426 586 329 346 512 244 279 272 52 469 72 72 568 568 204 204\\r\\n283 419 285 16 26 437 89 634 564 564 256 630 82 82 289 529 341 215 483 289 69 368 314 611 95 6 6 596 615 469 243 243 327 466 310 310\\r\\n558 482 370 16 148 417 358 32 178 315 519 516 352 352 46 413 413 554 561 561 577 165 165 534 534 80 355 596 312 18 373 455 212 212 228 27\\r\\n254 232 645 578 463 463 604 32 178 180 180 608 453 263 638 239 36 554 415 195 577 380 380 5...\", \"output\": [\"374\"]}, {\"input\": \"37 38\\r\\n490 107 167 224 511 511 33 452 698 698 308 302 302 3 463 636 573 401 401 628 155 155 320 95 95 549 289 289 465 230 230 592 225 235 383 383 207 207\\r\\n5 5 167 224 380 625 33 452 89 440 308 396 396 55 55 636 573 686 686 569 569 498 498 545 535 549 225 294 294 687 644 592 657 657 647 479 479 543\\r\\n44 485 485 320 544 544 692 254 89 440 666 36 36 99 125 125 349 126 126 57 57 577 577 545 604 604 600 606 116 687 644 395 395 421 421 47 684 684\\r\\n246 246 312 312 639 639 692 254 386 107 666 570 570 524 524 413 34...\", \"output\": [\"185\"]}, {\"input\": \"40 40\\r\\n553 102 183 552 16 413 255 675 695 225 440 248 275 262 704 209 209 726 547 305 704 707 45 472 330 95 483 621 705 141 46 688 439 385 544 69 36 399 786 752\\r\\n734 437 437 552 491 578 255 480 695 164 338 205 279 262 111 321 329 367 547 253 29 29 199 214 169 274 483 242 237 168 260 286 677 518 518 452 36 130 469 469\\r\\n93 93 587 337 281 348 335 450 742 206 21 689 635 475 58 417 144 338 622 83 278 42 574 612 612 166 196 254 237 297 772 35 35 587 266 302 388 340 81 724\\r\\n84 444 576 540 155 699 335 94 7 559 21 ...\", \"output\": [\"601\"]}, {\"input\": \"80 80\\r\\n663 2403 300 920 2698 2481 3196 730 1303 106 49 947 947 467 2303 1177 1765 2097 137 1427 3113 3113 357 1678 2675 1820 1036 2005 3049 717 1721 3021 1825 1570 2827 2970 691 3107 1640 454 696 696 1326 1959 2640 782 1141 1246 402 608 3070 1578 2141 1311 3000 3000 1523 582 2139 939 2991 605 2054 619 2781 664 1103 2631 2657 1669 2557 2224 2224 1112 168 264 264 1543 83 2735\\r\\n334 853 853 447 2698 1444 1336 1250 1259 1893 1003 789 693 2906 2303 356 400 820 820 1494 2750 2213 357 1678 1992 368 1036 2408 1569 ...\", \"output\": [\"2060\"]}, {\"input\": \"80 79\\r\\n963 1671 1671 2166 2166 137 137 1853 1853 2906 2906 2249 2249 998 998 2025 2025 1787 1787 518 518 1573 1573 3095 3095 1881 1881 2965 2965 2823 2823 2914 2914 2785 2785 392 392 2369 2369 2021 2021 1781 1781 1250 1250 2141 2141 2501 2501 2104 2104 910 910 2943 2943 1072 1072 1100 1100 2856 2856 924 924 2899 2899 395 395 1799 1799 1862 1862 2714 2714 1295 1295 1379 1379 175 175\\r\\n963 1874 1874 2397 2397 584 584 36 36 2519 2519 913 913 975 975 1031 1031 955 955 2562 2562 1537 1537 1611 1611 532 532 3014 ...\", \"output\": [\"0\"]}, {\"input\": \"80 80\\r\\n2357 1295 849 2155 1383 2518 2207 1692 1041 1317 2497 513 1011 1011 1442 1218 399 2304 2304 1077 107 1884 2672 2944 1972 1972 2476 1630 1630 1284 1092 2491 2491 1231 3145 3145 855 855 1701 1380 1779 2697 236 2756 1251 1251 2764 367 367 1413 1413 2975 953 1269 1269 3167 3167 2455 1190 3021 3021 58 1033 2514 2514 2803 939 939 275 275 1427 2190 744 540 165 165 1276 1342 1342 1495\\r\\n2357 2299 1364 2155 463 2518 2207 1692 1041 1317 2567 513 2992 2308 1442 682 2985 1373 1373 2122 1757 1884 2672 2944 1597 3...\", \"output\": [\"1486\"]}, {\"input\": \"80 80\\r\\n3172 1791 1197 869 2482 2484 3144 2296 1636 544 544 1539 1892 1892 2509 1174 390 2708 2708 38 32 32 2730 1990 696 696 928 384 348 1136 1281 1583 1583 1554 2558 292 1730 3022 3074 519 1553 1588 1418 2894 2820 52 1113 1397 2989 2459 2524 177 2868 2408 1224 2311 1941 1941 1846 26 26 387 1406 2003 1968 2732 1441 3199 2101 3181 2590 987 1432 703 2927 2119 799 2187 2187 1779\\r\\n546 1384 994 607 1207 2543 2719 1335 2648 2648 645 645 944 944 1064 2104 1610 543 333 1768 155 542 933 870 1174 1052 1052 2094 2094...\", \"output\": [\"2453\"]}, {\"input\": \"80 80\\r\\n1687 3167 2152 258 1069 287 719 2317 226 2121 2121 428 1461 2961 498 1511 2011 2011 2137 373 373 568 2960 141 141 583 1741 29 29 1143 753 753 2608 2576 2576 1826 1444 1909 1909 1814 1630 1630 352 397 3098 673 673 1279 2776 2776 110 110 2675 3099 3099 1542 846 2285 2285 1998 1309 2838 2079 90 893 1650 1650 2994 2994 2485 2485 2275 2275 2541 1547 2827 2827 2004 2135 2135\\r\\n2720 3167 2152 1382 1382 287 719 2317 136 79 79 1387 1531 2961 498 1511 530 530 2137 2805 2805 568 2505 1820 2436 583 1741 1853 105...\", \"output\": [\"922\"]}, {\"input\": \"80 79\\r\\n2410 94 279 1354 1172 1172 1887 1029 2630 2958 165 2384 670 2791 2927 2751 3072 709 2069 2269 31 685 1279 930 1283 503 1623 498 2321 1737 1440 1440 50 1958 1168 377 40 2363 2363 1959 2324 1843 733 733 2303 2480 2001 2001 33 2354 1513 2588 595 663 2625 368 2900 305 305 1850 870 870 3071 2435 1267 1267 2421 1338 2842 223 2168 2881 2085 1168 1883 820 1136 2288 718\\r\\n3132 94 482 1162 2980 2980 682 994 2012 3133 900 2384 787 787 77 2751 172 3074 663 2698 1034 1961 644 223 1295 1295 3067 343 1572 2020 724 ...\", \"output\": [\"2009\"]}, {\"input\": \"80 80\\r\\n614 2692 2440 490 679 1431 57 2208 2794 884 2230 776 675 2700 185 130 890 1500 253 1344 744 2209 2105 1113 2368 2594 742 1686 701 2942 1463 2429 409 409 2420 3043 1593 3070 2513 2686 2134 2134 159 2136 122 2646 2972 1094 904 904 755 791 2393 2866 549 2632 2713 1114 2834 157 2196 890 68 68 335 335 1364 1254 1254 2688 646 2195 1749 1974 1203 1597 1577 2562 1464 2909\\r\\n2130 469 2032 490 1954 802 2312 2069 1223 2955 110 262 2577 2399 2117 395 2581 2941 2772 2045 894 2209 1851 3063 2972 1243 3023 3023 529...\", \"output\": [\"2126\"]}, {\"input\": \"10 10\\r\\n32 29 37 6 6 49 49 17 15 7\\r\\n32 9 37 44 33 46 46 17 15 7\\r\\n41 13 45 11 23 47 1 24 24 31\\r\\n28 13 11 2 2 30 41 35 14 31\\r\\n28 36 40 40 43 30 10 35 14 42\\r\\n38 38 50 50 43 34 3 22 22 10\\r\\n8 8 42 16 16 39 3 1 18 12\\r\\n48 48 12 33 23 45 21 27 18 19\\r\\n25 36 4 4 20 ...\", \"output\": [\"19\"]}, {\"input\": \"16 18\\r\\n141 141 51 3 3 43 80 111 111 76 53 43 132 69 7 2 2 99\\r\\n4 95 95 34 16 52 85 85 63 76 53 71 114 69 99 73 38 38\\r\\n49 87 133 133 31 52 4 136 63 102 129 81 81 68 68 84 55 55\\r\\n84 87 124 122 122 59 20 90 101 101 129 19 80 106 17 109 83 104\\r\\n64 136 124 116 ...\", \"output\": [\"61\"]}, {\"input\": \"24 20\\r\\n151 151 197 197 126 126 225 225 77 77 59 59 117 117 152 152 173 173 218 218\\r\\n21 21 206 206 223 223 48 48 147 147 235 235 228 228 195 195 121 121 162 162\\r\\n97 97 39 39 217 217 19 19 85 85 90 90 202 202 230 230 6 6 189 189\\r\\n115 115 146 146 99 99 188 1...\", \"output\": [\"0\"]}, {\"input\": \"26 26\\r\\n180 86 86 334 307 307 85 76 114 240 235 235 291 71 264 264 187 179 56 33 33 212 69 263 51 25\\r\\n117 88 88 181 90 210 85 76 114 162 162 197 69 46 46 105 61 165 165 65 285 212 3 287 287 25\\r\\n14 52 55 55 90 24 24 59 59 227 247 197 17 163 257 159 11 47 21...\", \"output\": [\"162\"]}, {\"input\": \"26 26\\r\\n220 316 37 17 291 170 310 63 327 321 52 188 106 52 315 200 23 184 85 116 73 10 216 274 173 309\\r\\n184 91 280 5 126 225 257 234 265 155 110 84 208 208 320 308 276 237 306 315 60 220 66 133 259 174\\r\\n179 282 4 301 133 287 201 221 21 252 113 218 182 337 ...\", \"output\": [\"337\"]}, {\"input\": \"26 26\\r\\n170 226 60 304 61 153 288 288 33 147 270 224 262 209 209 40 40 9 9 174 265 166 281 236 84 84\\r\\n109 255 119 85 294 153 162 269 33 246 4 289 262 228 117 257 165 239 210 173 277 203 254 236 111 111\\r\\n56 245 266 85 294 142 129 129 335 42 42 289 259 228 1...\", \"output\": [\"203\"]}, {\"input\": \"30 30\\r\\n268 303 439 446 446 418 418 144 77 135 258 307 114 387 325 297 144 82 60 176 363 113 314 382 336 59 274 88 440 237\\r\\n161 160 160 183 395 401 111 69 74 135 126 307 7 67 67 253 253 226 226 325 189 56 241 382 263 263 316 316 419 235\\r\\n48 401 102 183 170...\", \"output\": [\"278\"]}, {\"input\": \"30 31\\r\\n308 308 103 103 295 295 343 343 149 149 122 122 376 376 188 188 141 141 234 234 209 209 440 440 201 201 107 107 439 439 422\\r\\n77 77 278 278 408 408 265 265 132 132 178 178 266 266 134 134 459 459 369 369 220 220 65 65 101 101 20 20 130 130 422\\r\\n105 ...\", \"output\": [\"0\"]}, {\"input\": \"30 30\\r\\n92 373 290 307 398 74 230 59 374 62 110 45 40 382 68 351 254 445 275 105 352 54 135 91 341 23 100 99 443 80\\r\\n129 255 365 2 379 39 62 342 407 230 144 364 293 20 200 194 90 32 35 181 424 164 409 196 199 86 403 44 250 84\\r\\n66 44 208 385 111 108 196 93 ...\", \"output\": [\"448\"]}, {\"input\": \"30 30\\r\\n296 136 79 285 285 362 273 228 228 419 262 222 21 261 261 22 339 339 227 155 415 105 17 180 168 172 101 152 197 209\\r\\n112 386 310 324 188 427 44 76 342 342 293 293 21 361 450 82 190 130 130 213 174 53 17 180 231 392 317 134 134 10\\r\\n132 386 55 55 417...\", \"output\": [\"216\"]}, {\"input\": \"30 30\\r\\n417 417 152 375 374 374 215 215 337 337 110 7 235 73 160 130 323 276 222 449 449 198 352 343 343 190 317 317 248 32\\r\\n142 397 397 375 55 55 149 43 43 368 110 340 340 73 160 130 98 276 58 315 96 96 352 439 166 62 261 261 440 198\\r\\n142 105 226 226 173 ...\", \"output\": [\"150\"]}, {\"input\": \"30 30\\r\\n319 319 254 156 209 158 32 237 352 17 324 324 29 29 274 210 210 115 294 294 326 38 423 423 103 103 160 160 262 262\\r\\n198 100 254 156 209 158 118 118 352 17 83 269 258 258 223 251 7 115 427 427 326 38 44 28 320 320 361 12 12 305\\r\\n222 100 195 280 280 ...\", \"output\": [\"98\"]}, {\"input\": \"36 36\\r\\n257 257 490 592 50 289 136 225 591 11 298 630 55 538 606 638 640 110 110 1 397 153 137 3 479 105 398 374 591 469 563 277 568 568 204 204\\r\\n579 526 27 404 58 387 414 139 414 296 444 630 82 82 428 78 449 55 645 519 37 9 467 363 95 160 138 48 283 469 2...\", \"output\": [\"528\"]}, {\"input\": \"36 36\\r\\n257 257 490 278 191 591 458 81 52 246 602 630 616 224 101 529 104 110 110 191 426 586 329 346 512 244 279 272 52 469 72 72 568 568 204 204\\r\\n283 419 285 16 26 437 89 634 564 564 256 630 82 82 289 529 341 215 483 289 69 368 314 611 95 6 6 596 615 469...\", \"output\": [\"374\"]}, {\"input\": \"37 38\\r\\n490 107 167 224 511 511 33 452 698 698 308 302 302 3 463 636 573 401 401 628 155 155 320 95 95 549 289 289 465 230 230 592 225 235 383 383 207 207\\r\\n5 5 167 224 380 625 33 452 89 440 308 396 396 55 55 636 573 686 686 569 569 498 498 545 535 549 225 ...\", \"output\": [\"185\"]}, {\"input\": \"40 40\\r\\n553 102 183 552 16 413 255 675 695 225 440 248 275 262 704 209 209 726 547 305 704 707 45 472 330 95 483 621 705 141 46 688 439 385 544 69 36 399 786 752\\r\\n734 437 437 552 491 578 255 480 695 164 338 205 279 262 111 321 329 367 547 253 29 29 199 214...\", \"output\": [\"601\"]}, {\"input\": \"80 80\\r\\n663 2403 300 920 2698 2481 3196 730 1303 106 49 947 947 467 2303 1177 1765 2097 137 1427 3113 3113 357 1678 2675 1820 1036 2005 3049 717 1721 3021 1825 1570 2827 2970 691 3107 1640 454 696 696 1326 1959 2640 782 1141 1246 402 608 3070 1578 2141 131...\", \"output\": [\"2060\"]}, {\"input\": \"80 79\\r\\n963 1671 1671 2166 2166 137 137 1853 1853 2906 2906 2249 2249 998 998 2025 2025 1787 1787 518 518 1573 1573 3095 3095 1881 1881 2965 2965 2823 2823 2914 2914 2785 2785 392 392 2369 2369 2021 2021 1781 1781 1250 1250 2141 2141 2501 2501 2104 2104 91...\", \"output\": [\"0\"]}, {\"input\": \"80 80\\r\\n2357 1295 849 2155 1383 2518 2207 1692 1041 1317 2497 513 1011 1011 1442 1218 399 2304 2304 1077 107 1884 2672 2944 1972 1972 2476 1630 1630 1284 1092 2491 2491 1231 3145 3145 855 855 1701 1380 1779 2697 236 2756 1251 1251 2764 367 367 1413 1413 29...\", \"output\": [\"1486\"]}, {\"input\": \"80 80\\r\\n3172 1791 1197 869 2482 2484 3144 2296 1636 544 544 1539 1892 1892 2509 1174 390 2708 2708 38 32 32 2730 1990 696 696 928 384 348 1136 1281 1583 1583 1554 2558 292 1730 3022 3074 519 1553 1588 1418 2894 2820 52 1113 1397 2989 2459 2524 177 2868 240...\", \"output\": [\"2453\"]}, {\"input\": \"80 80\\r\\n1687 3167 2152 258 1069 287 719 2317 226 2121 2121 428 1461 2961 498 1511 2011 2011 2137 373 373 568 2960 141 141 583 1741 29 29 1143 753 753 2608 2576 2576 1826 1444 1909 1909 1814 1630 1630 352 397 3098 673 673 1279 2776 2776 110 110 2675 3099 30...\", \"output\": [\"922\"]}, {\"input\": \"80 79\\r\\n2410 94 279 1354 1172 1172 1887 1029 2630 2958 165 2384 670 2791 2927 2751 3072 709 2069 2269 31 685 1279 930 1283 503 1623 498 2321 1737 1440 1440 50 1958 1168 377 40 2363 2363 1959 2324 1843 733 733 2303 2480 2001 2001 33 2354 1513 2588 595 663 2...\", \"output\": [\"2009\"]}, {\"input\": \"80 80\\r\\n614 2692 2440 490 679 1431 57 2208 2794 884 2230 776 675 2700 185 130 890 1500 253 1344 744 2209 2105 1113 2368 2594 742 1686 701 2942 1463 2429 409 409 2420 3043 1593 3070 2513 2686 2134 2134 159 2136 122 2646 2972 1094 904 904 755 791 2393 2866 5...\", \"output\": [\"2126\"]}]"} {"prob_desc_description":"Iahub got bored, so he invented a game to be played on paper. He writes n integers a1,\u2009a2,\u2009...,\u2009an. Each of those integers can be either 0 or 1. He's allowed to do exactly one move: he chooses two indices i and j (1\u2009\u2264\u2009i\u2009\u2264\u2009j\u2009\u2264\u2009n) and flips all values ak for which their positions are in range [i,\u2009j] (that is i\u2009\u2264\u2009k\u2009\u2264\u2009j). Flip the value of x means to apply operation x\u2009=\u20091 - x.The goal of the game is that after exactly one move to obtain the maximum number of ones. Write a program to solve the little game of Iahub.","prob_desc_output_spec":"Print an integer \u2014 the maximal number of 1s that can be obtained after exactly one move. ","lang_cluster":"","src_uid":"9b543e07e805fe1dd8fa869d5d7c8b99","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force","dp","implementation"],"prob_desc_created_at":"1372941000","prob_desc_sample_inputs":"[\"5\\n1 0 0 1 0\", \"4\\n1 0 0 1\"]","prob_desc_notes":"NoteIn the first case, flip the segment from 2 to 5 (i\u2009=\u20092,\u2009j\u2009=\u20095). That flip changes the sequence, it becomes: [1 1 1 0 1]. So, it contains four ones. There is no way to make the whole sequence equal to [1 1 1 1 1].In the second case, flipping only the second and the third element (i\u2009=\u20092,\u2009j\u2009=\u20093) will turn all numbers into 1.","exec_outcome":"","difficulty":1200.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line of the input contains an integer n (1\u2009\u2264\u2009n\u2009\u2264\u2009100). In the second line of the input there are n integers: a1,\u2009a2,\u2009...,\u2009an. It is guaranteed that each of those n values is either 0 or 1.","prob_desc_sample_outputs":"[\"4\", \"4\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"5\\r\\n1 0 0 1 0\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"4\\r\\n1 0 0 1\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"1\\r\\n1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1\\r\\n0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"8\\r\\n1 0 0 0 1 0 0 0\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"18\\r\\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\\r\\n\", \"output\": [\"18\"]}, {\"input\": \"23\\r\\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\\r\\n\", \"output\": [\"22\"]}, {\"input\": \"100\\r\\n0 1 0 1 1 1 0 1 0 1 0 0 1 1 1 1 0 0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 1 0 0 0 1 1 1 1 0 0 1 1 1 0 0 1 1 0 1 1 1 0 0 0 1 0 0 0 0 0 1 1 0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1\\r\\n\", \"output\": [\"70\"]}, {\"input\": \"100\\r\\n0 1 1 0 1 0 0 1 0 0 0 1 1 0 0 0 1 1 1 0 1 0 0 0 0 0 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 0 1 0 1 1 0 0 1 1 0 0 1 1 1 0 0 1 0 0 1 1 0 1 0 0 1 1 0 1 0 0 1 1 0 0 0 0 1 0 0 0 0 1 1 1 1\\r\\n\", \"output\": [\"60\"]}, {\"input\": \"18\\r\\n0 1 0 1 0 1 0 1 0 1 1 0 1 1 0 1 1 0\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"25\\r\\n0 1 0 0 0 0 0 1 0 1 0 1 0 0 0 0 1 1 1 0 0 1 1 0 1\\r\\n\", \"output\": [\"18\"]}, {\"input\": \"55\\r\\n0 0 1 1 0 0 0 1 0 1 1 0 1 1 1 0 1 1 1 1 1 0 0 1 0 0 1 0 1 1 0 0 1 0 1 1 0 1 1 1 1 0 1 1 0 0 0 0 1 1 0 1 1 1 1\\r\\n\", \"output\": [\"36\"]}, {\"input\": \"75\\r\\n1 1 0 1 0 1 1 0 0 0 0 0 1 1 1 1 1 0 1 0 1 0 0 0 0 1 1 1 0 1 0 0 1 1 0 1 0 0 1 1 0 1 0 1 0 1 0 0 0 0 1 0 0 1 1 1 0 0 1 0 1 1 0 0 0 0 1 1 0 0 0 1 0 0 0\\r\\n\", \"output\": [\"44\"]}, {\"input\": \"100\\r\\n0 0 1 0 1 0 0 1 1 0 1 1 0 1 0 1 1 0 0 0 0 0 1 0 0 1 1 0 0 0 1 0 0 1 1 0 0 1 1 1 0 0 0 0 1 0 1 1 1 0 0 1 0 1 1 1 1 1 1 1 0 1 0 1 0 0 1 0 1 1 1 0 0 0 0 1 0 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 0 0 1 1 0 1 0 1\\r\\n\", \"output\": [\"61\"]}, {\"input\": \"100\\r\\n0 0 0 1 0 0 0 1 0 1 1 0 1 1 1 1 1 0 1 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 1 1 0 1 1 0 1 1 1 1 0 1 0 0 1 0 1 0 0 0 0 1 1 0 0 1 0 0 1 1 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 1 0 0 1 0 1 1 1 0 1 1 0\\r\\n\", \"output\": [\"61\"]}, {\"input\": \"100\\r\\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\\r\\n\", \"output\": [\"100\"]}, {\"input\": \"100\\r\\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\\r\\n\", \"output\": [\"99\"]}, {\"input\": \"100\\r\\n0 0 1 1 1 0 1 1 0 0 1 0 1 0 1 0 0 1 0 1 1 0 0 1 1 1 1 1 1 0 1 0 0 1 0 0 0 0 1 1 1 0 1 1 1 0 1 1 1 0 0 1 0 0 1 1 0 0 0 1 1 1 0 1 1 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 1 1 1 0 1 1 1 0 1 1 1 1 1 0 0 0 0 1 0\\r\\n\", \"output\": [\"61\"]}, {\"input\": \"100\\r\\n0 1 1 1 1 1 1 0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 1 1 1 0 0 0 1 1 1 0 1 0 0 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 1 0 1 0 0 0 0 1 0 1 0 1 0 0 1 0 1 0 1 1 0 0 0 0 0 1 1 1 0 1 1 0 1 1 0 0 0 1 0 1 1 0 0 0 0 0 0 1\\r\\n\", \"output\": [\"59\"]}, {\"input\": \"99\\r\\n1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 0 0 0 0 1 1 0 0 1 0 1 1 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 1 0 1 0 0 1 1 0 1 0 0 0 1 1 1 1 0 1 1 1 0 0 1 1 0 0 0 0 1 0 0 0 0 0 1 0 1 1 1\\r\\n\", \"output\": [\"61\"]}, {\"input\": \"2\\r\\n1 1\\r\\n\", \"output\": [\"1\"]}]"} {"prob_desc_description":"Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three integers x1,\u2009x2,\u2009x3 and three more integers y1,\u2009y2,\u2009y3, such that x1\u2009<\u2009x2\u2009<\u2009x3, y1\u2009<\u2009y2\u2009<\u2009y3 and the eight point set consists of all points (xi,\u2009yj) (1\u2009\u2264\u2009i,\u2009j\u2009\u2264\u20093), except for point (x2,\u2009y2).You have a set of eight points. Find out if Gerald can use this set?","prob_desc_output_spec":"In a single line print word \"respectable\", if the given set of points corresponds to Gerald's decency rules, and \"ugly\" otherwise.","lang_cluster":"","src_uid":"f3c96123334534056f26b96f90886807","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["sortings"],"prob_desc_created_at":"1374913800","prob_desc_sample_inputs":"[\"0 0\\n0 1\\n0 2\\n1 0\\n1 2\\n2 0\\n2 1\\n2 2\", \"0 0\\n1 0\\n2 0\\n3 0\\n4 0\\n5 0\\n6 0\\n7 0\", \"1 1\\n1 2\\n1 3\\n2 1\\n2 2\\n2 3\\n3 1\\n3 2\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":1400.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The input consists of eight lines, the i-th line contains two space-separated integers xi and yi (0\u2009\u2264\u2009xi,\u2009yi\u2009\u2264\u2009106). You do not have any other conditions for these points.","prob_desc_sample_outputs":"[\"respectable\", \"ugly\", \"ugly\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"0 0\\r\\n0 1\\r\\n0 2\\r\\n1 0\\r\\n1 2\\r\\n2 0\\r\\n2 1\\r\\n2 2\\r\\n\", \"output\": [\"respectable\"]}, {\"input\": \"0 0\\r\\n1 0\\r\\n2 0\\r\\n3 0\\r\\n4 0\\r\\n5 0\\r\\n6 0\\r\\n7 0\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"1 1\\r\\n1 2\\r\\n1 3\\r\\n2 1\\r\\n2 2\\r\\n2 3\\r\\n3 1\\r\\n3 2\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"0 0\\r\\n0 0\\r\\n0 0\\r\\n0 0\\r\\n0 0\\r\\n0 0\\r\\n0 0\\r\\n0 0\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"1000000 1000000\\r\\n1000000 999999\\r\\n1000000 999998\\r\\n999999 1000000\\r\\n999999 999998\\r\\n999998 1000000\\r\\n999998 999999\\r\\n999998 999998\\r\\n\", \"output\": [\"respectable\"]}, {\"input\": \"0 0\\r\\n1 0\\r\\n0 1\\r\\n1 1\\r\\n0 2\\r\\n1 2\\r\\n0 3\\r\\n1 3\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"0 0\\r\\n2 1\\r\\n1 0\\r\\n0 2\\r\\n2 2\\r\\n1 0\\r\\n2 1\\r\\n0 2\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"791649 383826\\r\\n10864 260573\\r\\n504506 185571\\r\\n899991 511500\\r\\n503197 876976\\r\\n688727 569035\\r\\n343255 961333\\r\\n439355 759581\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"750592 335292\\r\\n226387 434036\\r\\n299976 154633\\r\\n593197 600998\\r\\n62014 689355\\r\\n566268 571630\\r\\n381455 222817\\r\\n50555 288617\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"716334 42808\\r\\n211710 645370\\r\\n515258 96837\\r\\n14392 766713\\r\\n439265 939607\\r\\n430602 918570\\r\\n845044 187545\\r\\n957977 441674\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"337873 813442\\r\\n995185 863182\\r\\n375545 263618\\r\\n310042 130019\\r\\n358572 560779\\r\\n305725 729179\\r\\n377381 267545\\r\\n41376 312626\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"803784 428886\\r\\n995691 328351\\r\\n211844 386054\\r\\n375491 74073\\r\\n692402 660275\\r\\n366073 536431\\r\\n485832 941417\\r\\n96032 356022\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"999231 584954\\r\\n246553 267441\\r\\n697080 920011\\r\\n173593 403511\\r\\n58535 101909\\r\\n131124 924182\\r\\n779830 204560\\r\\n684576 533111\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"666888 741208\\r\\n685852 578759\\r\\n211123 826453\\r\\n244759 601804\\r\\n670436 748132\\r\\n976425 387060\\r\\n587850 804554\\r\\n430242 805528\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"71768 834717\\r\\n13140 834717\\r\\n13140 991083\\r\\n880763 386898\\r\\n71768 386898\\r\\n880763 991083\\r\\n880763 834717\\r\\n13140 386898\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"941532 913025\\r\\n941532 862399\\r\\n686271 913025\\r\\n686271 862399\\r\\n686271 461004\\r\\n941532 461004\\r\\n908398 862399\\r\\n908398 913025\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"251515 680236\\r\\n761697 669947\\r\\n251515 669947\\r\\n761697 680236\\r\\n251515 476629\\r\\n761697 476629\\r\\n453296 669947\\r\\n453296 476629\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"612573 554036\\r\\n195039 655769\\r\\n472305 655769\\r\\n612573 655769\\r\\n195039 160740\\r\\n472305 160740\\r\\n472305 554036\\r\\n612573 160740\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"343395 788566\\r\\n171702 674699\\r\\n171702 788566\\r\\n971214 788566\\r\\n343395 9278\\r\\n971214 9278\\r\\n343395 674699\\r\\n971214 674699\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"38184 589856\\r\\n281207 447136\\r\\n281207 42438\\r\\n38184 42438\\r\\n38184 447136\\r\\n880488 589856\\r\\n281207 589856\\r\\n880488 42438\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"337499 89260\\r\\n337499 565883\\r\\n603778 89260\\r\\n603778 565883\\r\\n234246 89260\\r\\n603778 17841\\r\\n337499 17841\\r\\n234246 17841\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"180952 311537\\r\\n180952 918548\\r\\n126568 918548\\r\\n180952 268810\\r\\n732313 918548\\r\\n126568 311537\\r\\n126568 268810\\r\\n732313 311537\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"323728 724794\\r\\n265581 165113\\r\\n323728 146453\\r\\n265581 146453\\r\\n591097 146453\\r\\n265581 724794\\r\\n323728 165113\\r\\n591097 165113\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"642921 597358\\r\\n922979 597358\\r\\n127181 616833\\r\\n642921 828316\\r\\n922979 828316\\r\\n127181 597358\\r\\n922979 616833\\r\\n127181 828316\\r\\n\", \"output\": [\"respectable\"]}, {\"input\": \"69586 260253\\r\\n74916 203798\\r\\n985457 203798\\r\\n74916 943932\\r\\n985457 943932\\r\\n69586 943932\\r\\n985457 260253\\r\\n69586 203798\\r\\n\", \"output\": [\"respectable\"]}, {\"input\": \"57930 637387\\r\\n883991 573\\r\\n57930 573\\r\\n57930 499963\\r\\n399327 573\\r\\n399327 637387\\r\\n883991 637387\\r\\n883991 499963\\r\\n\", \"output\": [\"respectable\"]}, {\"input\": \"52820 216139\\r\\n52820 999248\\r\\n290345 216139\\r\\n290345 999248\\r\\n308639 216139\\r\\n308639 999248\\r\\n52820 477113\\r\\n308639 477113\\r\\n\", \"output\": [\"respectable\"]}, {\"input\": \"581646 464672\\r\\n493402 649074\\r\\n581646 649074\\r\\n214619 649074\\r\\n581646 252709\\r\\n214619 252709\\r\\n214619 464672\\r\\n493402 252709\\r\\n\", \"output\": [\"respectable\"]}, {\"input\": \"787948 77797\\r\\n421941 615742\\r\\n421941 77797\\r\\n400523 77797\\r\\n400523 111679\\r\\n787948 615742\\r\\n400523 615742\\r\\n787948 111679\\r\\n\", \"output\": [\"respectable\"]}, {\"input\": \"583956 366985\\r\\n759621 567609\\r\\n756846 567609\\r\\n759621 176020\\r\\n583956 567609\\r\\n583956 176020\\r\\n759621 366985\\r\\n756846 176020\\r\\n\", \"output\": [\"respectable\"]}, {\"input\": \"0 50000\\r\\n0 0\\r\\n0 1000000\\r\\n50000 0\\r\\n50000 1000000\\r\\n1000000 0\\r\\n1000000 50000\\r\\n1000000 1000000\\r\\n\", \"output\": [\"respectable\"]}, {\"input\": \"0 8\\r\\n0 9\\r\\n0 10\\r\\n1 8\\r\\n3 8\\r\\n3 8\\r\\n3 9\\r\\n3 10\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"0 1\\r\\n0 1\\r\\n0 2\\r\\n1 1\\r\\n1 2\\r\\n2 1\\r\\n2 1\\r\\n2 2\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"1 2\\r\\n1 3\\r\\n1 4\\r\\n2 2\\r\\n2 4\\r\\n4 2\\r\\n4 2\\r\\n4 4\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"0 0\\r\\n0 1\\r\\n0 2\\r\\n0 0\\r\\n1 2\\r\\n2 0\\r\\n2 1\\r\\n2 2\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"0 0\\r\\n0 0\\r\\n0 0\\r\\n1 1\\r\\n1 1\\r\\n2 2\\r\\n2 2\\r\\n2 2\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"0 0\\r\\n0 0\\r\\n0 2\\r\\n1 1\\r\\n1 2\\r\\n2 0\\r\\n2 1\\r\\n2 2\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"0 0\\r\\n0 1\\r\\n0 3\\r\\n1 0\\r\\n1 3\\r\\n2 0\\r\\n2 2\\r\\n2 3\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"0 0\\r\\n0 1\\r\\n0 2\\r\\n1 0\\r\\n1 2\\r\\n3 0\\r\\n3 1\\r\\n3 2\\r\\n\", \"output\": [\"respectable\"]}, {\"input\": \"1 1\\r\\n1 2\\r\\n1 5\\r\\n2 1\\r\\n2 5\\r\\n5 1\\r\\n5 2\\r\\n5 5\\r\\n\", \"output\": [\"respectable\"]}, {\"input\": \"1 1\\r\\n1 2\\r\\n1 2\\r\\n2 3\\r\\n2 1\\r\\n3 3\\r\\n3 1\\r\\n3 3\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"0 0\\r\\n0 0\\r\\n1 0\\r\\n0 1\\r\\n2 1\\r\\n1 2\\r\\n2 2\\r\\n2 2\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"1 1\\r\\n1 1\\r\\n1 3\\r\\n2 1\\r\\n2 3\\r\\n3 2\\r\\n3 2\\r\\n3 3\\r\\n\", \"output\": [\"ugly\"]}, {\"input\": \"1 0\\r\\n1 0\\r\\n1 0\\r\\n2 3\\r\\n2 3\\r\\n3 4\\r\\n3 4\\r\\n3 4\\r\\n\", \"output\": [\"ugly\"]}]"} {"prob_desc_description":"Iahub and his friend Floyd have started painting a wall. Iahub is painting the wall red and Floyd is painting it pink. You can consider the wall being made of a very large number of bricks, numbered 1, 2, 3 and so on. Iahub has the following scheme of painting: he skips x\u2009-\u20091 consecutive bricks, then he paints the x-th one. That is, he'll paint bricks x, 2\u00b7x, 3\u00b7x and so on red. Similarly, Floyd skips y\u2009-\u20091 consecutive bricks, then he paints the y-th one. Hence he'll paint bricks y, 2\u00b7y, 3\u00b7y and so on pink.After painting the wall all day, the boys observed that some bricks are painted both red and pink. Iahub has a lucky number a and Floyd has a lucky number b. Boys wonder how many bricks numbered no less than a and no greater than b are painted both red and pink. This is exactly your task: compute and print the answer to the question. ","prob_desc_output_spec":"Output a single integer \u2014 the number of bricks numbered no less than a and no greater than b that are painted both red and pink.","lang_cluster":"","src_uid":"c7aa8a95d5f8832015853cffa1374c48","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math"],"prob_desc_created_at":"1377876600","prob_desc_sample_inputs":"[\"2 3 6 18\"]","prob_desc_notes":"NoteLet's look at the bricks from a to b (a\u2009=\u20096,\u2009b\u2009=\u200918). The bricks colored in red are numbered 6, 8, 10, 12, 14, 16, 18. The bricks colored in pink are numbered 6, 9, 12, 15, 18. The bricks colored in both red and pink are numbered with 6, 12 and 18. ","exec_outcome":"","difficulty":1200.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The input will have a single line containing four integers in this order: x, y, a, b. (1\u2009\u2264\u2009x,\u2009y\u2009\u2264\u20091000, 1\u2009\u2264\u2009a,\u2009b\u2009\u2264\u20092\u00b7109, a\u2009\u2264\u2009b).","prob_desc_sample_outputs":"[\"3\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2 3 6 18\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"4 6 20 201\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"15 27 100 10000\\r\\n\", \"output\": [\"74\"]}, {\"input\": \"105 60 3456 78910\\r\\n\", \"output\": [\"179\"]}, {\"input\": \"1 1 1000 100000\\r\\n\", \"output\": [\"99001\"]}, {\"input\": \"3 2 5 5\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"555 777 1 1000000\\r\\n\", \"output\": [\"257\"]}, {\"input\": \"1000 1000 1 32323\\r\\n\", \"output\": [\"32\"]}, {\"input\": \"45 125 93451125 100000000\\r\\n\", \"output\": [\"5821\"]}, {\"input\": \"101 171 1 1000000000\\r\\n\", \"output\": [\"57900\"]}, {\"input\": \"165 255 69696 1000000000\\r\\n\", \"output\": [\"356482\"]}, {\"input\": \"555 777 666013 1000000000\\r\\n\", \"output\": [\"257229\"]}, {\"input\": \"23 46 123321 900000000\\r\\n\", \"output\": [\"19562537\"]}, {\"input\": \"321 123 15 1000000\\r\\n\", \"output\": [\"75\"]}, {\"input\": \"819 1000 9532 152901000\\r\\n\", \"output\": [\"186\"]}, {\"input\": \"819 1000 10000 1000000\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 1 1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 2 2 1000003\\r\\n\", \"output\": [\"500001\"]}, {\"input\": \"1 1 1 1000000000\\r\\n\", \"output\": [\"1000000000\"]}, {\"input\": \"10 15 69 195610342\\r\\n\", \"output\": [\"6520342\"]}, {\"input\": \"2 1 1 1000000000\\r\\n\", \"output\": [\"500000000\"]}, {\"input\": \"1000 1000 1 20\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 1 1 2000000000\\r\\n\", \"output\": [\"2000000000\"]}, {\"input\": \"1 2 1 2000000000\\r\\n\", \"output\": [\"1000000000\"]}, {\"input\": \"2 1 1 2000000000\\r\\n\", \"output\": [\"1000000000\"]}, {\"input\": \"2 3 1 1000000000\\r\\n\", \"output\": [\"166666666\"]}, {\"input\": \"2 3 1 2000000000\\r\\n\", \"output\": [\"333333333\"]}, {\"input\": \"3 7 1 1000000000\\r\\n\", \"output\": [\"47619047\"]}, {\"input\": \"1 1 1000000000 2000000000\\r\\n\", \"output\": [\"1000000001\"]}, {\"input\": \"2 2 1 2000000000\\r\\n\", \"output\": [\"1000000000\"]}, {\"input\": \"1 1 2 2000000000\\r\\n\", \"output\": [\"1999999999\"]}, {\"input\": \"3 2 1 2000000000\\r\\n\", \"output\": [\"333333333\"]}, {\"input\": \"1 1 2000000000 2000000000\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 3 7 7\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3 3 3 7\\r\\n\", \"output\": [\"2\"]}]"} {"prob_desc_description":"Mad scientist Mike is busy carrying out experiments in chemistry. Today he will attempt to join three atoms into one molecule.A molecule consists of atoms, with some pairs of atoms connected by atomic bonds. Each atom has a valence number \u2014 the number of bonds the atom must form with other atoms. An atom can form one or multiple bonds with any other atom, but it cannot form a bond with itself. The number of bonds of an atom in the molecule must be equal to its valence number. Mike knows valence numbers of the three atoms. Find a molecule that can be built from these atoms according to the stated rules, or determine that it is impossible.","prob_desc_output_spec":"If such a molecule can be built, print three space-separated integers \u2014 the number of bonds between the 1-st and the 2-nd, the 2-nd and the 3-rd, the 3-rd and the 1-st atoms, correspondingly. If there are multiple solutions, output any of them. If there is no solution, print \"Impossible\" (without the quotes).","lang_cluster":"","src_uid":"b3b986fddc3770fed64b878fa42ab1bc","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force","math","graphs"],"prob_desc_created_at":"1379172600","prob_desc_sample_inputs":"[\"1 1 2\", \"3 4 5\", \"4 1 1\"]","prob_desc_notes":"NoteThe first sample corresponds to the first figure. There are no bonds between atoms 1 and 2 in this case.The second sample corresponds to the second figure. There is one or more bonds between each pair of atoms.The third sample corresponds to the third figure. There is no solution, because an atom cannot form bonds with itself.The configuration in the fourth figure is impossible as each atom must have at least one atomic bond.","exec_outcome":"","difficulty":1200.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The single line of the input contains three space-separated integers a, b and c (1\u2009\u2264\u2009a,\u2009b,\u2009c\u2009\u2264\u2009106) \u2014 the valence numbers of the given atoms.","prob_desc_sample_outputs":"[\"0 1 1\", \"1 3 2\", \"Impossible\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"1 1 2\\r\\n\", \"output\": [\"0 1 1\"]}, {\"input\": \"3 4 5\\r\\n\", \"output\": [\"1 3 2\"]}, {\"input\": \"4 1 1\\r\\n\", \"output\": [\"Impossible\"]}, {\"input\": \"1 1 1\\r\\n\", \"output\": [\"Impossible\"]}, {\"input\": \"1000000 1000000 1000000\\r\\n\", \"output\": [\"500000 500000 500000\"]}, {\"input\": \"3 11 8\\r\\n\", \"output\": [\"3 8 0\"]}, {\"input\": \"8 5 12\\r\\n\", \"output\": [\"Impossible\"]}, {\"input\": \"1000000 500000 1\\r\\n\", \"output\": [\"Impossible\"]}, {\"input\": \"1000000 500000 2\\r\\n\", \"output\": [\"Impossible\"]}, {\"input\": \"2 2 2\\r\\n\", \"output\": [\"1 1 1\"]}, {\"input\": \"3 3 3\\r\\n\", \"output\": [\"Impossible\"]}, {\"input\": \"4 4 4\\r\\n\", \"output\": [\"2 2 2\"]}, {\"input\": \"2 4 2\\r\\n\", \"output\": [\"2 2 0\"]}, {\"input\": \"10 5 14\\r\\n\", \"output\": [\"Impossible\"]}, {\"input\": \"10 5 15\\r\\n\", \"output\": [\"0 5 10\"]}, {\"input\": \"10 4 16\\r\\n\", \"output\": [\"Impossible\"]}, {\"input\": \"3 3 6\\r\\n\", \"output\": [\"0 3 3\"]}, {\"input\": \"9 95 90\\r\\n\", \"output\": [\"7 88 2\"]}, {\"input\": \"3 5 8\\r\\n\", \"output\": [\"0 5 3\"]}, {\"input\": \"5 8 13\\r\\n\", \"output\": [\"0 8 5\"]}, {\"input\": \"6 1 5\\r\\n\", \"output\": [\"1 0 5\"]}, {\"input\": \"59 54 56\\r\\n\", \"output\": [\"Impossible\"]}, {\"input\": \"246 137 940\\r\\n\", \"output\": [\"Impossible\"]}, {\"input\": \"7357 3578 9123\\r\\n\", \"output\": [\"906 2672 6451\"]}, {\"input\": \"93952 49553 83405\\r\\n\", \"output\": [\"30050 19503 63902\"]}, {\"input\": \"688348 726472 442198\\r\\n\", \"output\": [\"486311 240161 202037\"]}, {\"input\": \"602752 645534 784262\\r\\n\", \"output\": [\"232012 413522 370740\"]}, {\"input\": \"741349 48244 642678\\r\\n\", \"output\": [\"Impossible\"]}, {\"input\": \"655754 418251 468390\\r\\n\", \"output\": [\"Impossible\"]}, {\"input\": \"310703 820961 326806\\r\\n\", \"output\": [\"Impossible\"]}, {\"input\": \"1 1 3\\r\\n\", \"output\": [\"Impossible\"]}, {\"input\": \"5 1 4\\r\\n\", \"output\": [\"1 0 4\"]}]"} {"prob_desc_description":"In mathematics, a subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements. For example, the sequence BDF is a subsequence of ABCDEF. A substring of a string is a continuous subsequence of the string. For example, BCD is a substring of ABCDEF.You are given two strings s1, s2 and another string called virus. Your task is to find the longest common subsequence of s1 and s2, such that it doesn't contain virus as a substring.","prob_desc_output_spec":"Output the longest common subsequence of s1 and s2 without virus as a substring. If there are multiple answers, any of them will be accepted. If there is no valid common subsequence, output 0.","lang_cluster":"","src_uid":"391c2abbe862139733fcb997ba1629b8","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"512 megabytes","file_name":"prog_syn_val.jsonl","tags":["dp","strings"],"prob_desc_created_at":"1379691000","prob_desc_sample_inputs":"[\"AJKEQSLOBSROFGZ\\nOVGURWZLWVLUXTH\\nOZ\", \"AA\\nA\\nA\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":2000.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"3 seconds","prob_desc_input_spec":"The input contains three strings in three separate lines: s1, s2 and virus (1\u2009\u2264\u2009|s1|,\u2009|s2|,\u2009|virus|\u2009\u2264\u2009100). Each string consists only of uppercase English letters.","prob_desc_sample_outputs":"[\"ORZ\", \"0\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"AJKEQSLOBSROFGZ\\r\\nOVGURWZLWVLUXTH\\r\\nOZ\\r\\n\", \"output\": [\"OGZ\", \"ORZ\"]}, {\"input\": \"AA\\r\\nA\\r\\nA\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"PWBJTZPQHA\\r\\nZJMKLWSROQ\\r\\nUQ\\r\\n\", \"output\": [\"WQ\", \"ZQ\"]}, {\"input\": \"QNHRPFYMAAPJDUHBAEXNEEZSTMYHVGQPYKNMVKMBVSVLIYGUVMJHEFLJEPIWFHSLISTGOKRXNMSCXYKMAXBPKCOCNTIRPCUEPHXM\\r\\nRRFCZUGFDRKKMQTOETNELXMEWGOCDHFKIXOPVHHEWTCDNXVFKFKTKNWKEIKTCMHMHDNCLLVQSGKHBCDDYVVVQIRPZEOPUGQUGRHH\\r\\nR\\r\\n\", \"output\": [\"FUENEMGKIVHEFEIHLSGKBCIPEPH\", \"FDENEMGKIVHEWFTKNMCKBCIPEPH\", \"FMENEEHKIVHEFEIHLSGKCYPOPUH\", \"QNHFPHEXNETMHMHLLSGKCYPOPUH\", \"QNHFPHETVKNKMMHLLSGKBCIPEPH\", \"FDENEMGKIVHEFEIHLSGKCYPOPUH\"]}, {\"input\": \"CGPWTAPEVBTGANLCLVSHQIIKHDPVUHRSQPXHSNYAHPGBECICFQYDFRTRELLLEDZYWJSLOBSKDGRRDHNRRGIXAMEBGFJJTEIGUGRU\\r\\nHAWYVKRRBEIWNOGYMIYQXDCFXMMCSAYSOXQFHHIFRRCJRAWHLDDHHHAKHXVKCVPBFGGEXUKWTFWMOUUGMXTSBUTHXCJCWHCQQTYQ\\r\\nANKFDWLYSX\\r\\n\", \"output\": [\"WVBGIQXSYHIFRRWLDDHXBGEUGU\", \"WVBNIQXSYHIFRRJLDDHXBFGUGU\", \"AVBIIQXSAHIFRRWLDDHXBFGUGU\", \"WVBGCSSQHHIFRRWLDDHXBGFUGU\", \"AVBNIQXSAHIFRRJLDDHABFGUGU\", \"WVBNIDXSYHIFRRWLDDHXBGFUGU\"]}, {\"input\": \"AUNBEKNURNUPHXQYKUTAHCOLMPRQZZTVDUYCTNIRACQQTQAIDTAWJXBUTIZUASDIJZWLHAQVGCAHKTZMXSDVVWAIGQEALRFKFYTT\\r\\nQBVRFKPKLYZLYNRFTRJZZQEYAEKPFXVICUVFVQSDENBJYYNCFTOZHULSWJQTNELYLKCZTGHOARDCFXBXQGGSQIVUCJVNGFZEEZQE\\r\\nN\\r\\n\", \"output\": [\"BKPYTRZZVICQDJTZUSJZHAQGSVVGQE\", \"BRPKLZYTRQAXIUSDJZWLHACXSVVGQE\", \"BRPKLRZZYACQDBTZUSWLHACXSVVGQE\", \"BRPKLRZZYICQDJTZUSJZHAQGSVVGQE\", \"BKPKLRZZVICQDJTZUSJZHAQGSVVGQE\"]}, {\"input\": \"BGIIURZTEUJJULBWKHDQBRFGEUOMQSREOTILICRSBUHBGTSRDHKVDDEBVHGMHXUVFJURSMFDJOOOWCYPJDVRVKLDHICPNKTBFXDJ\\r\\nXOADNTKNILGNHHBNFYNDWUNXBGDFUKUVHLPDOGOYRMOTAQELLRMHFAQEOXFWGAQUROVUSWOAWFRVIRJQVXPCXLSCQLCUWKBZUFQP\\r\\nYVF\\r\\n\", \"output\": [\"TLBWKHDGOROTLRHEGUVUSOWVRVLCKBF\", \"ILBWKHDGOMQELRHEGUVUSOWVRVLCKBF\", \"TLBWKHDGOROTLRMHXFUROOWVRVLCKBF\", \"TLBWKHDGOROTLRMHXFURSOWVRVLCKBF\"]}, {\"input\": \"AXBPBDEYIYKKCZBTLKBUNEQLCXXLKIUTOOATYDXYYQCLFAXAEIGTFMNTTQKCQRMEEFRYVYXAOLMUQNPJBMFBUGVXFZAJSBXWALSI\\r\\nVWFONLLKSHGHHQSFBBFWTXAITPUKNDANOCLMNFTAAMJVDLXYPILPCJCFWTNBQWEOMMXHRYHEGBJIVSXBBGQKXRIYNZFIWSZPPUUM\\r\\nPPKKLHXWWT\\r\\n\", \"output\": [\"BBITKNCLTADXYCFTNQMRYVXBBGXFWS\", \"BBITUNCLTADXYLFTNQERYVXBBGXZWS\", \"BBITKNCLTADXYCFTNQMRYVXBBGXZWS\"]}, {\"input\": \"XKTAOCPCVMIOGCQKPENDKIZRZBZVRTBTGCDRQUIMVHABDIHSCGWPUTQKLPBOXAYICPWJBFLFSEPERGJZHRINEHQMYTOTKLCQCSMZ\\r\\nAITFIOUTUVZLSSIYWXSYTQMFLICCXOFSACHTKGPXRHRCGXFZXPYWKWPUOIDNEEZOKMOUYGVUJRQTIRQFCSBCWXVFCIAOLZDGENNI\\r\\nDBHOIORVCPNXCDOJKSYYIENQRJGZFHOWBYQIITMTVWXRMAMYILTHBBAJRJELWMIZOZBGPDGSTIRTQIILJRYICMUQTUAFKDYGECPY\\r\\n\", \"output\": [\"AITTUVSWTQLICFSPRGZINEMOTQCSZ\", \"TOVMIOCKGRHCGWPUOIEEGJRQTQCSZ\", \"TOVMIOCKPRRCGWPUOIEEGJRQTQCSZ\", \"AIITUVSWTQLICFSPRGZINEMYTQCSZ\", \"AIITUVSWTQLICFSPRHRINEMYTQCSZ\"]}, {\"input\": \"UNGXODEEINVYVPHYVGSWPIPFMFLZJYRJIPCUSWVUDLLSLRPJJFWCUOYDUGXBRKWPARGLXFJCNNFUIGEZUCTPFYUIMQMJLQHTIVPO\\r\\nBWDEGORKXYCXIDWZKGFCUYIDYLTWLCDBUVHPAPFLIZPEUINQSTNRAOVYKZCKFWIJQVLSVCGLTCOEMAYRCDVVQWQENTWZALWUKKKA\\r\\nXDGPZXADAFCHKILONSXFGRHIQVMIYWUTJUPCCEKYQVYAENRHVWERJSNPVEMRYSZGYBNTQLIFKFISKZJQIQQGSKVGCNMPNIJDRTXI\\r\\n\", \"output\": [\"GODIYVHPPFLZPUSWVLSLCOYDWALU\", \"GODIYVHPPFLIPUSROYKFJCGTMQQT\", \"GXDIYVHPPFLIPUSROYKCFICTMQQT\", \"GODIYVHPPFLIPUSROYKCFICTMQQT\", \"GXDIYVHPPFLZPUSWVLSLCOYDWALU\", \"GXDIYVHPPFLZPUSROYKWGLCECQQT\"]}, {\"input\": \"KOROXDDWEUVYWJIXSFPEJFYZJDDUXISOFJTIFJSBTWIJQHMTQWLAGGMXTFALRXYCMGZNKYQRCDVTPRQDBAALTWAXTNLDPYWNSFKE\\r\\nNHZGRZFMFQGSAYOJTFKMMUPOOQXWCPPAIVRJHINJPHXTTBWRIYNOHMJKBBGXVXYZDBVBBTQRXTOFLBBCXGNICBKAAGOKAYCCJYCW\\r\\nXCXLBESCRBNKWYGFDZFKWYNLFAKEWWGRUIAQGNCFDQXCHDBEQDSWSNGVKUFOGGSPFFZWTXGZQMMFJXDWOPUEZCMZEFDHXTRJTNLW\\r\\n\", \"output\": [\"RFFYJUXIJIJTWIHMTQXTFLCGNCBAAAYW\", \"KOOXWVJIJXTBWIHMTQXTFLCGNCBAAAYW\", \"KOOXWVJIPXTBWIHMTQXTFLXGNCBAAAYW\", \"RFFYJUXIJIJTWIHMTQXTFLXGNCBAAAYW\", \"KOOXWVJIPXTBWIHMTQXTFLCGNCBAAAYW\"]}, {\"input\": \"ESQZPIRAWBTUZSOWLYKIYCHZJPYERRXPJANKPZVPEDCXCJIDTLCARMAOTZMHJVDJXRDNQRIIOFIUTALVSCKDUSAKANKKOFKWINLQ\\r\\nGKSTYEAXFJQQUTKPZDAKHZKXCJDONKBZOTYGLYQJOGKOYMYNNNQRRVAGARKBQYJRVYYPFXTIBJJYQUWJUGAUQZUVMUHXLIQWGRMP\\r\\nUFPHNRDXLNYRIIYVOFRKRUQCWAICQUUBPHHEGBCILXHHGLOBKADQVPSQCMXJRLIZQPSRLZJNZVQPIURDQUKNHVVYNVBYGXXXXJDI\\r\\n\", \"output\": [\"STYEXJKPZDXCJDTLOMVRQRFIUAVULQ\", \"STYEXJKPZDXCJDTLOMVRQRFIUAVUIQ\"]}, {\"input\": \"UAYQUMTSNGMYBORUYXJJQZVAGBRVDWUTGUYYYOTWAHVKGGOHADXULFUFQULSAGDWFJCSDKPWBROYZIFRGGRVZQMEHKHCKNHTQSMK\\r\\nSVKVTPUZOBRKGLEAAXMIUSRISOTDIFFUCODYGNYIPSWEEBHGNWRZETXSVVMQTRBVFZMYHOHUCMLBUXBMPMSNCSHFZTAFUVTMQFGL\\r\\nTNICVANBEBOQASUEJJAOJXWNMDGAAVYNHRPSMKGMXZDJHCZHFHRRMIDWUOQCZSBKDPLSGHNHFKFYDRGVKXOLPOOWBPOWSDFLEJVX\\r\\n\", \"output\": [\"SVVTUOKGAXUFFUCDPWBRZRVZMHHCNHTQ\", \"SVVTUOKGAXUSDFCDPWBRZRVZMHHCNHTQ\", \"SVVTUOKGAXUSDFCDPWBRZRVZMHHCNHTM\"]}, {\"input\": \"KEJHTOKHMKWTYSJEAJAXGADRHUKBCRHACSRDNSZIHTPQNLOSRKYBGYIIJDINTXRPMWSVMMBODAYPVVDDTIXGDIOMWUAKZVFKDAUM\\r\\nWTEVPIFAAJYIDTZSZKPPQKIOMHDZTKDMFVKSJRUFMNHZJPVSQYELWYAFACGGNRORSLGYVXAEYVLZBLDEHYDGOFDSWUYCXLXDKFSU\\r\\nTUZEQBWVBVTKETQ\\r\\n\", \"output\": [\"EJTKHMKSJRUNHPQLYGNRSVAYVDDGOWUKFU\", \"EJTOKMKSJRUHZPQLYGNRSVAYVDDGDWUKFU\", \"EJTOKMKSJRUNZPQLYGNRSVAYVDDGDWUKFU\", \"EJHTKMKSJRUHZPQLYGNRSVAYVDDGDWUKFU\"]}, {\"input\": \"EGQYYSKTFTURZNRDVIWBYXMRDGFWMYKFXGIFOGYJSXKDCJUAGZPVTYCHIXVFTVTCXMKHZFTXSMMQVFXZGKHCIYODDRZEYECDLKNG\\r\\nPEXXCTRFJAAKPOTBAEFRLDRZKORNMXHHXTLKMKCGPVPUOBELPLFQFXOBZWIVIQCHEJQPXKGSCQAWIMETCJVTAGXJIINTADDXJTKQ\\r\\nQURSEKPMSSEVQZI\\r\\n\", \"output\": [\"ETFTBRDKOXKCGPVFVCHQXKCIECDK\", \"EKTFRZRXMGFFXOZVCHXCMTVGIDDK\", \"ETFTBRDKOXKCGPVXVCHQXKCIECDK\", \"EKTFRZNXMGFFXIJXKCATCVTXTDDK\", \"EKTFRZNXMGFFXIJXKCATCVTXIDDK\"]}, {\"input\": \"ZFFBNYVXOZCJPSRAEACVPAUKVTCVZYQPHVENTKOCMHNIYYMIKKLNKHLWHHWAQMWFTSYEOQQFEYAAYGMPNZCRYBVNAQTDSLXZGBCG\\r\\nPIQHLNEWAMFAKGHBGZAWRWAXCSKUDZBDOCTXAHSVFZACXGFMDSYBYYDDNQNBEZCYCULSMMPBTQOJQNRPZTRCSDLIYPLVUGJPKDTG\\r\\nZBFJPLNAKWQBTUVJKMHVBATAM\\r\\n\", \"output\": [\"FBZRACKZOCHAFSYYYNZCYBQTSLGG\", \"FBZAACKZOCHAFSYYYNZCYBQTSLGG\", \"FBZRACKZOCHAMSYYYNZCYBNTDLGG\", \"FBZRACUZOCHAMSYYYNZCYBNTDLGG\"]}, {\"input\": \"BTWZLIKDACZVLCKMVTIQHLFBNRCBDSWPFFKGPCQFPTOIJLPFCDMFGQKFHTDFFCCULUAYPXXIIIWBZIDMOPNHPZBEXLVARJFTBFOE\\r\\nMDXYKKWZVASJPPWRCYNMRAOBBLUNBSMQAPCPSFAGLXWJRBQTBRWXYNQGWECYNFIAJXDMUHIIMDFMSHLPIMYQXNRRUSSNXALGNWIK\\r\\nKNFVBVAOWXMZVUHAVUDKDBUVAKNHACZBGBHMUOPHWGQSDFXLHB\\r\\n\", \"output\": [\"WZACMLNBSPFGCFIJDMHDFLPIMNXL\", \"WZACLMQLBRWGCFIJDMHDFLPIMNXL\", \"WZACMBNBSPFGQTIJDMHDFLPIMNXA\", \"WZVCMLNBSPFGCFIJDMHDFLPIMNXL\", \"WZACMLNBSPFGQTIJDMHDFLPIMNXL\", \"DZVCMBNBSPFGCFIJDMHDFLPIMNXA\"]}, {\"input\": \"GOZVMIRQIGYGVAGOREQTXFXPEZYOJOXPNDGAESICXHMKQDXQPRLMRVWHXFEJVCWZDLYMQLDURUXZPTLEHPTSKXGSNEQDKLVFFLDX\\r\\nIMEVFCZXACKRRJVXDRKFWTLTRTLQQDHEBZLCOCNVPABQMIWJHRLKFUKWOVVWGGNWCJNRYOYOAJFQWCLHQIQRBZTVWKBFOXKEHHQP\\r\\nSZ\\r\\n\", \"output\": [\"IEFZXACKRRVXFWLRTLHPKGNQLVFX\", \"IVARXFEZONAIHRLVWJWLQRZTKXEQ\", \"MVARXFEZOPAIHRLVWFCLQRZTKXEQ\"]}, {\"input\": \"BBYUVCIYLNUJPSEYCAAPQSDNSDDTNEHQZDPBEKQAWNAKEYFBNEEBGPDPRLCSVOWYDEDRPPEDOROCHRCNQUSPNVXGRXHNLKDETWQC\\r\\nBQCQXCAHADGJHBYIKEUWNXFUOOTVCCKJPJJCMWLAWWKSDGHFNZTCPSQNRTPCBLXDTSJLRHSCCZXQXCVLVGTROOUCUQASIQHZGNEI\\r\\nRYE\\r\\n\", \"output\": [\"BBYUVCJPCASDNZPQNBDRLVROOCQSGNE\", \"BBYINUJPCASDHZPQNPDRSVROOCUSHNE\", \"BBYINUJPCASDHZPQNPDLSVROOCUSHNE\", \"BBYUVCJPCASDNTPQNBDRLVROOCQSGNE\", \"BBYUVCJPCASDNTPQNBDLCVROOCQSGNE\"]}, {\"input\": \"WZRKLETJRBBRZKGHEFBVEFVLIERBPSEGJVSNUZUICONWWBOOTHCOJLLZFNOCNOFJQZTZWBLKHGIWWWPBUYWBAHYJGEBJZJDTNBGN\\r\\nZINFGDCNKHYFZYYWHTIHZTKWXXXMSWOVOPQDTRWSQKBWWCPEMYFVGARELELBLGEVJCMOCFTTUVCYUQUSFONAMWKVDWMGXVNZJBWH\\r\\nAFPA\\r\\n\", \"output\": [\"WZKTRKBEFVLEBGVCOTCFONWKWGZJB\", \"WZKTRBEFVELEBEJCOTCFONWKWGZJB\", \"WZKTRBEFVELEBGVCOTCFONWKWGZJB\", \"WZKTRKEFVELEBEJCOTCFONWKWGZJB\"]}, {\"input\": \"ABABABB\\r\\nABABABB\\r\\nABABB\\r\\n\", \"output\": [\"ABABAB\", \"ABBABB\"]}, {\"input\": \"ABBB\\r\\nABBB\\r\\nABB\\r\\n\", \"output\": [\"BBB\"]}, {\"input\": \"A\\r\\nBABAABAAABABABABABABAABABABABBABABABABAABBABBABAABABAABAABBAAAAAABBABABABABAABABAABABABABAABAABABABA\\r\\nB\\r\\n\", \"output\": [\"A\"]}, {\"input\": \"ABBAABAAABABAABAABABABABAABBBABABABAAABBABAAABABABABBABBABABAABABABABABABBABAABABAABABABAAABBABABABA\\r\\nA\\r\\nB\\r\\n\", \"output\": [\"A\"]}, {\"input\": \"ABBBABABABABABBABAABAAABABAABABABABBABAAAABABABBABAABABAAABAABBAAABAABABBABBABABBABAABABABAAAAABABAB\\r\\nB\\r\\nBABBABAABABABABABABABABABBAABABBABABBAAABAAABABBAABAABBABABBABABAABBABAABABBAABAABAABABABABABBABABAB\\r\\n\", \"output\": [\"B\"]}, {\"input\": \"AABABAABAAABABAAABAAAABBAAABABAAABABAABAABAAAABAABAAAABAAAABAAAABBAABAAAAABAAAAABABAAAAAABABAABAAAAA\\r\\nABAABABABAAABABAABABBAABAABAABABAABABAAABBAABAAAABABABAAAAABAAAAABABABABAABAABAABAABABAABABAABAABAAB\\r\\nBABAAABABBAABABAABAA\\r\\n\", \"output\": [\"AABABABAAABABAAABAAAABAABABAABABAABAABAAAABAABAAAABAAAABAAABAABAAAABAABABAABABAABAAAA\", \"ABAABABABAAABAAAABBAABAAAABABAABABAAABAABAAAABAAAAAAABAAAAAAABAAAAABAAAAAAABABAABAAAA\", \"AABABABAAABABAAABAAAABAABABAAABAAABAABAAAABAABAAAABAAAABAAABAABAAAABAABABAABABAABAAAA\", \"ABAABABABAAABAAAABBAAAABAABABAABABAAABAABAAAABAABAAAAABAAAAABAAAAABABAAAAAABABAABAAAA\", \"AABABABAAABABAABABBAABABAABABAABABAAABAABAAAABABAAAAAABAAAAABAAAAABABAAAAAABABAABAAAA\", \"ABAABABABAAABAAAABBAAAABAABABAABABAAABAABAAAABAAAAAAABAAAAAAABAAAAABABAAAAABABAABAAAA\", \"ABAABABABAAABAAAABBAABABAABABAABABAAABAABAAAABABAAAAAABAAAAABAAAAABABAAAAAABABAABAAAA\", \"ABAABABABAAABAAAABBAABAAAABABAABABAAABAABAAAABAABAAAABAAAAAAABAAAAABAAAAAAABABAABAAAA\"]}, {\"input\": \"AABABABABAAAABBAAAABABABABAAAAABABAAAA\\r\\nAABABAAABABABAAABAAAAABAAABAAABABABBBABBAAABAABAAAAABABBABAAABAABAABABAAAABABAAABAAABAABABBBABBABABA\\r\\nAAAAA\\r\\n\", \"output\": [\"AABABABABAAAABBAAAABABABABAAAABABAAAA\"]}, {\"input\": \"ZZXXAAZZAXAAZZAZZXXAAZZAXAXZZXXAAZZZZXXAZZXXAAAZZXXAAAZZXXZZXXXAAAZZXZZXXAZZXXZXXAAXAAZZZXXAXAXAZZXZ\\r\\nAZZXXAAZZXXAAXZXXAZZXAZZXZZXXAAZZXXAAZAAZZAAZZXXAA\\r\\nAAZZXAAXXAAAZZXXAZZXXAAZZXXAAAZZXXZ\\r\\n\", \"output\": [\"ZZXXAAZZXXAAXZXXAZZXAZZXZZXXAAZZXXAAZAZZAAZZXXAA\", \"ZZXXAAZZXXAAXZXXAZZXAZZXZZXXAAZZXXAAAAZZAAZZXXAA\", \"AZZXAAZZXXAAXZXXAZZXAZZXZZXXAAZZXXAAZAZZAAZZXXAA\"]}, {\"input\": \"SDASSDADASDASDASDSDADASASDAAASDASDDASDDASDADASDASDSSDASDD\\r\\nSDASDASDDASDASDASDSDSDASDASDASDASDASDASDASDADASDASDASDSDASDASDDDASSD\\r\\nSDASDSDDAA\\r\\n\", \"output\": [\"SDASSDADASDASDSDSDADASASDAAASDASDDASDDASDDASDASDDASD\", \"SDASSDDASDASDASDSDDASASDAASDASDDASDDASDADASDSDSSDASD\", \"SDASDADASDASDASDSDADASASDASDASDASDASDADASDASDSSDASDD\", \"SDASSDDASDASDASDSDDASASDAASDASDDASDDASDADASDSDSDASDD\", \"SDASDADASDASDASDSDADASASDAASDASDASDDASDADASDASDSDASD\", \"SDASDADASDASDASDSDDASASDAASDASDDASDDASDADASDSDSSDASD\", \"SDASDADASDASDASDSDDASASDASDASDASDDASDADASDASDSSDASDD\"]}, {\"input\": \"DASSDASDASDDAASDASDADASDASASDAS\\r\\nSDADASDASSDAASDASDASDADASSDDA\\r\\nSD\\r\\n\", \"output\": [\"DADADADAADADADADASSA\", \"DADASASAASASADADASSA\"]}, {\"input\": \"ASDASSDASDS\\r\\nDASDASDDDASDADASDASDASDASSDADASDDAASDA\\r\\nDSD\\r\\n\", \"output\": [\"ASDASSDASDS\"]}, {\"input\": \"ASDASASDASDASDAASDASDASDASASDDAASDASSASDSDAD\\r\\nDASDASSSDASDASDASASDASSDAASDASSDDSASDASDAASDDAASDASDAASDASDDASDASDASDASDASS\\r\\nDASD\\r\\n\", \"output\": [\"ASDASASDASASDAASDASASDASASDDAASDASSASDSDAD\"]}, {\"input\": \"DASDSDASDADASDDDSDASSDDAASDA\\r\\nDASDDASDSDADSDASDADSDSDADDASDASDDASDASDASDSDASD\\r\\nDAASD\\r\\n\", \"output\": [\"DASDSDASDADASDDDSDASSDDASDA\"]}, {\"input\": \"ABAAAABABADABAABAABCCABADABACABACABCABADABADABACABBACAADABACABABACABADABACABABA\\r\\nBACAACABABABACABCABADABAACABADABACABAA\\r\\nABBAB\\r\\n\", \"output\": [\"BACAACABABABACABCAADABAACABADABACABAA\", \"BACAACABABABACABCABAABAACABADABACABAA\", \"BAAACABABABACABCABADABAACABADABACABAA\"]}, {\"input\": \"ABAABACABADAACADABACAAB\\r\\nBAACABADABACABAAAADADAABACABACABADABABADABACABAADABBADABACAAACAABACABADABBBAA\\r\\nDABACA\\r\\n\", \"output\": [\"ABAABACABADAACAABACAAB\", \"ABAABACABADAACADABAAAB\"]}, {\"input\": \"BACABACABAACABADABABACAABACABBACAACAACABCABADAACABAABAABBADABACABADABCABAD\\r\\nBACAABADABABADABACABABACABADABACABCBADABACADABCABABADAABA\\r\\nBADABAA\\r\\n\", \"output\": [\"BACABAABABADABACAABACABAAACABCBADAACAABABABADAABA\", \"BACAABADABABAABACABBACAAAACABCBADAACADABAABADAABA\", \"BACAABAAABADABACAABACABAAACABCBADAACADABCABADAABA\", \"BACAABADABABAABACABBACAAAACABCBADAACADABCABADAABA\", \"BACAABAAABADABACAABACABAAACABCBADAACAABABABADAABA\", \"BACABAABABADABACAABACABAAACABCBADAACADABCABADAABA\"]}, {\"input\": \"ACABADABACABCABAAB\\r\\nBADAB\\r\\nACAACABA\\r\\n\", \"output\": [\"BADAB\"]}, {\"input\": \"ABABAC\\r\\nABABAC\\r\\nABAC\\r\\n\", \"output\": [\"ABBAC\", \"ABABA\"]}, {\"input\": \"BCBCBC\\r\\nBCBCBC\\r\\nBC\\r\\n\", \"output\": [\"CCC\", \"BBB\", \"CCB\"]}, {\"input\": \"AAACAAACAAADAAAAAAA\\r\\nAADAAAAAAAACDAAAAAAAAAAACAAAAABCACAAACAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADA\\r\\nAAACAADAAAAADD\\r\\n\", \"output\": [\"AAACAAACAAAAAAAAAA\"]}, {\"input\": \"ABABBB\\r\\nABABBB\\r\\nABB\\r\\n\", \"output\": [\"BBBB\", \"ABAB\"]}, {\"input\": \"ABABABAC\\r\\nABABABAC\\r\\nABABAC\\r\\n\", \"output\": [\"ABABBAC\", \"ABBABAC\", \"ABABABA\"]}, {\"input\": \"BBAABAAAAABBBBBBBABABAABAABAABBABABABBBABBABBABBBABAABBBBBBAABAAAAAAAAABABAAABBABBAAAAAABAABABBAAABB\\r\\nBBAABAAAAABBBBBBBABABAABAABAABBABABABBBABBABBABBBABAABBBBBBAABAAAAAAAAABABAAABBABBAAAAAABAABABBAAABB\\r\\nBBBAA\\r\\n\", \"output\": [\"BBAABAAAAABBBBBBBABABAABAABAABBABABABBBABBABBABBBABAABBBBBBABAAAAAAAAABABAAABBABBAAAAAABAABABBAAABB\"]}, {\"input\": \"ABABC\\r\\nABABC\\r\\nABC\\r\\n\", \"output\": [\"ABBC\", \"ABAB\"]}, {\"input\": \"BABBB\\r\\nBABBB\\r\\nABB\\r\\n\", \"output\": [\"BBBB\"]}, {\"input\": \"ABCCCCCCCC\\r\\nABCCCCCCCC\\r\\nABC\\r\\n\", \"output\": [\"BCCCCCCCC\", \"ACCCCCCCC\"]}]"} {"prob_desc_description":"Jeff loves regular bracket sequences.Today Jeff is going to take a piece of paper and write out the regular bracket sequence, consisting of nm brackets. Let's number all brackets of this sequence from 0 to nm - 1 from left to right. Jeff knows that he is going to spend ai mod n liters of ink on the i-th bracket of the sequence if he paints it opened and bi mod n liters if he paints it closed.You've got sequences a, b and numbers n, m. What minimum amount of ink will Jeff need to paint a regular bracket sequence of length nm?Operation x mod y means taking the remainder after dividing number x by number y.","prob_desc_output_spec":"In a single line print the answer to the problem \u2014 the minimum required amount of ink in liters.","lang_cluster":"","src_uid":"f40900973f4ebeb6fdafd75ebe4e9601","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["dp","matrices"],"prob_desc_created_at":"1380900600","prob_desc_sample_inputs":"[\"2 6\\n1 2\\n2 1\", \"1 10000000\\n2\\n3\"]","prob_desc_notes":"NoteIn the first test the optimal sequence is: ()()()()()(), the required number of ink liters is 12.","exec_outcome":"","difficulty":2500.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line contains two integers n and m (1\u2009\u2264\u2009n\u2009\u2264\u200920;\u00a01\u2009\u2264\u2009m\u2009\u2264\u2009107; m is even). The next line contains n integers: a0, a1, ..., an\u2009-\u20091 (1\u2009\u2264\u2009ai\u2009\u2264\u200910). The next line contains n integers: b0, b1, ..., bn\u2009-\u20091 (1\u2009\u2264\u2009bi\u2009\u2264\u200910). The numbers are separated by spaces.","prob_desc_sample_outputs":"[\"12\", \"25000000\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2 6\\r\\n1 2\\r\\n2 1\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"1 10000000\\r\\n2\\r\\n3\\r\\n\", \"output\": [\"25000000\"]}, {\"input\": \"3 184\\r\\n3 2 8\\r\\n3 9 2\\r\\n\", \"output\": [\"1288\"]}, {\"input\": \"4 26\\r\\n10 2 5 9\\r\\n5 4 2 5\\r\\n\", \"output\": [\"444\"]}, {\"input\": \"3 76\\r\\n4 7 9\\r\\n10 1 1\\r\\n\", \"output\": [\"684\"]}, {\"input\": \"3 98\\r\\n6 1 9\\r\\n10 2 4\\r\\n\", \"output\": [\"1127\"]}, {\"input\": \"5 114\\r\\n7 5 8 10 10\\r\\n2 7 9 4 5\\r\\n\", \"output\": [\"3021\"]}, {\"input\": \"1 14\\r\\n7\\r\\n6\\r\\n\", \"output\": [\"91\"]}, {\"input\": \"5 142\\r\\n8 7 6 2 2\\r\\n8 2 6 1 7\\r\\n\", \"output\": [\"2703\"]}, {\"input\": \"1 184\\r\\n8\\r\\n8\\r\\n\", \"output\": [\"1472\"]}, {\"input\": \"2 1900670\\r\\n10 3\\r\\n9 6\\r\\n\", \"output\": [\"22808044\"]}, {\"input\": \"6 17656\\r\\n2 7 4 7 7 3\\r\\n3 5 3 6 9 10\\r\\n\", \"output\": [\"459064\"]}, {\"input\": \"16 3273408\\r\\n3 2 8 8 10 1 1 7 1 4 5 7 5 8 10 10\\r\\n4 4 3 4 7 9 5 1 7 10 7 2 7 9 4 5\\r\\n\", \"output\": [\"186584261\"]}, {\"input\": \"11 4532614\\r\\n7 3 4 1 8 3 5 2 8 10 9\\r\\n6 10 3 7 5 1 1 8 4 9 7\\r\\n\", \"output\": [\"201701323\"]}, {\"input\": \"7 3952828\\r\\n1 1 9 3 5 9 2\\r\\n3 5 6 2 7 9 4\\r\\n\", \"output\": [\"106726356\"]}, {\"input\": \"20 807878\\r\\n9 4 2 5 2 7 9 3 4 4 9 2 8 3 8 9 5 7 4 7\\r\\n8 4 8 7 10 4 10 6 8 1 7 9 3 10 2 2 6 7 3 9\\r\\n\", \"output\": [\"67053877\"]}, {\"input\": \"3 3684044\\r\\n8 6 4\\r\\n3 1 2\\r\\n\", \"output\": [\"38682465\"]}, {\"input\": \"9 7683580\\r\\n4 6 8 5 10 6 3 4 7\\r\\n6 7 3 10 3 10 1 4 10\\r\\n\", \"output\": [\"303501412\"]}, {\"input\": \"10 6007734\\r\\n4 7 6 7 4 3 4 7 7 6\\r\\n8 9 5 7 6 3 2 2 10 4\\r\\n\", \"output\": [\"270348030\"]}, {\"input\": \"7 859320\\r\\n10 1 4 9 2 5 5\\r\\n5 10 3 6 6 5 10\\r\\n\", \"output\": [\"23201650\"]}, {\"input\": \"20 10000000\\r\\n10 3 2 6 2 3 9 2 8 4 4 4 3 4 7 9 5 1 7 10\\r\\n9 6 2 8 3 2 8 10 6 3 2 8 8 10 1 1 7 1 4 5\\r\\n\", \"output\": [\"730000001\"]}, {\"input\": \"20 10000000\\r\\n7 10 9 2 9 7 6 10 3 7 5 1 1 8 4 9 7 9 6 8\\r\\n9 4 3 6 1 7 3 4 1 8 3 5 2 8 10 9 1 2 10 4\\r\\n\", \"output\": [\"780000008\"]}, {\"input\": \"20 10000000\\r\\n2 7 9 4 1 9 8 4 6 10 5 10 4 5 9 9 10 9 1 6\\r\\n5 9 2 9 8 9 1 10 1 9 5 6 4 9 1 10 3 9 9 7\\r\\n\", \"output\": [\"890000001\"]}, {\"input\": \"20 10000000\\r\\n6 7 3 9 10 10 1 9 4 6 8 5 10 6 3 4 7 8 6 6\\r\\n7 4 7 2 7 3 10 10 6 7 3 10 3 10 1 4 10 10 7 3\\r\\n\", \"output\": [\"920000004\"]}, {\"input\": \"20 10000000\\r\\n7 4 3 4 7 7 6 5 4 6 5 8 3 5 3 8 4 3 4 8\\r\\n7 6 3 2 2 10 4 3 5 7 9 9 8 5 4 9 4 3 3 4\\r\\n\", \"output\": [\"880000001\"]}, {\"input\": \"1 2\\r\\n1\\r\\n1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"20 10000000\\r\\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\\r\\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\\r\\n\", \"output\": [\"200000000\"]}, {\"input\": \"20 10000000\\r\\n10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10\\r\\n10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10\\r\\n\", \"output\": [\"2000000000\"]}]"} {"prob_desc_description":"Little Petya is learning to play chess. He has already learned how to move a king, a rook and a bishop. Let us remind you the rules of moving chess pieces. A chessboard is 64 square fields organized into an 8\u2009\u00d7\u20098 table. A field is represented by a pair of integers (r,\u2009c) \u2014 the number of the row and the number of the column (in a classical game the columns are traditionally indexed by letters). Each chess piece takes up exactly one field. To make a move is to move a chess piece, the pieces move by the following rules: A rook moves any number of fields horizontally or vertically. A bishop moves any number of fields diagonally. A king moves one field in any direction \u2014 horizontally, vertically or diagonally. The pieces move like that Petya is thinking about the following problem: what minimum number of moves is needed for each of these pieces to move from field (r1,\u2009c1) to field (r2,\u2009c2)? At that, we assume that there are no more pieces besides this one on the board. Help him solve this problem.","prob_desc_output_spec":"Print three space-separated integers: the minimum number of moves the rook, the bishop and the king (in this order) is needed to move from field (r1,\u2009c1) to field (r2,\u2009c2). If a piece cannot make such a move, print a 0 instead of the corresponding number.","lang_cluster":"","src_uid":"7dbf58806db185f0fe70c00b60973f4b","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","shortest paths","graphs"],"prob_desc_created_at":"1386399600","prob_desc_sample_inputs":"[\"4 3 1 6\", \"5 5 5 6\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":1100.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The input contains four integers r1,\u2009c1,\u2009r2,\u2009c2 (1\u2009\u2264\u2009r1,\u2009c1,\u2009r2,\u2009c2\u2009\u2264\u20098) \u2014 the coordinates of the starting and the final field. The starting field doesn't coincide with the final one. You can assume that the chessboard rows are numbered from top to bottom 1 through 8, and the columns are numbered from left to right 1 through 8.","prob_desc_sample_outputs":"[\"2 1 3\", \"1 0 1\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"4 3 1 6\\r\\n\", \"output\": [\"2 1 3\", \"2\\r\\n1\\r\\n3\"]}, {\"input\": \"5 5 5 6\\r\\n\", \"output\": [\"1\\r\\n0\\r\\n1\", \"1 0 1\"]}, {\"input\": \"1 1 8 8\\r\\n\", \"output\": [\"2 1 7\", \"2\\r\\n1\\r\\n7\"]}, {\"input\": \"1 1 8 1\\r\\n\", \"output\": [\"1 0 7\", \"1\\r\\n0\\r\\n7\"]}, {\"input\": \"1 1 1 8\\r\\n\", \"output\": [\"1 0 7\", \"1\\r\\n0\\r\\n7\"]}, {\"input\": \"8 1 1 1\\r\\n\", \"output\": [\"1 0 7\", \"1\\r\\n0\\r\\n7\"]}, {\"input\": \"8 1 1 8\\r\\n\", \"output\": [\"2 1 7\", \"2\\r\\n1\\r\\n7\"]}, {\"input\": \"7 7 6 6\\r\\n\", \"output\": [\"2 1 1\", \"2\\r\\n1\\r\\n1\"]}, {\"input\": \"8 1 8 8\\r\\n\", \"output\": [\"1 0 7\", \"1\\r\\n0\\r\\n7\"]}, {\"input\": \"1 8 1 1\\r\\n\", \"output\": [\"1 0 7\", \"1\\r\\n0\\r\\n7\"]}, {\"input\": \"1 8 8 1\\r\\n\", \"output\": [\"2 1 7\", \"2\\r\\n1\\r\\n7\"]}, {\"input\": \"1 8 8 8\\r\\n\", \"output\": [\"1 0 7\", \"1\\r\\n0\\r\\n7\"]}, {\"input\": \"8 8 1 1\\r\\n\", \"output\": [\"2 1 7\", \"2\\r\\n1\\r\\n7\"]}, {\"input\": \"8 8 1 8\\r\\n\", \"output\": [\"1 0 7\", \"1\\r\\n0\\r\\n7\"]}, {\"input\": \"8 8 8 1\\r\\n\", \"output\": [\"1 0 7\", \"1\\r\\n0\\r\\n7\"]}, {\"input\": \"1 3 1 6\\r\\n\", \"output\": [\"1\\r\\n0\\r\\n3\", \"1 0 3\"]}, {\"input\": \"1 3 1 4\\r\\n\", \"output\": [\"1\\r\\n0\\r\\n1\", \"1 0 1\"]}, {\"input\": \"1 3 1 5\\r\\n\", \"output\": [\"1 2 2\", \"1\\r\\n2\\r\\n2\"]}, {\"input\": \"3 3 2 4\\r\\n\", \"output\": [\"2 1 1\", \"2\\r\\n1\\r\\n1\"]}, {\"input\": \"3 3 1 5\\r\\n\", \"output\": [\"2\\r\\n1\\r\\n2\", \"2 1 2\"]}, {\"input\": \"1 6 2 1\\r\\n\", \"output\": [\"2\\r\\n2\\r\\n5\", \"2 2 5\"]}, {\"input\": \"1 5 6 4\\r\\n\", \"output\": [\"2\\r\\n2\\r\\n5\", \"2 2 5\"]}, {\"input\": \"1 3 3 7\\r\\n\", \"output\": [\"2 2 4\", \"2\\r\\n2\\r\\n4\"]}, {\"input\": \"1 1 8 1\\r\\n\", \"output\": [\"1 0 7\", \"1\\r\\n0\\r\\n7\"]}, {\"input\": \"1 7 5 4\\r\\n\", \"output\": [\"2\\r\\n0\\r\\n4\", \"2 0 4\"]}, {\"input\": \"1 5 2 7\\r\\n\", \"output\": [\"2 0 2\", \"2\\r\\n0\\r\\n2\"]}, {\"input\": \"1 4 6 2\\r\\n\", \"output\": [\"2\\r\\n0\\r\\n5\", \"2 0 5\"]}, {\"input\": \"1 2 3 5\\r\\n\", \"output\": [\"2\\r\\n0\\r\\n3\", \"2 0 3\"]}, {\"input\": \"1 8 8 7\\r\\n\", \"output\": [\"2 2 7\", \"2\\r\\n2\\r\\n7\"]}, {\"input\": \"6 5 6 2\\r\\n\", \"output\": [\"1\\r\\n0\\r\\n3\", \"1 0 3\"]}, {\"input\": \"6 3 3 5\\r\\n\", \"output\": [\"2\\r\\n0\\r\\n3\", \"2 0 3\"]}, {\"input\": \"6 1 7 8\\r\\n\", \"output\": [\"2 2 7\", \"2\\r\\n2\\r\\n7\"]}, {\"input\": \"1 2 3 2\\r\\n\", \"output\": [\"1 2 2\", \"1\\r\\n2\\r\\n2\"]}, {\"input\": \"3 8 7 2\\r\\n\", \"output\": [\"2 2 6\", \"2\\r\\n2\\r\\n6\"]}, {\"input\": \"4 2 6 4\\r\\n\", \"output\": [\"2\\r\\n1\\r\\n2\", \"2 1 2\"]}, {\"input\": \"1 1 1 3\\r\\n\", \"output\": [\"1 2 2\", \"1\\r\\n2\\r\\n2\"]}, {\"input\": \"6 8 8 6\\r\\n\", \"output\": [\"2\\r\\n1\\r\\n2\", \"2 1 2\"]}, {\"input\": \"6 7 4 1\\r\\n\", \"output\": [\"2 2 6\", \"2\\r\\n2\\r\\n6\"]}, {\"input\": \"6 5 1 4\\r\\n\", \"output\": [\"2\\r\\n2\\r\\n5\", \"2 2 5\"]}, {\"input\": \"3 2 7 6\\r\\n\", \"output\": [\"2 1 4\", \"2\\r\\n1\\r\\n4\"]}, {\"input\": \"3 8 4 1\\r\\n\", \"output\": [\"2 2 7\", \"2\\r\\n2\\r\\n7\"]}, {\"input\": \"3 6 1 4\\r\\n\", \"output\": [\"2\\r\\n1\\r\\n2\", \"2 1 2\"]}]"} {"prob_desc_description":"Cucumber boy is fan of Kyubeat, a famous music game.Kyubeat has 16 panels for playing arranged in 4\u2009\u00d7\u20094 table. When a panel lights up, he has to press that panel.Each panel has a timing to press (the preffered time when a player should press it), and Cucumber boy is able to press at most k panels in a time with his one hand. Cucumber boy is trying to press all panels in perfect timing, that is he wants to press each panel exactly in its preffered time. If he cannot press the panels with his two hands in perfect timing, his challenge to press all the panels in perfect timing will fail.You are given one scene of Kyubeat's panel from the music Cucumber boy is trying. Tell him is he able to press all the panels in perfect timing.","prob_desc_output_spec":"Output \"YES\" (without quotes), if he is able to press all the panels in perfect timing. If not, output \"NO\" (without quotes).","lang_cluster":"","src_uid":"5fdaf8ee7763cb5815f49c0c38398f16","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["implementation"],"prob_desc_created_at":"1386943200","prob_desc_sample_inputs":"[\"1\\n.135\\n1247\\n3468\\n5789\", \"5\\n..1.\\n1111\\n..1.\\n..1.\", \"1\\n....\\n12.1\\n.2..\\n.2..\"]","prob_desc_notes":"NoteIn the third sample boy cannot press all panels in perfect timing. He can press all the panels in timing in time 1, but he cannot press the panels in time 2 in timing with his two hands.","exec_outcome":"","difficulty":900.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line contains a single integer k (1\u2009\u2264\u2009k\u2009\u2264\u20095) \u2014 the number of panels Cucumber boy can press with his one hand. Next 4 lines contain 4 characters each (digits from 1 to 9, or period) \u2014 table of panels. If a digit i was written on the panel, it means the boy has to press that panel in time i. If period was written on the panel, he doesn't have to press that panel.","prob_desc_sample_outputs":"[\"YES\", \"YES\", \"NO\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"1\\r\\n.135\\r\\n1247\\r\\n3468\\r\\n5789\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"5\\r\\n..1.\\r\\n1111\\r\\n..1.\\r\\n..1.\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"1\\r\\n....\\r\\n12.1\\r\\n.2..\\r\\n.2..\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"1\\r\\n....\\r\\n....\\r\\n....\\r\\n....\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"1\\r\\n6981\\r\\n.527\\r\\n4163\\r\\n2345\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"5\\r\\n9999\\r\\n9999\\r\\n9999\\r\\n9999\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"2\\r\\n4444\\r\\n3333\\r\\n2222\\r\\n1111\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"3\\r\\n2123\\r\\n1232\\r\\n2321\\r\\n3213\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"2\\r\\n1...\\r\\n.1..\\r\\n..1.\\r\\n...1\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"2\\r\\n1.1.\\r\\n.1.1\\r\\n2.2.\\r\\n.222\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"1\\r\\n1..2\\r\\n.3.4\\r\\n567.\\r\\n.89.\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"1\\r\\n1122\\r\\n3344\\r\\n5588\\r\\n6699\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"4\\r\\n1111\\r\\n1221\\r\\n1221\\r\\n1111\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"5\\r\\n3141\\r\\n5926\\r\\n5358\\r\\n9793\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"5\\r\\n5454\\r\\n4343\\r\\n3232\\r\\n2121\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"5\\r\\n1222\\r\\n2221\\r\\n2221\\r\\n1122\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"4\\r\\n...1\\r\\n..2.\\r\\n.3..\\r\\n4...\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"1\\r\\n....\\r\\n5..5\\r\\n6..6\\r\\n7..7\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"1\\r\\n9875\\r\\n8643\\r\\n7421\\r\\n531.\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"1\\r\\n..1.\\r\\n..1.\\r\\n..1.\\r\\n..1.\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"3\\r\\n7777\\r\\n..7.\\r\\n.7..\\r\\n7...\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"4\\r\\n7777\\r\\n..7.\\r\\n.7..\\r\\n7...\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"4\\r\\n4.4.\\r\\n4.4.\\r\\n4444\\r\\n..4.\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"5\\r\\n4.4.\\r\\n4.4.\\r\\n4444\\r\\n..4.\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"3\\r\\n1.1.\\r\\n.1.1\\r\\n1.1.\\r\\n.1.1\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"2\\r\\n1131\\r\\n4412\\r\\n2569\\r\\n3478\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"2\\r\\n8888\\r\\n8888\\r\\n8888\\r\\n8888\\r\\n\", \"output\": [\"NO\"]}]"} {"prob_desc_description":"Our bear's forest has a checkered field. The checkered field is an n\u2009\u00d7\u2009n table, the rows are numbered from 1 to n from top to bottom, the columns are numbered from 1 to n from left to right. Let's denote a cell of the field on the intersection of row x and column y by record (x,\u2009y). Each cell of the field contains growing raspberry, at that, the cell (x,\u2009y) of the field contains x\u2009+\u2009y raspberry bushes.The bear came out to walk across the field. At the beginning of the walk his speed is (dx,\u2009dy). Then the bear spends exactly t seconds on the field. Each second the following takes place: Let's suppose that at the current moment the bear is in cell (x,\u2009y). First the bear eats the raspberry from all the bushes he has in the current cell. After the bear eats the raspberry from k bushes, he increases each component of his speed by k. In other words, if before eating the k bushes of raspberry his speed was (dx,\u2009dy), then after eating the berry his speed equals (dx\u2009+\u2009k,\u2009dy\u2009+\u2009k). Let's denote the current speed of the bear (dx,\u2009dy) (it was increased after the previous step). Then the bear moves from cell (x,\u2009y) to cell (((x\u2009+\u2009dx\u2009-\u20091)\u00a0mod\u00a0n)\u2009+\u20091,\u2009((y\u2009+\u2009dy\u2009-\u20091)\u00a0mod\u00a0n)\u2009+\u20091). Then one additional raspberry bush grows in each cell of the field. You task is to predict the bear's actions. Find the cell he ends up in if he starts from cell (sx,\u2009sy). Assume that each bush has infinitely much raspberry and the bear will never eat all of it.","prob_desc_output_spec":"Print two integers \u2014 the coordinates of the cell the bear will end up in after t seconds.","lang_cluster":"","src_uid":"ee9fa8be2ae05a4e831a4f608c0cc785","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","matrices"],"prob_desc_created_at":"1390577700","prob_desc_sample_inputs":"[\"5 1 2 0 1 2\", \"1 1 1 -1 -1 2\"]","prob_desc_notes":"NoteOperation a\u00a0mod\u00a0b means taking the remainder after dividing a by b. Note that the result of the operation is always non-negative. For example, (\u2009-\u20091)\u00a0mod\u00a03\u2009=\u20092.In the first sample before the first move the speed vector will equal (3,4) and the bear will get to cell (4,1). Before the second move the speed vector will equal (9,10) and he bear will get to cell (3,1). Don't forget that at the second move, the number of berry bushes increased by 1.In the second sample before the first move the speed vector will equal (1,1) and the bear will get to cell (1,1). Before the second move, the speed vector will equal (4,4) and the bear will get to cell (1,1). Don't forget that at the second move, the number of berry bushes increased by 1.","exec_outcome":"","difficulty":2300.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line of the input contains six space-separated integers: n, sx, sy, dx, dy, t (1\u2009\u2264\u2009n\u2009\u2264\u2009109;\u00a01\u2009\u2264\u2009sx,\u2009sy\u2009\u2264\u2009n;\u00a0\u2009-\u2009100\u2009\u2264\u2009dx,\u2009dy\u2009\u2264\u2009100;\u00a00\u2009\u2264\u2009t\u2009\u2264\u20091018).","prob_desc_sample_outputs":"[\"3 1\", \"1 1\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"5 1 2 0 1 2\\r\\n\", \"output\": [\"3 1\"]}, {\"input\": \"1 1 1 -1 -1 2\\r\\n\", \"output\": [\"1 1\"]}, {\"input\": \"1 1 1 1 1 0\\r\\n\", \"output\": [\"1 1\"]}, {\"input\": \"2 2 1 -2 -2 5\\r\\n\", \"output\": [\"1 2\"]}, {\"input\": \"1000000000 1 1 1 1 1000000000000000000\\r\\n\", \"output\": [\"168318977 168318977\"]}, {\"input\": \"1000000000 1 2 -100 -100 1\\r\\n\", \"output\": [\"999999904 999999905\"]}, {\"input\": \"3 2 2 -100 -100 2\\r\\n\", \"output\": [\"1 1\"]}, {\"input\": \"1000000000 1000000000 1000000000 100 -100 1000000000000000000\\r\\n\", \"output\": [\"969796608 969796608\"]}, {\"input\": \"907122235 107269653 309181328 26 -64 242045007473044676\\r\\n\", \"output\": [\"23731316 525833901\"]}, {\"input\": \"804 658 177 -95 37 9\\r\\n\", \"output\": [\"270 173\"]}, {\"input\": \"2 1 1 31 -74 2712360435504330\\r\\n\", \"output\": [\"1 1\"]}, {\"input\": \"230182675 73108597 42152975 -72 -8 93667970058209518\\r\\n\", \"output\": [\"34918692 197804272\"]}, {\"input\": \"487599125 469431740 316230350 -77 57 18\\r\\n\", \"output\": [\"320939970 167740992\"]}, {\"input\": \"1710 654 941 -81 -37 1281183940\\r\\n\", \"output\": [\"1568 945\"]}, {\"input\": \"568980902 147246752 87068387 -17 58 677739653\\r\\n\", \"output\": [\"150920864 281916196\"]}, {\"input\": \"38 10 36 19 30 4054886\\r\\n\", \"output\": [\"18 36\"]}, {\"input\": \"546978166 115293871 313560296 -33 54 215761558342792301\\r\\n\", \"output\": [\"353006839 497349709\"]}, {\"input\": \"323544442 39059198 2970015 92 17 98\\r\\n\", \"output\": [\"105890973 69794440\"]}, {\"input\": \"321575625 2929581 31407414 -40 -44 920902537044\\r\\n\", \"output\": [\"320222592 65760999\"]}, {\"input\": \"5928 1508 4358 75 -4 794927060433551549\\r\\n\", \"output\": [\"4973 5148\"]}, {\"input\": \"7310962 7564 6333485 -45 41 81980903005818\\r\\n\", \"output\": [\"5246110 6302893\"]}, {\"input\": \"224 81 30 57 -13 8363\\r\\n\", \"output\": [\"130 205\"]}, {\"input\": \"75081054 91 47131957 -94 -54 5588994022550344\\r\\n\", \"output\": [\"6742019 52104963\"]}, {\"input\": \"185144 100489 52 32 -21 5752324832726786\\r\\n\", \"output\": [\"56326 173503\"]}, {\"input\": \"61728 24280 17963 -19 81 652432745607745078\\r\\n\", \"output\": [\"3174 1169\"]}, {\"input\": \"25699863 23288611 24796719 -45 46 437606836\\r\\n\", \"output\": [\"24072870 13015404\"]}, {\"input\": \"475875319 333393831 284835031 22 7 90332975949346\\r\\n\", \"output\": [\"441571464 288459461\"]}, {\"input\": \"372903 106681 40781 54 -40 6188704\\r\\n\", \"output\": [\"161485 86089\"]}, {\"input\": \"923 452 871 -95 -55 273135237285890\\r\\n\", \"output\": [\"563 142\"]}, {\"input\": \"672939 589365 391409 -54 -70 205083640\\r\\n\", \"output\": [\"503747 218115\"]}, {\"input\": \"560010572 4172512 514044248 -78 13 97386\\r\\n\", \"output\": [\"11882888 530616750\"]}, {\"input\": \"717485513 5935 3 -5 -67 28\\r\\n\", \"output\": [\"71683921 71676253\"]}, {\"input\": \"138971202 137695723 48931985 -28 -3 68901440898766\\r\\n\", \"output\": [\"110585553 85995539\"]}, {\"input\": \"910958510 60 98575 38 -99 97880\\r\\n\", \"output\": [\"304849180 291538135\"]}, {\"input\": \"67163467 36963416 50381 -49 -12 76558237\\r\\n\", \"output\": [\"23368224 65407811\"]}, {\"input\": \"557911547 9 460221236 -58 -96 74518856\\r\\n\", \"output\": [\"246089810 106240697\"]}, {\"input\": \"85 37 69 30 47 131\\r\\n\", \"output\": [\"74 38\"]}, {\"input\": \"852525230 538352221 97088953 -12 98 9197937568\\r\\n\", \"output\": [\"84737577 321684009\"]}, {\"input\": \"885849694 703278210 46391 33 23 965949118732\\r\\n\", \"output\": [\"16593182 13087113\"]}, {\"input\": \"976890548 675855343 988 -11 46 796041265897304\\r\\n\", \"output\": [\"652954007 789518296\"]}, {\"input\": \"108774060 15274597 430014 -85 -94 6\\r\\n\", \"output\": [\"98184736 83340099\"]}, {\"input\": \"2 2 2 -36 94 9429569334\\r\\n\", \"output\": [\"1 1\"]}, {\"input\": \"713835677 404390162 67429 -91 10 178697004637242062\\r\\n\", \"output\": [\"244834060 560206120\"]}, {\"input\": \"620330674 603592488 3 38 94 34309127789188\\r\\n\", \"output\": [\"200990066 258175045\"]}, {\"input\": \"95 70 7 -36 -100 5\\r\\n\", \"output\": [\"85 82\"]}, {\"input\": \"900854530 82 7 30 -88 6797628981503799\\r\\n\", \"output\": [\"66039616 641057009\"]}, {\"input\": \"147834 6 2565 15 -35 166779\\r\\n\", \"output\": [\"54423 144570\"]}, {\"input\": \"642762664 588605882 1 -47 82 8\\r\\n\", \"output\": [\"355500874 409658689\"]}, {\"input\": \"122740849 8646067 70003215 -100 -80 70\\r\\n\", \"output\": [\"80795619 19413318\"]}, {\"input\": \"73221379 4311914 992324 65 -40 705623357422685593\\r\\n\", \"output\": [\"62692638 21726334\"]}]"} {"prob_desc_description":"You will receive 3 points for solving this problem.Manao is designing the genetic code for a new type of algae to efficiently produce fuel. Specifically, Manao is focusing on a stretch of DNA that encodes one protein. The stretch of DNA is represented by a string containing only the characters 'A', 'T', 'G' and 'C'.Manao has determined that if the stretch of DNA contains a maximal sequence of consecutive identical nucleotides that is of even length, then the protein will be nonfunctional. For example, consider a protein described by DNA string \"GTTAAAG\". It contains four maximal sequences of consecutive identical nucleotides: \"G\", \"TT\", \"AAA\", and \"G\". The protein is nonfunctional because sequence \"TT\" has even length.Manao is trying to obtain a functional protein from the protein he currently has. Manao can insert additional nucleotides into the DNA stretch. Each additional nucleotide is a character from the set {'A', 'T', 'G', 'C'}. Manao wants to determine the minimum number of insertions necessary to make the DNA encode a functional protein.","prob_desc_output_spec":"The program should print on one line a single integer representing the minimum number of 'A', 'T', 'G', 'C' characters that are required to be inserted into the input string in order to make all runs of identical characters have odd length.","lang_cluster":"","src_uid":"8b26ca1ca2b28166c3d25dceb1f3d49f","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["implementation","two pointers"],"prob_desc_created_at":"1392573600","prob_desc_sample_inputs":"[\"GTTAAAG\", \"AACCAACCAAAAC\"]","prob_desc_notes":"NoteIn the first example, it is sufficient to insert a single nucleotide of any type between the two 'T's in the sequence to restore the functionality of the protein.","exec_outcome":"","difficulty":null,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The input consists of a single line, containing a string s of length n (1\u2009\u2264\u2009n\u2009\u2264\u2009100). Each character of s will be from the set {'A', 'T', 'G', 'C'}. This problem doesn't have subproblems. You will get 3 points for the correct submission.","prob_desc_sample_outputs":"[\"1\", \"5\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"GTTAAAG\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"AACCAACCAAAAC\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"GTGAATTTCC\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"CAGGGGGCCGCCCATGAAAAAAACCCGGCCCCTTGGGAAAACTTGGGTTA\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"CCCTTCACCCGGATCCAAATCCCTTAGAAATAATCCCCGACGGCGTTGTATCACCTCTGCACTTGTTAGTAAGGTCAGGCGTCCATTACGGAAGAACGTA\\r\\n\", \"output\": [\"19\"]}, {\"input\": \"GCATTACATGGGGGGGTCCTACGAGCCCGGCATCCCGGAAACTAGCCGGTTAATTTGGTTTAAACCCTCCCACCCCGGATTGTAACCCCCCTCATTGGTT\\r\\n\", \"output\": [\"17\"]}, {\"input\": \"TTCCCAGAGAAAAAAAGGGGCCCAAATGCCCTAAAAACCCCCTTTGCCCCCCAACCCCTTTTTAAAATAAAAAGGGGCCCATTCCCTTAAAAATTTTTTG\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"AGCCGCCCCCCCAAAAAAGGGGGAAAAAAAAAAAAAAAAAAAAACTTTTGGAAACCCCCCCCTTTTTTTTTTTTTTTTTTTTTTTTTGGGGAAGGGGGGG\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"AAAAAAAAAAAAAAAAAATTTTTTTTTTTTTTTTGGGGGGGGGGGGGGGGGGGGGGGTTTTTTTTTTTTTTGGGGGGGGGGGGGGGGGGGGAAAAATTTT\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"AACCGGTTAACCGGTTAACCGGTTAACCGGTTAACCGGTTAACCGGTTAACCGGTTAACCGGTTAACCGGTTAACCGGTTAACCGGTTAACCGGTTCCGG\\r\\n\", \"output\": [\"50\"]}, {\"input\": \"A\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"TTT\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"G\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"T\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"C\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"AA\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"GGG\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"AAG\\r\\n\", \"output\": [\"1\"]}]"} {"prob_desc_description":"The employees of the F company have lots of ways to entertain themselves. Today they invited a famous magician who shows a trick with plastic cups and a marble.The point is to trick the spectator's attention. Initially, the spectator stands in front of a line of n plastic cups. Then the magician places a small marble under one cup and shuffles the cups. Then the spectator should guess which cup hides the marble.But the head coder of the F company isn't easy to trick. When he saw the performance, he noticed several important facts: each cup contains a mark \u2014 a number from 1 to n; all marks on the cups are distinct; the magician shuffles the cups in m operations, each operation looks like that: take a cup marked xi, sitting at position yi in the row of cups (the positions are numbered from left to right, starting from 1) and shift it to the very beginning of the cup row (on the first position). When the head coder came home after work he wanted to re-do the trick. Unfortunately, he didn't remember the starting or the final position of the cups. He only remembered which operations the magician performed. Help the coder: given the operations in the order they were made find at least one initial permutation of the cups that can go through the described operations in the given order. Otherwise, state that such permutation doesn't exist.","prob_desc_output_spec":"If the described permutation doesn't exist (the programmer remembered wrong operations), print -1. Otherwise, print n distinct integers, each from 1 to n: the i-th number should represent the mark on the cup that initially is in the row in position i. If there are multiple correct answers, you should print the lexicographically minimum one.","lang_cluster":"","src_uid":"a2616b1681f30ce4b2a5fdc81cf52b50","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["data structures"],"prob_desc_created_at":"1398169140","prob_desc_sample_inputs":"[\"2 1\\n2 1\", \"3 2\\n1 2\\n1 1\", \"3 3\\n1 3\\n2 3\\n1 3\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":2200.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"3 seconds","prob_desc_input_spec":"The first line contains integers n and m (1\u2009\u2264\u2009n,\u2009m\u2009\u2264\u2009106). Each of the next m lines contains a couple of integers. The i-th line contains integers xi, yi (1\u2009\u2264\u2009xi,\u2009yi\u2009\u2264\u2009n) \u2014 the description of the i-th operation of the magician. Note that the operations are given in the order in which the magician made them and the coder wants to make them in the same order.","prob_desc_sample_outputs":"[\"2 1\", \"2 1 3\", \"-1\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2 1\\r\\n2 1\\r\\n\", \"output\": [\"2 1\"]}, {\"input\": \"3 2\\r\\n1 2\\r\\n1 1\\r\\n\", \"output\": [\"2 1 3\"]}, {\"input\": \"3 3\\r\\n1 3\\r\\n2 3\\r\\n1 3\\r\\n\", \"output\": [\"-1\"]}, {\"input\": \"3 2\\r\\n1 1\\r\\n3 2\\r\\n\", \"output\": [\"1 3 2\"]}, {\"input\": \"5 2\\r\\n3 3\\r\\n3 1\\r\\n\", \"output\": [\"1 2 3 4 5\"]}, {\"input\": \"5 3\\r\\n3 1\\r\\n4 3\\r\\n5 4\\r\\n\", \"output\": [\"3 1 4 5 2\"]}, {\"input\": \"7 3\\r\\n4 4\\r\\n5 4\\r\\n2 4\\r\\n\", \"output\": [\"1 2 5 4 3 6 7\"]}, {\"input\": \"10 3\\r\\n7 10\\r\\n8 7\\r\\n5 5\\r\\n\", \"output\": [\"1 2 5 3 4 8 6 9 10 7\"]}, {\"input\": \"100 50\\r\\n11 28\\r\\n11 1\\r\\n98 58\\r\\n38 27\\r\\n24 27\\r\\n67 37\\r\\n90 48\\r\\n91 14\\r\\n43 29\\r\\n3 64\\r\\n24 6\\r\\n53 19\\r\\n97 65\\r\\n13 27\\r\\n75 53\\r\\n37 82\\r\\n69 75\\r\\n94 99\\r\\n1 26\\r\\n95 60\\r\\n45 27\\r\\n100 82\\r\\n71 49\\r\\n86 99\\r\\n74 58\\r\\n88 68\\r\\n39 63\\r\\n38 23\\r\\n22 39\\r\\n29 58\\r\\n62 83\\r\\n62 1\\r\\n61 58\\r\\n2 30\\r\\n41 48\\r\\n83 90\\r\\n1 17\\r\\n73 81\\r\\n23 53\\r\\n71 16\\r\\n43 29\\r\\n27 78\\r\\n54 48\\r\\n6 89\\r\\n75 27\\r\\n16 93\\r\\n81 81\\r\\n97 31\\r\\n53 32\\r\\n15 96\\r\\n\", \"output\": [\"2 4 5 7 8 9 10 91 12 45 53 1 14 17 18 19 20 13 22 54 21 25 43 24 38 26 28 11 41 30 31 23 32 33 34 67 35 36 71 40 42 61 44 29 46 47 90 74 48 75 49 50 39 95 51 52 55 98 56 57 88 58 59 3 97 60 63 64 65 27 81 66 68 69 73 70 72 76 62 100 77 37 78 79 80 6 82 83 84 85 16 87 89 15 92 93 96 86 94 99\"]}, {\"input\": \"1000000 1000000\\r\\n700833 953480\\r\\n302784 979572\\r\\n292527 1307\\r\\n858668 290285\\r\\n951562 855901\\r\\n810645 427870\\r\\n876834 98466\\r\\n273375 237878\\r\\n464842 946463\\r\\n322686 774281\\r\\n968231 501596\\r\\n721715 494597\\r\\n932210 724682\\r\\n161646 44819\\r\\n908489 549667\\r\\n197570 531975\\r\\n636824 610507\\r\\n904192 539002\\r\\n468366 913132\\r\\n388151 793408\\r\\n535586 995449\\r\\n498191 549071\\r\\n480046 212113\\r\\n553820 77387\\r\\n301144 933938\\r\\n593949 637897\\r\\n56113 336121\\r\\n337463 574591\\r\\n863181 491155\\r\\n861957 441846\\r\\n935887 790693\\r\\n936526 136302\\r\\n772527 677843\\r\\n75477...\", \"output\": [\"287979 230793 805881 397585 695359 3 296206 4 257828 7 649020 9 622178 482759 161855 499413 690372 14 541524 906954 116709 15 17736 555558 848745 16 532778 20 28 752084 32 248311 37 697678 323802 224937 41 44 886110 635290 46 451068 50 79451 52 54 299392 214455 319511 55 56 57 532938 349206 621734 730138 59 61 436368 63 783682 66 608715 997853 823656 79353 73 739717 914085 74 726928 353300 174944 367702 722155 75 991004 341644 492185 79 157363 826980 82 121357 325844 825977 85 87 173852 653068 285829 88 8...\", \"287979 230793 805881 397585 695359 3 296206 4 257828 7 649020 9 622178 482759 161855 499413 690372 14 541524 906954 116709 15 17736 555558 848745 16 532778 20 28 752084 32 248311 37 697678 323802 224937 41 44 886110 635290 46 451068 50 79451 52 54 299392 214455 319511 55 56 57 532938 349206 621734 730138 59 61 436368 63 783682 66 608715 997853 823656 79353 73 739717 914085 74 726928 353300 174944 367702 722155 75 991004 341644 492185 79 157363 826980 82 121357 325844 825977 85 87 173852 653068 285829 88 89...\"]}, {\"input\": \"1 1\\r\\n1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 1\\r\\n1 1\\r\\n\", \"output\": [\"1 2\"]}, {\"input\": \"2 1\\r\\n1 2\\r\\n\", \"output\": [\"2 1\"]}, {\"input\": \"2 1\\r\\n2 2\\r\\n\", \"output\": [\"1 2\"]}, {\"input\": \"2 2\\r\\n1 1\\r\\n2 1\\r\\n\", \"output\": [\"-1\"]}, {\"input\": \"2 2\\r\\n1 2\\r\\n2 2\\r\\n\", \"output\": [\"2 1\"]}, {\"input\": \"1000000 1\\r\\n458596 373648\\r\\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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 15...\", \"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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155...\"]}, {\"input\": \"1000000 1000000\\r\\n731129 48813\\r\\n411546 534931\\r\\n500799 719558\\r\\n39726 355640\\r\\n72122 769210\\r\\n982992 821130\\r\\n607720 707439\\r\\n395072 960368\\r\\n411414 286147\\r\\n508491 72669\\r\\n963634 316245\\r\\n866688 283962\\r\\n310688 372849\\r\\n251056 422517\\r\\n148593 509187\\r\\n816258 455977\\r\\n858080 296300\\r\\n326170 795291\\r\\n159288 884331\\r\\n979105 588144\\r\\n823563 372590\\r\\n611626 544803\\r\\n136506 806211\\r\\n690071 606045\\r\\n242673 270451\\r\\n215281 197109\\r\\n24668 828553\\r\\n632795 108982\\r\\n165283 834509\\r\\n699264 509305\\r\\n213071 263720\\r\\n198166 62575\\r\\n399046 737811\\r\\n87394...\", \"output\": [\"821273 246590 590490 524668 836635 4 9 10 267943 642594 668620 817485 13 94745 131772 15 70102 270675 17 640287 301334 948927 22 194651 23 29 43124 32 186904 343425 82128 33 34 832597 252217 37 648232 578816 799253 196663 41 43 46 251828 400616 47 749074 670231 995189 295270 50 57 905201 190342 60 63 64 350022 3581 65 455405 66 471585 109369 425981 752815 163963 67 68 945210 69 633720 218102 70 103860 7932 71 717197 784072 72 329416 74 696305 765540 75 79 81 82 803752 867534 83 241162 4207 213624 680152 5...\", \"821273 246590 590490 524668 836635 4 9 10 267943 642594 668620 817485 13 94745 131772 15 70102 270675 17 640287 301334 948927 22 194651 23 29 43124 32 186904 343425 82128 33 34 832597 252217 37 648232 578816 799253 196663 41 43 46 251828 400616 47 749074 670231 995189 295270 50 57 905201 190342 60 63 64 350022 3581 65 455405 66 471585 109369 425981 752815 163963 67 68 945210 69 633720 218102 70 103860 7932 71 717197 784072 72 329416 74 696305 765540 75 79 81 82 803752 867534 83 241162 4207 213624 680152 51...\"]}, {\"input\": \"1000000 1000000\\r\\n248060 999999\\r\\n447756 1000000\\r\\n681182 1000000\\r\\n86296 1000000\\r\\n458962 999997\\r\\n729332 1000000\\r\\n698076 1000000\\r\\n25643 1000000\\r\\n522391 1000000\\r\\n767795 999999\\r\\n235938 1000000\\r\\n942695 1000000\\r\\n96224 999992\\r\\n234167 1000000\\r\\n618507 999999\\r\\n556764 1000000\\r\\n122707 1000000\\r\\n418520 1000000\\r\\n536574 1000000\\r\\n153893 999999\\r\\n844291 1000000\\r\\n457188 1000000\\r\\n604145 1000000\\r\\n326690 999998\\r\\n309815 1000000\\r\\n715554 1000000\\r\\n151397 1000000\\r\\n866520 999998\\r\\n39977 1000000\\r\\n416373 1000000\\r\\n952765 1000000\\r\\n314450 100...\", \"output\": [\"257581 365845 438294 925353 46675 223563 16659 845540 342813 843913 267501 198150 19593 674899 548589 783170 642246 56134 363583 215362 449555 304971 375850 649610 405484 701400 754009 197400 319265 879998 9118 1783 769183 822290 174724 848811 845276 108145 311352 562645 301825 936889 296988 524929 936132 319721 127483 981999 956061 572761 191812 99639 490682 620683 68099 54675 275208 423004 329898 746270 45838 953317 738471 775551 951107 179114 286271 839755 224699 45250 409151 24891 327761 587249 834162...\", \"257581 365845 438294 925353 46675 223563 16659 845540 342813 843913 267501 198150 19593 674899 548589 783170 642246 56134 363583 215362 449555 304971 375850 649610 405484 701400 754009 197400 319265 879998 9118 1783 769183 822290 174724 848811 845276 108145 311352 562645 301825 936889 296988 524929 936132 319721 127483 981999 956061 572761 191812 99639 490682 620683 68099 54675 275208 423004 329898 746270 45838 953317 738471 775551 951107 179114 286271 839755 224699 45250 409151 24891 327761 587249 834162 ...\"]}, {\"input\": \"1000000 1000000\\r\\n686437 1\\r\\n686437 1\\r\\n684166 2\\r\\n684166 1\\r\\n684166 1\\r\\n684166 1\\r\\n684166 1\\r\\n684166 1\\r\\n684166 1\\r\\n686437 2\\r\\n305093 4\\r\\n305093 1\\r\\n305093 1\\r\\n305093 1\\r\\n608490 4\\r\\n686437 3\\r\\n686437 1\\r\\n686437 1\\r\\n686437 1\\r\\n686437 1\\r\\n686437 1\\r\\n686437 1\\r\\n686437 1\\r\\n686437 1\\r\\n686437 1\\r\\n686437 1\\r\\n684166 4\\r\\n686437 2\\r\\n686437 1\\r\\n686437 1\\r\\n608490 3\\r\\n686437 2\\r\\n686437 1\\r\\n608490 2\\r\\n608490 1\\r\\n686437 2\\r\\n686437 1\\r\\n608490 2\\r\\n608490 1\\r\\n686437 2\\r\\n684166 3\\r\\n684166 1\\r\\n684166 1\\r\\n686437 2\\r\\n684166 2\\r\\n684166 1\\r\\n686437 2\\r\\n684166 2\\r\\n686437 2\\r\\n6864...\", \"output\": [\"686437 684166 608490 305093 931589 26069 753320 647738 286711 121954 463009 189179 906660 970639 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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 1...\", \"686437 684166 608490 305093 931589 26069 753320 647738 286711 121954 463009 189179 906660 970639 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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 13...\"]}, {\"input\": \"5 3\\r\\n2 4\\r\\n3 5\\r\\n5 2\\r\\n\", \"output\": [\"-1\"]}, {\"input\": \"10 10\\r\\n9 1\\r\\n6 7\\r\\n4 2\\r\\n8 7\\r\\n3 1\\r\\n10 10\\r\\n3 5\\r\\n6 7\\r\\n10 1\\r\\n6 6\\r\\n\", \"output\": [\"-1\"]}, {\"input\": \"100 200\\r\\n97 26\\r\\n71 59\\r\\n1 17\\r\\n52 66\\r\\n58 51\\r\\n76 59\\r\\n23 26\\r\\n91 96\\r\\n32 29\\r\\n61 60\\r\\n34 85\\r\\n4 71\\r\\n99 33\\r\\n76 73\\r\\n63 80\\r\\n31 11\\r\\n84 69\\r\\n17 24\\r\\n15 62\\r\\n73 22\\r\\n44 98\\r\\n41 59\\r\\n70 54\\r\\n34 8\\r\\n81 1\\r\\n87 97\\r\\n14 99\\r\\n41 14\\r\\n47 6\\r\\n49 64\\r\\n60 44\\r\\n26 70\\r\\n11 15\\r\\n98 72\\r\\n97 97\\r\\n46 68\\r\\n19 8\\r\\n79 76\\r\\n62 31\\r\\n98 90\\r\\n71 63\\r\\n44 36\\r\\n19 79\\r\\n34 84\\r\\n56 65\\r\\n59 100\\r\\n58 63\\r\\n93 19\\r\\n59 14\\r\\n72 87\\r\\n44 38\\r\\n27 25\\r\\n17 20\\r\\n81 96\\r\\n97 79\\r\\n53 30\\r\\n92 68\\r\\n46 9\\r\\n20 38\\r\\n12 23\\r\\n52 86\\r\\n25 39\\r\\n48 76\\r\\n85 54\\r\\n11 92\\r\\n71 71\\r\\n71 94\\r\\n33 84\\r\\n32 58\\r\\n51 50\\r\\n37 1\\r\\n97 12\\r\\n66 10...\", \"output\": [\"-1\"]}, {\"input\": \"100 1000000\\r\\n5 75\\r\\n69 13\\r\\n34 26\\r\\n98 37\\r\\n49 10\\r\\n39 9\\r\\n49 22\\r\\n27 37\\r\\n28 6\\r\\n95 80\\r\\n54 30\\r\\n40 37\\r\\n51 28\\r\\n66 21\\r\\n9 77\\r\\n43 63\\r\\n7 36\\r\\n54 74\\r\\n99 90\\r\\n36 31\\r\\n49 57\\r\\n26 17\\r\\n42 50\\r\\n41 35\\r\\n82 26\\r\\n77 30\\r\\n10 52\\r\\n27 40\\r\\n51 30\\r\\n43 97\\r\\n100 11\\r\\n42 10\\r\\n33 32\\r\\n77 93\\r\\n2 12\\r\\n77 99\\r\\n16 14\\r\\n53 54\\r\\n29 6\\r\\n83 11\\r\\n99 64\\r\\n99 29\\r\\n57 20\\r\\n97 88\\r\\n18 5\\r\\n23 83\\r\\n7 71\\r\\n34 54\\r\\n93 88\\r\\n40 97\\r\\n97 18\\r\\n85 71\\r\\n67 67\\r\\n31 44\\r\\n68 52\\r\\n99 44\\r\\n59 71\\r\\n71 17\\r\\n3 98\\r\\n7 93\\r\\n88 57\\r\\n63 94\\r\\n62 67\\r\\n48 32\\r\\n25 58\\r\\n11 58\\r\\n67 18\\r\\n4 9\\r\\n40 74\\r\\n52 40\\r\\n66 19\\r\\n67 82\\r\\n98 72\\r...\", \"output\": [\"-1\"]}, {\"input\": \"1 1000000\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n1 1\\r\\n...\", \"output\": [\"1\"]}, {\"input\": \"1000000 1000000\\r\\n145493 709877\\r\\n915888 170549\\r\\n680394 2504\\r\\n24665 758139\\r\\n242644 365499\\r\\n994789 535590\\r\\n518365 297247\\r\\n852392 834337\\r\\n480961 945750\\r\\n485671 126953\\r\\n262033 11673\\r\\n199902 473744\\r\\n91856 743475\\r\\n779195 394619\\r\\n60537 616388\\r\\n570144 756645\\r\\n285494 510464\\r\\n298148 932570\\r\\n110058 627373\\r\\n686867 469501\\r\\n82153 559208\\r\\n231338 90754\\r\\n748347 478689\\r\\n716892 749236\\r\\n849948 326682\\r\\n733583 653616\\r\\n724863 883500\\r\\n683104 347625\\r\\n780294 675841\\r\\n482075 61922\\r\\n263884 391899\\r\\n777411 701879\\r\\n519515 168716\\r\\n398224 9...\", \"output\": [\"-1\"]}, {\"input\": \"1000000 500000\\r\\n158922 612043\\r\\n520750 458508\\r\\n43377 689461\\r\\n499760 598167\\r\\n59809 158478\\r\\n528215 828265\\r\\n776195 306192\\r\\n969661 949090\\r\\n716100 804829\\r\\n226883 642563\\r\\n789973 77177\\r\\n842955 700209\\r\\n677612 596299\\r\\n768381 990264\\r\\n59201 301792\\r\\n415811 70469\\r\\n351314 702568\\r\\n827596 439659\\r\\n319263 51319\\r\\n967564 61471\\r\\n490158 376261\\r\\n582779 636988\\r\\n56264 709743\\r\\n488338 80832\\r\\n419834 664820\\r\\n200209 434893\\r\\n761686 878648\\r\\n767036 854889\\r\\n678383 272516\\r\\n919705 583934\\r\\n36064 785412\\r\\n14963 292187\\r\\n450118 913031\\r\\n116570 9329...\", \"output\": [\"-1\"]}, {\"input\": \"10000 3000\\r\\n7531 5050\\r\\n1786 5222\\r\\n8170 8065\\r\\n2280 9993\\r\\n7701 1972\\r\\n9237 4740\\r\\n7465 6285\\r\\n9264 500\\r\\n3162 6281\\r\\n3438 3815\\r\\n8397 474\\r\\n8294 5168\\r\\n3196 195\\r\\n3541 2583\\r\\n9093 6176\\r\\n2635 8118\\r\\n9243 2507\\r\\n6413 9357\\r\\n9987 9400\\r\\n6705 8270\\r\\n2009 4618\\r\\n9588 2769\\r\\n9833 1307\\r\\n7655 8082\\r\\n2662 5224\\r\\n974 1534\\r\\n9222 1971\\r\\n2912 3402\\r\\n8467 3840\\r\\n938 1276\\r\\n9164 1848\\r\\n1436 384\\r\\n5154 8969\\r\\n9562 7652\\r\\n6107 1235\\r\\n5452 3084\\r\\n1539 6716\\r\\n1134 607\\r\\n9558 3085\\r\\n7041 3447\\r\\n3127 9492\\r\\n5192 9429\\r\\n7229 9168\\r\\n4780 5324\\r\\n6176 5880\\r\\n8009 5841\\r\\n...\", \"output\": [\"-1\"]}, {\"input\": \"50000 77000\\r\\n11640 12953\\r\\n24857 19131\\r\\n10379 33514\\r\\n48482 41888\\r\\n14804 32268\\r\\n13579 10572\\r\\n38169 40\\r\\n45500 15067\\r\\n6563 17385\\r\\n4128 32716\\r\\n26911 1327\\r\\n12822 2815\\r\\n47262 38911\\r\\n41105 45371\\r\\n47717 38816\\r\\n12473 59\\r\\n42590 111\\r\\n1576 18411\\r\\n43653 1788\\r\\n39614 14016\\r\\n40589 13659\\r\\n45806 9726\\r\\n9977 41444\\r\\n2319 20223\\r\\n34898 12420\\r\\n5659 3299\\r\\n49351 794\\r\\n15891 18186\\r\\n46233 37946\\r\\n34393 10940\\r\\n29371 18509\\r\\n26772 28065\\r\\n36648 271\\r\\n34128 47610\\r\\n33980 27568\\r\\n29259 49702\\r\\n15690 47604\\r\\n17545 11997\\r\\n2501 18563\\r\\n17297 31481\\r\\n14...\", \"output\": [\"-1\"]}]"} {"prob_desc_description":"Let's assume that set S consists of m distinct intervals [l1,\u2009r1], [l2,\u2009r2], ..., [lm,\u2009rm] (1\u2009\u2264\u2009li\u2009\u2264\u2009ri\u2009\u2264\u2009n; li,\u2009ri are integers).Let's assume that f(S) is the maximum number of intervals that you can choose from the set S, such that every two of them do not intersect. We assume that two intervals, [l1,\u2009r1] and [l2,\u2009r2], intersect if there is an integer x, which meets two inequalities: l1\u2009\u2264\u2009x\u2009\u2264\u2009r1 and l2\u2009\u2264\u2009x\u2009\u2264\u2009r2.Sereja wonders, how many sets S are there, such that f(S)\u2009=\u2009k? Count this number modulo 1000000007 (109\u2009+\u20097).","prob_desc_output_spec":"In a single line, print the answer to the problem modulo 1000000007 (109\u2009+\u20097).","lang_cluster":"","src_uid":"111673158df2e37ac6c019bb99225ccb","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["dp"],"prob_desc_created_at":"1398612600","prob_desc_sample_inputs":"[\"3 1\", \"3 2\", \"2 0\", \"2 2\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":2500.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1.5 seconds","prob_desc_input_spec":"The first line contains integers n, k (1\u2009\u2264\u2009n\u2009\u2264\u2009500;\u00a00\u2009\u2264\u2009k\u2009\u2264\u2009500).","prob_desc_sample_outputs":"[\"23\", \"32\", \"1\", \"2\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"3 1\\r\\n\", \"output\": [\"23\"]}, {\"input\": \"3 2\\r\\n\", \"output\": [\"32\"]}, {\"input\": \"2 0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"20 10\\r\\n\", \"output\": [\"169364726\"]}, {\"input\": \"50 49\\r\\n\", \"output\": [\"560578792\"]}, {\"input\": \"50 100\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"10 0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"50 0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"10 9\\r\\n\", \"output\": [\"391716853\"]}, {\"input\": \"100 10\\r\\n\", \"output\": [\"209177805\"]}, {\"input\": \"1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 100\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"100 100\\r\\n\", \"output\": [\"281603733\"]}, {\"input\": \"100 99\\r\\n\", \"output\": [\"599757793\"]}, {\"input\": \"100 50\\r\\n\", \"output\": [\"820383341\"]}, {\"input\": \"99 60\\r\\n\", \"output\": [\"97903617\"]}, {\"input\": \"95 93\\r\\n\", \"output\": [\"483334618\"]}, {\"input\": \"400 399\\r\\n\", \"output\": [\"760864214\"]}, {\"input\": \"500 499\\r\\n\", \"output\": [\"582854781\"]}, {\"input\": \"500 500\\r\\n\", \"output\": [\"731931766\"]}, {\"input\": \"400 500\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"500 20\\r\\n\", \"output\": [\"211189748\"]}, {\"input\": \"5 3\\r\\n\", \"output\": [\"14720\"]}, {\"input\": \"5 5\\r\\n\", \"output\": [\"1024\"]}, {\"input\": \"4 1\\r\\n\", \"output\": [\"127\"]}, {\"input\": \"4 4\\r\\n\", \"output\": [\"64\"]}]"} {"prob_desc_description":"Iahub is training for the IOI. What is a better way to train than playing a Zuma-like game? There are n balls put in a row. Each ball is colored in one of k colors. Initially the row doesn't contain three or more contiguous balls with the same color. Iahub has a single ball of color x. He can insert his ball at any position in the row (probably, between two other balls). If at any moment there are three or more contiguous balls of the same color in the row, they are destroyed immediately. This rule is applied multiple times, until there are no more sets of 3 or more contiguous balls of the same color. For example, if Iahub has the row of balls [black, black, white, white, black, black] and a white ball, he can insert the ball between two white balls. Thus three white balls are destroyed, and then four black balls become contiguous, so all four balls are destroyed. The row will not contain any ball in the end, so Iahub can destroy all 6 balls.Iahub wants to destroy as many balls as possible. You are given the description of the row of balls, and the color of Iahub's ball. Help Iahub train for the IOI by telling him the maximum number of balls from the row he can destroy.","prob_desc_output_spec":"Print a single integer \u2014 the maximum number of balls Iahub can destroy.","lang_cluster":"","src_uid":"d73d9610e3800817a3109314b1e6f88c","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force","two pointers"],"prob_desc_created_at":"1399822800","prob_desc_sample_inputs":"[\"6 2 2\\n1 1 2 2 1 1\", \"1 1 1\\n1\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":1400.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line of input contains three integers: n (1\u2009\u2264\u2009n\u2009\u2264\u2009100), k (1\u2009\u2264\u2009k\u2009\u2264\u2009100) and x (1\u2009\u2264\u2009x\u2009\u2264\u2009k). The next line contains n space-separated integers c1,\u2009c2,\u2009...,\u2009cn (1\u2009\u2264\u2009ci\u2009\u2264\u2009k). Number ci means that the i-th ball in the row has color ci. It is guaranteed that the initial row of balls will never contain three or more contiguous balls of the same color. ","prob_desc_sample_outputs":"[\"6\", \"0\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"6 2 2\\r\\n1 1 2 2 1 1\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"1 1 1\\r\\n1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"10 2 1\\r\\n2 1 2 2 1 2 2 1 1 2\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"50 2 1\\r\\n1 1 2 2 1 2 1 1 2 2 1 2 1 2 1 1 2 2 1 2 1 2 2 1 2 1 2 1 2 2 1 1 2 2 1 1 2 2 1 2 1 1 2 1 1 2 2 1 1 2\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"75 5 5\\r\\n1 1 5 5 3 5 2 3 3 2 2 1 1 5 4 4 3 4 5 4 3 3 1 2 2 1 2 1 2 5 5 2 1 3 2 2 3 1 2 1 1 5 5 1 1 2 1 1 2 2 5 2 2 1 1 2 1 2 1 1 3 3 5 4 4 3 3 4 4 5 5 1 1 2 2\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"100 3 2\\r\\n1 1 2 3 1 3 2 1 1 3 3 2 2 1 1 2 2 1 1 3 2 2 3 2 3 2 2 3 3 1 1 2 2 1 2 2 1 3 3 1 3 3 1 2 1 2 2 1 2 3 2 1 1 2 1 1 3 3 1 3 3 1 1 2 2 1 1 2 1 3 2 2 3 2 2 3 3 1 2 1 2 2 1 1 2 3 1 3 3 1 2 3 2 2 1 3 2 2 3 3\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"100 2 1\\r\\n2 2 1 2 1 2 1 2 2 1 1 2 1 1 2 1 1 2 2 1 1 2 1 1 2 1 2 2 1 2 1 2 1 2 1 1 2 1 1 2 1 1 2 2 1 1 2 1 2 2 1 2 1 2 1 2 1 1 2 2 1 2 1 1 2 2 1 1 2 1 2 1 2 1 2 2 1 2 1 1 2 1 2 1 1 2 1 1 2 1 1 2 2 1 2 2 1 1 2 1\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"100 2 2\\r\\n1 2 1 2 2 1 2 1 2 1 2 1 1 2 1 2 2 1 1 2 1 1 2 2 1 1 2 1 2 2 1 2 2 1 2 1 2 1 1 2 1 2 1 2 1 2 1 1 2 1 1 2 2 1 1 2 2 1 2 1 2 1 2 1 2 2 1 2 1 2 2 1 1 2 1 2 2 1 1 2 2 1 2 1 2 1 1 2 1 2 1 2 1 2 1 2 2 1 2 2\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"100 2 2\\r\\n1 2 1 1 2 1 2 2 1 2 1 2 1 2 1 2 1 2 2 1 1 2 2 1 2 1 1 2 2 1 1 2 1 2 1 2 1 1 2 1 1 2 1 2 2 1 1 2 2 1 1 2 1 2 2 1 1 2 1 2 1 2 2 1 2 2 1 1 2 1 2 2 1 2 2 1 2 1 1 2 1 2 2 1 2 2 1 2 1 2 1 2 1 1 2 2 1 1 2 2\\r\\n\", \"output\": [\"17\"]}, {\"input\": \"100 2 2\\r\\n2 1 1 2 2 1 1 2 1 2 1 1 2 2 1 2 1 2 1 2 2 1 2 1 1 2 1 2 1 2 1 2 1 1 2 2 1 1 2 1 1 2 1 2 2 1 1 2 1 2 1 1 2 2 1 1 2 1 2 1 2 1 2 2 1 1 2 2 1 1 2 2 1 2 1 2 1 1 2 1 1 2 2 1 2 1 2 2 1 2 2 1 1 2 1 2 2 1 2 2\\r\\n\", \"output\": [\"17\"]}, {\"input\": \"100 2 2\\r\\n1 2 2 1 2 2 1 1 2 1 2 1 2 1 2 1 2 1 2 1 1 2 2 1 2 1 2 1 2 1 2 1 1 2 1 1 2 1 2 2 1 1 2 2 1 1 2 1 1 2 2 1 2 1 2 1 2 1 2 1 1 2 2 1 1 2 2 1 1 2 2 1 2 2 1 1 2 1 2 2 1 2 2 1 2 2 1 2 2 1 1 2 2 1 2 1 2 1 2 1\\r\\n\", \"output\": [\"28\"]}, {\"input\": \"100 2 2\\r\\n1 1 2 1 2 1 1 2 1 2 1 2 2 1 2 1 2 1 1 2 2 1 2 1 1 2 2 1 1 2 1 2 2 1 2 2 1 2 1 2 1 1 2 1 2 1 1 2 2 1 1 2 1 2 1 2 1 2 1 2 2 1 1 2 1 2 2 1 2 1 1 2 1 1 2 1 2 1 2 1 1 2 1 2 2 1 2 1 2 2 1 1 2 1 2 2 1 1 2 2\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"100 100 50\\r\\n15 44 5 7 75 40 52 82 78 90 48 32 16 53 69 2 21 84 7 21 21 87 29 8 42 54 10 21 38 55 54 88 48 63 3 17 45 82 82 91 7 11 11 24 24 79 1 32 32 38 41 41 4 4 74 17 26 26 96 96 3 3 50 50 96 26 26 17 17 74 74 4 41 38 38 32 1 1 79 79 24 11 11 7 7 91 91 82 45 45 97 9 74 60 32 91 61 64 100 26\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"100 50 22\\r\\n15 2 18 15 48 35 46 33 32 39 39 5 5 27 27 50 50 47 47 10 10 6 3 3 7 8 7 17 17 29 14 10 10 46 13 13 31 32 31 22 22 32 31 31 32 13 13 46 46 10 10 14 14 29 29 17 7 7 8 3 6 6 10 47 50 50 27 5 5 39 39 21 47 4 40 47 21 28 21 21 40 27 34 17 3 36 5 7 21 14 25 49 40 34 32 13 23 29 2 4\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"100 3 3\\r\\n3 1 1 2 1 1 3 1 3 3 1 3 3 1 2 1 1 2 2 3 3 2 3 2 2 3 1 3 3 2 2 1 3 3 2 2 1 2 3 3 1 3 1 3 1 2 2 1 2 1 2 3 1 3 1 3 2 1 3 2 3 3 2 3 2 3 1 3 2 2 1 2 1 2 1 1 3 1 3 1 2 1 2 1 2 3 2 2 3 3 2 2 3 2 2 3 1 1 2 3\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"100 100 100\\r\\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\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"100 2 2\\r\\n1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 1 2 2\\r\\n\", \"output\": [\"98\"]}, {\"input\": \"6 20 10\\r\\n10 2 10 10 2 2\\r\\n\", \"output\": [\"5\"]}]"} {"prob_desc_description":"Ann has recently started commuting by subway. We know that a one ride subway ticket costs a rubles. Besides, Ann found out that she can buy a special ticket for m rides (she can buy it several times). It costs b rubles. Ann did the math; she will need to use subway n times. Help Ann, tell her what is the minimum sum of money she will have to spend to make n rides?","prob_desc_output_spec":"Print a single integer \u2014 the minimum sum in rubles that Ann will need to spend.","lang_cluster":"","src_uid":"faa343ad6028c5a069857a38fa19bb24","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["implementation"],"prob_desc_created_at":"1410535800","prob_desc_sample_inputs":"[\"6 2 1 2\", \"5 2 2 3\"]","prob_desc_notes":"NoteIn the first sample one of the optimal solutions is: each time buy a one ride ticket. There are other optimal solutions. For example, buy three m ride tickets.","exec_outcome":"","difficulty":1200.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The single line contains four space-separated integers n, m, a, b (1\u2009\u2264\u2009n,\u2009m,\u2009a,\u2009b\u2009\u2264\u20091000) \u2014 the number of rides Ann has planned, the number of rides covered by the m ride ticket, the price of a one ride ticket and the price of an m ride ticket. ","prob_desc_sample_outputs":"[\"6\", \"8\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"6 2 1 2\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"5 2 2 3\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"10 3 5 1\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"1000 1 1000 1000\\r\\n\", \"output\": [\"1000000\"]}, {\"input\": \"1000 3 1000 1000\\r\\n\", \"output\": [\"334000\"]}, {\"input\": \"1 1 1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"10 2 1 1\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"1 1000 1 2\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 1000 3 2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"10 3 1 2\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"995 1 2 1\\r\\n\", \"output\": [\"995\"]}, {\"input\": \"556 2 16 15\\r\\n\", \"output\": [\"4170\"]}, {\"input\": \"477 2 16 14\\r\\n\", \"output\": [\"3346\"]}, {\"input\": \"101 110 1 100\\r\\n\", \"output\": [\"100\"]}, {\"input\": \"9 3 3 10\\r\\n\", \"output\": [\"27\"]}, {\"input\": \"100 8 10 1\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"6 4 1 3\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"8 5 2 8\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"1000 2 1 1000\\r\\n\", \"output\": [\"1000\"]}]"} {"prob_desc_description":"Pasha has a positive integer a without leading zeroes. Today he decided that the number is too small and he should make it larger. Unfortunately, the only operation Pasha can do is to swap two adjacent decimal digits of the integer.Help Pasha count the maximum number he can get if he has the time to make at most k swaps.","prob_desc_output_spec":"Print the maximum number that Pasha can get if he makes at most k swaps.","lang_cluster":"","src_uid":"e56f6c343167745821f0b18dcf0d0cde","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["greedy"],"prob_desc_created_at":"1401463800","prob_desc_sample_inputs":"[\"1990 1\", \"300 0\", \"1034 2\", \"9090000078001234 6\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":1400.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The single line contains two integers a and k (1\u2009\u2264\u2009a\u2009\u2264\u20091018;\u00a00\u2009\u2264\u2009k\u2009\u2264\u2009100).","prob_desc_sample_outputs":"[\"9190\", \"300\", \"3104\", \"9907000008001234\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"1990 1\\r\\n\", \"output\": [\"9190\"]}, {\"input\": \"300 0\\r\\n\", \"output\": [\"300\"]}, {\"input\": \"1034 2\\r\\n\", \"output\": [\"3104\"]}, {\"input\": \"9090000078001234 6\\r\\n\", \"output\": [\"9907000008001234\"]}, {\"input\": \"1234 3\\r\\n\", \"output\": [\"4123\"]}, {\"input\": \"5 100\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"1234 5\\r\\n\", \"output\": [\"4312\"]}, {\"input\": \"1234 6\\r\\n\", \"output\": [\"4321\"]}, {\"input\": \"9022 2\\r\\n\", \"output\": [\"9220\"]}, {\"input\": \"66838 4\\r\\n\", \"output\": [\"86863\"]}, {\"input\": \"39940894417248510 10\\r\\n\", \"output\": [\"99984304417248510\"]}, {\"input\": \"5314 4\\r\\n\", \"output\": [\"5431\"]}, {\"input\": \"1026 9\\r\\n\", \"output\": [\"6210\"]}, {\"input\": \"4529 8\\r\\n\", \"output\": [\"9542\"]}, {\"input\": \"83811284 3\\r\\n\", \"output\": [\"88321184\"]}, {\"input\": \"92153348 6\\r\\n\", \"output\": [\"98215334\"]}, {\"input\": \"5846059 3\\r\\n\", \"output\": [\"8654059\"]}, {\"input\": \"521325125110071928 4\\r\\n\", \"output\": [\"552132125110071928\"]}, {\"input\": \"39940894417248510 10\\r\\n\", \"output\": [\"99984304417248510\"]}, {\"input\": \"77172428736634377 29\\r\\n\", \"output\": [\"87777764122363437\"]}, {\"input\": \"337775999910796051 37\\r\\n\", \"output\": [\"999997733751076051\"]}, {\"input\": \"116995340392134308 27\\r\\n\", \"output\": [\"999654331120134308\"]}, {\"input\": \"10120921290110921 20\\r\\n\", \"output\": [\"99221010120110921\"]}, {\"input\": \"929201010190831892 30\\r\\n\", \"output\": [\"999928201010103182\"]}, {\"input\": \"111111111111111119 8\\r\\n\", \"output\": [\"111111111911111111\"]}, {\"input\": \"219810011901120912 100\\r\\n\", \"output\": [\"999822211111110000\"]}, {\"input\": \"191919191919119911 100\\r\\n\", \"output\": [\"999999991111111111\"]}, {\"input\": \"801211288881101019 22\\r\\n\", \"output\": [\"982111028888110101\"]}, {\"input\": \"619911311932347059 3\\r\\n\", \"output\": [\"969111311932347059\"]}, {\"input\": \"620737553540689123 2\\r\\n\", \"output\": [\"672037553540689123\"]}, {\"input\": \"621563797296514835 3\\r\\n\", \"output\": [\"662153797296514835\"]}, {\"input\": \"915277434701161 9\\r\\n\", \"output\": [\"977541234701161\"]}, {\"input\": \"15603712376708 28\\r\\n\", \"output\": [\"87761503123670\"]}, {\"input\": \"784069392990841 0\\r\\n\", \"output\": [\"784069392990841\"]}, {\"input\": \"787464780004 2\\r\\n\", \"output\": [\"877644780004\"]}, {\"input\": \"74604713975 29\\r\\n\", \"output\": [\"97776544310\"]}, {\"input\": \"901000000954321789 5\\r\\n\", \"output\": [\"910009000054321789\"]}, {\"input\": \"901000000954321789 10\\r\\n\", \"output\": [\"991000000504321789\"]}, {\"input\": \"901000000954321789 28\\r\\n\", \"output\": [\"999100050000432178\"]}, {\"input\": \"901000000954321789 40\\r\\n\", \"output\": [\"999810000050043217\"]}, {\"input\": \"901000000954321789 70\\r\\n\", \"output\": [\"999875410000300021\"]}, {\"input\": \"1234567891234567 99\\r\\n\", \"output\": [\"9877665544332211\"]}, {\"input\": \"123456789123456789 100\\r\\n\", \"output\": [\"998877665544213123\"]}, {\"input\": \"12345670123456789 100\\r\\n\", \"output\": [\"98776655443322101\"]}, {\"input\": \"12 100\\r\\n\", \"output\": [\"21\"]}, {\"input\": \"11223344556677889 47\\r\\n\", \"output\": [\"98821213344556677\"]}]"} {"prob_desc_description":"This winter is so cold in Nvodsk! A group of n friends decided to buy k bottles of a soft drink called \"Take-It-Light\" to warm up a bit. Each bottle has l milliliters of the drink. Also they bought c limes and cut each of them into d slices. After that they found p grams of salt.To make a toast, each friend needs nl milliliters of the drink, a slice of lime and np grams of salt. The friends want to make as many toasts as they can, provided they all drink the same amount. How many toasts can each friend make?","prob_desc_output_spec":"Print a single integer \u2014 the number of toasts each friend can make.","lang_cluster":"","src_uid":"67410b7d36b9d2e6a97ca5c7cff317c1","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","implementation"],"prob_desc_created_at":"1329490800","prob_desc_sample_inputs":"[\"3 4 5 10 8 100 3 1\", \"5 100 10 1 19 90 4 3\", \"10 1000 1000 25 23 1 50 1\"]","prob_desc_notes":"NoteA comment to the first sample: Overall the friends have 4\u2009*\u20095\u2009=\u200920 milliliters of the drink, it is enough to make 20\u2009\/\u20093\u2009=\u20096 toasts. The limes are enough for 10\u2009*\u20098\u2009=\u200980 toasts and the salt is enough for 100\u2009\/\u20091\u2009=\u2009100 toasts. However, there are 3 friends in the group, so the answer is min(6,\u200980,\u2009100)\u2009\/\u20093\u2009=\u20092.","exec_outcome":"","difficulty":800.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first and only line contains positive integers n, k, l, c, d, p, nl, np, not exceeding 1000 and no less than 1. The numbers are separated by exactly one space.","prob_desc_sample_outputs":"[\"2\", \"3\", \"0\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"3 4 5 10 8 100 3 1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"5 100 10 1 19 90 4 3\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"10 1000 1000 25 23 1 50 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 7 4 5 5 8 3 2\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"2 3 3 5 5 10 1 3\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 6 4 5 6 5 1 3\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 7 3 5 3 6 2 1\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"2 4 5 4 5 7 3 2\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 3 6 5 7 8 2 1\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"1 4 5 5 3 10 3 1\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"1 4 6 7 3 5 1 3\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 6 5 5 5 8 3 1\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"1 7 5 3 3 9 2 1\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"3 5 3 7 6 10 3 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"3 6 3 5 3 6 3 1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1 7 5 5 5 5 2 2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"2 5 3 5 6 9 2 1\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"3 4 3 5 3 6 2 1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1 5 5 4 7 6 3 1\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"2 3 7 6 5 9 3 1\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"2 6 5 3 3 8 1 1\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"2 4 7 3 4 10 2 1\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"1 1000 1000 1000 1000 1000 1 1\\r\\n\", \"output\": [\"1000\"]}, {\"input\": \"17 1000 1000 1000 1000 1000 3 7\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"115 1000 1000 1000 1000 1000 17 15\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 587 981 1 2 1 1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 1 2 1 2 2 1 1\\r\\n\", \"output\": [\"2\"]}]"} {"prob_desc_description":"Lavrenty, a baker, is going to make several buns with stuffings and sell them.Lavrenty has n grams of dough as well as m different stuffing types. The stuffing types are numerated from 1 to m. Lavrenty knows that he has ai grams left of the i-th stuffing. It takes exactly bi grams of stuffing i and ci grams of dough to cook a bun with the i-th stuffing. Such bun can be sold for di tugriks.Also he can make buns without stuffings. Each of such buns requires c0 grams of dough and it can be sold for d0 tugriks. So Lavrenty can cook any number of buns with different stuffings or without it unless he runs out of dough and the stuffings. Lavrenty throws away all excess material left after baking.Find the maximum number of tugriks Lavrenty can earn.","prob_desc_output_spec":"Print the only number \u2014 the maximum number of tugriks Lavrenty can earn.","lang_cluster":"","src_uid":"4e166b8b44427b1227e0f811161d3a6f","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["dp"],"prob_desc_created_at":"1313766000","prob_desc_sample_inputs":"[\"10 2 2 1\\n7 3 2 100\\n12 3 1 10\", \"100 1 25 50\\n15 5 20 10\"]","prob_desc_notes":"NoteTo get the maximum number of tugriks in the first sample, you need to cook 2 buns with stuffing 1, 4 buns with stuffing 2 and a bun without any stuffing.In the second sample Lavrenty should cook 4 buns without stuffings.","exec_outcome":"","difficulty":1700.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line contains 4 integers n, m, c0 and d0 (1\u2009\u2264\u2009n\u2009\u2264\u20091000, 1\u2009\u2264\u2009m\u2009\u2264\u200910, 1\u2009\u2264\u2009c0,\u2009d0\u2009\u2264\u2009100). Each of the following m lines contains 4 integers. The i-th line contains numbers ai, bi, ci and di (1\u2009\u2264\u2009ai,\u2009bi,\u2009ci,\u2009di\u2009\u2264\u2009100).","prob_desc_sample_outputs":"[\"241\", \"200\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"10 2 2 1\\r\\n7 3 2 100\\r\\n12 3 1 10\\r\\n\", \"output\": [\"241\"]}, {\"input\": \"100 1 25 50\\r\\n15 5 20 10\\r\\n\", \"output\": [\"200\"]}, {\"input\": \"10 1 5 2\\r\\n100 1 2 3\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"10 1 5 11\\r\\n3 1 3 8\\r\\n\", \"output\": [\"24\"]}, {\"input\": \"10 2 11 5\\r\\n100 1 3 10\\r\\n100 1 2 4\\r\\n\", \"output\": [\"30\"]}, {\"input\": \"5 8 6 5\\r\\n1 2 5 4\\r\\n1 2 6 7\\r\\n1 2 3 5\\r\\n1 2 1 6\\r\\n1 2 8 3\\r\\n1 2 2 4\\r\\n1 2 5 6\\r\\n1 2 7 7\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"300 4 100 2\\r\\n10 1 24 5\\r\\n10 1 25 6\\r\\n10 1 26 7\\r\\n10 1 27 8\\r\\n\", \"output\": [\"87\"]}, {\"input\": \"1 1 1 1\\r\\n1 1 1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 1 2 1\\r\\n1 2 1 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"10 2 13 100\\r\\n20 1 3 10\\r\\n20 1 2 6\\r\\n\", \"output\": [\"32\"]}, {\"input\": \"100 5 8 80\\r\\n25 8 2 70\\r\\n27 6 7 30\\r\\n26 1 6 5\\r\\n7 1 1 86\\r\\n18 8 4 54\\r\\n\", \"output\": [\"1670\"]}, {\"input\": \"150 8 3 46\\r\\n39 4 10 25\\r\\n31 17 8 70\\r\\n37 2 13 1\\r\\n29 17 17 59\\r\\n54 20 5 39\\r\\n53 14 10 23\\r\\n50 12 16 41\\r\\n8 2 6 61\\r\\n\", \"output\": [\"2300\"]}, {\"input\": \"231 10 9 30\\r\\n98 11 5 17\\r\\n59 13 1 47\\r\\n83 1 7 2\\r\\n42 21 1 6\\r\\n50 16 2 9\\r\\n44 10 5 31\\r\\n12 20 8 9\\r\\n61 23 7 2\\r\\n85 18 2 19\\r\\n82 25 10 20\\r\\n\", \"output\": [\"1065\"]}, {\"input\": \"345 10 5 45\\r\\n1 23 14 55\\r\\n51 26 15 11\\r\\n65 4 16 36\\r\\n81 14 13 25\\r\\n8 9 13 60\\r\\n43 4 7 59\\r\\n85 11 14 35\\r\\n82 13 5 49\\r\\n85 28 15 3\\r\\n51 21 18 53\\r\\n\", \"output\": [\"3129\"]}, {\"input\": \"401 10 2 82\\r\\n17 9 14 48\\r\\n79 4 3 38\\r\\n1 2 6 31\\r\\n45 2 9 60\\r\\n45 2 4 50\\r\\n6 1 3 36\\r\\n3 1 19 37\\r\\n78 3 8 33\\r\\n59 8 19 19\\r\\n65 10 2 61\\r\\n\", \"output\": [\"16400\"]}, {\"input\": \"777 10 23 20\\r\\n50 90 86 69\\r\\n33 90 59 73\\r\\n79 26 35 31\\r\\n57 48 97 4\\r\\n5 10 48 87\\r\\n35 99 33 34\\r\\n7 32 54 35\\r\\n56 25 10 38\\r\\n5 3 89 76\\r\\n13 33 91 66\\r\\n\", \"output\": [\"734\"]}, {\"input\": \"990 10 7 20\\r\\n38 82 14 69\\r\\n5 66 51 5\\r\\n11 26 91 11\\r\\n29 12 73 96\\r\\n93 82 48 59\\r\\n19 15 5 50\\r\\n15 36 6 63\\r\\n16 57 94 90\\r\\n45 3 57 72\\r\\n61 41 47 18\\r\\n\", \"output\": [\"2850\"]}, {\"input\": \"1000 10 51 56\\r\\n2 62 82 65\\r\\n37 90 87 97\\r\\n11 94 47 95\\r\\n49 24 97 24\\r\\n33 38 40 31\\r\\n27 15 17 66\\r\\n91 80 34 71\\r\\n60 93 42 94\\r\\n9 35 73 68\\r\\n93 65 83 58\\r\\n\", \"output\": [\"1145\"]}, {\"input\": \"1000 10 1 53\\r\\n63 1 1 58\\r\\n58 1 2 28\\r\\n100 1 1 25\\r\\n61 1 1 90\\r\\n96 2 2 50\\r\\n19 2 1 90\\r\\n7 2 1 30\\r\\n90 1 2 5\\r\\n34 2 1 12\\r\\n3 2 1 96\\r\\n\", \"output\": [\"55948\"]}, {\"input\": \"1000 10 1 65\\r\\n77 1 1 36\\r\\n74 1 1 41\\r\\n96 1 1 38\\r\\n48 1 1 35\\r\\n1 1 1 54\\r\\n42 1 1 67\\r\\n26 1 1 23\\r\\n43 1 1 89\\r\\n82 1 1 7\\r\\n45 1 1 63\\r\\n\", \"output\": [\"66116\"]}, {\"input\": \"1000 10 1 87\\r\\n100 1 1 38\\r\\n100 1 1 45\\r\\n100 1 1 73\\r\\n100 1 1 89\\r\\n100 1 1 38\\r\\n100 1 1 13\\r\\n100 1 1 93\\r\\n100 1 1 89\\r\\n100 1 1 71\\r\\n100 1 1 29\\r\\n\", \"output\": [\"88000\"]}, {\"input\": \"1000 10 1 7\\r\\n100 1 1 89\\r\\n100 1 1 38\\r\\n100 1 1 13\\r\\n100 1 1 93\\r\\n100 1 1 89\\r\\n100 1 1 38\\r\\n100 1 1 45\\r\\n100 1 1 73\\r\\n100 1 1 71\\r\\n100 1 1 29\\r\\n\", \"output\": [\"57800\"]}, {\"input\": \"1000 10 1 100\\r\\n100 1 1 100\\r\\n100 1 1 100\\r\\n100 1 1 100\\r\\n100 1 1 100\\r\\n100 1 1 100\\r\\n100 1 1 100\\r\\n100 1 1 100\\r\\n100 1 1 100\\r\\n100 1 1 100\\r\\n100 1 1 100\\r\\n\", \"output\": [\"100000\"]}, {\"input\": \"99 10 100 100\\r\\n100 1 100 100\\r\\n100 1 100 100\\r\\n100 1 100 100\\r\\n100 1 100 100\\r\\n100 1 100 100\\r\\n100 1 100 100\\r\\n100 1 100 100\\r\\n100 1 100 100\\r\\n100 1 100 100\\r\\n100 1 100 100\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1000 10 100 75\\r\\n100 97 100 95\\r\\n100 64 100 78\\r\\n100 82 100 35\\r\\n100 51 100 64\\r\\n100 67 100 25\\r\\n100 79 100 33\\r\\n100 65 100 85\\r\\n100 99 100 78\\r\\n100 53 100 74\\r\\n100 87 100 73\\r\\n\", \"output\": [\"786\"]}, {\"input\": \"999 10 5 100\\r\\n100 1 10 100\\r\\n100 1 10 100\\r\\n100 1 10 100\\r\\n100 1 10 100\\r\\n100 1 10 100\\r\\n100 1 10 100\\r\\n100 1 10 100\\r\\n100 1 10 100\\r\\n100 1 10 100\\r\\n100 1 10 100\\r\\n\", \"output\": [\"19900\"]}, {\"input\": \"1000 10 50 100\\r\\n7 1 80 100\\r\\n5 1 37 100\\r\\n9 1 25 100\\r\\n7 1 17 100\\r\\n6 1 10 100\\r\\n5 1 15 100\\r\\n6 1 13 100\\r\\n2 1 14 100\\r\\n4 1 17 100\\r\\n3 1 32 100\\r\\n\", \"output\": [\"4800\"]}, {\"input\": \"1000 10 1 1\\r\\n1 2 1 97\\r\\n1 2 1 95\\r\\n1 2 1 99\\r\\n1 2 1 98\\r\\n1 2 1 93\\r\\n1 2 1 91\\r\\n1 2 1 90\\r\\n1 2 1 94\\r\\n1 2 1 92\\r\\n1 2 1 99\\r\\n\", \"output\": [\"1000\"]}, {\"input\": \"1 10 1 97\\r\\n1 1 1 98\\r\\n1 1 1 99\\r\\n1 1 1 76\\r\\n1 1 1 89\\r\\n1 1 1 64\\r\\n1 1 1 83\\r\\n1 1 1 72\\r\\n1 1 1 66\\r\\n1 1 1 54\\r\\n1 1 1 73\\r\\n\", \"output\": [\"99\"]}, {\"input\": \"3 10 10 98\\r\\n10 5 5 97\\r\\n6 7 1 56\\r\\n23 10 5 78\\r\\n40 36 4 35\\r\\n30 50 1 30\\r\\n60 56 8 35\\r\\n70 90 2 17\\r\\n10 11 3 68\\r\\n1 2 17 70\\r\\n13 4 8 19\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1000 1 23 76\\r\\n74 22 14 5\\r\\n\", \"output\": [\"3268\"]}, {\"input\": \"1000 2 95 56\\r\\n58 54 66 61\\r\\n61 14 67 65\\r\\n\", \"output\": [\"713\"]}, {\"input\": \"1000 3 67 88\\r\\n90 86 66 17\\r\\n97 38 63 17\\r\\n55 78 39 51\\r\\n\", \"output\": [\"1232\"]}, {\"input\": \"1000 4 91 20\\r\\n74 18 18 73\\r\\n33 10 59 21\\r\\n7 42 87 79\\r\\n9 100 77 100\\r\\n\", \"output\": [\"515\"]}, {\"input\": \"1000 5 63 52\\r\\n6 98 18 77\\r\\n17 34 3 73\\r\\n59 6 35 7\\r\\n61 16 85 64\\r\\n73 62 40 11\\r\\n\", \"output\": [\"804\"]}, {\"input\": \"1000 6 87 32\\r\\n90 30 70 33\\r\\n53 6 99 77\\r\\n59 22 83 35\\r\\n65 32 93 28\\r\\n85 50 60 7\\r\\n15 15 5 82\\r\\n\", \"output\": [\"771\"]}, {\"input\": \"1000 7 59 64\\r\\n22 62 70 89\\r\\n37 78 43 29\\r\\n11 86 83 63\\r\\n17 48 1 92\\r\\n97 38 80 55\\r\\n15 3 89 42\\r\\n87 80 62 35\\r\\n\", \"output\": [\"1024\"]}, {\"input\": \"1000 8 31 96\\r\\n6 94 70 93\\r\\n73 2 39 33\\r\\n63 50 31 91\\r\\n21 64 9 56\\r\\n61 26 100 51\\r\\n67 39 21 50\\r\\n79 4 2 71\\r\\n100 9 18 86\\r\\n\", \"output\": [\"4609\"]}, {\"input\": \"1000 9 55 28\\r\\n38 74 22 49\\r\\n9 74 83 85\\r\\n63 66 79 19\\r\\n25 32 17 20\\r\\n73 62 20 47\\r\\n19 27 53 58\\r\\n71 80 94 7\\r\\n56 69 62 98\\r\\n49 7 65 76\\r\\n\", \"output\": [\"831\"]}, {\"input\": \"1000 10 67 55\\r\\n10 21 31 19\\r\\n95 29 53 1\\r\\n55 53 19 18\\r\\n26 88 19 94\\r\\n31 1 45 50\\r\\n70 38 33 93\\r\\n2 12 7 95\\r\\n54 37 81 31\\r\\n65 32 63 16\\r\\n93 66 98 38\\r\\n\", \"output\": [\"1161\"]}, {\"input\": \"1000 10 37 38\\r\\n65 27 78 14\\r\\n16 70 78 66\\r\\n93 86 91 43\\r\\n95 6 72 86\\r\\n72 59 94 36\\r\\n66 58 96 40\\r\\n41 72 64 4\\r\\n26 47 69 13\\r\\n85 2 52 15\\r\\n34 62 16 79\\r\\n\", \"output\": [\"1156\"]}, {\"input\": \"1000 10 58 21\\r\\n73 85 73 10\\r\\n38 60 55 31\\r\\n32 66 62 16\\r\\n63 76 73 78\\r\\n61 17 92 70\\r\\n61 79 11 87\\r\\n27 31 21 62\\r\\n47 9 4 94\\r\\n4 71 42 61\\r\\n76 5 35 72\\r\\n\", \"output\": [\"1823\"]}, {\"input\": \"12 2 100 1\\r\\n100 1 9 10\\r\\n100 1 4 4\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"1 1 1 10\\r\\n100 100 1 100\\r\\n\", \"output\": [\"100\"]}, {\"input\": \"10 3 5 1\\r\\n100 1 3 7\\r\\n100 1 2 5\\r\\n1 1 1 10\\r\\n\", \"output\": [\"32\"]}, {\"input\": \"10 3 5 1\\r\\n100 1 3 7\\r\\n100 1 2 5\\r\\n1 1 1 10\\r\\n\", \"output\": [\"32\"]}, {\"input\": \"1000 10 1 1\\r\\n100 1 1 1\\r\\n100 1 1 1\\r\\n100 1 1 1\\r\\n100 1 1 1\\r\\n100 1 1 1\\r\\n100 1 1 1\\r\\n100 1 1 1\\r\\n100 1 1 1\\r\\n100 1 1 1\\r\\n100 1 1 1\\r\\n\", \"output\": [\"1000\"]}, {\"input\": \"10 2 100 1\\r\\n4 4 5 7\\r\\n6 2 3 4\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"8 2 10 10\\r\\n5 5 5 15\\r\\n50 5 4 8\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"8 2 10 10\\r\\n5 5 5 15\\r\\n50 5 4 8\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"4 1 2 4\\r\\n10 1 3 7\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"4 1 2 4\\r\\n10 1 3 7\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"10 2 5 1\\r\\n100 1 2 5\\r\\n100 1 3 8\\r\\n\", \"output\": [\"26\"]}, {\"input\": \"1000 10 10 10\\r\\n100 1 1 1\\r\\n100 1 1 2\\r\\n100 1 2 1\\r\\n100 1 2 2\\r\\n100 1 1 1\\r\\n100 1 2 3\\r\\n100 1 3 2\\r\\n100 1 3 3\\r\\n100 1 1 3\\r\\n100 1 3 1\\r\\n\", \"output\": [\"1400\"]}, {\"input\": \"10 3 5 1\\r\\n100 1 3 7\\r\\n100 1 2 5\\r\\n1 1 1 10\\r\\n\", \"output\": [\"32\"]}]"} {"prob_desc_description":"Little Petya loves training spiders. Petya has a board n\u2009\u00d7\u2009m in size. Each cell of the board initially has a spider sitting on it. After one second Petya chooses a certain action for each spider, and all of them humbly perform its commands. There are 5 possible commands: to stay idle or to move from current cell to some of the four side-neighboring cells (that is, one command for each of the four possible directions). Petya gives the commands so that no spider leaves the field. It is allowed for spiders to pass through each other when they crawl towards each other in opposite directions. All spiders crawl simultaneously and several spiders may end up in one cell. Petya wants to know the maximum possible number of spider-free cells after one second.","prob_desc_output_spec":"In the first line print the maximum number of cells without spiders.","lang_cluster":"","src_uid":"097674b4dd696b30e102938f71dd39b9","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["bitmasks","dp","dsu"],"prob_desc_created_at":"1315051200","prob_desc_sample_inputs":"[\"1 1\", \"2 3\"]","prob_desc_notes":"NoteIn the first sample the only possible answer is:sIn the second sample one of the possible solutions is: rdlruls denotes command \"stay idle\", l, r, d, u denote commands \"crawl left\", \"crawl right\", \"crawl down\", \"crawl up\", correspondingly.","exec_outcome":"","difficulty":2100.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line contains two space-separated integers n and m (1\u2009\u2264\u2009n,\u2009m\u2009\u2264\u200940,\u2009n\u00b7m\u2009\u2264\u200940) \u2014 the board sizes.","prob_desc_sample_outputs":"[\"0\", \"4\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"1 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 3\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"4 1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"4 2\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"4 3\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"4 4\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"1 40\\r\\n\", \"output\": [\"26\"]}, {\"input\": \"1 2\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 3\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1 4\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1 5\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"1 6\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"1 7\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"1 8\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"1 9\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"1 10\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"1 11\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"1 12\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"1 13\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"1 14\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"1 15\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"1 16\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"1 17\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"1 18\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"1 19\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"1 20\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"1 21\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"1 22\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"1 23\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"1 24\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"1 25\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"1 26\\r\\n\", \"output\": [\"17\"]}, {\"input\": \"1 27\\r\\n\", \"output\": [\"18\"]}, {\"input\": \"1 28\\r\\n\", \"output\": [\"18\"]}, {\"input\": \"1 29\\r\\n\", \"output\": [\"19\"]}, {\"input\": \"1 30\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"1 31\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"1 32\\r\\n\", \"output\": [\"21\"]}, {\"input\": \"1 33\\r\\n\", \"output\": [\"22\"]}, {\"input\": \"1 34\\r\\n\", \"output\": [\"22\"]}, {\"input\": \"1 35\\r\\n\", \"output\": [\"23\"]}, {\"input\": \"1 36\\r\\n\", \"output\": [\"24\"]}, {\"input\": \"1 37\\r\\n\", \"output\": [\"24\"]}, {\"input\": \"1 38\\r\\n\", \"output\": [\"25\"]}, {\"input\": \"1 39\\r\\n\", \"output\": [\"26\"]}, {\"input\": \"2 1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"2 4\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"2 5\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"2 6\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"2 7\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"2 8\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"2 9\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"2 10\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"2 11\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"2 12\\r\\n\", \"output\": [\"17\"]}, {\"input\": \"2 13\\r\\n\", \"output\": [\"19\"]}, {\"input\": \"2 14\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"2 15\\r\\n\", \"output\": [\"22\"]}, {\"input\": \"2 16\\r\\n\", \"output\": [\"23\"]}, {\"input\": \"2 17\\r\\n\", \"output\": [\"25\"]}, {\"input\": \"2 18\\r\\n\", \"output\": [\"26\"]}, {\"input\": \"2 19\\r\\n\", \"output\": [\"28\"]}, {\"input\": \"2 20\\r\\n\", \"output\": [\"29\"]}, {\"input\": \"3 1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"3 2\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"3 3\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"3 4\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"3 5\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"3 6\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"3 7\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"3 8\\r\\n\", \"output\": [\"17\"]}, {\"input\": \"3 9\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"3 10\\r\\n\", \"output\": [\"22\"]}, {\"input\": \"3 11\\r\\n\", \"output\": [\"24\"]}, {\"input\": \"3 12\\r\\n\", \"output\": [\"26\"]}, {\"input\": \"3 13\\r\\n\", \"output\": [\"29\"]}, {\"input\": \"4 5\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"4 6\\r\\n\", \"output\": [\"17\"]}, {\"input\": \"4 7\\r\\n\", \"output\": [\"21\"]}, {\"input\": \"4 8\\r\\n\", \"output\": [\"24\"]}, {\"input\": \"4 9\\r\\n\", \"output\": [\"26\"]}, {\"input\": \"4 10\\r\\n\", \"output\": [\"30\"]}, {\"input\": \"5 1\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"5 2\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"5 3\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"5 4\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"5 5\\r\\n\", \"output\": [\"18\"]}, {\"input\": \"5 6\\r\\n\", \"output\": [\"22\"]}, {\"input\": \"5 7\\r\\n\", \"output\": [\"26\"]}, {\"input\": \"5 8\\r\\n\", \"output\": [\"29\"]}, {\"input\": \"6 1\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"6 2\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"6 3\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"6 4\\r\\n\", \"output\": [\"17\"]}, {\"input\": \"6 5\\r\\n\", \"output\": [\"22\"]}, {\"input\": \"6 6\\r\\n\", \"output\": [\"26\"]}, {\"input\": \"7 1\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"7 2\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"7 3\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"7 4\\r\\n\", \"output\": [\"21\"]}, {\"input\": \"7 5\\r\\n\", \"output\": [\"26\"]}, {\"input\": \"8 1\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"8 2\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"8 3\\r\\n\", \"output\": [\"17\"]}, {\"input\": \"8 4\\r\\n\", \"output\": [\"24\"]}, {\"input\": \"8 5\\r\\n\", \"output\": [\"29\"]}, {\"input\": \"9 1\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"9 2\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"9 3\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"9 4\\r\\n\", \"output\": [\"26\"]}, {\"input\": \"10 1\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"10 2\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"10 3\\r\\n\", \"output\": [\"22\"]}, {\"input\": \"10 4\\r\\n\", \"output\": [\"30\"]}, {\"input\": \"11 1\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"11 2\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"11 3\\r\\n\", \"output\": [\"24\"]}, {\"input\": \"12 1\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"12 2\\r\\n\", \"output\": [\"17\"]}, {\"input\": \"12 3\\r\\n\", \"output\": [\"26\"]}, {\"input\": \"13 1\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"13 2\\r\\n\", \"output\": [\"19\"]}, {\"input\": \"13 3\\r\\n\", \"output\": [\"29\"]}, {\"input\": \"14 1\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"14 2\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"15 1\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"15 2\\r\\n\", \"output\": [\"22\"]}, {\"input\": \"16 1\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"16 2\\r\\n\", \"output\": [\"23\"]}, {\"input\": \"17 1\\r\\n\", \"output\": [\"11\"]}, {\"input\": \"17 2\\r\\n\", \"output\": [\"25\"]}, {\"input\": \"18 1\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"18 2\\r\\n\", \"output\": [\"26\"]}, {\"input\": \"19 1\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"19 2\\r\\n\", \"output\": [\"28\"]}, {\"input\": \"20 1\\r\\n\", \"output\": [\"13\"]}, {\"input\": \"20 2\\r\\n\", \"output\": [\"29\"]}, {\"input\": \"21 1\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"22 1\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"23 1\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"24 1\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"25 1\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"26 1\\r\\n\", \"output\": [\"17\"]}, {\"input\": \"27 1\\r\\n\", \"output\": [\"18\"]}, {\"input\": \"28 1\\r\\n\", \"output\": [\"18\"]}, {\"input\": \"29 1\\r\\n\", \"output\": [\"19\"]}, {\"input\": \"30 1\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"31 1\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"32 1\\r\\n\", \"output\": [\"21\"]}, {\"input\": \"33 1\\r\\n\", \"output\": [\"22\"]}, {\"input\": \"34 1\\r\\n\", \"output\": [\"22\"]}, {\"input\": \"35 1\\r\\n\", \"output\": [\"23\"]}, {\"input\": \"36 1\\r\\n\", \"output\": [\"24\"]}, {\"input\": \"37 1\\r\\n\", \"output\": [\"24\"]}, {\"input\": \"38 1\\r\\n\", \"output\": [\"25\"]}, {\"input\": \"39 1\\r\\n\", \"output\": [\"26\"]}, {\"input\": \"40 1\\r\\n\", \"output\": [\"26\"]}]"} {"prob_desc_description":"Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.One day Petya dreamt of a lexicographically k-th permutation of integers from 1 to n. Determine how many lucky numbers in the permutation are located on the positions whose indexes are also lucky numbers.","prob_desc_output_spec":"If the k-th permutation of numbers from 1 to n does not exist, print the single number \"-1\" (without the quotes). Otherwise, print the answer to the problem: the number of such indexes i, that i and ai are both lucky numbers.","lang_cluster":"","src_uid":"cb2aa02772f95fefd1856960b6ceac4c","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force","combinatorics","number theory"],"prob_desc_created_at":"1319727600","prob_desc_sample_inputs":"[\"7 4\", \"4 7\"]","prob_desc_notes":"NoteA permutation is an ordered set of n elements, where each integer from 1 to n occurs exactly once. The element of permutation in position with index i is denoted as ai (1\u2009\u2264\u2009i\u2009\u2264\u2009n). Permutation a is lexicographically smaller that permutation b if there is such a i (1\u2009\u2264\u2009i\u2009\u2264\u2009n), that ai\u2009<\u2009bi, and for any j (1\u2009\u2264\u2009j\u2009<\u2009i) aj\u2009=\u2009bj. Let's make a list of all possible permutations of n elements and sort it in the order of lexicographical increasing. Then the lexicographically k-th permutation is the k-th element of this list of permutations.In the first sample the permutation looks like that:1 2 3 4 6 7 5The only suitable position is 4.In the second sample the permutation looks like that:2 1 3 4The only suitable position is 4.","exec_outcome":"","difficulty":1900.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line contains two integers n and k (1\u2009\u2264\u2009n,\u2009k\u2009\u2264\u2009109) \u2014 the number of elements in the permutation and the lexicographical number of the permutation.","prob_desc_sample_outputs":"[\"1\", \"1\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"7 4\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"4 7\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"7 1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"7 5040\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"10 1023\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"7 7477\\r\\n\", \"output\": [\"-1\"]}, {\"input\": \"10 10000\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"3 7\\r\\n\", \"output\": [\"-1\"]}, {\"input\": \"27 1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"40 8544\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"47 1\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"47 8547744\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"50 1000000000\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"64 87\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"98 854555\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"100 1\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"9985 5888454\\r\\n\", \"output\": [\"30\"]}, {\"input\": \"1 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 2\\r\\n\", \"output\": [\"-1\"]}, {\"input\": \"2 1000000000\\r\\n\", \"output\": [\"-1\"]}, {\"input\": \"10 1000000000\\r\\n\", \"output\": [\"-1\"]}, {\"input\": \"20 1000000000\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"777777 1\\r\\n\", \"output\": [\"126\"]}, {\"input\": \"777777 2\\r\\n\", \"output\": [\"125\"]}, {\"input\": \"777474 10000\\r\\n\", \"output\": [\"120\"]}, {\"input\": \"1000000000 1\\r\\n\", \"output\": [\"1022\"]}, {\"input\": \"777777777 5\\r\\n\", \"output\": [\"1021\"]}, {\"input\": \"777777777 1\\r\\n\", \"output\": [\"1022\"]}, {\"input\": \"777477774 1\\r\\n\", \"output\": [\"989\"]}, {\"input\": \"444747744 1000000000\\r\\n\", \"output\": [\"554\"]}, {\"input\": \"475 88555458\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"12 855448\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"20 1000000000\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"47 99998544\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"49 1000000000\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"854459 95554455\\r\\n\", \"output\": [\"126\"]}, {\"input\": \"77777779 1000000000\\r\\n\", \"output\": [\"508\"]}, {\"input\": \"77 47\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"6999 85488877\\r\\n\", \"output\": [\"22\"]}, {\"input\": \"7479 58884598\\r\\n\", \"output\": [\"24\"]}, {\"input\": \"1000000000 1000000000\\r\\n\", \"output\": [\"1022\"]}, {\"input\": \"7 1000\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"7 124\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"7 2048\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"7 3001\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"7 127\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"7 980\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"7 5000\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"7 4095\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"7 3856\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"7 5032\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"7 4999\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 3\\r\\n\", \"output\": [\"-1\"]}, {\"input\": \"2 4\\r\\n\", \"output\": [\"-1\"]}, {\"input\": \"7 985\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"4 25\\r\\n\", \"output\": [\"-1\"]}, {\"input\": \"6 121\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"11 39916801\\r\\n\", \"output\": [\"-1\"]}, {\"input\": \"29 1000000000\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"10 4589\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"10 100000\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"10 98564\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"10 1\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"10 100000009\\r\\n\", \"output\": [\"-1\"]}]"} {"prob_desc_description":"Little Petya very much likes strings. Recently he has received a voucher to purchase a string as a gift from his mother. The string can be bought in the local shop. One can consider that the shop has all sorts of strings over the alphabet of fixed size. The size of the alphabet is equal to k. However, the voucher has a string type limitation: specifically, the voucher can be used to purchase string s if the length of string's longest substring that is also its weak subsequence (see the definition given below) equals w.String a with the length of n is considered the weak subsequence of the string s with the length of m, if there exists such a set of indexes 1\u2009\u2264\u2009i1\u2009<\u2009i2\u2009<\u2009...\u2009<\u2009in\u2009\u2264\u2009m, that has the following two properties: ak\u2009=\u2009sik for all k from 1 to n; there exists at least one such k (1\u2009\u2264\u2009k\u2009<\u2009n), for which ik\u2009+\u20091\u2009\u2013\u2009ik\u2009>\u20091. Petya got interested how many different strings are available for him to purchase in the shop. As the number of strings can be very large, please find it modulo 1000000007 (109\u2009+\u20097). If there are infinitely many such strings, print \"-1\".","prob_desc_output_spec":"Print a single number \u2014 the number of strings Petya can buy using the voucher, modulo 1000000007 (109\u2009+\u20097). If there are infinitely many such strings, print \"-1\" (without the quotes).","lang_cluster":"","src_uid":"b715f0fdc83ec539eb3ae2b0371ee130","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["combinatorics"],"prob_desc_created_at":"1323443100","prob_desc_sample_inputs":"[\"2 2\", \"3 5\", \"2 139\"]","prob_desc_notes":"NoteIn the first sample Petya can buy the following strings: aaa, aab, abab, abb, abba, baa, baab, baba, bba, bbb.","exec_outcome":"","difficulty":3000.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"3 seconds","prob_desc_input_spec":"The first line contains two integers k (1\u2009\u2264\u2009k\u2009\u2264\u2009106) and w (2\u2009\u2264\u2009w\u2009\u2264\u2009109) \u2014 the alphabet size and the required length of the maximum substring that also is the weak subsequence, correspondingly.","prob_desc_sample_outputs":"[\"10\", \"1593\", \"717248223\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2 2\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"3 5\\r\\n\", \"output\": [\"1593\"]}, {\"input\": \"2 139\\r\\n\", \"output\": [\"717248223\"]}, {\"input\": \"5 6\\r\\n\", \"output\": [\"983725\"]}, {\"input\": \"1000 1002\\r\\n\", \"output\": [\"9396758\"]}, {\"input\": \"131 132\\r\\n\", \"output\": [\"757914194\"]}, {\"input\": \"4 4\\r\\n\", \"output\": [\"4912\"]}, {\"input\": \"3 2\\r\\n\", \"output\": [\"57\"]}, {\"input\": \"1 1000000000\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"666 888888888\\r\\n\", \"output\": [\"424798470\"]}, {\"input\": \"1000000 1000000000\\r\\n\", \"output\": [\"600002237\"]}, {\"input\": \"1000000 1000000\\r\\n\", \"output\": [\"438349146\"]}, {\"input\": \"1000000 2\\r\\n\", \"output\": [\"739181318\"]}, {\"input\": \"2 1000000000\\r\\n\", \"output\": [\"851562506\"]}, {\"input\": \"1000000 500000\\r\\n\", \"output\": [\"53435433\"]}, {\"input\": \"12345 543210123\\r\\n\", \"output\": [\"290786804\"]}, {\"input\": \"1 2\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 3\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 4\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 5\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 6\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 7\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1 8\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2 3\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"2 4\\r\\n\", \"output\": [\"40\"]}, {\"input\": \"2 5\\r\\n\", \"output\": [\"80\"]}, {\"input\": \"2 6\\r\\n\", \"output\": [\"160\"]}, {\"input\": \"2 7\\r\\n\", \"output\": [\"320\"]}, {\"input\": \"2 8\\r\\n\", \"output\": [\"640\"]}, {\"input\": \"3 3\\r\\n\", \"output\": [\"177\"]}, {\"input\": \"3 4\\r\\n\", \"output\": [\"531\"]}, {\"input\": \"3 6\\r\\n\", \"output\": [\"4779\"]}, {\"input\": \"3 7\\r\\n\", \"output\": [\"14337\"]}, {\"input\": \"3 8\\r\\n\", \"output\": [\"43011\"]}, {\"input\": \"4 2\\r\\n\", \"output\": [\"292\"]}, {\"input\": \"4 3\\r\\n\", \"output\": [\"1216\"]}, {\"input\": \"4 5\\r\\n\", \"output\": [\"19648\"]}, {\"input\": \"4 6\\r\\n\", \"output\": [\"78592\"]}, {\"input\": \"4 7\\r\\n\", \"output\": [\"314368\"]}, {\"input\": \"4 8\\r\\n\", \"output\": [\"1257472\"]}, {\"input\": \"5 2\\r\\n\", \"output\": [\"1585\"]}, {\"input\": \"5 3\\r\\n\", \"output\": [\"7745\"]}, {\"input\": \"5 4\\r\\n\", \"output\": [\"39205\"]}, {\"input\": \"5 5\\r\\n\", \"output\": [\"196745\"]}, {\"input\": \"5 7\\r\\n\", \"output\": [\"4918625\"]}, {\"input\": \"5 8\\r\\n\", \"output\": [\"24593125\"]}, {\"input\": \"6 2\\r\\n\", \"output\": [\"9726\"]}, {\"input\": \"6 3\\r\\n\", \"output\": [\"50916\"]}, {\"input\": \"6 4\\r\\n\", \"output\": [\"296856\"]}, {\"input\": \"6 5\\r\\n\", \"output\": [\"1789776\"]}, {\"input\": \"6 6\\r\\n\", \"output\": [\"10755936\"]}, {\"input\": \"6 7\\r\\n\", \"output\": [\"64535616\"]}, {\"input\": \"6 8\\r\\n\", \"output\": [\"387213696\"]}, {\"input\": \"7 2\\r\\n\", \"output\": [\"68425\"]}, {\"input\": \"7 3\\r\\n\", \"output\": [\"366625\"]}, {\"input\": \"7 4\\r\\n\", \"output\": [\"2290855\"]}, {\"input\": \"7 5\\r\\n\", \"output\": [\"15673105\"]}, {\"input\": \"7 6\\r\\n\", \"output\": [\"109953655\"]}, {\"input\": \"7 7\\r\\n\", \"output\": [\"770280385\"]}, {\"input\": \"7 8\\r\\n\", \"output\": [\"391962660\"]}, {\"input\": \"8 2\\r\\n\", \"output\": [\"547912\"]}, {\"input\": \"8 3\\r\\n\", \"output\": [\"2953952\"]}, {\"input\": \"8 4\\r\\n\", \"output\": [\"18951136\"]}, {\"input\": \"8 5\\r\\n\", \"output\": [\"138867968\"]}, {\"input\": \"8 6\\r\\n\", \"output\": [\"92073977\"]}, {\"input\": \"8 7\\r\\n\", \"output\": [\"746268616\"]}, {\"input\": \"8 8\\r\\n\", \"output\": [\"999179293\"]}, {\"input\": \"999999 1000001\\r\\n\", \"output\": [\"134450642\"]}, {\"input\": \"1000000 1000001\\r\\n\", \"output\": [\"142931557\"]}, {\"input\": \"1000000 999999\\r\\n\", \"output\": [\"250496915\"]}, {\"input\": \"1000000 999998\\r\\n\", \"output\": [\"129080538\"]}, {\"input\": \"1000000 999997\\r\\n\", \"output\": [\"769225275\"]}, {\"input\": \"1000000 1000002\\r\\n\", \"output\": [\"555999483\"]}, {\"input\": \"1000000 1000003\\r\\n\", \"output\": [\"479108007\"]}, {\"input\": \"983039 939524096\\r\\n\", \"output\": [\"604697498\"]}, {\"input\": \"998999 3\\r\\n\", \"output\": [\"356230103\"]}, {\"input\": \"987899 555555\\r\\n\", \"output\": [\"229752266\"]}, {\"input\": \"999009 55\\r\\n\", \"output\": [\"484803676\"]}, {\"input\": \"999009 818243\\r\\n\", \"output\": [\"282452206\"]}, {\"input\": \"999009 999004\\r\\n\", \"output\": [\"614735788\"]}, {\"input\": \"999009 999005\\r\\n\", \"output\": [\"945978791\"]}, {\"input\": \"999009 999006\\r\\n\", \"output\": [\"175954096\"]}, {\"input\": \"999009 999007\\r\\n\", \"output\": [\"318397869\"]}, {\"input\": \"999009 999008\\r\\n\", \"output\": [\"751039945\"]}, {\"input\": \"999009 999009\\r\\n\", \"output\": [\"187298386\"]}, {\"input\": \"999010 72\\r\\n\", \"output\": [\"131671481\"]}, {\"input\": \"999010 808035\\r\\n\", \"output\": [\"568832480\"]}, {\"input\": \"999010 999005\\r\\n\", \"output\": [\"898095114\"]}, {\"input\": \"999010 999006\\r\\n\", \"output\": [\"100649860\"]}, {\"input\": \"999010 999007\\r\\n\", \"output\": [\"292072410\"]}, {\"input\": \"999010 999008\\r\\n\", \"output\": [\"253072162\"]}, {\"input\": \"999010 999009\\r\\n\", \"output\": [\"808216351\"]}, {\"input\": \"999010 999010\\r\\n\", \"output\": [\"493965177\"]}, {\"input\": \"999011 64\\r\\n\", \"output\": [\"197612280\"]}, {\"input\": \"999011 133617\\r\\n\", \"output\": [\"471490419\"]}, {\"input\": \"999011 999006\\r\\n\", \"output\": [\"537424009\"]}, {\"input\": \"999011 999007\\r\\n\", \"output\": [\"932469897\"]}, {\"input\": \"999011 999008\\r\\n\", \"output\": [\"712314569\"]}, {\"input\": \"999011 999009\\r\\n\", \"output\": [\"272668831\"]}, {\"input\": \"999011 999010\\r\\n\", \"output\": [\"926206743\"]}, {\"input\": \"999011 999011\\r\\n\", \"output\": [\"68819519\"]}]"} {"prob_desc_description":"Life is not easy for the perfectly common variable named Vasya. Wherever it goes, it is either assigned a value, or simply ignored, or is being used!Vasya's life goes in states of a program. In each state, Vasya can either be used (for example, to calculate the value of another variable), or be assigned a value, or ignored. Between some states are directed (oriented) transitions.A path is a sequence of states v1,\u2009v2,\u2009...,\u2009vx, where for any 1\u2009\u2264\u2009i\u2009<\u2009x exists a transition from vi to vi\u2009+\u20091.Vasya's value in state v is interesting to the world, if exists path p1,\u2009p2,\u2009...,\u2009pk such, that pi\u2009=\u2009v for some i (1\u2009\u2264\u2009i\u2009\u2264\u2009k), in state p1 Vasya gets assigned a value, in state pk Vasya is used and there is no state pi (except for p1) where Vasya gets assigned a value.Help Vasya, find the states in which Vasya's value is interesting to the world.","prob_desc_output_spec":"Print n integers r1,\u2009r2,\u2009...,\u2009rn, separated by spaces or new lines. Number ri should equal 1, if Vasya's value in state i is interesting to the world and otherwise, it should equal 0. The states are numbered from 1 to n in the order, in which they are described in the input.","lang_cluster":"","src_uid":"87d869a0fd4a510c5e7e310886b86a57","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["graphs"],"prob_desc_created_at":"1333897500","prob_desc_sample_inputs":"[\"4 3\\n1 0 0 2\\n1 2\\n2 3\\n3 4\", \"3 1\\n1 0 2\\n1 3\", \"3 1\\n2 0 1\\n1 3\"]","prob_desc_notes":"NoteIn the first sample the program states can be used to make the only path in which the value of Vasya interests the world, 1 2 3 4; it includes all the states, so in all of them Vasya's value is interesting to the world.The second sample the only path in which Vasya's value is interesting to the world is , \u2014 1 3; state 2 is not included there.In the third sample we cannot make from the states any path in which the value of Vasya would be interesting to the world, so the value of Vasya is never interesting to the world.","exec_outcome":"","difficulty":1700.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line contains two space-separated integers n and m (1\u2009\u2264\u2009n,\u2009m\u2009\u2264\u2009105) \u2014 the numbers of states and transitions, correspondingly. The second line contains space-separated n integers f1,\u2009f2,\u2009...,\u2009fn (0\u2009\u2264\u2009fi\u2009\u2264\u20092), fi described actions performed upon Vasya in state i: 0 represents ignoring, 1 \u2014 assigning a value, 2 \u2014 using. Next m lines contain space-separated pairs of integers ai,\u2009bi (1\u2009\u2264\u2009ai,\u2009bi\u2009\u2264\u2009n, ai\u2009\u2260\u2009bi), each pair represents the transition from the state number ai to the state number bi. Between two states can be any number of transitions.","prob_desc_sample_outputs":"[\"1\\n1\\n1\\n1\", \"1\\n0\\n1\", \"0\\n0\\n0\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"4 3\\r\\n1 0 0 2\\r\\n1 2\\r\\n2 3\\r\\n3 4\\r\\n\", \"output\": [\"1\\r\\n1\\r\\n1\\r\\n1\"]}, {\"input\": \"3 1\\r\\n1 0 2\\r\\n1 3\\r\\n\", \"output\": [\"1\\r\\n0\\r\\n1\"]}, {\"input\": \"3 1\\r\\n2 0 1\\r\\n1 3\\r\\n\", \"output\": [\"0\\r\\n0\\r\\n0\"]}, {\"input\": \"4 4\\r\\n1 0 2 0\\r\\n1 2\\r\\n2 3\\r\\n3 4\\r\\n4 1\\r\\n\", \"output\": [\"1\\r\\n1\\r\\n1\\r\\n0\"]}, {\"input\": \"10000 10000\\r\\n0 1 2 2 2 0 1 0 1 0 0 0 1 2 2 0 0 0 2 1 2 0 1 0 2 1 1 1 1 0 1 1 0 2 1 2 0 1 0 1 2 2 0 0 0 1 0 0 0 2 2 2 1 2 2 1 0 2 2 1 1 2 0 2 1 1 2 2 1 0 0 2 1 0 1 0 2 0 2 0 2 0 0 0 0 0 0 0 2 0 0 0 1 2 2 2 1 2 2 1 2 1 1 1 0 1 2 0 2 2 0 0 1 0 0 0 1 0 2 2 1 ...\", \"output\": [\"0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n...\"]}, {\"input\": \"10000 10000\\r\\n1 1 1 2 1 2 2 1 2 1 2 1 1 1 1 1 2 1 2 1 1 2 2 2 2 2 1 1 2 2 1 1 2 1 1 2 1 1 2 1 2 1 1 1 1 2 1 2 2 2 2 1 1 1 2 1 1 2 1 2 2 1 1 1 2 1 1 1 1 1 1 2 1 2 2 2 1 2 1 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 1 2 2 2 2 2 2 2 2 1 2 1 1 2 2 1 2 1 2 1 1 1 2 1 1 2 ...\", \"output\": [\"0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n...\"]}, {\"input\": \"10000 100000\\r\\n0 1 2 1 1 2 2 0 0 2 1 0 1 1 2 2 0 1 1 2 1 2 2 1 2 2 0 0 2 1 1 2 1 1 2 1 2 0 1 2 0 1 0 1 2 1 0 0 1 2 2 0 1 0 1 2 2 1 0 0 1 1 2 2 1 2 2 2 2 2 2 2 2 2 0 1 2 2 1 0 1 1 0 0 2 2 1 0 1 2 2 0 1 0 2 2 2 1 1 1 0 1 1 0 1 0 0 2 1 1 2 0 1 1 2 2 0 0 1 0 0...\", \"output\": [\"1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n...\"]}, {\"input\": \"2 100000\\r\\n1 0\\r\\n2 1\\r\\n1 2\\r\\n1 2\\r\\n2 1\\r\\n1 2\\r\\n2 1\\r\\n2 1\\r\\n2 1\\r\\n1 2\\r\\n1 2\\r\\n2 1\\r\\n2 1\\r\\n1 2\\r\\n2 1\\r\\n1 2\\r\\n2 1\\r\\n1 2\\r\\n2 1\\r\\n2 1\\r\\n1 2\\r\\n1 2\\r\\n2 1\\r\\n2 1\\r\\n1 2\\r\\n2 1\\r\\n1 2\\r\\n2 1\\r\\n1 2\\r\\n2 1\\r\\n1 2\\r\\n2 1\\r\\n2 1\\r\\n2 1\\r\\n2 1\\r\\n2 1\\r\\n1 2\\r\\n1 2\\r\\n2 1\\r\\n2 1\\r\\n2 1\\r\\n1 2\\r\\n2 1\\r\\n2 1\\r\\n2 1\\r\\n1 2\\r\\n2 1\\r\\n1 2\\r\\n1 2\\r\\n...\", \"output\": [\"0\\r\\n0\"]}, {\"input\": \"100000 100000\\r\\n0 2 1 1 1 2 0 0 1 0 1 1 2 1 0 1 2 0 1 2 2 2 2 1 1 1 0 2 1 1 2 0 0 2 1 0 0 0 0 2 1 0 2 2 1 0 0 1 2 0 0 2 0 1 2 1 0 1 0 2 0 0 1 1 0 0 2 2 0 1 1 0 2 2 2 1 1 2 2 1 1 1 1 0 0 0 1 0 2 0 2 2 2 2 0 2 0 2 0 1 0 1 0 1 1 1 2 0 0 1 2 0 0 2 1 0 2 0 0 1 ...\", \"output\": [\"0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n...\"]}, {\"input\": \"100000 100000\\r\\n2 2 2 1 1 2 1 1 1 1 2 2 1 2 1 1 2 1 2 2 1 2 2 2 1 1 1 2 2 1 1 2 1 1 1 1 1 1 2 2 1 1 1 2 2 1 2 1 2 1 2 1 1 1 1 2 2 1 2 1 1 2 2 1 2 2 1 2 2 1 1 1 1 1 2 2 1 1 2 2 1 1 1 1 1 1 1 1 2 1 2 2 1 1 1 1 1 2 1 2 1 1 2 1 1 1 1 2 2 2 1 1 1 1 1 2 1 1 2 1 ...\", \"output\": [\"0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n...\"]}, {\"input\": \"100000 100000\\r\\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...\", \"output\": [\"0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n...\"]}, {\"input\": \"100000 100000\\r\\n2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...\", \"output\": [\"0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n...\"]}, {\"input\": \"100000 100000\\r\\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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...\", \"output\": [\"0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n...\", \"1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n...\"]}, {\"input\": \"100000 100000\\r\\n1 1 0 0 1 0 1 0 1 0 1 0 1 1 0 1 1 1 1 0 0 0 0 1 0 0 0 1 0 1 1 1 1 0 1 1 0 1 1 1 0 0 1 0 0 1 0 1 1 1 0 0 0 0 1 1 0 1 0 0 1 0 1 0 1 1 0 1 1 1 0 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 0 1 1 1 0 1 1 0 1 0 1 0 0 0 1 0 1 1 1 0 0 1 0 0 1 1 0 0 0 1 0 0 ...\", \"output\": [\"0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n...\"]}, {\"input\": \"100000 100000\\r\\n0 0 2 2 0 2 2 0 0 0 2 0 0 2 2 0 0 2 2 2 0 2 0 2 0 2 2 0 2 2 2 0 2 2 2 0 2 0 2 2 2 0 0 0 2 0 0 2 2 0 2 2 2 0 0 0 2 2 2 2 0 0 2 0 0 2 2 0 2 0 0 2 0 0 2 0 2 0 2 0 0 2 0 0 2 2 0 2 0 2 0 2 2 2 2 2 0 0 2 0 2 0 2 2 0 2 2 2 0 2 2 0 0 0 0 0 2 2 0 0 ...\", \"output\": [\"0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n...\"]}, {\"input\": \"2 1\\r\\n2 1\\r\\n2 1\\r\\n\", \"output\": [\"1\\r\\n1\"]}, {\"input\": \"100000 99999\\r\\n2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2...\", \"output\": [\"1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n...\"]}, {\"input\": \"100000 10\\r\\n2 2 2 2 2 2 1 1 1 2 2 2 1 1 1 2 1 1 2 2 1 2 1 1 2 1 2 2 2 2 1 2 2 2 1 2 2 2 2 1 2 2 2 1 1 1 2 2 1 2 2 1 1 1 1 1 1 2 1 2 2 2 1 2 2 1 1 1 1 1 1 2 1 2 2 1 2 1 2 1 1 2 1 2 1 1 1 2 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 2 2 1 2 2 2 1 2 1 1 1 1 2 2 2 2 2 1 1 ...\", \"output\": [\"0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n...\"]}, {\"input\": \"3 2\\r\\n1 2 0\\r\\n1 2\\r\\n3 2\\r\\n\", \"output\": [\"1\\r\\n1\\r\\n0\"]}, {\"input\": \"50000 99997\\r\\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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...\", \"output\": [\"1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n...\"]}, {\"input\": \"100000 99999\\r\\n0 0 2 0 2 2 2 2 2 1 1 0 1 0 2 0 2 0 2 1 0 1 2 0 0 2 0 2 0 1 0 2 1 1 1 2 2 0 1 2 2 0 1 0 2 1 0 0 1 1 2 2 2 1 2 2 2 0 0 1 0 0 0 0 1 0 1 0 0 2 2 2 0 2 0 2 0 1 2 2 2 0 0 0 1 0 0 1 1 0 0 0 1 1 0 2 0 1 1 2 0 0 1 1 2 1 1 1 2 2 0 0 1 0 0 0 2 1 1 1 0...\", \"output\": [\"1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n...\"]}, {\"input\": \"99991 100000\\r\\n1 1 2 0 1 2 0 0 0 2 2 2 0 0 1 0 1 0 0 0 0 2 1 1 2 0 2 2 2 2 1 2 2 2 0 2 0 2 0 1 2 2 2 0 2 1 2 1 2 0 1 0 0 2 0 2 1 2 1 1 1 1 0 0 2 2 0 2 1 1 1 0 2 2 0 0 2 1 1 1 2 2 1 1 2 0 1 0 1 2 2 1 1 0 1 2 1 0 0 1 0 1 1 0 1 0 1 1 0 0 1 2 2 2 0 2 1 2 0 1 0...\", \"output\": [\"1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n...\"]}, {\"input\": \"99001 100000\\r\\n0 1 1 1 1 1 2 0 1 0 2 1 2 2 2 1 2 1 2 1 2 2 0 2 1 1 0 1 2 2 0 2 2 1 2 0 0 0 1 2 2 1 2 1 2 1 2 0 0 2 0 0 1 0 1 1 1 2 2 1 2 2 2 1 2 1 0 0 2 1 2 1 1 2 0 0 2 0 2 2 2 2 1 2 1 2 2 0 2 0 2 0 0 0 1 1 2 0 2 2 0 0 0 1 2 2 2 1 1 0 2 1 2 2 2 0 2 1 2 1 2...\", \"output\": [\"1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n...\"]}, {\"input\": \"99001 100000\\r\\n1 2 2 0 1 1 2 0 1 1 0 1 0 0 0 0 1 2 1 2 2 1 1 2 1 0 1 0 0 0 2 1 1 1 0 2 2 2 1 2 2 1 0 1 0 1 2 0 1 1 1 0 1 0 1 0 0 0 1 2 0 1 2 0 0 2 1 2 1 0 0 0 2 2 0 2 1 1 2 2 2 0 0 2 1 2 1 0 0 1 0 1 0 0 1 0 1 0 1 2 2 0 1 1 0 2 2 0 2 2 2 0 2 2 2 0 1 1 2 0 2...\", \"output\": [\"1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n...\"]}, {\"input\": \"100000 99999\\r\\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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...\", \"output\": [\"0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n...\"]}, {\"input\": \"99001 100000\\r\\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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...\", \"output\": [\"0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n...\"]}, {\"input\": \"99001 100000\\r\\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 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...\", \"output\": [\"1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n...\"]}, {\"input\": \"90001 100000\\r\\n1 0 0 0 1 2 0 0 0 0 0 0 0 2 0 0 0 0 0 1 0 2 2 1 0 0 1 1 0 0 0 0 0 1 0 0 0 1 0 2 0 1 0 0 0 0 2 0 0 0 0 0 2 0 0 2 0 0 0 0 0 2 0 0 0 0 0 0 1 2 1 0 0 0 0 1 1 0 0 2 0 0 0 2 2 0 0 0 2 0 0 0 0 0 0 0 1 2 0 2 0 0 0 2 2 1 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0...\", \"output\": [\"0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n...\"]}, {\"input\": \"99001 100000\\r\\n0 2 0 1 2 1 1 2 2 0 1 1 2 1 2 0 0 0 0 0 2 1 1 2 2 1 2 2 0 0 1 2 2 2 0 0 0 2 1 0 1 0 0 2 0 1 2 2 0 1 2 2 0 2 0 2 2 2 2 2 0 2 2 2 0 1 0 1 1 0 0 0 0 2 0 2 2 0 1 1 0 0 2 0 0 2 0 1 1 2 0 0 0 1 1 2 0 1 2 2 1 0 1 0 0 1 0 2 2 2 2 1 1 0 1 2 2 1 0 2 1...\", \"output\": [\"1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n...\"]}, {\"input\": \"90001 100000\\r\\n0 0 1 1 0 1 2 1 2 1 0 0 0 2 2 0 2 1 1 1 1 1 1 0 0 1 0 0 0 0 2 1 2 2 0 1 1 1 1 0 2 2 0 2 1 0 1 0 1 2 0 2 1 2 2 1 2 0 1 2 1 1 1 2 1 1 0 1 2 1 1 1 2 1 2 1 0 2 0 0 0 1 2 0 0 2 0 1 2 0 0 1 2 0 2 0 2 2 2 1 0 1 0 1 0 2 0 2 2 1 0 2 1 1 1 1 0 2 1 1 1...\", \"output\": [\"1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n1\\r\\n0\\r\\n0\\r\\n0\\r\\n1\\r\\n1\\r\\n1\\r\\n0\\r\\n...\"]}, {\"input\": \"30000 74999\\r\\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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...\", \"output\": [\"1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n...\"]}, {\"input\": \"8 8\\r\\n1 0 0 2 1 0 0 2\\r\\n1 2\\r\\n2 3\\r\\n3 2\\r\\n2 4\\r\\n6 8\\r\\n7 6\\r\\n6 7\\r\\n5 6\\r\\n\", \"output\": [\"1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\"]}, {\"input\": \"6 6\\r\\n1 0 0 0 0 2\\r\\n1 2\\r\\n2 3\\r\\n3 4\\r\\n4 5\\r\\n5 2\\r\\n3 6\\r\\n\", \"output\": [\"1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\"]}, {\"input\": \"100000 99999\\r\\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...\", \"output\": [\"0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n0\\r\\n...\"]}]"} {"prob_desc_description":"To get money for a new aeonic blaster, ranger Qwerty decided to engage in trade for a while. He wants to buy some number of items (or probably not to buy anything at all) on one of the planets, and then sell the bought items on another planet. Note that this operation is not repeated, that is, the buying and the selling are made only once. To carry out his plan, Qwerty is going to take a bank loan that covers all expenses and to return the loaned money at the end of the operation (the money is returned without the interest). At the same time, Querty wants to get as much profit as possible.The system has n planets in total. On each of them Qwerty can buy or sell items of m types (such as food, medicine, weapons, alcohol, and so on). For each planet i and each type of items j Qwerty knows the following: aij \u2014 the cost of buying an item; bij \u2014 the cost of selling an item; cij \u2014 the number of remaining items.It is not allowed to buy more than cij items of type j on planet i, but it is allowed to sell any number of items of any kind.Knowing that the hold of Qwerty's ship has room for no more than k items, determine the maximum profit which Qwerty can get.","prob_desc_output_spec":"Print a single number \u2014 the maximum profit Qwerty can get.","lang_cluster":"","src_uid":"7419c4268a9815282fadca6581f28ec1","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["games","graph matchings","greedy"],"prob_desc_created_at":"1334934300","prob_desc_sample_inputs":"[\"3 3 10\\nVenus\\n6 5 3\\n7 6 5\\n8 6 10\\nEarth\\n10 9 0\\n8 6 4\\n10 9 3\\nMars\\n4 3 0\\n8 4 12\\n7 2 5\"]","prob_desc_notes":"NoteIn the first test case you should fly to planet Venus, take a loan on 74 units of money and buy three items of the first type and 7 items of the third type (3\u00b76\u2009+\u20097\u00b78\u2009=\u200974). Then the ranger should fly to planet Earth and sell there all the items he has bought. He gets 3\u00b79\u2009+\u20097\u00b79\u2009=\u200990 units of money for the items, he should give 74 of them for the loan. The resulting profit equals 16 units of money. We cannot get more profit in this case.","exec_outcome":"","difficulty":1200.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line contains three space-separated integers n, m and k (2\u2009\u2264\u2009n\u2009\u2264\u200910, 1\u2009\u2264\u2009m,\u2009k\u2009\u2264\u2009100) \u2014 the number of planets, the number of question types and the capacity of Qwerty's ship hold, correspondingly. Then follow n blocks describing each planet. The first line of the i-th block has the planet's name as a string with length from 1 to 10 Latin letters. The first letter of the name is uppercase, the rest are lowercase. Then in the i-th block follow m lines, the j-th of them contains three integers aij, bij and cij (1\u2009\u2264\u2009bij\u2009<\u2009aij\u2009\u2264\u20091000, 0\u2009\u2264\u2009cij\u2009\u2264\u2009100) \u2014 the numbers that describe money operations with the j-th item on the i-th planet. The numbers in the lines are separated by spaces. It is guaranteed that the names of all planets are different.","prob_desc_sample_outputs":"[\"16\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"3 3 10\\r\\nVenus\\r\\n6 5 3\\r\\n7 6 5\\r\\n8 6 10\\r\\nEarth\\r\\n10 9 0\\r\\n8 6 4\\r\\n10 9 3\\r\\nMars\\r\\n4 3 0\\r\\n8 4 12\\r\\n7 2 5\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"2 1 5\\r\\nA\\r\\n6 5 5\\r\\nB\\r\\n10 9 0\\r\\n\", \"output\": [\"15\"]}, {\"input\": \"2 2 5\\r\\nAbcdefghij\\r\\n20 15 20\\r\\n10 5 13\\r\\nKlmopqrstu\\r\\n19 16 20\\r\\n12 7 14\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3 1 5\\r\\nTomato\\r\\n10 7 20\\r\\nBanana\\r\\n13 11 0\\r\\nApple\\r\\n15 14 10\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"3 2 11\\r\\nMars\\r\\n15 10 4\\r\\n7 6 3\\r\\nSnickers\\r\\n20 17 2\\r\\n10 8 0\\r\\nBounty\\r\\n21 18 5\\r\\n9 7 3\\r\\n\", \"output\": [\"12\"]}, {\"input\": \"5 7 30\\r\\nBzbmwey\\r\\n61 2 6\\r\\n39 20 2\\r\\n76 15 7\\r\\n12 1 5\\r\\n62 38 1\\r\\n84 22 7\\r\\n52 31 3\\r\\nDyfw\\r\\n77 22 8\\r\\n88 21 4\\r\\n48 21 7\\r\\n82 81 2\\r\\n49 2 7\\r\\n57 38 10\\r\\n99 98 8\\r\\nG\\r\\n91 2 4\\r\\n84 60 4\\r\\n9 6 5\\r\\n69 45 1\\r\\n81 27 4\\r\\n93 22 9\\r\\n73 14 5\\r\\nUpwb\\r\\n72 67 10\\r\\n18 9 7\\r\\n80 13 2\\r\\n66 30 2\\r\\n88 61 7\\r\\n98 13 6\\r\\n90 12 1\\r\\nYiadtlcoue\\r\\n95 57 1\\r\\n99 86 10\\r\\n59 20 6\\r\\n98 95 1\\r\\n36 5 1\\r\\n42 14 1\\r\\n91 11 7\\r\\n\", \"output\": [\"534\"]}, {\"input\": \"2 1 1\\r\\nIeyxawsao\\r\\n2 1 0\\r\\nJhmsvvy\\r\\n2 1 0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 1 1\\r\\nCcn\\r\\n2 1 1\\r\\nOxgzx\\r\\n2 1 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 1 1\\r\\nG\\r\\n2 1 9\\r\\nRdepya\\r\\n2 1 8\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 10 10\\r\\nB\\r\\n9 1 0\\r\\n7 6 0\\r\\n10 3 0\\r\\n4 3 0\\r\\n10 7 0\\r\\n7 6 0\\r\\n6 5 0\\r\\n3 2 0\\r\\n5 4 0\\r\\n6 2 0\\r\\nFffkk\\r\\n7 6 0\\r\\n6 3 0\\r\\n8 7 0\\r\\n9 2 0\\r\\n4 3 0\\r\\n10 2 0\\r\\n9 2 0\\r\\n3 1 0\\r\\n10 9 0\\r\\n10 1 0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"2 10 10\\r\\nQdkeso\\r\\n7 4 7\\r\\n2 1 0\\r\\n9 2 6\\r\\n9 8 1\\r\\n3 2 0\\r\\n7 5 7\\r\\n5 2 0\\r\\n6 3 4\\r\\n7 4 5\\r\\n8 4 0\\r\\nRzh\\r\\n3 1 9\\r\\n10 3 0\\r\\n8 1 0\\r\\n10 9 6\\r\\n10 7 4\\r\\n10 3 3\\r\\n10 3 1\\r\\n9 2 7\\r\\n10 9 0\\r\\n10 6 6\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"2 17 100\\r\\nFevvyt\\r\\n35 34 4\\r\\n80 50 7\\r\\n88 85 1\\r\\n60 45 9\\r\\n48 47 9\\r\\n63 47 9\\r\\n81 56 1\\r\\n25 23 5\\r\\n100 46 1\\r\\n25 7 9\\r\\n29 12 6\\r\\n36 2 8\\r\\n49 27 10\\r\\n35 20 5\\r\\n92 64 2\\r\\n60 3 8\\r\\n72 28 3\\r\\nOfntgr\\r\\n93 12 4\\r\\n67 38 6\\r\\n28 21 2\\r\\n86 29 5\\r\\n23 3 4\\r\\n81 69 6\\r\\n79 12 3\\r\\n64 43 5\\r\\n81 38 9\\r\\n62 25 2\\r\\n54 1 1\\r\\n95 78 8\\r\\n78 23 5\\r\\n96 90 10\\r\\n95 38 8\\r\\n84 20 5\\r\\n80 77 5\\r\\n\", \"output\": [\"770\"]}, {\"input\": \"2 23 97\\r\\nAfgickc\\r\\n737 670 3\\r\\n554 515 2\\r\\n725 568 1\\r\\n365 77 2\\r\\n951 183 0\\r\\n902 833 3\\r\\n326 146 1\\r\\n876 299 2\\r\\n484 151 1\\r\\n753 406 2\\r\\n415 35 2\\r\\n547 154 3\\r\\n377 297 1\\r\\n620 238 3\\r\\n479 207 1\\r\\n931 834 0\\r\\n874 127 1\\r\\n847 499 0\\r\\n276 75 0\\r\\n424 281 3\\r\\n835 420 1\\r\\n637 596 3\\r\\n939 568 3\\r\\nNgupewohxf\\r\\n820 747 2\\r\\n371 191 3\\r\\n881 401 0\\r\\n952 893 0\\r\\n376 226 1\\r\\n791 472 0\\r\\n742 692 1\\r\\n451 158 3\\r\\n853 174 0\\r\\n98 91 2\\r\\n934 459 1\\r\\n405 317 3\\r\\n736 346 2\\r\\n369 192 1\\r\\n626 43 3\\r\\n656 628 0\\r\\n635 164 3\\r\\n817 479 1\\r\\n667 274 1\\r\\n872 373 0\\r\\n440 374 3\\r\\n635...\", \"output\": [\"1540\"]}, {\"input\": \"2 47 55\\r\\nXjlxsyttw\\r\\n649 514 14\\r\\n642 319 2\\r\\n598 353 14\\r\\n657 455 0\\r\\n609 527 5\\r\\n667 216 9\\r\\n615 603 3\\r\\n360 222 7\\r\\n320 154 3\\r\\n514 286 15\\r\\n283 213 7\\r\\n247 16 4\\r\\n423 317 7\\r\\n469 58 15\\r\\n638 507 15\\r\\n407 341 0\\r\\n587 454 10\\r\\n125 70 12\\r\\n558 44 7\\r\\n477 30 12\\r\\n675 601 14\\r\\n346 311 7\\r\\n394 232 7\\r\\n421 160 4\\r\\n77 38 15\\r\\n339 306 7\\r\\n472 318 0\\r\\n665 354 15\\r\\n573 541 4\\r\\n370 205 1\\r\\n473 74 14\\r\\n347 301 12\\r\\n613 176 14\\r\\n626 529 1\\r\\n435 51 6\\r\\n273 266 5\\r\\n696 536 6\\r\\n483 435 14\\r\\n441 236 8\\r\\n278 201 14\\r\\n620 349 1\\r\\n639 107 8\\r\\n391 120 13\\r\\n149 23 6\\r\\n...\", \"output\": [\"10526\"]}, {\"input\": \"2 79 81\\r\\nMacvhxgfcn\\r\\n483 34 49\\r\\n438 60 19\\r\\n271 54 13\\r\\n416 361 29\\r\\n365 76 21\\r\\n583 230 2\\r\\n580 159 18\\r\\n253 56 27\\r\\n561 110 11\\r\\n511 322 12\\r\\n493 352 36\\r\\n305 165 3\\r\\n572 336 8\\r\\n93 8 42\\r\\n263 208 42\\r\\n479 397 47\\r\\n568 428 34\\r\\n497 370 49\\r\\n352 250 31\\r\\n68 48 33\\r\\n356 278 29\\r\\n246 175 0\\r\\n313 186 14\\r\\n333 35 1\\r\\n205 186 49\\r\\n403 162 25\\r\\n539 174 38\\r\\n562 555 38\\r\\n575 570 28\\r\\n181 21 44\\r\\n343 201 16\\r\\n348 57 17\\r\\n471 74 2\\r\\n469 323 42\\r\\n552 347 49\\r\\n402 291 35\\r\\n265 82 46\\r\\n344 142 36\\r\\n361 242 32\\r\\n160 134 50\\r\\n486 404 12\\r\\n522 134 44\\r\\n515 16 ...\", \"output\": [\"31581\"]}, {\"input\": \"2 100 1\\r\\nLjmpcxrzul\\r\\n695 271 1\\r\\n723 720 1\\r\\n152 10 1\\r\\n966 757 0\\r\\n486 279 1\\r\\n229 145 1\\r\\n440 8 1\\r\\n798 294 1\\r\\n671 595 0\\r\\n96 7 0\\r\\n510 65 0\\r\\n637 56 0\\r\\n621 174 1\\r\\n76 55 1\\r\\n770 114 1\\r\\n123 38 0\\r\\n337 216 1\\r\\n152 141 0\\r\\n535 253 1\\r\\n696 170 1\\r\\n332 228 1\\r\\n412 198 0\\r\\n628 459 0\\r\\n837 335 1\\r\\n830 332 0\\r\\n519 104 1\\r\\n975 87 0\\r\\n69 26 1\\r\\n356 82 1\\r\\n700 138 0\\r\\n842 186 0\\r\\n975 48 0\\r\\n779 728 1\\r\\n440 247 1\\r\\n245 92 1\\r\\n606 31 0\\r\\n817 192 0\\r\\n468 39 0\\r\\n993 542 1\\r\\n708 616 1\\r\\n911 256 0\\r\\n868 821 0\\r\\n948 491 0\\r\\n781 442 0\\r\\n158 125 0\\r\\n178 65 0\\r\\n589 ...\", \"output\": [\"597\"]}, {\"input\": \"2 100 1\\r\\nD\\r\\n742 643 21\\r\\n394 113 53\\r\\n969 856 8\\r\\n544 535 99\\r\\n715 456 36\\r\\n442 434 15\\r\\n368 354 51\\r\\n518 219 97\\r\\n816 412 60\\r\\n552 536 59\\r\\n406 241 37\\r\\n728 644 70\\r\\n551 54 52\\r\\n875 847 36\\r\\n591 311 5\\r\\n122 26 75\\r\\n741 382 25\\r\\n791 347 55\\r\\n465 395 96\\r\\n835 135 33\\r\\n362 48 3\\r\\n826 767 96\\r\\n759 704 18\\r\\n262 59 11\\r\\n838 70 39\\r\\n345 148 37\\r\\n563 503 96\\r\\n50 8 68\\r\\n870 759 35\\r\\n881 336 48\\r\\n604 299 61\\r\\n889 50 20\\r\\n863 345 58\\r\\n148 104 91\\r\\n811 123 42\\r\\n696 474 31\\r\\n481 473 22\\r\\n644 611 28\\r\\n846 699 97\\r\\n867 434 14\\r\\n208 11 89\\r\\n778 767 44\\r\\n884 365 ...\", \"output\": [\"435\"]}, {\"input\": \"2 100 100\\r\\nRzhggggh\\r\\n323 53 1\\r\\n788 434 0\\r\\n675 369 1\\r\\n575 46 0\\r\\n60 42 0\\r\\n745 625 1\\r\\n76 49 1\\r\\n662 548 0\\r\\n673 432 0\\r\\n402 272 0\\r\\n904 328 0\\r\\n616 6 0\\r\\n474 272 1\\r\\n164 28 1\\r\\n749 692 0\\r\\n833 228 0\\r\\n188 160 0\\r\\n728 190 1\\r\\n946 280 0\\r\\n321 180 0\\r\\n853 705 0\\r\\n621 256 0\\r\\n654 419 1\\r\\n984 32 1\\r\\n441 50 0\\r\\n537 483 1\\r\\n786 772 0\\r\\n900 217 0\\r\\n504 212 1\\r\\n802 46 1\\r\\n874 821 0\\r\\n428 129 0\\r\\n668 13 1\\r\\n770 476 0\\r\\n744 77 0\\r\\n745 24 0\\r\\n181 137 0\\r\\n813 507 0\\r\\n235 131 1\\r\\n596 556 1\\r\\n865 361 0\\r\\n582 84 1\\r\\n620 615 0\\r\\n731 192 1\\r\\n695 217 1\\r\\n721 426 1\\r\\n...\", \"output\": [\"2299\"]}, {\"input\": \"2 100 100\\r\\nPdxrul\\r\\n669 24 10\\r\\n750 639 7\\r\\n781 454 2\\r\\n760 263 2\\r\\n558 304 8\\r\\n996 685 6\\r\\n924 714 6\\r\\n685 266 4\\r\\n244 214 5\\r\\n660 657 9\\r\\n437 116 3\\r\\n929 249 9\\r\\n823 211 5\\r\\n415 60 10\\r\\n596 221 6\\r\\n903 389 4\\r\\n394 217 8\\r\\n666 218 4\\r\\n881 268 9\\r\\n742 169 7\\r\\n886 283 5\\r\\n771 294 4\\r\\n933 181 9\\r\\n557 259 5\\r\\n499 6 0\\r\\n404 109 0\\r\\n783 488 7\\r\\n283 124 6\\r\\n799 269 7\\r\\n638 354 3\\r\\n960 495 8\\r\\n628 285 8\\r\\n805 555 3\\r\\n861 414 6\\r\\n476 345 0\\r\\n919 911 3\\r\\n953 855 5\\r\\n955 188 9\\r\\n765 37 2\\r\\n269 80 0\\r\\n635 263 0\\r\\n820 486 0\\r\\n246 176 0\\r\\n742 464 8\\r\\n948 219 10\\r\\n...\", \"output\": [\"10027\"]}, {\"input\": \"2 100 100\\r\\nBfk\\r\\n825 303 97\\r\\n959 81 9\\r\\n959 887 39\\r\\n844 765 34\\r\\n896 221 14\\r\\n637 556 12\\r\\n330 65 89\\r\\n916 379 77\\r\\n765 718 54\\r\\n553 132 29\\r\\n979 422 12\\r\\n885 353 39\\r\\n588 445 7\\r\\n474 457 91\\r\\n560 121 2\\r\\n783 602 8\\r\\n971 370 0\\r\\n398 207 98\\r\\n610 66 15\\r\\n606 388 70\\r\\n200 113 26\\r\\n832 185 66\\r\\n850 417 54\\r\\n990 933 78\\r\\n917 796 67\\r\\n887 660 51\\r\\n486 227 72\\r\\n346 5 8\\r\\n793 287 22\\r\\n941 11 4\\r\\n524 459 10\\r\\n174 17 80\\r\\n870 757 22\\r\\n780 736 46\\r\\n60 57 80\\r\\n690 326 78\\r\\n792 715 85\\r\\n246 124 41\\r\\n801 606 81\\r\\n337 25 30\\r\\n457 413 64\\r\\n427 341 71\\r\\n884 287 ...\", \"output\": [\"71339\"]}, {\"input\": \"5 10 15\\r\\nDdunkjly\\r\\n13 12 4\\r\\n83 26 1\\r\\n63 42 3\\r\\n83 22 2\\r\\n57 33 0\\r\\n59 10 1\\r\\n89 31 1\\r\\n57 17 2\\r\\n98 79 5\\r\\n46 41 3\\r\\nFbpbc\\r\\n28 21 0\\r\\n93 66 5\\r\\n66 21 0\\r\\n68 58 0\\r\\n59 17 3\\r\\n57 23 1\\r\\n72 71 1\\r\\n55 51 2\\r\\n58 40 5\\r\\n70 67 2\\r\\nKeiotmh\\r\\n73 44 4\\r\\n98 14 0\\r\\n19 7 0\\r\\n55 10 5\\r\\n30 25 4\\r\\n66 48 2\\r\\n66 51 4\\r\\n82 79 3\\r\\n73 63 4\\r\\n87 46 5\\r\\nNksdivdyjr\\r\\n92 83 4\\r\\n89 75 2\\r\\n87 40 5\\r\\n79 78 3\\r\\n26 18 1\\r\\n21 17 1\\r\\n95 43 1\\r\\n84 26 1\\r\\n49 43 3\\r\\n90 88 5\\r\\nW\\r\\n87 3 4\\r\\n91 44 1\\r\\n63 18 3\\r\\n57 3 5\\r\\n88 47 0\\r\\n43 2 1\\r\\n29 18 2\\r\\n82 76 3\\r\\n4 3 2\\r\\n73 58 1\\r\\n\", \"output\": [\"406\"]}, {\"input\": \"5 15 20\\r\\nFrimnrnqk\\r\\n16 12 1\\r\\n12 7 2\\r\\n15 10 0\\r\\n19 9 7\\r\\n15 4 4\\r\\n8 7 2\\r\\n20 10 3\\r\\n20 19 5\\r\\n17 8 8\\r\\n12 6 3\\r\\n16 1 5\\r\\n15 4 3\\r\\n19 15 6\\r\\n18 10 1\\r\\n16 4 9\\r\\nOhx\\r\\n17 7 5\\r\\n20 18 0\\r\\n7 5 6\\r\\n20 8 3\\r\\n17 8 2\\r\\n11 4 0\\r\\n18 8 2\\r\\n5 4 9\\r\\n7 4 1\\r\\n10 3 5\\r\\n11 5 6\\r\\n16 9 2\\r\\n11 6 9\\r\\n12 6 5\\r\\n17 12 4\\r\\nPygxzzst\\r\\n15 5 6\\r\\n17 5 3\\r\\n11 6 7\\r\\n8 5 7\\r\\n14 9 7\\r\\n13 3 4\\r\\n15 2 10\\r\\n9 3 4\\r\\n16 15 3\\r\\n20 6 10\\r\\n9 1 9\\r\\n18 14 8\\r\\n7 2 2\\r\\n11 8 6\\r\\n14 11 2\\r\\nRoq\\r\\n20 8 1\\r\\n14 7 1\\r\\n5 4 9\\r\\n10 1 10\\r\\n20 5 1\\r\\n15 7 6\\r\\n15 5 0\\r\\n10 5 6\\r\\n20 19 8\\r\\n10 1 10\\r\\n17 4 1\\r\\n14 3 3\\r\\n6 3 4\\r\\n1...\", \"output\": [\"168\"]}, {\"input\": \"5 39 46\\r\\nCbtvxde\\r\\n345 342 6\\r\\n317 256 9\\r\\n170 20 13\\r\\n365 141 12\\r\\n428 183 3\\r\\n252 62 0\\r\\n246 59 11\\r\\n168 44 4\\r\\n297 123 13\\r\\n397 177 9\\r\\n343 321 12\\r\\n156 75 7\\r\\n83 70 15\\r\\n478 207 5\\r\\n455 418 1\\r\\n267 91 1\\r\\n277 13 0\\r\\n55 35 16\\r\\n286 146 12\\r\\n361 96 4\\r\\n431 407 3\\r\\n301 270 6\\r\\n482 265 9\\r\\n302 130 16\\r\\n376 339 16\\r\\n267 160 12\\r\\n362 183 7\\r\\n199 7 1\\r\\n439 138 15\\r\\n334 323 8\\r\\n455 240 1\\r\\n441 144 3\\r\\n14 11 9\\r\\n414 100 6\\r\\n424 261 6\\r\\n381 38 9\\r\\n251 204 16\\r\\n398 3 7\\r\\n264 169 0\\r\\nGhn\\r\\n400 198 16\\r\\n432 102 11\\r\\n361 246 16\\r\\n362 315 15\\r\\n186 12 16\\r\\n275 14...\", \"output\": [\"14964\"]}, {\"input\": \"5 89 88\\r\\nAn\\r\\n316 284 57\\r\\n218 40 25\\r\\n741 285 77\\r\\n767 513 43\\r\\n804 448 40\\r\\n504 195 94\\r\\n596 198 31\\r\\n775 500 98\\r\\n703 515 71\\r\\n780 93 42\\r\\n999 290 98\\r\\n549 456 23\\r\\n975 903 76\\r\\n886 642 11\\r\\n492 365 78\\r\\n836 334 82\\r\\n408 219 51\\r\\n178 172 38\\r\\n611 201 12\\r\\n921 858 86\\r\\n724 435 14\\r\\n826 125 96\\r\\n808 418 56\\r\\n909 50 16\\r\\n878 32 97\\r\\n918 811 58\\r\\n878 636 33\\r\\n968 310 80\\r\\n894 175 24\\r\\n663 35 98\\r\\n928 251 2\\r\\n616 478 69\\r\\n869 130 72\\r\\n521 486 0\\r\\n583 82 42\\r\\n603 189 90\\r\\n565 445 86\\r\\n531 250 24\\r\\n556 202 78\\r\\n53 4 100\\r\\n782 106 86\\r\\n839 507 92\\r\\n494 ...\", \"output\": [\"68456\"]}, {\"input\": \"5 100 100\\r\\nC\\r\\n627 413 43\\r\\n684 666 97\\r\\n819 409 19\\r\\n929 537 45\\r\\n845 545 79\\r\\n505 119 98\\r\\n914 303 42\\r\\n173 155 27\\r\\n730 369 57\\r\\n851 650 37\\r\\n526 117 7\\r\\n693 569 55\\r\\n714 375 63\\r\\n603 484 64\\r\\n784 534 5\\r\\n733 167 17\\r\\n788 688 46\\r\\n869 353 76\\r\\n709 346 38\\r\\n808 112 25\\r\\n894 22 22\\r\\n305 168 59\\r\\n960 347 9\\r\\n310 198 71\\r\\n269 268 64\\r\\n93 27 23\\r\\n406 289 96\\r\\n897 306 37\\r\\n339 142 63\\r\\n955 209 53\\r\\n910 106 32\\r\\n408 369 16\\r\\n227 54 52\\r\\n218 137 10\\r\\n734 221 94\\r\\n428 47 80\\r\\n730 529 90\\r\\n726 473 7\\r\\n782 565 94\\r\\n705 549 15\\r\\n716 128 18\\r\\n862 200 94\\r\\n81...\", \"output\": [\"61124\"]}, {\"input\": \"7 10 17\\r\\nHqqmwdcno\\r\\n61 55 5\\r\\n75 34 3\\r\\n46 34 5\\r\\n93 40 1\\r\\n33 14 2\\r\\n99 40 5\\r\\n72 71 5\\r\\n52 22 3\\r\\n90 82 5\\r\\n52 5 4\\r\\nP\\r\\n77 11 3\\r\\n94 57 5\\r\\n95 5 0\\r\\n86 71 0\\r\\n53 22 2\\r\\n38 17 3\\r\\n91 4 1\\r\\n40 39 2\\r\\n13 12 1\\r\\n86 12 5\\r\\nQnoqdxse\\r\\n51 18 3\\r\\n12 4 3\\r\\n3 2 1\\r\\n89 66 4\\r\\n73 34 5\\r\\n93 86 0\\r\\n88 69 2\\r\\n14 3 4\\r\\n96 33 0\\r\\n100 25 5\\r\\nU\\r\\n67 32 4\\r\\n81 73 5\\r\\n51 49 1\\r\\n19 5 3\\r\\n50 34 0\\r\\n88 35 5\\r\\n42 5 4\\r\\n72 66 4\\r\\n96 57 1\\r\\n43 25 3\\r\\nUbrke\\r\\n47 7 1\\r\\n50 8 3\\r\\n85 63 0\\r\\n77 26 0\\r\\n56 35 1\\r\\n59 57 2\\r\\n60 11 3\\r\\n89 6 1\\r\\n87 50 3\\r\\n59 35 4\\r\\nUtxee\\r\\n93 84 0\\r\\n68 7 3\\r\\n95 11...\", \"output\": [\"437\"]}, {\"input\": \"8 78 45\\r\\nHs\\r\\n429 318 3\\r\\n774 368 4\\r\\n522 42 8\\r\\n511 442 8\\r\\n337 211 4\\r\\n135 84 3\\r\\n450 286 6\\r\\n901 86 9\\r\\n716 487 8\\r\\n971 181 7\\r\\n932 596 7\\r\\n495 371 7\\r\\n604 157 8\\r\\n156 30 9\\r\\n901 316 3\\r\\n795 162 1\\r\\n948 380 4\\r\\n68 6 6\\r\\n604 282 9\\r\\n964 593 9\\r\\n707 592 5\\r\\n841 413 2\\r\\n411 234 10\\r\\n727 188 10\\r\\n987 199 4\\r\\n562 445 9\\r\\n942 65 10\\r\\n743 273 8\\r\\n472 345 8\\r\\n597 187 6\\r\\n462 245 1\\r\\n957 896 2\\r\\n153 30 1\\r\\n995 952 3\\r\\n954 847 6\\r\\n390 53 0\\r\\n469 413 7\\r\\n527 477 7\\r\\n435 30 6\\r\\n884 407 8\\r\\n797 18 7\\r\\n760 709 0\\r\\n877 695 10\\r\\n819 786 5\\r\\n693 520 2\\r\\n326 5 9\\r\\n92...\", \"output\": [\"18006\"]}, {\"input\": \"8 100 100\\r\\nAeg\\r\\n982 760 2\\r\\n861 271 2\\r\\n444 45 3\\r\\n889 134 1\\r\\n808 396 1\\r\\n637 574 2\\r\\n920 427 0\\r\\n972 206 2\\r\\n688 227 3\\r\\n629 561 1\\r\\n969 208 0\\r\\n783 313 1\\r\\n795 253 1\\r\\n968 632 2\\r\\n956 373 2\\r\\n864 515 0\\r\\n544 187 1\\r\\n583 112 2\\r\\n744 102 3\\r\\n519 482 0\\r\\n603 502 0\\r\\n210 104 0\\r\\n832 579 3\\r\\n968 134 2\\r\\n412 86 0\\r\\n651 54 1\\r\\n332 202 3\\r\\n981 807 2\\r\\n516 31 2\\r\\n408 155 0\\r\\n780 240 2\\r\\n375 53 1\\r\\n740 255 3\\r\\n247 25 1\\r\\n444 292 3\\r\\n334 86 2\\r\\n777 46 1\\r\\n330 212 0\\r\\n689 543 3\\r\\n707 591 3\\r\\n561 447 2\\r\\n762 684 2\\r\\n683 74 2\\r\\n478 167 3\\r\\n737 401 3\\r\\n811 563 1...\", \"output\": [\"8961\"]}, {\"input\": \"9 100 100\\r\\nAsp\\r\\n833 56 1\\r\\n504 313 1\\r\\n503 387 1\\r\\n810 577 1\\r\\n730 408 0\\r\\n808 433 1\\r\\n345 103 0\\r\\n276 17 1\\r\\n827 90 1\\r\\n871 523 1\\r\\n625 488 1\\r\\n980 383 0\\r\\n892 878 1\\r\\n558 386 0\\r\\n354 271 0\\r\\n316 62 0\\r\\n639 489 0\\r\\n238 4 1\\r\\n907 647 1\\r\\n420 193 1\\r\\n512 170 1\\r\\n728 221 1\\r\\n862 634 0\\r\\n427 40 1\\r\\n967 458 1\\r\\n715 69 0\\r\\n238 223 1\\r\\n528 124 1\\r\\n871 286 1\\r\\n525 34 0\\r\\n913 796 0\\r\\n691 260 1\\r\\n746 246 0\\r\\n802 560 1\\r\\n864 233 1\\r\\n940 377 0\\r\\n559 2 1\\r\\n892 681 0\\r\\n201 109 0\\r\\n788 121 0\\r\\n387 7 1\\r\\n501 339 0\\r\\n717 320 1\\r\\n852 339 0\\r\\n570 530 1\\r\\n465 396 0\\r\\n87...\", \"output\": [\"3120\"]}, {\"input\": \"9 100 100\\r\\nBfopehfrke\\r\\n354 3 68\\r\\n328 214 38\\r\\n555 213 39\\r\\n305 2 40\\r\\n613 381 59\\r\\n166 10 34\\r\\n143 96 47\\r\\n713 261 11\\r\\n531 217 56\\r\\n941 238 73\\r\\n648 439 70\\r\\n578 199 65\\r\\n607 482 35\\r\\n656 385 8\\r\\n633 415 18\\r\\n325 80 77\\r\\n973 719 36\\r\\n491 9 80\\r\\n709 565 61\\r\\n935 656 19\\r\\n761 34 11\\r\\n971 922 96\\r\\n843 112 72\\r\\n366 262 90\\r\\n379 304 17\\r\\n569 271 91\\r\\n958 146 34\\r\\n816 670 6\\r\\n901 244 6\\r\\n614 175 82\\r\\n481 162 7\\r\\n690 449 94\\r\\n373 372 49\\r\\n253 25 67\\r\\n911 155 44\\r\\n782 592 33\\r\\n903 298 86\\r\\n480 413 82\\r\\n620 135 2\\r\\n367 314 24\\r\\n896 388 52\\r\\n293 200 88\\r\\n...\", \"output\": [\"71510\"]}, {\"input\": \"10 1 1\\r\\nAgeni\\r\\n2 1 0\\r\\nCqp\\r\\n2 1 0\\r\\nDjllpqrlm\\r\\n2 1 0\\r\\nEge\\r\\n2 1 0\\r\\nFgrjxcp\\r\\n2 1 0\\r\\nGzsd\\r\\n2 1 0\\r\\nJckfp\\r\\n2 1 0\\r\\nLkaiztim\\r\\n2 1 0\\r\\nU\\r\\n2 1 0\\r\\nWxkrapkcd\\r\\n2 1 0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"10 1 1\\r\\nApwdf\\r\\n2 1 1\\r\\nEyb\\r\\n2 1 0\\r\\nJsexqpea\\r\\n2 1 0\\r\\nNdpbjiinid\\r\\n2 1 0\\r\\nQxblqe\\r\\n2 1 1\\r\\nUiclztzfv\\r\\n2 1 0\\r\\nUzioe\\r\\n2 1 1\\r\\nV\\r\\n2 1 0\\r\\nZi\\r\\n2 1 1\\r\\nZwweiabfd\\r\\n2 1 0\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"10 1 1\\r\\nBtwam\\r\\n403 173 85\\r\\nGzpwvavbi\\r\\n943 801 83\\r\\nHeg\\r\\n608 264 87\\r\\nKfjdge\\r\\n840 618 21\\r\\nN\\r\\n946 165 77\\r\\nOel\\r\\n741 49 9\\r\\nPxlirkw\\r\\n718 16 78\\r\\nRysunixvhj\\r\\n711 305 10\\r\\nWtuvsdckhu\\r\\n636 174 13\\r\\nZpqqjvr\\r\\n600 517 96\\r\\n\", \"output\": [\"398\"]}, {\"input\": \"10 100 100\\r\\nCzorqzgkrt\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 ...\", \"output\": [\"0\"]}, {\"input\": \"10 100 100\\r\\nEhzuddnw\\r\\n342 215 0\\r\\n805 114 0\\r\\n942 832 1\\r\\n648 538 1\\r\\n888 536 0\\r\\n951 51 1\\r\\n318 283 1\\r\\n775 730 1\\r\\n851 733 0\\r\\n660 360 1\\r\\n327 225 0\\r\\n665 281 1\\r\\n290 32 1\\r\\n395 124 0\\r\\n283 48 1\\r\\n347 1 1\\r\\n795 184 1\\r\\n842 137 1\\r\\n572 164 1\\r\\n953 249 1\\r\\n45 29 1\\r\\n983 192 0\\r\\n537 47 1\\r\\n431 164 0\\r\\n322 216 0\\r\\n769 343 1\\r\\n424 72 0\\r\\n968 463 1\\r\\n728 299 1\\r\\n915 42 0\\r\\n247 52 1\\r\\n140 98 1\\r\\n801 351 1\\r\\n808 182 0\\r\\n15 13 0\\r\\n772 271 0\\r\\n910 347 1\\r\\n646 416 1\\r\\n407 72 0\\r\\n735 708 1\\r\\n554 166 1\\r\\n600 119 1\\r\\n531 123 1\\r\\n879 27 1\\r\\n269 176 1\\r\\n830 222 0\\r...\", \"output\": [\"3427\"]}, {\"input\": \"10 98 79\\r\\nAgdjtes\\r\\n442 188 4\\r\\n494 219 9\\r\\n427 122 5\\r\\n428 42 6\\r\\n128 23 4\\r\\n131 55 9\\r\\n174 31 7\\r\\n267 43 1\\r\\n164 132 2\\r\\n95 86 9\\r\\n310 271 3\\r\\n322 228 1\\r\\n483 133 4\\r\\n10 1 6\\r\\n421 61 2\\r\\n484 318 1\\r\\n344 118 10\\r\\n320 283 2\\r\\n215 56 8\\r\\n382 44 2\\r\\n408 124 2\\r\\n278 75 5\\r\\n88 24 8\\r\\n488 372 4\\r\\n474 196 9\\r\\n346 194 9\\r\\n442 438 7\\r\\n82 23 8\\r\\n373 128 4\\r\\n384 62 2\\r\\n387 210 10\\r\\n456 47 8\\r\\n324 139 4\\r\\n416 8 10\\r\\n442 312 2\\r\\n484 299 9\\r\\n499 101 10\\r\\n418 134 1\\r\\n117 64 3\\r\\n448 49 10\\r\\n272 221 4\\r\\n343 3 7\\r\\n365 175 3\\r\\n460 235 2\\r\\n488 404 4\\r\\n438 99 3\\r\\n478 448 ...\", \"output\": [\"14736\"]}, {\"input\": \"10 100 100\\r\\nEr\\r\\n892 844 2\\r\\n488 245 6\\r\\n817 583 9\\r\\n738 707 2\\r\\n562 82 3\\r\\n869 437 7\\r\\n960 37 2\\r\\n777 545 8\\r\\n991 192 9\\r\\n341 139 5\\r\\n749 34 5\\r\\n917 478 8\\r\\n171 69 3\\r\\n889 527 1\\r\\n895 784 4\\r\\n766 333 7\\r\\n27 9 1\\r\\n911 369 1\\r\\n855 99 1\\r\\n992 39 10\\r\\n261 60 9\\r\\n691 53 4\\r\\n334 261 10\\r\\n839 389 5\\r\\n863 414 9\\r\\n987 979 8\\r\\n222 217 2\\r\\n382 266 9\\r\\n826 85 1\\r\\n965 548 8\\r\\n160 106 4\\r\\n539 403 8\\r\\n445 237 8\\r\\n788 651 6\\r\\n701 82 10\\r\\n525 344 7\\r\\n724 84 1\\r\\n605 197 9\\r\\n204 157 2\\r\\n826 382 3\\r\\n783 76 10\\r\\n903 718 4\\r\\n996 827 6\\r\\n947 835 4\\r\\n564 511 10\\r\\n818 408 7\\r...\", \"output\": [\"35342\"]}, {\"input\": \"10 100 100\\r\\nIepcfjlv\\r\\n532 378 62\\r\\n720 252 4\\r\\n891 7 99\\r\\n432 384 86\\r\\n927 813 6\\r\\n571 120 89\\r\\n300 149 31\\r\\n639 627 39\\r\\n597 136 94\\r\\n463 72 37\\r\\n713 300 93\\r\\n210 8 59\\r\\n362 98 12\\r\\n923 813 29\\r\\n329 9 100\\r\\n986 807 54\\r\\n788 109 94\\r\\n647 612 5\\r\\n867 94 77\\r\\n359 158 61\\r\\n585 333 97\\r\\n757 411 7\\r\\n978 798 61\\r\\n883 558 11\\r\\n927 100 80\\r\\n307 305 65\\r\\n989 685 32\\r\\n574 204 5\\r\\n957 408 99\\r\\n810 286 70\\r\\n616 89 49\\r\\n963 659 78\\r\\n653 508 74\\r\\n444 403 35\\r\\n807 218 84\\r\\n637 315 12\\r\\n595 128 48\\r\\n977 72 3\\r\\n997 992 8\\r\\n59 25 63\\r\\n751 525 32\\r\\n392 332 58\\r\\n916 ...\", \"output\": [\"78153\"]}, {\"input\": \"10 100 100\\r\\nElgr\\r\\n897 340 43\\r\\n975 666 54\\r\\n469 125 87\\r\\n595 534 99\\r\\n619 415 22\\r\\n997 312 34\\r\\n391 306 2\\r\\n702 630 26\\r\\n499 426 31\\r\\n185 181 31\\r\\n661 599 99\\r\\n934 283 99\\r\\n666 84 23\\r\\n413 167 56\\r\\n641 139 19\\r\\n886 852 27\\r\\n625 47 65\\r\\n838 68 34\\r\\n866 428 87\\r\\n410 276 32\\r\\n649 369 49\\r\\n398 84 69\\r\\n763 89 44\\r\\n753 364 23\\r\\n590 145 91\\r\\n712 102 10\\r\\n817 671 100\\r\\n227 197 80\\r\\n739 67 35\\r\\n441 102 50\\r\\n187 130 9\\r\\n974 88 75\\r\\n558 107 62\\r\\n709 130 23\\r\\n692 100 7\\r\\n739 82 58\\r\\n991 393 23\\r\\n150 138 73\\r\\n155 78 26\\r\\n671 234 2\\r\\n639 606 37\\r\\n295 158 90\\r\\n2...\", \"output\": [\"72354\"]}, {\"input\": \"10 100 100\\r\\nEol\\r\\n959 955 61\\r\\n859 160 94\\r\\n641 405 63\\r\\n795 414 70\\r\\n326 61 51\\r\\n854 810 22\\r\\n732 668 24\\r\\n782 321 51\\r\\n150 93 3\\r\\n516 293 67\\r\\n698 159 86\\r\\n435 109 59\\r\\n972 154 70\\r\\n246 152 62\\r\\n891 603 37\\r\\n660 369 61\\r\\n490 110 41\\r\\n889 438 33\\r\\n776 471 56\\r\\n345 57 20\\r\\n704 3 6\\r\\n795 665 88\\r\\n712 638 53\\r\\n492 219 90\\r\\n949 710 12\\r\\n917 498 63\\r\\n764 313 31\\r\\n606 252 25\\r\\n993 355 64\\r\\n892 370 19\\r\\n536 29 21\\r\\n400 265 25\\r\\n678 91 77\\r\\n691 32 42\\r\\n833 100 56\\r\\n722 31 5\\r\\n962 578 12\\r\\n549 458 55\\r\\n974 924 72\\r\\n402 241 33\\r\\n254 212 70\\r\\n987 702 33\\r\\n41...\", \"output\": [\"73440\"]}, {\"input\": \"10 100 100\\r\\nAaxx\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1...\", \"output\": [\"99700\"]}, {\"input\": \"10 100 100\\r\\nAbxx\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n100...\", \"output\": [\"0\"]}, {\"input\": \"10 100 100\\r\\nAaxx\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100...\", \"output\": [\"80100\"]}, {\"input\": \"10 10 100\\r\\nAdzzzzk\\r\\n100 1 10\\r\\n100 1 10\\r\\n100 1 10\\r\\n100 1 10\\r\\n100 1 10\\r\\n100 1 10\\r\\n100 1 10\\r\\n100 1 10\\r\\n100 1 10\\r\\n100 1 10\\r\\nBdzzzzk\\r\\n200 101 10\\r\\n200 101 10\\r\\n200 101 10\\r\\n200 101 10\\r\\n200 101 10\\r\\n200 101 10\\r\\n200 101 10\\r\\n200 101 10\\r\\n200 101 10\\r\\n200 101 10\\r\\nCdzzzzk\\r\\n300 201 10\\r\\n300 201 10\\r\\n300 201 10\\r\\n300 201 10\\r\\n300 201 10\\r\\n300 201 10\\r\\n300 201 10\\r\\n300 201 10\\r\\n300 201 10\\r\\n300 201 10\\r\\nDdzzzzk\\r\\n400 301 10\\r\\n400 301 10\\r\\n400 301 10\\r\\n400 301 10\\r\\n400 301 10\\r\\n400 301 10\\r\\n400 301 10\\r\\n400 301 10\\r\\n400 301 10\\r\\n400 301 10\\r\\nEdzz...\", \"output\": [\"80100\"]}, {\"input\": \"10 100 100\\r\\nAbbbzzk\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1...\", \"output\": [\"0\"]}, {\"input\": \"10 100 100\\r\\nCap\\r\\n998 2 1\\r\\n997 3 1\\r\\n996 4 1\\r\\n995 5 1\\r\\n994 6 1\\r\\n993 7 1\\r\\n992 8 1\\r\\n991 9 1\\r\\n990 10 1\\r\\n989 11 1\\r\\n988 12 1\\r\\n987 13 1\\r\\n986 14 1\\r\\n985 15 1\\r\\n984 16 1\\r\\n983 17 1\\r\\n982 18 1\\r\\n981 19 1\\r\\n980 20 1\\r\\n979 21 1\\r\\n978 22 1\\r\\n977 23 1\\r\\n976 24 1\\r\\n975 25 1\\r\\n974 26 1\\r\\n973 27 1\\r\\n972 28 1\\r\\n971 29 1\\r\\n970 30 1\\r\\n969 31 1\\r\\n968 32 1\\r\\n967 33 1\\r\\n966 34 1\\r\\n965 35 1\\r\\n964 36 1\\r\\n963 37 1\\r\\n962 38 1\\r\\n961 39 1\\r\\n960 40 1\\r\\n959 41 1\\r\\n958 42 1\\r\\n957 43 1\\r\\n956 44 1\\r\\n955 45 1\\r\\n954 46 1\\r\\n953 47 1\\r\\n952 48 1\\r\\n951 49 1\\r\\n950 50 1\\r\\n949 51 1\\r\\n94...\", \"output\": [\"0\"]}, {\"input\": \"3 3 1\\r\\nVenus\\r\\n40 5 3\\r\\n7 6 3\\r\\n8 4 3\\r\\nEarth\\r\\n70 60 3\\r\\n800 700 3\\r\\n6 5 3\\r\\nMars\\r\\n8 7 3\\r\\n14 5 3\\r\\n15 14 3\\r\\n\", \"output\": [\"693\"]}, {\"input\": \"2 3 10\\r\\nEarth\\r\\n10 9 0\\r\\n8 6 4\\r\\n10 9 3\\r\\nVenus\\r\\n6 5 3\\r\\n7 6 5\\r\\n8 6 10\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"3 3 10\\r\\nEarth\\r\\n10 9 0\\r\\n8 6 4\\r\\n10 9 3\\r\\nVenus\\r\\n6 5 3\\r\\n7 6 5\\r\\n8 6 10\\r\\nMars\\r\\n4 3 0\\r\\n8 4 12\\r\\n7 2 5\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"2 100 100\\r\\nAasdsad\\r\\n783 451 77\\r\\n796 790 58\\r\\n838 835 86\\r\\n640 454 27\\r\\n566 473 38\\r\\n750 421 86\\r\\n417 155 23\\r\\n838 637 51\\r\\n854 779 9\\r\\n893 522 45\\r\\n973 62 31\\r\\n534 453 76\\r\\n835 154 36\\r\\n749 187 43\\r\\n951 644 15\\r\\n444 237 51\\r\\n891 769 7\\r\\n551 315 55\\r\\n822 334 73\\r\\n199 52 18\\r\\n844 340 30\\r\\n801 398 99\\r\\n828 519 21\\r\\n489 91 50\\r\\n776 715 27\\r\\n994 866 77\\r\\n551 188 46\\r\\n806 596 90\\r\\n790 184 73\\r\\n732 227 85\\r\\n556 325 2\\r\\n754 357 6\\r\\n900 138 72\\r\\n590 421 11\\r\\n859 661 28\\r\\n801 128 37\\r\\n745 583 21\\r\\n951 927 5\\r\\n689 577 16\\r\\n95 44 53\\r\\n922 220 33\\r\\n756 348 8...\", \"output\": [\"50640\"]}, {\"input\": \"2 2 1\\r\\nQwe\\r\\n900 800 1\\r\\n5 1 1\\r\\nEwq\\r\\n1000 999 0\\r\\n11 10 0\\r\\n\", \"output\": [\"99\"]}, {\"input\": \"5 7 30\\r\\nBzbmwey\\r\\n61 2 6\\r\\n39 20 2\\r\\n76 15 7\\r\\n12 1 5\\r\\n62 38 1\\r\\n84 22 7\\r\\n52 31 3\\r\\nDyfw\\r\\n77 22 8\\r\\n88 21 4\\r\\n48 21 7\\r\\n82 81 2\\r\\n49 2 7\\r\\n57 38 10\\r\\n99 98 8\\r\\nG\\r\\n91 2 4\\r\\n84 60 4\\r\\n9 6 5\\r\\n69 45 1\\r\\n81 27 4\\r\\n93 22 9\\r\\n73 14 5\\r\\nUpwb\\r\\n72 67 10\\r\\n18 9 7\\r\\n80 13 2\\r\\n66 30 2\\r\\n88 ...\", \"output\": [\"534\"]}, {\"input\": \"2 17 100\\r\\nFevvyt\\r\\n35 34 4\\r\\n80 50 7\\r\\n88 85 1\\r\\n60 45 9\\r\\n48 47 9\\r\\n63 47 9\\r\\n81 56 1\\r\\n25 23 5\\r\\n100 46 1\\r\\n25 7 9\\r\\n29 12 6\\r\\n36 2 8\\r\\n49 27 10\\r\\n35 20 5\\r\\n92 64 2\\r\\n60 3 8\\r\\n72 28 3\\r\\nOfntgr\\r\\n93 12 4\\r\\n67 38 6\\r\\n28 21 2\\r\\n86 29 5\\r\\n23 3 4\\r\\n81 69 6\\r\\n79 12 3\\r\\n64 43 5\\r\\n81 38 ...\", \"output\": [\"770\"]}, {\"input\": \"2 23 97\\r\\nAfgickc\\r\\n737 670 3\\r\\n554 515 2\\r\\n725 568 1\\r\\n365 77 2\\r\\n951 183 0\\r\\n902 833 3\\r\\n326 146 1\\r\\n876 299 2\\r\\n484 151 1\\r\\n753 406 2\\r\\n415 35 2\\r\\n547 154 3\\r\\n377 297 1\\r\\n620 238 3\\r\\n479 207 1\\r\\n931 834 0\\r\\n874 127 1\\r\\n847 499 0\\r\\n276 75 0\\r\\n424 281 3\\r\\n835 420 1\\r\\n637 596 3...\", \"output\": [\"1540\"]}, {\"input\": \"2 47 55\\r\\nXjlxsyttw\\r\\n649 514 14\\r\\n642 319 2\\r\\n598 353 14\\r\\n657 455 0\\r\\n609 527 5\\r\\n667 216 9\\r\\n615 603 3\\r\\n360 222 7\\r\\n320 154 3\\r\\n514 286 15\\r\\n283 213 7\\r\\n247 16 4\\r\\n423 317 7\\r\\n469 58 15\\r\\n638 507 15\\r\\n407 341 0\\r\\n587 454 10\\r\\n125 70 12\\r\\n558 44 7\\r\\n477 30 12\\r\\n675 601 14\\r\\n...\", \"output\": [\"10526\"]}, {\"input\": \"2 79 81\\r\\nMacvhxgfcn\\r\\n483 34 49\\r\\n438 60 19\\r\\n271 54 13\\r\\n416 361 29\\r\\n365 76 21\\r\\n583 230 2\\r\\n580 159 18\\r\\n253 56 27\\r\\n561 110 11\\r\\n511 322 12\\r\\n493 352 36\\r\\n305 165 3\\r\\n572 336 8\\r\\n93 8 42\\r\\n263 208 42\\r\\n479 397 47\\r\\n568 428 34\\r\\n497 370 49\\r\\n352 250 31\\r\\n68 48 33\\r\\n356 278...\", \"output\": [\"31581\"]}, {\"input\": \"2 100 1\\r\\nLjmpcxrzul\\r\\n695 271 1\\r\\n723 720 1\\r\\n152 10 1\\r\\n966 757 0\\r\\n486 279 1\\r\\n229 145 1\\r\\n440 8 1\\r\\n798 294 1\\r\\n671 595 0\\r\\n96 7 0\\r\\n510 65 0\\r\\n637 56 0\\r\\n621 174 1\\r\\n76 55 1\\r\\n770 114 1\\r\\n123 38 0\\r\\n337 216 1\\r\\n152 141 0\\r\\n535 253 1\\r\\n696 170 1\\r\\n332 228 1\\r\\n412 198 0\\r\\n628...\", \"output\": [\"597\"]}, {\"input\": \"2 100 1\\r\\nD\\r\\n742 643 21\\r\\n394 113 53\\r\\n969 856 8\\r\\n544 535 99\\r\\n715 456 36\\r\\n442 434 15\\r\\n368 354 51\\r\\n518 219 97\\r\\n816 412 60\\r\\n552 536 59\\r\\n406 241 37\\r\\n728 644 70\\r\\n551 54 52\\r\\n875 847 36\\r\\n591 311 5\\r\\n122 26 75\\r\\n741 382 25\\r\\n791 347 55\\r\\n465 395 96\\r\\n835 135 33\\r\\n362 48 ...\", \"output\": [\"435\"]}, {\"input\": \"2 100 100\\r\\nRzhggggh\\r\\n323 53 1\\r\\n788 434 0\\r\\n675 369 1\\r\\n575 46 0\\r\\n60 42 0\\r\\n745 625 1\\r\\n76 49 1\\r\\n662 548 0\\r\\n673 432 0\\r\\n402 272 0\\r\\n904 328 0\\r\\n616 6 0\\r\\n474 272 1\\r\\n164 28 1\\r\\n749 692 0\\r\\n833 228 0\\r\\n188 160 0\\r\\n728 190 1\\r\\n946 280 0\\r\\n321 180 0\\r\\n853 705 0\\r\\n621 256 0\\r\\n6...\", \"output\": [\"2299\"]}, {\"input\": \"2 100 100\\r\\nPdxrul\\r\\n669 24 10\\r\\n750 639 7\\r\\n781 454 2\\r\\n760 263 2\\r\\n558 304 8\\r\\n996 685 6\\r\\n924 714 6\\r\\n685 266 4\\r\\n244 214 5\\r\\n660 657 9\\r\\n437 116 3\\r\\n929 249 9\\r\\n823 211 5\\r\\n415 60 10\\r\\n596 221 6\\r\\n903 389 4\\r\\n394 217 8\\r\\n666 218 4\\r\\n881 268 9\\r\\n742 169 7\\r\\n886 283 5\\r\\n771 2...\", \"output\": [\"10027\"]}, {\"input\": \"2 100 100\\r\\nBfk\\r\\n825 303 97\\r\\n959 81 9\\r\\n959 887 39\\r\\n844 765 34\\r\\n896 221 14\\r\\n637 556 12\\r\\n330 65 89\\r\\n916 379 77\\r\\n765 718 54\\r\\n553 132 29\\r\\n979 422 12\\r\\n885 353 39\\r\\n588 445 7\\r\\n474 457 91\\r\\n560 121 2\\r\\n783 602 8\\r\\n971 370 0\\r\\n398 207 98\\r\\n610 66 15\\r\\n606 388 70\\r\\n200 113...\", \"output\": [\"71339\"]}, {\"input\": \"5 10 15\\r\\nDdunkjly\\r\\n13 12 4\\r\\n83 26 1\\r\\n63 42 3\\r\\n83 22 2\\r\\n57 33 0\\r\\n59 10 1\\r\\n89 31 1\\r\\n57 17 2\\r\\n98 79 5\\r\\n46 41 3\\r\\nFbpbc\\r\\n28 21 0\\r\\n93 66 5\\r\\n66 21 0\\r\\n68 58 0\\r\\n59 17 3\\r\\n57 23 1\\r\\n72 71 1\\r\\n55 51 2\\r\\n58 40 5\\r\\n70 67 2\\r\\nKeiotmh\\r\\n73 44 4\\r\\n98 14 0\\r\\n19 7 0\\r\\n55 10 5\\r\\n30 25...\", \"output\": [\"406\"]}, {\"input\": \"5 15 20\\r\\nFrimnrnqk\\r\\n16 12 1\\r\\n12 7 2\\r\\n15 10 0\\r\\n19 9 7\\r\\n15 4 4\\r\\n8 7 2\\r\\n20 10 3\\r\\n20 19 5\\r\\n17 8 8\\r\\n12 6 3\\r\\n16 1 5\\r\\n15 4 3\\r\\n19 15 6\\r\\n18 10 1\\r\\n16 4 9\\r\\nOhx\\r\\n17 7 5\\r\\n20 18 0\\r\\n7 5 6\\r\\n20 8 3\\r\\n17 8 2\\r\\n11 4 0\\r\\n18 8 2\\r\\n5 4 9\\r\\n7 4 1\\r\\n10 3 5\\r\\n11 5 6\\r\\n16 9 2\\r\\n11 6 9\\r\\n12 ...\", \"output\": [\"168\"]}, {\"input\": \"5 39 46\\r\\nCbtvxde\\r\\n345 342 6\\r\\n317 256 9\\r\\n170 20 13\\r\\n365 141 12\\r\\n428 183 3\\r\\n252 62 0\\r\\n246 59 11\\r\\n168 44 4\\r\\n297 123 13\\r\\n397 177 9\\r\\n343 321 12\\r\\n156 75 7\\r\\n83 70 15\\r\\n478 207 5\\r\\n455 418 1\\r\\n267 91 1\\r\\n277 13 0\\r\\n55 35 16\\r\\n286 146 12\\r\\n361 96 4\\r\\n431 407 3\\r\\n301 270 6\\r...\", \"output\": [\"14964\"]}, {\"input\": \"5 89 88\\r\\nAn\\r\\n316 284 57\\r\\n218 40 25\\r\\n741 285 77\\r\\n767 513 43\\r\\n804 448 40\\r\\n504 195 94\\r\\n596 198 31\\r\\n775 500 98\\r\\n703 515 71\\r\\n780 93 42\\r\\n999 290 98\\r\\n549 456 23\\r\\n975 903 76\\r\\n886 642 11\\r\\n492 365 78\\r\\n836 334 82\\r\\n408 219 51\\r\\n178 172 38\\r\\n611 201 12\\r\\n921 858 86\\r\\n724 ...\", \"output\": [\"68456\"]}, {\"input\": \"5 100 100\\r\\nC\\r\\n627 413 43\\r\\n684 666 97\\r\\n819 409 19\\r\\n929 537 45\\r\\n845 545 79\\r\\n505 119 98\\r\\n914 303 42\\r\\n173 155 27\\r\\n730 369 57\\r\\n851 650 37\\r\\n526 117 7\\r\\n693 569 55\\r\\n714 375 63\\r\\n603 484 64\\r\\n784 534 5\\r\\n733 167 17\\r\\n788 688 46\\r\\n869 353 76\\r\\n709 346 38\\r\\n808 112 25\\r\\n894...\", \"output\": [\"61124\"]}, {\"input\": \"7 10 17\\r\\nHqqmwdcno\\r\\n61 55 5\\r\\n75 34 3\\r\\n46 34 5\\r\\n93 40 1\\r\\n33 14 2\\r\\n99 40 5\\r\\n72 71 5\\r\\n52 22 3\\r\\n90 82 5\\r\\n52 5 4\\r\\nP\\r\\n77 11 3\\r\\n94 57 5\\r\\n95 5 0\\r\\n86 71 0\\r\\n53 22 2\\r\\n38 17 3\\r\\n91 4 1\\r\\n40 39 2\\r\\n13 12 1\\r\\n86 12 5\\r\\nQnoqdxse\\r\\n51 18 3\\r\\n12 4 3\\r\\n3 2 1\\r\\n89 66 4\\r\\n73 34 5\\r\\n93 ...\", \"output\": [\"437\"]}, {\"input\": \"8 78 45\\r\\nHs\\r\\n429 318 3\\r\\n774 368 4\\r\\n522 42 8\\r\\n511 442 8\\r\\n337 211 4\\r\\n135 84 3\\r\\n450 286 6\\r\\n901 86 9\\r\\n716 487 8\\r\\n971 181 7\\r\\n932 596 7\\r\\n495 371 7\\r\\n604 157 8\\r\\n156 30 9\\r\\n901 316 3\\r\\n795 162 1\\r\\n948 380 4\\r\\n68 6 6\\r\\n604 282 9\\r\\n964 593 9\\r\\n707 592 5\\r\\n841 413 2\\r\\n411 234...\", \"output\": [\"18006\"]}, {\"input\": \"8 100 100\\r\\nAeg\\r\\n982 760 2\\r\\n861 271 2\\r\\n444 45 3\\r\\n889 134 1\\r\\n808 396 1\\r\\n637 574 2\\r\\n920 427 0\\r\\n972 206 2\\r\\n688 227 3\\r\\n629 561 1\\r\\n969 208 0\\r\\n783 313 1\\r\\n795 253 1\\r\\n968 632 2\\r\\n956 373 2\\r\\n864 515 0\\r\\n544 187 1\\r\\n583 112 2\\r\\n744 102 3\\r\\n519 482 0\\r\\n603 502 0\\r\\n210 104 0...\", \"output\": [\"8961\"]}, {\"input\": \"9 100 100\\r\\nAsp\\r\\n833 56 1\\r\\n504 313 1\\r\\n503 387 1\\r\\n810 577 1\\r\\n730 408 0\\r\\n808 433 1\\r\\n345 103 0\\r\\n276 17 1\\r\\n827 90 1\\r\\n871 523 1\\r\\n625 488 1\\r\\n980 383 0\\r\\n892 878 1\\r\\n558 386 0\\r\\n354 271 0\\r\\n316 62 0\\r\\n639 489 0\\r\\n238 4 1\\r\\n907 647 1\\r\\n420 193 1\\r\\n512 170 1\\r\\n728 221 1\\r\\n862...\", \"output\": [\"3120\"]}, {\"input\": \"9 100 100\\r\\nBfopehfrke\\r\\n354 3 68\\r\\n328 214 38\\r\\n555 213 39\\r\\n305 2 40\\r\\n613 381 59\\r\\n166 10 34\\r\\n143 96 47\\r\\n713 261 11\\r\\n531 217 56\\r\\n941 238 73\\r\\n648 439 70\\r\\n578 199 65\\r\\n607 482 35\\r\\n656 385 8\\r\\n633 415 18\\r\\n325 80 77\\r\\n973 719 36\\r\\n491 9 80\\r\\n709 565 61\\r\\n935 656 19\\r\\n76...\", \"output\": [\"71510\"]}, {\"input\": \"10 100 100\\r\\nCzorqzgkrt\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 0\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 1\\r\\n2 1 0\\r\\n...\", \"output\": [\"0\"]}, {\"input\": \"10 100 100\\r\\nEhzuddnw\\r\\n342 215 0\\r\\n805 114 0\\r\\n942 832 1\\r\\n648 538 1\\r\\n888 536 0\\r\\n951 51 1\\r\\n318 283 1\\r\\n775 730 1\\r\\n851 733 0\\r\\n660 360 1\\r\\n327 225 0\\r\\n665 281 1\\r\\n290 32 1\\r\\n395 124 0\\r\\n283 48 1\\r\\n347 1 1\\r\\n795 184 1\\r\\n842 137 1\\r\\n572 164 1\\r\\n953 249 1\\r\\n45 29 1\\r\\n983 192 0...\", \"output\": [\"3427\"]}, {\"input\": \"10 98 79\\r\\nAgdjtes\\r\\n442 188 4\\r\\n494 219 9\\r\\n427 122 5\\r\\n428 42 6\\r\\n128 23 4\\r\\n131 55 9\\r\\n174 31 7\\r\\n267 43 1\\r\\n164 132 2\\r\\n95 86 9\\r\\n310 271 3\\r\\n322 228 1\\r\\n483 133 4\\r\\n10 1 6\\r\\n421 61 2\\r\\n484 318 1\\r\\n344 118 10\\r\\n320 283 2\\r\\n215 56 8\\r\\n382 44 2\\r\\n408 124 2\\r\\n278 75 5\\r\\n88 24 8...\", \"output\": [\"14736\"]}, {\"input\": \"10 100 100\\r\\nEr\\r\\n892 844 2\\r\\n488 245 6\\r\\n817 583 9\\r\\n738 707 2\\r\\n562 82 3\\r\\n869 437 7\\r\\n960 37 2\\r\\n777 545 8\\r\\n991 192 9\\r\\n341 139 5\\r\\n749 34 5\\r\\n917 478 8\\r\\n171 69 3\\r\\n889 527 1\\r\\n895 784 4\\r\\n766 333 7\\r\\n27 9 1\\r\\n911 369 1\\r\\n855 99 1\\r\\n992 39 10\\r\\n261 60 9\\r\\n691 53 4\\r\\n334 261...\", \"output\": [\"35342\"]}, {\"input\": \"10 100 100\\r\\nIepcfjlv\\r\\n532 378 62\\r\\n720 252 4\\r\\n891 7 99\\r\\n432 384 86\\r\\n927 813 6\\r\\n571 120 89\\r\\n300 149 31\\r\\n639 627 39\\r\\n597 136 94\\r\\n463 72 37\\r\\n713 300 93\\r\\n210 8 59\\r\\n362 98 12\\r\\n923 813 29\\r\\n329 9 100\\r\\n986 807 54\\r\\n788 109 94\\r\\n647 612 5\\r\\n867 94 77\\r\\n359 158 61\\r\\n585 ...\", \"output\": [\"78153\"]}, {\"input\": \"10 100 100\\r\\nElgr\\r\\n897 340 43\\r\\n975 666 54\\r\\n469 125 87\\r\\n595 534 99\\r\\n619 415 22\\r\\n997 312 34\\r\\n391 306 2\\r\\n702 630 26\\r\\n499 426 31\\r\\n185 181 31\\r\\n661 599 99\\r\\n934 283 99\\r\\n666 84 23\\r\\n413 167 56\\r\\n641 139 19\\r\\n886 852 27\\r\\n625 47 65\\r\\n838 68 34\\r\\n866 428 87\\r\\n410 276 32\\r\\n6...\", \"output\": [\"72354\"]}, {\"input\": \"10 100 100\\r\\nEol\\r\\n959 955 61\\r\\n859 160 94\\r\\n641 405 63\\r\\n795 414 70\\r\\n326 61 51\\r\\n854 810 22\\r\\n732 668 24\\r\\n782 321 51\\r\\n150 93 3\\r\\n516 293 67\\r\\n698 159 86\\r\\n435 109 59\\r\\n972 154 70\\r\\n246 152 62\\r\\n891 603 37\\r\\n660 369 61\\r\\n490 110 41\\r\\n889 438 33\\r\\n776 471 56\\r\\n345 57 20\\r\\n70...\", \"output\": [\"73440\"]}, {\"input\": \"10 100 100\\r\\nAaxx\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 ...\", \"output\": [\"99700\"]}, {\"input\": \"10 100 100\\r\\nAbxx\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 0\\r\\n1000 1 ...\", \"output\": [\"0\"]}, {\"input\": \"10 100 100\\r\\nAaxx\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 100\\r\\n100 1 ...\", \"output\": [\"80100\"]}, {\"input\": \"10 10 100\\r\\nAdzzzzk\\r\\n100 1 10\\r\\n100 1 10\\r\\n100 1 10\\r\\n100 1 10\\r\\n100 1 10\\r\\n100 1 10\\r\\n100 1 10\\r\\n100 1 10\\r\\n100 1 10\\r\\n100 1 10\\r\\nBdzzzzk\\r\\n200 101 10\\r\\n200 101 10\\r\\n200 101 10\\r\\n200 101 10\\r\\n200 101 10\\r\\n200 101 10\\r\\n200 101 10\\r\\n200 101 10\\r\\n200 101 10\\r\\n200 101 10\\r\\nCdzzzz...\", \"output\": [\"80100\"]}, {\"input\": \"10 100 100\\r\\nAbbbzzk\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 999 1\\r\\n1000 9...\", \"output\": [\"0\"]}, {\"input\": \"10 100 100\\r\\nCap\\r\\n998 2 1\\r\\n997 3 1\\r\\n996 4 1\\r\\n995 5 1\\r\\n994 6 1\\r\\n993 7 1\\r\\n992 8 1\\r\\n991 9 1\\r\\n990 10 1\\r\\n989 11 1\\r\\n988 12 1\\r\\n987 13 1\\r\\n986 14 1\\r\\n985 15 1\\r\\n984 16 1\\r\\n983 17 1\\r\\n982 18 1\\r\\n981 19 1\\r\\n980 20 1\\r\\n979 21 1\\r\\n978 22 1\\r\\n977 23 1\\r\\n976 24 1\\r\\n975 25 1\\r\\n974 26...\", \"output\": [\"0\"]}, {\"input\": \"2 100 100\\r\\nAasdsad\\r\\n783 451 77\\r\\n796 790 58\\r\\n838 835 86\\r\\n640 454 27\\r\\n566 473 38\\r\\n750 421 86\\r\\n417 155 23\\r\\n838 637 51\\r\\n854 779 9\\r\\n893 522 45\\r\\n973 62 31\\r\\n534 453 76\\r\\n835 154 36\\r\\n749 187 43\\r\\n951 644 15\\r\\n444 237 51\\r\\n891 769 7\\r\\n551 315 55\\r\\n822 334 73\\r\\n199 52 18\\r...\", \"output\": [\"50640\"]}]"} {"prob_desc_description":"Several ages ago Berland was a kingdom. The King of Berland adored math. That's why, when he first visited one of his many palaces, he first of all paid attention to the floor in one hall. The floor was tiled with hexagonal tiles.The hall also turned out hexagonal in its shape. The King walked along the perimeter of the hall and concluded that each of the six sides has a, b, c, a, b and c adjacent tiles, correspondingly.To better visualize the situation, look at the picture showing a similar hexagon for a\u2009=\u20092, b\u2009=\u20093 and c\u2009=\u20094. According to the legend, as the King of Berland obtained the values a, b and c, he almost immediately calculated the total number of tiles on the hall floor. Can you do the same?","prob_desc_output_spec":"Print a single number \u2014 the total number of tiles on the hall floor.","lang_cluster":"","src_uid":"8ab25ed4955d978fe20f6872cb94b0da","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math","implementation"],"prob_desc_created_at":"1344958200","prob_desc_sample_inputs":"[\"2 3 4\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":1200.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line contains three integers: a, b and c (2\u2009\u2264\u2009a,\u2009b,\u2009c\u2009\u2264\u20091000).","prob_desc_sample_outputs":"[\"18\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2 3 4\\r\\n\", \"output\": [\"18\"]}, {\"input\": \"2 2 2\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"7 8 13\\r\\n\", \"output\": [\"224\"]}, {\"input\": \"14 7 75\\r\\n\", \"output\": [\"1578\"]}, {\"input\": \"201 108 304\\r\\n\", \"output\": [\"115032\"]}, {\"input\": \"999 998 996\\r\\n\", \"output\": [\"2983022\"]}, {\"input\": \"2 2 3\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"2 3 2\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"3 2 2\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"2 3 3\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"3 2 3\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"3 3 2\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"3 3 3\\r\\n\", \"output\": [\"19\"]}, {\"input\": \"4 5 3\\r\\n\", \"output\": [\"36\"]}, {\"input\": \"2 2 856\\r\\n\", \"output\": [\"2569\"]}, {\"input\": \"2 986 2\\r\\n\", \"output\": [\"2959\"]}, {\"input\": \"985 2 2\\r\\n\", \"output\": [\"2956\"]}, {\"input\": \"2 958 983\\r\\n\", \"output\": [\"943654\"]}, {\"input\": \"992 2 912\\r\\n\", \"output\": [\"906607\"]}, {\"input\": \"789 894 2\\r\\n\", \"output\": [\"707048\"]}, {\"input\": \"1000 1000 1000\\r\\n\", \"output\": [\"2997001\"]}, {\"input\": \"384 458 284\\r\\n\", \"output\": [\"413875\"]}, {\"input\": \"709 14 290\\r\\n\", \"output\": [\"218584\"]}, {\"input\": \"485 117 521\\r\\n\", \"output\": [\"369265\"]}, {\"input\": \"849 333 102\\r\\n\", \"output\": [\"401998\"]}, {\"input\": \"998 999 1000\\r\\n\", \"output\": [\"2991006\"]}, {\"input\": \"2 2 1000\\r\\n\", \"output\": [\"3001\"]}, {\"input\": \"2 1000 2\\r\\n\", \"output\": [\"3001\"]}, {\"input\": \"1000 2 2\\r\\n\", \"output\": [\"3001\"]}, {\"input\": \"1000 2 1000\\r\\n\", \"output\": [\"1001999\"]}, {\"input\": \"865 291 383\\r\\n\", \"output\": [\"692925\"]}, {\"input\": \"41 49 28\\r\\n\", \"output\": [\"4412\"]}, {\"input\": \"34 86 90\\r\\n\", \"output\": [\"13515\"]}, {\"input\": \"39 23 56\\r\\n\", \"output\": [\"4252\"]}, {\"input\": \"14 99 81\\r\\n\", \"output\": [\"10346\"]}, {\"input\": \"48 38 193\\r\\n\", \"output\": [\"18144\"]}, {\"input\": \"395 85 22\\r\\n\", \"output\": [\"43634\"]}, {\"input\": \"38 291 89\\r\\n\", \"output\": [\"39922\"]}, {\"input\": \"7 23 595\\r\\n\", \"output\": [\"17387\"]}, {\"input\": \"948 48 3\\r\\n\", \"output\": [\"47494\"]}]"} {"prob_desc_description":"Polycarpus is an amateur businessman. Recently he was surprised to find out that the market for paper scissors is completely free! Without further ado, Polycarpus decided to start producing and selling such scissors.Polycaprus calculated that the optimal celling price for such scissors would be p bourles. However, he read somewhere that customers are attracted by prices that say something like \"Special Offer! Super price 999 bourles!\". So Polycarpus decided to lower the price a little if it leads to the desired effect.Polycarpus agrees to lower the price by no more than d bourles so that the number of nines at the end of the resulting price is maximum. If there are several ways to do it, he chooses the maximum possible price.Note, Polycarpus counts only the trailing nines in a price.","prob_desc_output_spec":"Print the required price \u2014 the maximum price that ends with the largest number of nines and that is less than p by no more than d. The required number shouldn't have leading zeroes.","lang_cluster":"","src_uid":"c706cfcd4c37fbc1b1631aeeb2c02b6a","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["implementation"],"prob_desc_created_at":"1346081400","prob_desc_sample_inputs":"[\"1029 102\", \"27191 17\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":1400.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line contains two integers p and d (1\u2009\u2264\u2009p\u2009\u2264\u20091018; 0\u2009\u2264\u2009d\u2009<\u2009p) \u2014 the initial price of scissors and the maximum possible price reduction. Please, do not use the %lld specifier to read or write 64-bit integers in \u0421++. It is preferred to use cin, cout streams or the %I64d specifier.","prob_desc_sample_outputs":"[\"999\", \"27189\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"1029 102\\r\\n\", \"output\": [\"999\"]}, {\"input\": \"27191 17\\r\\n\", \"output\": [\"27189\"]}, {\"input\": \"1 0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"9 0\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"20 1\\r\\n\", \"output\": [\"19\"]}, {\"input\": \"100 23\\r\\n\", \"output\": [\"99\"]}, {\"input\": \"10281 1\\r\\n\", \"output\": [\"10281\"]}, {\"input\": \"2111 21\\r\\n\", \"output\": [\"2099\"]}, {\"input\": \"3021 112\\r\\n\", \"output\": [\"2999\"]}, {\"input\": \"1000000000000000000 999999999999999999\\r\\n\", \"output\": [\"999999999999999999\"]}, {\"input\": \"29287101 301\\r\\n\", \"output\": [\"29286999\"]}, {\"input\": \"302918113 8113\\r\\n\", \"output\": [\"302917999\"]}, {\"input\": \"23483247283432 47283432\\r\\n\", \"output\": [\"23483239999999\"]}, {\"input\": \"47283432 7283432\\r\\n\", \"output\": [\"46999999\"]}, {\"input\": \"7283432 7283431\\r\\n\", \"output\": [\"6999999\"]}, {\"input\": \"2304324853947 5853947\\r\\n\", \"output\": [\"2304319999999\"]}, {\"input\": \"2485348653485 123483\\r\\n\", \"output\": [\"2485348599999\"]}, {\"input\": \"29845435345 34543\\r\\n\", \"output\": [\"29845429999\"]}, {\"input\": \"2348723847234234 234829384234\\r\\n\", \"output\": [\"2348699999999999\"]}, {\"input\": \"596383801524465437 13997918422040\\r\\n\", \"output\": [\"596379999999999999\"]}, {\"input\": \"621306590487786841 47851896849379\\r\\n\", \"output\": [\"621299999999999999\"]}, {\"input\": \"990575220328844835 100861359807341\\r\\n\", \"output\": [\"990499999999999999\"]}, {\"input\": \"403277728241895842 15097810739041\\r\\n\", \"output\": [\"403269999999999999\"]}, {\"input\": \"287854791214303304 98046359947548\\r\\n\", \"output\": [\"287799999999999999\"]}, {\"input\": \"847222126505823289 115713658562976\\r\\n\", \"output\": [\"847199999999999999\"]}, {\"input\": \"991096248227872657 181679439312637\\r\\n\", \"output\": [\"990999999999999999\"]}, {\"input\": \"954402996235787062 354162450334047\\r\\n\", \"output\": [\"954399999999999999\"]}, {\"input\": \"220466716596033408 44952575147901\\r\\n\", \"output\": [\"220459999999999999\"]}, {\"input\": \"559198116944738707 844709119308273\\r\\n\", \"output\": [\"558999999999999999\"]}, {\"input\": \"363980380443991024 4242310030748\\r\\n\", \"output\": [\"363979999999999999\"]}, {\"input\": \"733498827000355608 13253459808159\\r\\n\", \"output\": [\"733489999999999999\"]}, {\"input\": \"757663489894439901 139905688448459\\r\\n\", \"output\": [\"757599999999999999\"]}, {\"input\": \"30528581170507487 1199546082507\\r\\n\", \"output\": [\"30527999999999999\"]}, {\"input\": \"534463403123444176 67776394133861\\r\\n\", \"output\": [\"534399999999999999\"]}, {\"input\": \"399943891120381720 89545256475298\\r\\n\", \"output\": [\"399899999999999999\"]}, {\"input\": \"697076786191991245 95935185412097\\r\\n\", \"output\": [\"696999999999999999\"]}, {\"input\": \"495773842562930245 17116719198640\\r\\n\", \"output\": [\"495769999999999999\"]}, {\"input\": \"343540186435799067 48368225269792\\r\\n\", \"output\": [\"343499999999999999\"]}, {\"input\": \"393776794010351632 4138311260892\\r\\n\", \"output\": [\"393775999999999999\"]}, {\"input\": \"830005749156754342 157633405415940\\r\\n\", \"output\": [\"829999999999999999\"]}, {\"input\": \"735716632509713228 109839072010906\\r\\n\", \"output\": [\"735699999999999999\"]}, {\"input\": \"925835698451819219 232827103605000\\r\\n\", \"output\": [\"925799999999999999\"]}, {\"input\": \"362064657893189225 54298707317247\\r\\n\", \"output\": [\"362059999999999999\"]}, {\"input\": \"286739242579659245 61808986676984\\r\\n\", \"output\": [\"286699999999999999\"]}, {\"input\": \"234522568185994645 14536016333590\\r\\n\", \"output\": [\"234519999999999999\"]}, {\"input\": \"989980699593228598 382407804389880\\r\\n\", \"output\": [\"989899999999999999\"]}, {\"input\": \"953287447601143003 367647762226264\\r\\n\", \"output\": [\"952999999999999999\"]}, {\"input\": \"369834331957505226 421031521866991\\r\\n\", \"output\": [\"369799999999999999\"]}, {\"input\": \"433225528653135646 16671330805568\\r\\n\", \"output\": [\"433219999999999999\"]}, {\"input\": \"664584428369850915 516656201621892\\r\\n\", \"output\": [\"664499999999999999\"]}, {\"input\": \"100813383516253625 468493737928751\\r\\n\", \"output\": [\"100799999999999999\"]}, {\"input\": \"63600749936231318 12287109070881\\r\\n\", \"output\": [\"63599999999999999\"]}, {\"input\": \"196643334958802150 3659421793154\\r\\n\", \"output\": [\"196639999999999999\"]}, {\"input\": \"803015192835672406 14043666502157\\r\\n\", \"output\": [\"803009999999999999\"]}, {\"input\": \"43201857567928862 5891486380570\\r\\n\", \"output\": [\"43199999999999999\"]}, {\"input\": \"142195487377202511 32209508975060\\r\\n\", \"output\": [\"142189999999999999\"]}, {\"input\": \"159171676706847083 28512592184962\\r\\n\", \"output\": [\"159169999999999999\"]}, {\"input\": \"377788117133266645 12127036235155\\r\\n\", \"output\": [\"377779999999999999\"]}, {\"input\": \"949501478909148807 31763408418934\\r\\n\", \"output\": [\"949499999999999999\"]}, {\"input\": \"955412075341421601 220849506773896\\r\\n\", \"output\": [\"955399999999999999\"]}, {\"input\": \"652742935922718161 11045914932687\\r\\n\", \"output\": [\"652739999999999999\"]}, {\"input\": \"371621017875752909 511452352707014\\r\\n\", \"output\": [\"371599999999999999\"]}, {\"input\": \"979748686171802330 281906901894586\\r\\n\", \"output\": [\"979699999999999999\"]}, {\"input\": \"987860891213585005 85386263418762\\r\\n\", \"output\": [\"987799999999999999\"]}, {\"input\": \"59225847802373220 8605552735740\\r\\n\", \"output\": [\"59219999999999999\"]}, {\"input\": \"22532595810287625 1459945485391\\r\\n\", \"output\": [\"22531999999999999\"]}, {\"input\": \"191654878233371957 258451919478343\\r\\n\", \"output\": [\"191599999999999999\"]}, {\"input\": \"796937674525939896 892734175683845\\r\\n\", \"output\": [\"796899999999999999\"]}, {\"input\": \"166564871934000326 22888347028438\\r\\n\", \"output\": [\"166559999999999999\"]}, {\"input\": \"559198116944738707 84470911930827\\r\\n\", \"output\": [\"559189999999999999\"]}, {\"input\": \"559198116944738707 8447091193082\\r\\n\", \"output\": [\"559189999999999999\"]}, {\"input\": \"559198116944738707 844709119308\\r\\n\", \"output\": [\"559197999999999999\"]}, {\"input\": \"559198116944738707 84470911930\\r\\n\", \"output\": [\"559198099999999999\"]}, {\"input\": \"559198116944738707 8447091193\\r\\n\", \"output\": [\"559198109999999999\"]}, {\"input\": \"559198116944738707 844709119\\r\\n\", \"output\": [\"559198116899999999\"]}, {\"input\": \"559198116944738707 84470911\\r\\n\", \"output\": [\"559198116899999999\"]}, {\"input\": \"559198116944738707 8447091\\r\\n\", \"output\": [\"559198116939999999\"]}, {\"input\": \"559198116944738707 844709\\r\\n\", \"output\": [\"559198116943999999\"]}, {\"input\": \"559198116944738707 84470\\r\\n\", \"output\": [\"559198116944699999\"]}, {\"input\": \"559198116944738707 8447\\r\\n\", \"output\": [\"559198116944737999\"]}, {\"input\": \"559198116944738707 844\\r\\n\", \"output\": [\"559198116944737999\"]}, {\"input\": \"559198116944738707 84\\r\\n\", \"output\": [\"559198116944738699\"]}, {\"input\": \"559198116944738707 8\\r\\n\", \"output\": [\"559198116944738699\"]}, {\"input\": \"559198116944738707 7\\r\\n\", \"output\": [\"559198116944738707\"]}, {\"input\": \"559198116944738707 6\\r\\n\", \"output\": [\"559198116944738707\"]}, {\"input\": \"559198116944738707 1\\r\\n\", \"output\": [\"559198116944738707\"]}, {\"input\": \"559198116944738707 0\\r\\n\", \"output\": [\"559198116944738707\"]}, {\"input\": \"559198116944738700 1\\r\\n\", \"output\": [\"559198116944738699\"]}, {\"input\": \"559198116944738700 0\\r\\n\", \"output\": [\"559198116944738700\"]}, {\"input\": \"559198116944738999 0\\r\\n\", \"output\": [\"559198116944738999\"]}, {\"input\": \"559198116944738999 1\\r\\n\", \"output\": [\"559198116944738999\"]}, {\"input\": \"199 100\\r\\n\", \"output\": [\"199\"]}, {\"input\": \"99 10\\r\\n\", \"output\": [\"99\"]}, {\"input\": \"10 1\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"18 17\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"199 198\\r\\n\", \"output\": [\"199\"]}, {\"input\": \"1000000000000000000 0\\r\\n\", \"output\": [\"1000000000000000000\"]}, {\"input\": \"59 3\\r\\n\", \"output\": [\"59\"]}, {\"input\": \"9999 10\\r\\n\", \"output\": [\"9999\"]}, {\"input\": \"999999999999999998 999999999999999997\\r\\n\", \"output\": [\"899999999999999999\"]}, {\"input\": \"8 7\\r\\n\", \"output\": [\"8\"]}]"} {"prob_desc_description":"The Little Elephant is playing with the Cartesian coordinates' system. Most of all he likes playing with integer points. The Little Elephant defines an integer point as a pair of integers (x;\u00a0y), such that 0\u2009\u2264\u2009x\u2009\u2264\u2009w and 0\u2009\u2264\u2009y\u2009\u2264\u2009h. Thus, the Little Elephant knows only (w\u2009+\u20091)\u00b7(h\u2009+\u20091) distinct integer points.The Little Elephant wants to paint a triangle with vertexes at integer points, the triangle's area must be a positive integer. For that, he needs to find the number of groups of three points that form such triangle. At that, the order of points in a group matters, that is, the group of three points (0;0), (0;2), (2;2) isn't equal to the group (0;2), (0;0), (2;2).Help the Little Elephant to find the number of groups of three integer points that form a nondegenerate triangle with integer area.","prob_desc_output_spec":"In a single output line print an integer \u2014 the remainder of dividing the answer to the problem by 1000000007 (109\u2009+\u20097).","lang_cluster":"","src_uid":"984788e4b4925c15c9c6f31e42f2f8fa","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["geometry","math"],"prob_desc_created_at":"1346427000","prob_desc_sample_inputs":"[\"2 1\", \"2 2\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":2500.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"3 seconds","prob_desc_input_spec":"A single line contains two integers w and h (1\u2009\u2264\u2009w,\u2009h\u2009\u2264\u20094000).","prob_desc_sample_outputs":"[\"36\", \"240\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2 1\\r\\n\", \"output\": [\"36\"]}, {\"input\": \"2 2\\r\\n\", \"output\": [\"240\"]}, {\"input\": \"4 4\\r\\n\", \"output\": [\"7488\"]}, {\"input\": \"1 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"1 2\\r\\n\", \"output\": [\"36\"]}, {\"input\": \"3 3\\r\\n\", \"output\": [\"1560\"]}, {\"input\": \"1 3\\r\\n\", \"output\": [\"96\"]}, {\"input\": \"1000 1\\r\\n\", \"output\": [\"2999979\"]}, {\"input\": \"1 4\\r\\n\", \"output\": [\"240\"]}, {\"input\": \"1 10\\r\\n\", \"output\": [\"3300\"]}, {\"input\": \"10 1\\r\\n\", \"output\": [\"3300\"]}, {\"input\": \"1000 1000\\r\\n\", \"output\": [\"569772966\"]}, {\"input\": \"47 74\\r\\n\", \"output\": [\"45773261\"]}, {\"input\": \"1 1000\\r\\n\", \"output\": [\"2999979\"]}, {\"input\": \"999 1\\r\\n\", \"output\": [\"993999986\"]}, {\"input\": \"2 10\\r\\n\", \"output\": [\"17520\"]}, {\"input\": \"2 4\\r\\n\", \"output\": [\"1392\"]}, {\"input\": \"10 10\\r\\n\", \"output\": [\"1032528\"]}, {\"input\": \"9 9\\r\\n\", \"output\": [\"568512\"]}, {\"input\": \"8 8\\r\\n\", \"output\": [\"301248\"]}, {\"input\": \"7 11\\r\\n\", \"output\": [\"500472\"]}, {\"input\": \"3 25\\r\\n\", \"output\": [\"601632\"]}, {\"input\": \"25 25\\r\\n\", \"output\": [\"189684480\"]}, {\"input\": \"100 25\\r\\n\", \"output\": [\"247915499\"]}, {\"input\": \"100 99\\r\\n\", \"output\": [\"968021874\"]}, {\"input\": \"512 1000\\r\\n\", \"output\": [\"722505988\"]}, {\"input\": \"999 999\\r\\n\", \"output\": [\"290889748\"]}, {\"input\": \"987 895\\r\\n\", \"output\": [\"888141259\"]}, {\"input\": \"597 574\\r\\n\", \"output\": [\"789630913\"]}, {\"input\": \"975 157\\r\\n\", \"output\": [\"484861614\"]}, {\"input\": \"976 485\\r\\n\", \"output\": [\"672226096\"]}, {\"input\": \"999 689\\r\\n\", \"output\": [\"323811885\"]}, {\"input\": \"888 999\\r\\n\", \"output\": [\"421953459\"]}, {\"input\": \"999 2\\r\\n\", \"output\": [\"978999902\"]}, {\"input\": \"998 1000\\r\\n\", \"output\": [\"300694183\"]}, {\"input\": \"990 1000\\r\\n\", \"output\": [\"256938752\"]}, {\"input\": \"990 990\\r\\n\", \"output\": [\"437439079\"]}, {\"input\": \"950 851\\r\\n\", \"output\": [\"805992327\"]}, {\"input\": \"2 5\\r\\n\", \"output\": [\"2484\"]}, {\"input\": \"3 7\\r\\n\", \"output\": [\"15480\"]}, {\"input\": \"13 11\\r\\n\", \"output\": [\"2790408\"]}, {\"input\": \"2000 2000\\r\\n\", \"output\": [\"537764217\"]}, {\"input\": \"3000 3000\\r\\n\", \"output\": [\"235619250\"]}, {\"input\": \"4000 4000\\r\\n\", \"output\": [\"255288322\"]}, {\"input\": \"1001 1000\\r\\n\", \"output\": [\"916251534\"]}, {\"input\": \"1001 1007\\r\\n\", \"output\": [\"59378872\"]}, {\"input\": \"1000 4000\\r\\n\", \"output\": [\"796436035\"]}, {\"input\": \"2001 3999\\r\\n\", \"output\": [\"287223043\"]}, {\"input\": \"3999 3998\\r\\n\", \"output\": [\"146043529\"]}, {\"input\": \"3997 2584\\r\\n\", \"output\": [\"304397084\"]}, {\"input\": \"2000 2578\\r\\n\", \"output\": [\"729387043\"]}, {\"input\": \"3000 2000\\r\\n\", \"output\": [\"44275416\"]}, {\"input\": \"3545 3942\\r\\n\", \"output\": [\"683342945\"]}, {\"input\": \"2888 3999\\r\\n\", \"output\": [\"944142552\"]}, {\"input\": \"1 4000\\r\\n\", \"output\": [\"47998656\"]}, {\"input\": \"2 3999\\r\\n\", \"output\": [\"663993287\"]}, {\"input\": \"7 3777\\r\\n\", \"output\": [\"614855828\"]}, {\"input\": \"47 3747\\r\\n\", \"output\": [\"191757978\"]}, {\"input\": \"3757 256\\r\\n\", \"output\": [\"814200976\"]}, {\"input\": \"100 2000\\r\\n\", \"output\": [\"570798722\"]}, {\"input\": \"4000 500\\r\\n\", \"output\": [\"792193190\"]}]"} {"prob_desc_description":"Polycarpus loves lucky numbers. Everybody knows that lucky numbers are positive integers, whose decimal representation (without leading zeroes) contain only the lucky digits x and y. For example, if x\u2009=\u20094, and y\u2009=\u20097, then numbers 47, 744, 4 are lucky.Let's call a positive integer a undoubtedly lucky, if there are such digits x and y (0\u2009\u2264\u2009x,\u2009y\u2009\u2264\u20099), that the decimal representation of number a (without leading zeroes) contains only digits x and y.Polycarpus has integer n. He wants to know how many positive integers that do not exceed n, are undoubtedly lucky. Help him, count this number.","prob_desc_output_spec":"Print a single integer that says, how many positive integers that do not exceed n are undoubtedly lucky.","lang_cluster":"","src_uid":"0f7f10557602c8c2f2eb80762709ffc4","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force","bitmasks","dfs and similar"],"prob_desc_created_at":"1353079800","prob_desc_sample_inputs":"[\"10\", \"123\"]","prob_desc_notes":"NoteIn the first test sample all numbers that do not exceed 10 are undoubtedly lucky.In the second sample numbers 102, 103, 104, 105, 106, 107, 108, 109, 120, 123 are not undoubtedly lucky.","exec_outcome":"","difficulty":1600.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line contains a single integer n (1\u2009\u2264\u2009n\u2009\u2264\u2009109) \u2014 Polycarpus's number.","prob_desc_sample_outputs":"[\"10\", \"113\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"10\\r\\n\", \"output\": [\"10\"]}, {\"input\": \"123\\r\\n\", \"output\": [\"113\"]}, {\"input\": \"1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1000\\r\\n\", \"output\": [\"352\"]}, {\"input\": \"1000000000\\r\\n\", \"output\": [\"40744\"]}, {\"input\": \"999999999\\r\\n\", \"output\": [\"40743\"]}, {\"input\": \"999999998\\r\\n\", \"output\": [\"40742\"]}, {\"input\": \"999999997\\r\\n\", \"output\": [\"40741\"]}, {\"input\": \"909090901\\r\\n\", \"output\": [\"38532\"]}, {\"input\": \"142498040\\r\\n\", \"output\": [\"21671\"]}, {\"input\": \"603356456\\r\\n\", \"output\": [\"31623\"]}, {\"input\": \"64214872\\r\\n\", \"output\": [\"15759\"]}, {\"input\": \"820040584\\r\\n\", \"output\": [\"36407\"]}, {\"input\": \"442198\\r\\n\", \"output\": [\"3071\"]}, {\"input\": \"784262\\r\\n\", \"output\": [\"4079\"]}, {\"input\": \"642678\\r\\n\", \"output\": [\"3615\"]}, {\"input\": \"468390\\r\\n\", \"output\": [\"3223\"]}, {\"input\": \"326806\\r\\n\", \"output\": [\"2759\"]}, {\"input\": \"940\\r\\n\", \"output\": [\"331\"]}, {\"input\": \"356\\r\\n\", \"output\": [\"175\"]}, {\"input\": \"68\\r\\n\", \"output\": [\"68\"]}, {\"input\": \"132\\r\\n\", \"output\": [\"114\"]}, {\"input\": \"72\\r\\n\", \"output\": [\"72\"]}, {\"input\": \"89\\r\\n\", \"output\": [\"89\"]}, {\"input\": \"3\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"4\\r\\n\", \"output\": [\"4\"]}, {\"input\": \"5\\r\\n\", \"output\": [\"5\"]}, {\"input\": \"6\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"7\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"8\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"9\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"101\\r\\n\", \"output\": [\"101\"]}, {\"input\": \"102\\r\\n\", \"output\": [\"101\"]}]"} {"prob_desc_description":"One hot summer day Pete and his friend Billy decided to buy a watermelon. They chose the biggest and the ripest one, in their opinion. After that the watermelon was weighed, and the scales showed w kilos. They rushed home, dying of thirst, and decided to divide the berry, however they faced a hard problem.Pete and Billy are great fans of even numbers, that's why they want to divide the watermelon in such a way that each of the two parts weighs even number of kilos, at the same time it is not obligatory that the parts are equal. The boys are extremely tired and want to start their meal as soon as possible, that's why you should help them and find out, if they can divide the watermelon in the way they want. For sure, each of them should get a part of positive weight.","prob_desc_output_spec":"Print YES, if the boys can divide the watermelon into two parts, each of them weighing even number of kilos; and NO in the opposite case.","lang_cluster":"","src_uid":"230a3c4d7090401e5fa3c6b9d994cdf2","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"64 megabytes","file_name":"prog_syn_val.jsonl","tags":["brute force","math"],"prob_desc_created_at":"1268395200","prob_desc_sample_inputs":"[\"8\"]","prob_desc_notes":"NoteFor example, the boys can divide the watermelon into two parts of 2 and 6 kilos respectively (another variant \u2014 two parts of 4 and 4 kilos).","exec_outcome":"","difficulty":800.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first (and the only) input line contains integer number w (1\u2009\u2264\u2009w\u2009\u2264\u2009100) \u2014 the weight of the watermelon bought by the boys.","prob_desc_sample_outputs":"[\"YES\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"8\\r\\n\", \"output\": [\"YES\", \"Yes\", \"yes\"]}, {\"input\": \"5\\r\\n\", \"output\": [\"No\", \"NO\", \"no\"]}, {\"input\": \"4\\r\\n\", \"output\": [\"YES\", \"Yes\", \"yes\"]}, {\"input\": \"3\\r\\n\", \"output\": [\"No\", \"NO\", \"no\"]}, {\"input\": \"2\\r\\n\", \"output\": [\"No\", \"NO\", \"no\"]}, {\"input\": \"1\\r\\n\", \"output\": [\"No\", \"NO\", \"no\"]}, {\"input\": \"7\\r\\n\", \"output\": [\"No\", \"NO\", \"no\"]}, {\"input\": \"6\\r\\n\", \"output\": [\"YES\", \"Yes\", \"yes\"]}, {\"input\": \"10\\r\\n\", \"output\": [\"YES\", \"Yes\", \"yes\"]}, {\"input\": \"9\\r\\n\", \"output\": [\"No\", \"NO\", \"no\"]}, {\"input\": \"53\\r\\n\", \"output\": [\"No\", \"NO\", \"no\"]}, {\"input\": \"77\\r\\n\", \"output\": [\"No\", \"NO\", \"no\"]}, {\"input\": \"32\\r\\n\", \"output\": [\"YES\", \"Yes\", \"yes\"]}, {\"input\": \"44\\r\\n\", \"output\": [\"YES\", \"Yes\", \"yes\"]}, {\"input\": \"98\\r\\n\", \"output\": [\"YES\", \"Yes\", \"yes\"]}, {\"input\": \"99\\r\\n\", \"output\": [\"No\", \"NO\", \"no\"]}, {\"input\": \"90\\r\\n\", \"output\": [\"YES\", \"Yes\", \"yes\"]}, {\"input\": \"67\\r\\n\", \"output\": [\"No\", \"NO\", \"no\"]}, {\"input\": \"100\\r\\n\", \"output\": [\"YES\", \"Yes\", \"yes\"]}, {\"input\": \"88\\r\\n\", \"output\": [\"YES\", \"Yes\", \"yes\"]}]"} {"prob_desc_description":"Bob likes to draw camels: with a single hump, two humps, three humps, etc. He draws a camel by connecting points on a coordinate plane. Now he's drawing camels with t humps, representing them as polylines in the plane. Each polyline consists of n vertices with coordinates (x1,\u2009y1), (x2,\u2009y2), ..., (xn,\u2009yn). The first vertex has a coordinate x1\u2009=\u20091, the second \u2014 x2\u2009=\u20092, etc. Coordinates yi might be any, but should satisfy the following conditions: there should be t humps precisely, i.e. such indexes j (2\u2009\u2264\u2009j\u2009\u2264\u2009n\u2009-\u20091), so that yj\u2009-\u20091\u2009<\u2009yj\u2009>\u2009yj\u2009+\u20091, there should be precisely t\u2009-\u20091 such indexes j (2\u2009\u2264\u2009j\u2009\u2264\u2009n\u2009-\u20091), so that yj\u2009-\u20091\u2009>\u2009yj\u2009<\u2009yj\u2009+\u20091, no segment of a polyline should be parallel to the Ox-axis, all yi are integers between 1 and 4. For a series of his drawings of camels with t humps Bob wants to buy a notebook, but he doesn't know how many pages he will need. Output the amount of different polylines that can be drawn to represent camels with t humps for a given number n.","prob_desc_output_spec":"Output the required amount of camels with t humps.","lang_cluster":"","src_uid":"6d67559744583229455c5eafe68f7952","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"64 megabytes","file_name":"prog_syn_val.jsonl","tags":["dp"],"prob_desc_created_at":"1274283000","prob_desc_sample_inputs":"[\"6 1\", \"4 2\"]","prob_desc_notes":"NoteIn the first sample test sequences of y-coordinates for six camels are: 123421, 123431, 123432, 124321, 134321 \u0438 234321 (each digit corresponds to one value of yi).","exec_outcome":"","difficulty":1900.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line contains a pair of integers n and t (3\u2009\u2264\u2009n\u2009\u2264\u200920, 1\u2009\u2264\u2009t\u2009\u2264\u200910).","prob_desc_sample_outputs":"[\"6\", \"0\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"6 1\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"4 2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3 1\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"3 2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3 3\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"3 10\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"4 1\\r\\n\", \"output\": [\"22\"]}, {\"input\": \"4 3\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"4 9\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"5 1\\r\\n\", \"output\": [\"16\"]}, {\"input\": \"5 2\\r\\n\", \"output\": [\"70\"]}, {\"input\": \"5 3\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"5 5\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"5 9\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"5 10\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"6 1\\r\\n\", \"output\": [\"6\"]}, {\"input\": \"6 2\\r\\n\", \"output\": [\"232\"]}, {\"input\": \"6 3\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"6 4\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"6 10\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"19 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"19 2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"19 3\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"19 4\\r\\n\", \"output\": [\"32632\"]}, {\"input\": \"19 5\\r\\n\", \"output\": [\"4594423\"]}, {\"input\": \"19 6\\r\\n\", \"output\": [\"69183464\"]}, {\"input\": \"19 7\\r\\n\", \"output\": [\"197939352\"]}, {\"input\": \"19 8\\r\\n\", \"output\": [\"109824208\"]}, {\"input\": \"19 9\\r\\n\", \"output\": [\"5846414\"]}, {\"input\": \"19 10\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"20 1\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"20 2\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"20 3\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"20 4\\r\\n\", \"output\": [\"12628\"]}, {\"input\": \"20 5\\r\\n\", \"output\": [\"3715462\"]}, {\"input\": \"20 6\\r\\n\", \"output\": [\"96046590\"]}, {\"input\": \"20 7\\r\\n\", \"output\": [\"468541040\"]}, {\"input\": \"20 8\\r\\n\", \"output\": [\"503245466\"]}, {\"input\": \"20 9\\r\\n\", \"output\": [\"90700276\"]}, {\"input\": \"20 10\\r\\n\", \"output\": [\"0\"]}]"} {"prob_desc_description":"A car moves from point A to point B at speed v meters per second. The action takes place on the X-axis. At the distance d meters from A there are traffic lights. Starting from time 0, for the first g seconds the green light is on, then for the following r seconds the red light is on, then again the green light is on for the g seconds, and so on.The car can be instantly accelerated from 0 to v and vice versa, can instantly slow down from the v to 0. Consider that it passes the traffic lights at the green light instantly. If the car approaches the traffic lights at the moment when the red light has just turned on, it doesn't have time to pass it. But if it approaches the traffic lights at the moment when the green light has just turned on, it can move. The car leaves point A at the time 0.What is the minimum time for the car to get from point A to point B without breaking the traffic rules?","prob_desc_output_spec":"Output a single number \u2014 the minimum time that the car needs to get from point A to point B. Your output must have relative or absolute error less than 10\u2009-\u20096.","lang_cluster":"","src_uid":"e4a4affb439365c843c9f9828d81b42c","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["implementation"],"prob_desc_created_at":"1284994800","prob_desc_sample_inputs":"[\"2 1 3 4 5\", \"5 4 3 1 1\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":1500.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line contains integers l, d, v, g, r (1\u2009\u2264\u2009l,\u2009d,\u2009v,\u2009g,\u2009r\u2009\u2264\u20091000,\u2009d\u2009<\u2009l) \u2014 the distance between A and B (in meters), the distance from A to the traffic lights, car's speed, the duration of green light and the duration of red light.","prob_desc_sample_outputs":"[\"0.66666667\", \"2.33333333\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"2 1 3 4 5\\r\\n\", \"output\": [\"0.66666667\", \"0.6666666666666666\", \"0.666666666667\", \"0.666667\", \"0.6666666667\"]}, {\"input\": \"5 4 3 1 1\\r\\n\", \"output\": [\"2.333333\", \"2.33333333\", \"2.3333333333\", \"2.333333333333\", \"2.33333333333\", \"2.3333333333333335\"]}, {\"input\": \"862 33 604 888 704\\r\\n\", \"output\": [\"1.42715232\", \"1.427152317881\", \"1.427152\", \"1.42715231788\", \"1.4271523179\", \"1.4271523178807948\"]}, {\"input\": \"458 251 49 622 472\\r\\n\", \"output\": [\"9.346938775510203\", \"9.346939\", \"9.3469387755\", \"9.34693877551\", \"9.34693878\", \"9.346938775510\"]}, {\"input\": \"772 467 142 356 889\\r\\n\", \"output\": [\"5.436619718309859\", \"5.436619718310\", \"5.43661971831\", \"5.43661972\", \"5.4366197183\", \"5.436620\"]}, {\"input\": \"86 64 587 89 657\\r\\n\", \"output\": [\"0.14650767\", \"0.146507666099\", \"0.1465076660988075\", \"0.1465076661\", \"0.146508\"]}, {\"input\": \"400 333 31 823 74\\r\\n\", \"output\": [\"12.903226\", \"12.90322581\", \"12.903225806452\", \"12.903225806451612\", \"12.9032258065\"]}, {\"input\": \"714 474 124 205 491\\r\\n\", \"output\": [\"5.7580645161\", \"5.758064516129032\", \"5.758064516129\", \"5.75806452\", \"5.75806451613\", \"5.758065\"]}, {\"input\": \"29 12 569 939 259\\r\\n\", \"output\": [\"0.050966608084\", \"0.0509666081\", \"0.0509666080844\", \"0.050967\", \"0.050966608084358524\", \"0.05096661\"]}, {\"input\": \"65 24 832 159 171\\r\\n\", \"output\": [\"0.0781250000\", \"0.078125\", \"0.078125000000\", \"0.07812500\"]}, {\"input\": \"2 1 1 1 1\\r\\n\", \"output\": [\"3.0000000000\", \"3.000000\", \"3.0\", \"3.000000000000\", \"3.00000000\", \"3\"]}, {\"input\": \"2 1 1 1 1000\\r\\n\", \"output\": [\"1002\", \"1002.0000000000\", \"1002.000000\", \"1002.000000000000\", \"1002.00000000\", \"1002.0\"]}, {\"input\": \"2 1 1 1000 1\\r\\n\", \"output\": [\"2\", \"2.0\", \"2.00000000\", \"2.000000000000\", \"2.0000000000\", \"2.000000\"]}, {\"input\": \"2 1 1 1000 1000\\r\\n\", \"output\": [\"2\", \"2.0\", \"2.00000000\", \"2.000000000000\", \"2.0000000000\", \"2.000000\"]}, {\"input\": \"2 1 1000 1 1\\r\\n\", \"output\": [\"0.002\", \"0.002000000000\", \"0.0020000000\", \"0.002000\", \"0.00200000\", \"0.0020\"]}, {\"input\": \"2 1 1000 1 1000\\r\\n\", \"output\": [\"0.002\", \"0.002000000000\", \"0.0020000000\", \"0.002000\", \"0.00200000\", \"0.0020\"]}, {\"input\": \"2 1 1000 1000 1\\r\\n\", \"output\": [\"0.002\", \"0.002000000000\", \"0.0020000000\", \"0.002000\", \"0.00200000\", \"0.0020\"]}, {\"input\": \"2 1 1000 1000 1000\\r\\n\", \"output\": [\"0.002\", \"0.002000000000\", \"0.0020000000\", \"0.002000\", \"0.00200000\", \"0.0020\"]}, {\"input\": \"1000 1 1 1 1\\r\\n\", \"output\": [\"1001.000000000000\", \"1001.0000000000\", \"1001.000000\", \"1001\", \"1001.0\", \"1001.00000000\"]}, {\"input\": \"1000 1 1 1 1000\\r\\n\", \"output\": [\"2000\", \"2000.00000000\", \"2000.000000\", \"2000.0\", \"2000.000000000000\", \"2000.0000000000\"]}, {\"input\": \"1000 1 1 1000 1\\r\\n\", \"output\": [\"1000.0000000000\", \"1000.000000\", \"1000.000000000000\", \"1000.00000000\", \"1000\", \"1000.0\"]}, {\"input\": \"1000 1 1 1000 1000\\r\\n\", \"output\": [\"1000.0000000000\", \"1000.000000\", \"1000.000000000000\", \"1000.00000000\", \"1000\", \"1000.0\"]}, {\"input\": \"1000 1 1000 1 1\\r\\n\", \"output\": [\"1\", \"1.000000000000\", \"1.000000\", \"1.0\", \"1.00000000\", \"1.0000000000\"]}, {\"input\": \"1000 1 1000 1 1000\\r\\n\", \"output\": [\"1\", \"1.000000000000\", \"1.000000\", \"1.0\", \"1.00000000\", \"1.0000000000\"]}, {\"input\": \"1000 1 1000 1000 1\\r\\n\", \"output\": [\"1\", \"1.000000000000\", \"1.000000\", \"1.0\", \"1.00000000\", \"1.0000000000\"]}, {\"input\": \"1000 1 1000 1000 1000\\r\\n\", \"output\": [\"1\", \"1.000000000000\", \"1.000000\", \"1.0\", \"1.00000000\", \"1.0000000000\"]}, {\"input\": \"1000 999 1 1 1\\r\\n\", \"output\": [\"1001.000000000000\", \"1001.0000000000\", \"1001.000000\", \"1001\", \"1001.0\", \"1001.00000000\"]}, {\"input\": \"1000 999 1 1 1000\\r\\n\", \"output\": [\"1002\", \"1002.0000000000\", \"1002.000000\", \"1002.000000000000\", \"1002.00000000\", \"1002.0\"]}, {\"input\": \"1000 999 1 1000 1\\r\\n\", \"output\": [\"1000.0000000000\", \"1000.000000\", \"1000.000000000000\", \"1000.00000000\", \"1000\", \"1000.0\"]}, {\"input\": \"1000 999 1 1000 1000\\r\\n\", \"output\": [\"1000.0000000000\", \"1000.000000\", \"1000.000000000000\", \"1000.00000000\", \"1000\", \"1000.0\"]}, {\"input\": \"1000 999 1000 1 1\\r\\n\", \"output\": [\"1\", \"1.000000000000\", \"1.000000\", \"1.0\", \"1.00000000\", \"1.0000000000\"]}, {\"input\": \"1000 999 1000 1 1000\\r\\n\", \"output\": [\"1\", \"1.000000000000\", \"1.000000\", \"1.0\", \"1.00000000\", \"1.0000000000\"]}, {\"input\": \"1000 999 1000 1000 1\\r\\n\", \"output\": [\"1\", \"1.000000000000\", \"1.000000\", \"1.0\", \"1.00000000\", \"1.0000000000\"]}, {\"input\": \"1000 999 1000 1000 1000\\r\\n\", \"output\": [\"1\", \"1.000000000000\", \"1.000000\", \"1.0\", \"1.00000000\", \"1.0000000000\"]}]"} {"prob_desc_description":"Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is divisible by each of its nonzero digits. We will not argue with this and just count the quantity of beautiful numbers in given ranges.","prob_desc_output_spec":"Output should contain t numbers \u2014 answers to the queries, one number per line \u2014 quantities of beautiful numbers in given intervals (from li to ri, inclusively).","lang_cluster":"","src_uid":"37feadce373f728ba2a560b198ca4bc9","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["dp","number theory"],"prob_desc_created_at":"1294992000","prob_desc_sample_inputs":"[\"1\\n1 9\", \"1\\n12 15\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":2500.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"4 seconds","prob_desc_input_spec":"The first line of the input contains the number of cases t (1\u2009\u2264\u2009t\u2009\u2264\u200910). Each of the next t lines contains two natural numbers li and ri (1\u2009\u2264\u2009li\u2009\u2264\u2009ri\u2009\u2264\u20099\u2009\u00b71018). Please, do not use %lld specificator to read or write 64-bit integers in C++. It is preffered to use cin (also you may use %I64d).","prob_desc_sample_outputs":"[\"9\", \"2\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"1\\r\\n1 9\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"1\\r\\n12 15\\r\\n\", \"output\": [\"2\"]}, {\"input\": \"1\\r\\n25 53\\r\\n\", \"output\": [\"7\"]}, {\"input\": \"1\\r\\n1 1000\\r\\n\", \"output\": [\"138\"]}, {\"input\": \"1\\r\\n1 100000\\r\\n\", \"output\": [\"4578\"]}, {\"input\": \"2\\r\\n234 59843\\r\\n46 3243\\r\\n\", \"output\": [\"3378\\r\\n381\"]}, {\"input\": \"4\\r\\n55 55\\r\\n1234 2348\\r\\n620 620\\r\\n4 1000\\r\\n\", \"output\": [\"1\\r\\n135\\r\\n0\\r\\n135\"]}, {\"input\": \"1\\r\\n1 9000000000000000000\\r\\n\", \"output\": [\"15957349671845566\"]}, {\"input\": \"5\\r\\n5397562498 1230483490253448\\r\\n39218765 5293867493184739\\r\\n99 999999999999\\r\\n546234 2394748365397856\\r\\n67 801834\\r\\n\", \"output\": [\"3974776165902\\r\\n15977172601197\\r\\n5429986145\\r\\n7654830993719\\r\\n26117\"]}, {\"input\": \"3\\r\\n1 1\\r\\n9000000000000000000 9000000000000000000\\r\\n8999999999999999999 8999999999999999999\\r\\n\", \"output\": [\"1\\r\\n1\\r\\n0\"]}, {\"input\": \"9\\r\\n357816591093473912 478906145736655650\\r\\n154072099530098530 297675544560923083\\r\\n853274171983555776 877332810632329118\\r\\n258601077826366175 856890041027686262\\r\\n151084241340128367 868279055062218946\\r\\n360302714872207562 400114081267420149\\r\\n15181634044326791 602401427137909762\\r\\n85295343866069509 372373854804747278\\r\\n61825864286248332 820583114541565140\\r\\n\", \"output\": [\"262303539156695\\r\\n312897266661597\\r\\n38778726789519\\r\\n1139862940345127\\r\\n1402615778591617\\r\\n79118901111096\\r\\n1245376292216844\\r\\n659738283968181\\r\\n1512151848646298\"]}, {\"input\": \"7\\r\\n104609317611013150 341289880328203892\\r\\n97241912027543222 314418300699926877\\r\\n53441135299739439 389735416311904624\\r\\n275391517859532788 467960038909170238\\r\\n304318532879803217 768089672739846481\\r\\n319824835697587963 736305171087865698\\r\\n409387390360731466 545771099640557323\\r\\n\", \"output\": [\"549953639217759\\r\\n500330757015166\\r\\n752572674468163\\r\\n436944574287103\\r\\n888035593458099\\r\\n815512909354668\\r\\n274130616468780\"]}, {\"input\": \"9\\r\\n445541835776354804 558734188486271358\\r\\n73682036065176542 366947184576839560\\r\\n308564620247881013 586289290590337947\\r\\n191966067909858814 427579642915908767\\r\\n96549472115040860 524715559221512354\\r\\n255020036710938147 654502276995773879\\r\\n80176357776022017 657344223781591909\\r\\n16719475415528318 443326279724654990\\r\\n338052544981592129 686095491515876947\\r\\n\", \"output\": [\"201308654973933\\r\\n671018900952294\\r\\n557260640825456\\r\\n540245067535034\\r\\n951590675251248\\r\\n821822247331406\\r\\n1236063703297355\\r\\n975752055142342\\r\\n695221153195519\"]}, {\"input\": \"8\\r\\n423727899203401096 465066089007515233\\r\\n592099166919122847 693326943315408193\\r\\n231531173552972562 531446476635170028\\r\\n716633579315369700 812280907158531602\\r\\n418627020920440527 499027876613131004\\r\\n163898261665251882 822784355862669948\\r\\n435839418352342371 467127616759016838\\r\\n485096651053655121 650414421921269042\\r\\n\", \"output\": [\"95861671721858\\r\\n223094952917814\\r\\n644166606425537\\r\\n120467904177516\\r\\n171364758258616\\r\\n1283490622790032\\r\\n70087190765465\\r\\n307069761298908\"]}, {\"input\": \"10\\r\\n317170715064111090 793355628628194180\\r\\n739156054415396992 777408930205278114\\r\\n190203742284298612 871433095584843953\\r\\n299464632866349604 887366147454183925\\r\\n604292320992752545 686849525965889579\\r\\n671343144075216807 887426356575285220\\r\\n29419076620738966 587651333431204877\\r\\n623639325649517323 649463206025796889\\r\\n433988870372201677 826343090001917979\\r\\n59211672688034983 185391377687885100\\r\\n\", \"output\": [\"882906430841196\\r\\n42022148935039\\r\\n1331583561781769\\r\\n1112192163424357\\r\\n187737287429964\\r\\n340983354590699\\r\\n1187362489423650\\r\\n65177281203879\\r\\n681151115425128\\r\\n281120105826732\"]}, {\"input\": \"10\\r\\n284628591358250298 646259693733499061\\r\\n124314877444536921 158360653417589331\\r\\n294802485707819594 348409229744008981\\r\\n600000720865727637 612539571868349067\\r\\n43148541126130378 706710122330555006\\r\\n623654284391810432 864058024613618266\\r\\n96275043624390708 878551347136533260\\r\\n101314040620664356 877345387577542422\\r\\n330459790968153544 396766608075635018\\r\\n437750508922390426 606265056174456186\\r\\n\", \"output\": [\"747510034316095\\r\\n79156178606166\\r\\n135124732730027\\r\\n34085557037263\\r\\n1399630254414422\\r\\n411736949395029\\r\\n1554771181008711\\r\\n1542736445406160\\r\\n140533045281525\\r\\n291140888308231\"]}, {\"input\": \"2\\r\\n699477065952458657 872009205627849715\\r\\n125384274193311446 322714849067940236\\r\\n\", \"output\": [\"264558248920386\\r\\n447564169675211\"]}, {\"input\": \"5\\r\\n287022480899155515 575607276198133575\\r\\n269577246853440756 493029962385944199\\r\\n33867048981266469 753806197266881614\\r\\n122720683292361468 585860767594869710\\r\\n158415500607290576 291208960498755656\\r\\n\", \"output\": [\"592269002835278\\r\\n490392318097910\\r\\n1479332749456685\\r\\n973971824970712\\r\\n293817273058831\"]}, {\"input\": \"7\\r\\n256594007991864539 522344824090301945\\r\\n244974983299956912 369564779245483014\\r\\n389003124143900342 870218470015550418\\r\\n195460950995683388 651270783906429493\\r\\n346224221518880818 866785151789106062\\r\\n253038155332981304 335508507616974071\\r\\n90600597989420506 233249608331610512\\r\\n\", \"output\": [\"569988591376813\\r\\n279165427586805\\r\\n878614839734539\\r\\n963922382771989\\r\\n955701376330903\\r\\n185737826200532\\r\\n335147883567859\"]}, {\"input\": \"4\\r\\n1316690822130409 43473794526140271\\r\\n31324963681870844 400596320533679208\\r\\n145052817797209833 830063350205257021\\r\\n158658407621553147 888417552777282422\\r\\n\", \"output\": [\"111729862958642\\r\\n828223557472883\\r\\n1338195829521665\\r\\n1422989272142417\"]}, {\"input\": \"5\\r\\n54466217578737820 199602944107455170\\r\\n590840692238108171 845011715230237399\\r\\n13556617965656361 472040489988635161\\r\\n714035286668109810 850408020486632812\\r\\n300350088832329391 447391742372023290\\r\\n\", \"output\": [\"315665808201383\\r\\n452173335782140\\r\\n1043520592810950\\r\\n207881845406015\\r\\n346723658222085\"]}, {\"input\": \"5\\r\\n319233236657111501 439203315902660433\\r\\n576536153378125966 581498392015228293\\r\\n211896470192814609 802604291686025035\\r\\n276426676181343125 621591075446200211\\r\\n508640487982063778 534483221559283380\\r\\n\", \"output\": [\"275614372867493\\r\\n4659637264553\\r\\n1137342068923219\\r\\n699280378176787\\r\\n43498698267824\"]}, {\"input\": \"2\\r\\n109665811875257879 257740418232519221\\r\\n604210587139443191 625314575765100157\\r\\n\", \"output\": [\"346819987743014\\r\\n55092823341467\"]}, {\"input\": \"6\\r\\n268178188710040742 576988663070502189\\r\\n504550929759464987 781375970672533626\\r\\n383664952430952316 634627265571145187\\r\\n32079280703703870 854176930200007145\\r\\n91332009005179043 184053275183946180\\r\\n40615673830587752 81118443341384874\\r\\n\", \"output\": [\"626997097457560\\r\\n461119872685266\\r\\n494669041669140\\r\\n1651825364810407\\r\\n212939340175502\\r\\n81771949489938\"]}, {\"input\": \"6\\r\\n302303335070090868 450003809972976938\\r\\n38797475097975886 362745244153909054\\r\\n255979212134580442 584044352113226014\\r\\n296314585958572870 577227175635398364\\r\\n62422561943575682 256080854477707325\\r\\n211472647017729730 238012961902478501\\r\\n\", \"output\": [\"346244647306943\\r\\n735804706209393\\r\\n662539475305881\\r\\n575163541821522\\r\\n442982474060829\\r\\n69445242386875\"]}, {\"input\": \"2\\r\\n682002069204224661 741697951489458142\\r\\n183681502765856661 640437699585130293\\r\\n\", \"output\": [\"88198304176240\\r\\n962081125874149\"]}, {\"input\": \"10\\r\\n139335835151468925 484066860116557425\\r\\n263442856552254877 313125870358044935\\r\\n251857673095776569 867489314560690117\\r\\n537516700522410653 723282616279678271\\r\\n395380521908450082 806672097008414136\\r\\n235871329996145263 884796582724269557\\r\\n534443148879117170 654182410587394685\\r\\n380572226198783846 879140470933346585\\r\\n44215071468435238 258286912303970378\\r\\n26312939052691831 729014058195540988\\r\\n\", \"output\": [\"768880516070086\\r\\n105251422042778\\r\\n1171842666779485\\r\\n340594731814913\\r\\n733127744647337\\r\\n1237953582953797\\r\\n227668828811669\\r\\n906919615037865\\r\\n483212415948596\\r\\n1471096234030452\"]}, {\"input\": \"1\\r\\n409932656755767888 555182693984224688\\r\\n\", \"output\": [\"288403268897055\"]}, {\"input\": \"5\\r\\n85486498031991129 609519488362467658\\r\\n580104402950188545 585551649929612890\\r\\n266889485749089795 290577696596475568\\r\\n29875185901092149 120388080236728441\\r\\n287513302314456963 523308494771522710\\r\\n\", \"output\": [\"1105188916073505\\r\\n8401535899653\\r\\n42676144797046\\r\\n203278778614845\\r\\n511366630991705\"]}, {\"input\": \"5\\r\\n19182336056148152 208792307948641418\\r\\n679752014854666194 698235312605408252\\r\\n171120031998422805 569721388031168451\\r\\n12148793149507654 583293559019372679\\r\\n132953494234881925 342019770688732055\\r\\n\", \"output\": [\"428539359425062\\r\\n38145118408539\\r\\n843379203441666\\r\\n1226321445918381\\r\\n477944627277795\"]}, {\"input\": \"1\\r\\n290788238061324166 326414205793715944\\r\\n\", \"output\": [\"88194728799125\"]}, {\"input\": \"5\\r\\n234980802136837794 678684394174931737\\r\\n379107007207217021 898625960325636363\\r\\n299786954727403405 471077420542543174\\r\\n128226582798019699 763298680395163050\\r\\n211161692546607273 384187742288440244\\r\\n\", \"output\": [\"912901045635585\\r\\n946264344323228\\r\\n396530582015099\\r\\n1276195957822587\\r\\n393055025121430\"]}, {\"input\": \"5\\r\\n89021901785536018 721970357006512096\\r\\n10455209854982 672121404159230388\\r\\n177585137659819353 575574850046871820\\r\\n65145962073623720 680133228947272669\\r\\n391876042757036995 669425246021613653\\r\\n\", \"output\": [\"1326519621640374\\r\\n1455095002395873\\r\\n839815657146984\\r\\n1301765297380635\\r\\n556427727905125\"]}, {\"input\": \"7\\r\\n759792714318263446 835705573208322900\\r\\n460742320949633715 470758694665495415\\r\\n415505837605910991 569430654167207205\\r\\n377168676014875291 658290859272415183\\r\\n283793404702060566 304952201274598832\\r\\n511204209665235974 673646757429123938\\r\\n204114397228198672 797985176265960222\\r\\n\", \"output\": [\"125479708961158\\r\\n23959650169069\\r\\n295105797092887\\r\\n558580533111335\\r\\n46911931274954\\r\\n306769834874325\\r\\n1148348273935072\"]}, {\"input\": \"9\\r\\n84911486803129062 371360395960886607\\r\\n215284546951446780 821388426823792006\\r\\n166750422723367513 332960369043386392\\r\\n656713493264874130 830533243210221453\\r\\n279192318807285719 846434989742407222\\r\\n184571653844680221 502821438236701008\\r\\n158613676606887401 202707248716070578\\r\\n57540730334410124 60880782285483617\\r\\n180003597833276637 824443392811852241\\r\\n\", \"output\": [\"659040707264401\\r\\n1169272353137522\\r\\n376194188156988\\r\\n265702711225992\\r\\n1082952205541968\\r\\n710617267557674\\r\\n90657680784523\\r\\n5900863115303\\r\\n1261270219463080\"]}, {\"input\": \"8\\r\\n57710938094283125 133772303709577393\\r\\n225971608986591641 527160269434785752\\r\\n326606700768403490 501974015736773213\\r\\n104238980296659530 597665360857507536\\r\\n129585992859086273 782985334217822917\\r\\n95949900165719335 509445717207521416\\r\\n282373530338110359 395331940454914825\\r\\n109101574779985403 119360877564462401\\r\\n\", \"output\": [\"174229855050036\\r\\n652036071424638\\r\\n380051677908779\\r\\n1036346035129658\\r\\n1296518899055801\\r\\n926646671294788\\r\\n253442916135262\\r\\n27096176893815\"]}, {\"input\": \"6\\r\\n143809081082381724 710709485503956307\\r\\n477002227475791129 748415761498654762\\r\\n194250190495612708 722691609433551584\\r\\n75162568328377570 286478648363940215\\r\\n167009103400266860 565869134050802277\\r\\n502744098916587217 886107958887143606\\r\\n\", \"output\": [\"1174608615264406\\r\\n478873948513061\\r\\n1088489184647499\\r\\n477237176264941\\r\\n845730891804138\\r\\n655620551892311\"]}, {\"input\": \"7\\r\\n44244599058777278 782140424182656491\\r\\n253187103338885776 695335736560569599\\r\\n29699011635943174 255027033171638318\\r\\n620123105021375390 632580504164439237\\r\\n15375925200954959 514151645969327190\\r\\n543405682133478575 609214152593311339\\r\\n319215262961370608 516830493012444317\\r\\n\", \"output\": [\"1483854651250762\\r\\n905015525981812\\r\\n517553165213234\\r\\n33709204034254\\r\\n1113374351058951\\r\\n100352641671765\\r\\n426472119432887\"]}, {\"input\": \"9\\r\\n126345625290218706 784850219000022089\\r\\n87023426041824251 129119697169349357\\r\\n115069371829617205 505544318183729913\\r\\n101524249349082603 410056021854163969\\r\\n365868821220246374 407398810119575711\\r\\n430453801123321243 449066562720974247\\r\\n343735112634641611 864077546788537811\\r\\n40949324306296116 718988450894528392\\r\\n374523541044751782 624503429430134549\\r\\n\", \"output\": [\"1305739310768597\\r\\n102116549043209\\r\\n871997518159200\\r\\n702650020836287\\r\\n83143533290706\\r\\n47299584944773\\r\\n955940809894257\\r\\n1421553310960175\\r\\n483847068411766\"]}, {\"input\": \"6\\r\\n628054167404305809 628631960105352883\\r\\n76614448048985164 664591413517666821\\r\\n262907302737145633 436561742851767924\\r\\n546542973469933497 609783019570052293\\r\\n144878328150224178 587802477340215629\\r\\n418802873287839235 492960279487924481\\r\\n\", \"output\": [\"1567925255004\\r\\n1257931500816068\\r\\n392229959274848\\r\\n95900315764706\\r\\n917682338726377\\r\\n160732132866347\"]}, {\"input\": \"4\\r\\n314756235091775713 527675415702104393\\r\\n262211905544992553 474539845101486132\\r\\n650849880923001511 686127592579746738\\r\\n302723886566715571 800643954239584448\\r\\n\", \"output\": [\"453938626100478\\r\\n474023849716525\\r\\n67782962321158\\r\\n928258453065819\"]}, {\"input\": \"10\\r\\n459047565386426124 557194352219781174\\r\\n334174633100816445 574518777618872908\\r\\n339256617206207374 461702378236276473\\r\\n588718051366049429 591583237944573629\\r\\n279503563837328065 787989497738844701\\r\\n21523491428669060 804432015267107086\\r\\n176599362925115382 372462231016537122\\r\\n86537781617987114 189304598553178698\\r\\n752344156097144261 806368993421691027\\r\\n823292318017906645 846671299523066080\\r\\n\", \"output\": [\"175044419962203\\r\\n475567289515459\\r\\n271613608429105\\r\\n3445772208321\\r\\n966370135430115\\r\\n1572574434602937\\r\\n449309541759218\\r\\n233323955652174\\r\\n64992990053986\\r\\n52429533514265\"]}, {\"input\": \"8\\r\\n235988693924367721 871763392821283031\\r\\n831354122145544757 897628959367475233\\r\\n208456624263360265 304233837602695736\\r\\n564455930754426325 747724855342153655\\r\\n733111142906877033 788390309965048178\\r\\n105753118324937331 227328301612681221\\r\\n89981956803108752 608240082487490427\\r\\n247970213583436454 274499034399377923\\r\\n\", \"output\": [\"1217007726638431\\r\\n122388636057875\\r\\n217887979666251\\r\\n326178731297371\\r\\n61066928664641\\r\\n284737008145535\\r\\n1093373317372355\\r\\n53748508684990\"]}, {\"input\": \"3\\r\\n106944629644846234 868784028501976520\\r\\n609893146415774201 829549590949963820\\r\\n280831004762390139 860314575937399777\\r\\n\", \"output\": [\"1516745018492261\\r\\n379777276962608\\r\\n1101541359723373\"]}, {\"input\": \"6\\r\\n43993555587390686 472396927744198873\\r\\n166115563323012274 740944002931589125\\r\\n745385119308013664 778824408151010477\\r\\n298307917637500505 739076799736050705\\r\\n270559504032562580 324248373286245715\\r\\n445587297201428883 453886541051311950\\r\\n\", \"output\": [\"964419689750151\\r\\n1163718720277976\\r\\n36086421106555\\r\\n874162586490607\\r\\n118661992679784\\r\\n16505740933228\"]}, {\"input\": \"7\\r\\n617593704688843596 828119736217232389\\r\\n3293204449283890 690109219324558805\\r\\n175366679625274382 211592984052182604\\r\\n134013605241468389 156621244614592310\\r\\n87651424533962276 294531661482220423\\r\\n652576309304110648 855895695568516689\\r\\n477666266196006205 647707658685159920\\r\\n\", \"output\": [\"355371372539710\\r\\n1476637881473656\\r\\n78566652210064\\r\\n51957130064357\\r\\n470606070577295\\r\\n325555975457004\\r\\n316743540058033\"]}, {\"input\": \"10\\r\\n50041481631208215 447762572637187951\\r\\n168215116153505310 514436306319509511\\r\\n247862097199125155 712191937735295742\\r\\n98125769392212035 345332927057490352\\r\\n351553192787723038 775772738657478138\\r\\n412742092029203073 627638533260248401\\r\\n196268314021034051 765318785061421414\\r\\n129127817256091656 848467628311779115\\r\\n209408331444736026 477286893553657979\\r\\n199077079465747558 382720611537297379\\r\\n\", \"output\": [\"901252368499013\\r\\n758846043617857\\r\\n939353740423384\\r\\n579394703095088\\r\\n778021740563806\\r\\n409454897225469\\r\\n1132337130752633\\r\\n1422718774146674\\r\\n606275219995081\\r\\n421492007921185\"]}, {\"input\": \"9\\r\\n360616474860484616 383999497202599749\\r\\n309747278163068128 324627518197345788\\r\\n37810933547908346 442701859960681398\\r\\n206321505581033547 517952468011059058\\r\\n830707273735965413 838545144291501943\\r\\n481064567699374119 637860173392597272\\r\\n64724838137416918 401453198057895626\\r\\n90969763647055934 161655002682127994\\r\\n832701350006309129 863335897035281262\\r\\n\", \"output\": [\"46498133371402\\r\\n40850597316229\\r\\n919493060637341\\r\\n687618814419970\\r\\n17501208925553\\r\\n286355733364676\\r\\n752235164806132\\r\\n170035203610447\\r\\n60213403274850\"]}, {\"input\": \"2\\r\\n17998572321587853 467288454221606647\\r\\n123156820907183052 834785732165266684\\r\\n\", \"output\": [\"1024878648284905\\r\\n1407846459864944\"]}, {\"input\": \"1\\r\\n1 999999999999999999\\r\\n\", \"output\": [\"1986512740492024\"]}, {\"input\": \"1\\r\\n191919191919191919 919191919191919191\\r\\n\", \"output\": [\"1412002458948136\"]}, {\"input\": \"10\\r\\n7090909090909090909 8191919191919191919\\r\\n7090909090909090909 8191919191919191919\\r\\n7090909090909090909 8191919191919191919\\r\\n7090909090909090909 8191919191919191919\\r\\n7090909090909090909 8191919191919191919\\r\\n7090909090909090909 8191919191919191919\\r\\n7090909090909090909 8191919191919191919\\r\\n7090909090909090909 8191919191919191919\\r\\n7090909090909090909 8191919191919191919\\r\\n7090909090909090909 8191919191919191919\\r\\n\", \"output\": [\"1308643426185330\\r\\n1308643426185330\\r\\n1308643426185330\\r\\n1308643426185330\\r\\n1308643426185330\\r\\n1308643426185330\\r\\n1308643426185330\\r\\n1308643426185330\\r\\n1308643426185330\\r\\n1308643426185330\"]}, {\"input\": \"10\\r\\n5555555555555555555 5555555555555555555\\r\\n5555555555555555555 5555555555555555555\\r\\n5555555555555555555 5555555555555555555\\r\\n5555555555555555555 5555555555555555555\\r\\n5555555555555555555 5555555555555555555\\r\\n5555555555555555555 5555555555555555555\\r\\n5555555555555555555 5555555555555555555\\r\\n5555555555555555555 5555555555555555555\\r\\n5555555555555555555 5555555555555555555\\r\\n5555555555555555555 5555555555555555555\\r\\n\", \"output\": [\"1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\\r\\n1\"]}, {\"input\": \"6\\r\\n312118719 8999999999291228845\\r\\n667149650 8999999999517267203\\r\\n913094187 8999999999725405253\\r\\n154899869 8999999999515635472\\r\\n17006149 8999999999611234564\\r\\n557783437 8999999999450461526\\r\\n\", \"output\": [\"15957349664614135\\r\\n15957349661485914\\r\\n15957349660288369\\r\\n15957349667743907\\r\\n15957349670077199\\r\\n15957349662484120\"]}, {\"input\": \"3\\r\\n49395813 8999999999232681026\\r\\n130560985 8999999999732049698\\r\\n561847056 8999999999660238105\\r\\n\", \"output\": [\"15957349668110658\\r\\n15957349668753664\\r\\n15957349663087863\"]}, {\"input\": \"5\\r\\n988020422 8999999999820367297\\r\\n146385894 8999999999144649284\\r\\n647276749 8999999999118469703\\r\\n545904849 8999999999653000715\\r\\n66157176 8999999999517239977\\r\\n\", \"output\": [\"15957349659989376\\r\\n15957349666269127\\r\\n15957349660004094\\r\\n15957349663205409\\r\\n15957349669084965\"]}, {\"input\": \"4\\r\\n159528081 8999999999254686152\\r\\n155140195 8999999999221118378\\r\\n573463040 8999999999924740913\\r\\n984536526 8999999999076714216\\r\\n\", \"output\": [\"15957349666612744\\r\\n15957349666487217\\r\\n15957349663881451\\r\\n15957349657279299\"]}, {\"input\": \"10\\r\\n79746525 8999999999623095709\\r\\n107133428 8999999999011808285\\r\\n395554969 8999999999078624899\\r\\n617453363 8999999999094258969\\r\\n152728928 8999999999672481523\\r\\n252006040 8999999999766225306\\r\\n547017602 8999999999444173567\\r\\n765495515 8999999999421300177\\r\\n974820465 8999999999294163554\\r\\n560970841 8999999999720023934\\r\\n\", \"output\": [\"15957349669242168\\r\\n15957349666397845\\r\\n15957349662613062\\r\\n15957349660358569\\r\\n15957349668236046\\r\\n15957349666959085\\r\\n15957349662552352\\r\\n15957349660553361\\r\\n15957349658288950\\r\\n15957349663286963\"]}, {\"input\": \"8\\r\\n989660313 8999999999396148104\\r\\n74305000 8999999999742113337\\r\\n122356523 8999999999305515797\\r\\n592472806 8999999999132041329\\r\\n241537546 8999999999521843612\\r\\n885836059 8999999999480097833\\r\\n636266002 8999999999732372739\\r\\n202992959 8999999999981938988\\r\\n\", \"output\": [\"15957349658680891\\r\\n15957349669642622\\r\\n15957349667387215\\r\\n15957349660885350\\r\\n15957349666468387\\r\\n15957349659758751\\r\\n15957349662500550\\r\\n15957349668676585\"]}, {\"input\": \"6\\r\\n367798644 8999999999638151319\\r\\n332338496 8999999999040457114\\r\\n623242741 8999999999949105799\\r\\n531142995 8999999999535909314\\r\\n717090981 8999999999596647230\\r\\n158402883 8999999999599697481\\r\\n\", \"output\": [\"15957349665093234\\r\\n15957349663187787\\r\\n15957349663490125\\r\\n15957349662956630\\r\\n15957349661257647\\r\\n15957349667853562\"]}, {\"input\": \"5\\r\\n956765583 8999999999016337994\\r\\n370504871 8999999999584832832\\r\\n419407328 8999999999309673477\\r\\n518267114 8999999999030078889\\r\\n575673403 8999999999079982623\\r\\n\", \"output\": [\"15957349657174545\\r\\n15957349664842554\\r\\n15957349663287444\\r\\n15957349660934012\\r\\n15957349660687410\"]}, {\"input\": \"3\\r\\n739134224 8999999999892539778\\r\\n960410270 8999999999024682694\\r\\n286103376 8999999999849390015\\r\\n\", \"output\": [\"15957349662121656\\r\\n15957349657206147\\r\\n15957349666880631\"]}, {\"input\": \"4\\r\\n674378376 8999999999719931608\\r\\n37509017 8999999999387372213\\r\\n406034921 8999999999018438724\\r\\n546125539 8999999999879368044\\r\\n\", \"output\": [\"15957349662041057\\r\\n15957349668957044\\r\\n15957349662212605\\r\\n15957349663840013\"]}, {\"input\": \"4\\r\\n840893847 8999999999654562383\\r\\n139840441 8999999999921619811\\r\\n311512855 8999999999801704512\\r\\n25959825 8999999999551930487\\r\\n\", \"output\": [\"15957349660688006\\r\\n15957349669232504\\r\\n15957349666299121\\r\\n15957349669765189\"]}, {\"input\": \"7\\r\\n89870013 8999999999917755425\\r\\n802311555 8999999999055366008\\r\\n847333505 8999999999726653552\\r\\n132149035 8999999999144498325\\r\\n943135535 8999999999038849200\\r\\n820468253 8999999999630582637\\r\\n369473186 8999999999168524327\\r\\n\", \"output\": [\"15957349670087446\\r\\n15957349658761550\\r\\n15957349660810956\\r\\n15957349666520206\\r\\n15957349657360988\\r\\n15957349660817284\\r\\n15957349663250037\"]}, {\"input\": \"5\\r\\n508307251 8999999999718177123\\r\\n521516981 8999999999464659141\\r\\n290241176 8999999999356325428\\r\\n615193857 8999999999597603944\\r\\n207549445 8999999999906844873\\r\\n\", \"output\": [\"15957349663733007\\r\\n15957349662832928\\r\\n15957349665236045\\r\\n15957349662359742\\r\\n15957349668276315\"]}, {\"input\": \"2\\r\\n27550482 8999999999973770612\\r\\n120156054 8999999999028557489\\r\\n\", \"output\": [\"15957349671150714\\r\\n15957349666232530\"]}, {\"input\": \"1\\r\\n271055852 8999999999909378243\\r\\n\", \"output\": [\"15957349667254063\"]}, {\"input\": \"8\\r\\n787842267 8999999999359738007\\r\\n133322301 8999999999943290774\\r\\n417668696 8999999999749402497\\r\\n46587622 8999999999589402579\\r\\n718959740 8999999999109688815\\r\\n529442028 8999999999809940983\\r\\n943175645 8999999999567139418\\r\\n865545527 8999999999260702769\\r\\n\", \"output\": [\"15957349660173586\\r\\n15957349669437416\\r\\n15957349664824777\\r\\n15957349669455115\\r\\n15957349659354335\\r\\n15957349663684224\\r\\n15957349659508226\\r\\n15957349658965833\"]}, {\"input\": \"10\\r\\n1883143 8999999999664400380\\r\\n373522758 8999999999528614034\\r\\n49945668 8999999999257821295\\r\\n659209563 8999999999455232186\\r\\n74336065 8999999999709871509\\r\\n97315679 8999999999108629997\\r\\n112069256 8999999999626576439\\r\\n12161303 8999999999432219862\\r\\n756831002 8999999999681371635\\r\\n230283719 8999999999550291145\\r\\n\", \"output\": [\"15957349670641976\\r\\n15957349664736116\\r\\n15957349668207957\\r\\n15957349661419878\\r\\n15957349669602216\\r\\n15957349667015648\\r\\n15957349668768809\\r\\n15957349669676588\\r\\n15957349661437380\\r\\n15957349666718051\"]}]"} {"prob_desc_description":"Vasya has recently learned to type and log on to the Internet. He immediately entered a chat room and decided to say hello to everybody. Vasya typed the word s. It is considered that Vasya managed to say hello if several letters can be deleted from the typed word so that it resulted in the word \"hello\". For example, if Vasya types the word \"ahhellllloou\", it will be considered that he said hello, and if he types \"hlelo\", it will be considered that Vasya got misunderstood and he didn't manage to say hello. Determine whether Vasya managed to say hello by the given word s.","prob_desc_output_spec":"If Vasya managed to say hello, print \"YES\", otherwise print \"NO\".","lang_cluster":"","src_uid":"c5d19dc8f2478ee8d9cba8cc2e4cd838","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["strings","greedy"],"prob_desc_created_at":"1296489600","prob_desc_sample_inputs":"[\"ahhellllloou\", \"hlelo\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":1000.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first and only line contains the word s, which Vasya typed. This word consisits of small Latin letters, its length is no less that 1 and no more than 100 letters.","prob_desc_sample_outputs":"[\"YES\", \"NO\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"ahhellllloou\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"hlelo\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"helhcludoo\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"hehwelloho\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"pnnepelqomhhheollvlo\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"tymbzjyqhymedasloqbq\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"yehluhlkwo\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"hatlevhhalrohairnolsvocafgueelrqmlqlleello\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"hhhtehdbllnhwmbyhvelqqyoulretpbfokflhlhreeflxeftelziclrwllrpflflbdtotvlqgoaoqldlroovbfsq\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"rzlvihhghnelqtwlexmvdjjrliqllolhyewgozkuovaiezgcilelqapuoeglnwmnlftxxiigzczlouooi\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"pfhhwctyqdlkrwhebfqfelhyebwllhemtrmeblgrynmvyhioesqklclocxmlffuormljszllpoo\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"lqllcolohwflhfhlnaow\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"heheeellollvoo\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"hellooo\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"o\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"hhqhzeclohlehljlhtesllylrolmomvuhcxsobtsckogdv\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"yoegfuzhqsihygnhpnukluutocvvwuldiighpogsifealtgkfzqbwtmgghmythcxflebrkctlldlkzlagovwlstsghbouk\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"uatqtgbvrnywfacwursctpagasnhydvmlinrcnqrry\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"tndtbldbllnrwmbyhvqaqqyoudrstpbfokfoclnraefuxtftmgzicorwisrpfnfpbdtatvwqgyalqtdtrjqvbfsq\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"rzlvirhgemelnzdawzpaoqtxmqucnahvqnwldklrmjiiyageraijfivigvozgwngiulttxxgzczptusoi\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"kgyelmchocojsnaqdsyeqgnllytbqietpdlgknwwumqkxrexgdcnwoldicwzwofpmuesjuxzrasscvyuqwspm\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"pnyvrcotjvgynbeldnxieghfltmexttuxzyac\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"dtwhbqoumejligbenxvzhjlhosqojetcqsynlzyhfaevbdpekgbtjrbhlltbceobcok\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"crrfpfftjwhhikwzeedrlwzblckkteseofjuxjrktcjfsylmlsvogvrcxbxtffujqshslemnixoeezivksouefeqlhhokwbqjz\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"jhfbndhyzdvhbvhmhmefqllujdflwdpjbehedlsqfdsqlyelwjtyloxwsvasrbqosblzbowlqjmyeilcvotdlaouxhdpoeloaovb\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"hwlghueoemiqtjhhpashjsouyegdlvoyzeunlroypoprnhlyiwiuxrghekaylndhrhllllwhbebezoglydcvykllotrlaqtvmlla\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"wshiaunnqnqxodholbipwhhjmyeblhgpeleblklpzwhdunmpqkbuzloetmwwxmeltkrcomulxauzlwmlklldjodozxryghsnwgcz\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"shvksednttggehroewuiptvvxtrzgidravtnjwuqrlnnkxbplctzkckinpkgjopjfoxdbojtcvsuvablcbkrzajrlhgobkcxeqti\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"hyyhddqhxhekehkwfhlnlsihzefwchzerevcjtokefplholrbvxlltdlafjxrfhleglrvlolojoqaolagtbeyogxlbgfolllslli\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"iaagrdhhelxpdegueiulflquvlzidoprzkehthkldaytrjwhyhprwjxlltinxvuilxohqgjqcvkkdcuoliekcnlilwgqlnlzouoo\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"wfluaeseldgxyvxpwuhkptdmlflnlhktwxiabsvkolsquymrmhzczzoybvlilhmvsuunggvgxzgyyffk\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"loee\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"izdipwylefqmjbuoznfglgcfvedeouflkeehxbasaqmiooppfsqlhprospqgxvzrcpwlfdddngoqvpwvggsnvvxhmjoslwjudjlo\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"pplynflbjlseflaegzqpdxswgunhnlglqhycrbcwdfhclmcrwekkzsoosmfblljeenwfjyifcvxihhhbyhmhlkvtskeglaovjnsi\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"xqjqmenkodmlhzyzmmvofdngktygbbxbzpluzcohohmalkoeuwfikblltaaigv\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"hello\\r\\n\", \"output\": [\"YES\"]}, {\"input\": \"oohell\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"hell\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"eloellohoelo\\r\\n\", \"output\": [\"NO\"]}, {\"input\": \"helllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllo\\r\\n\", \"output\": [\"YES\"]}]"} {"prob_desc_description":"Sometimes one has to spell email addresses over the phone. Then one usually pronounces a dot as dot, an at sign as at. As a result, we get something like vasyaatgmaildotcom. Your task is to transform it into a proper email address (vasya@gmail.com). It is known that a proper email address contains only such symbols as . @ and lower-case Latin letters, doesn't start with and doesn't end with a dot. Also, a proper email address doesn't start with and doesn't end with an at sign. Moreover, an email address contains exactly one such symbol as @, yet may contain any number (possible, zero) of dots. You have to carry out a series of replacements so that the length of the result was as short as possible and it was a proper email address. If the lengths are equal, you should print the lexicographically minimal result. Overall, two variants of replacement are possible: dot can be replaced by a dot, at can be replaced by an at. ","prob_desc_output_spec":"Print the shortest email address, from which the given line could be made by the described above replacements. If there are several solutions to that problem, print the lexicographically minimal one (the lexicographical comparison of the lines are implemented with an operator < in modern programming languages). In the ASCII table the symbols go in this order: . @ ab...z","lang_cluster":"","src_uid":"a11c9679d8e2dca51be17d466202df6e","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["expression parsing","implementation"],"prob_desc_created_at":"1289232000","prob_desc_sample_inputs":"[\"vasyaatgmaildotcom\", \"dotdotdotatdotdotat\", \"aatt\"]","prob_desc_notes":null,"exec_outcome":"","difficulty":1300.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"The first line contains the email address description. It is guaranteed that that is a proper email address with all the dots replaced by dot an the at signs replaced by at. The line is not empty and its length does not exceed 100 symbols.","prob_desc_sample_outputs":"[\"vasya@gmail.com\", \"dot..@..at\", \"a@t\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"vasyaatgmaildotcom\\r\\n\", \"output\": [\"vasya@gmail.com\"]}, {\"input\": \"dotdotdotatdotdotat\\r\\n\", \"output\": [\"dot..@..at\"]}, {\"input\": \"aatt\\r\\n\", \"output\": [\"a@t\"]}, {\"input\": \"zdotdotatdotz\\r\\n\", \"output\": [\"z..@.z\"]}, {\"input\": \"dotdotdotdotatdotatatatdotdotdot\\r\\n\", \"output\": [\"dot...@.atatat..dot\"]}, {\"input\": \"taatta\\r\\n\", \"output\": [\"ta@ta\"]}, {\"input\": \"doatdt\\r\\n\", \"output\": [\"do@dt\"]}, {\"input\": \"catdotdotdotatatdotdotdotnatjdotatdotdotdoteatatoatatatoatatatdotdotatdotdotwxrdotatfatgfdotuatata\\r\\n\", \"output\": [\"c@...atat...natj.at...eatatoatatatoatatat..at..wxr.atfatgf.uatata\"]}, {\"input\": \"hmatcxatxatdotatlyucjatdothatdotcatatatdotqatatdotdotdotdotatjddotdotdotqdotdotattdotdotatddotatatat\\r\\n\", \"output\": [\"hm@cxatxat.atlyucjat.hat.catatat.qatat....atjd...q..att..atd.atatat\"]}, {\"input\": \"xatvdotrjatatatdotatatdotdotdotdotndothidotatdotdotdotqyxdotdotatdotdotdotdotdotdotduatgdotdotaatdot\\r\\n\", \"output\": [\"x@v.rjatatat.atat....n.hi.at...qyx..at......duatg..aatdot\"]}, {\"input\": \"attdotdotatdotzsedotdotatcyatdotpndotdotdotatuwatatatatatwdotdotqsatatrqatatsatqndotjcdotatnatxatoq\\r\\n\", \"output\": [\"att..@.zse..atcyat.pn...atuwatatatatatw..qsatatrqatatsatqn.jc.atnatxatoq\"]}, {\"input\": \"atdotatsatatiatatnatudotdotdotatdotdotddotdotdotwatxdotdotdotdotdoteatatfattatatdotatatdotidotzkvnat\\r\\n\", \"output\": [\"at.@satatiatatnatu...at..d...watx.....eatatfattatat.atat.i.zkvnat\"]}, {\"input\": \"atdotdotatatdottatdotatatatatdotdotdotatdotdotatucrdotdotatatdotdatatatusgdatatdotatdotdotpdotatdot\\r\\n\", \"output\": [\"at..@at.tat.atatatat...at..atucr..atat.datatatusgdatat.at..p.atdot\"]}, {\"input\": \"dotdotdotdotatdotatdoteatdotatatatatatneatatdotmdotdotatsatdotdotdotndotatjatdotatdotdotatatdotdotgp\\r\\n\", \"output\": [\"dot...@.at.eat.atatatatatneatat.m..atsat...n.atjat.at..atat..gp\"]}, {\"input\": \"dotatjdotqcratqatidotatdotudotqulatdotdotdotatatdotdotdotdotdotatatdotdotatdotdotdotymdotdotwvdotat\\r\\n\", \"output\": [\"dot@j.qcratqati.at.u.qulat...atat.....atat..at...ym..wv.at\"]}, {\"input\": \"dotatatcdotxdotatgatatatkqdotrspatdotatodotqdotbdotdotnndotatatgatatudotdotatlatatdotatbjdotdotatdot\\r\\n\", \"output\": [\"dot@atc.x.atgatatatkq.rspat.ato.q.b..nn.atatgatatu..atlatat.atbj..atdot\"]}, {\"input\": \"xqbdotatuatatdotatatatidotdotdotbatpdotdotatatatdotatbptatdotatigdotdotdotdotatatatatatdotdotdotdotl\\r\\n\", \"output\": [\"xqb.@uatat.atatati...batp..atatat.atbptat.atig....atatatatat....l\"]}, {\"input\": \"hatatatdotcatqatdotwhvdotatdotsatattatatcdotddotdotvasatdottxdotatatdotatmdotvvatkatdotxatcdotdotzsx\\r\\n\", \"output\": [\"h@atat.catqat.whv.at.satattatatc.d..vasat.tx.atat.atm.vvatkat.xatc..zsx\"]}, {\"input\": \"dotxcdotdottdotdotatdotybdotqdotatdotatdotatatpndotljethatdotdotlrdotdotdottgdotgkdotkatatdotdotzat\\r\\n\", \"output\": [\"dotxc..t..@.yb.q.at.at.atatpn.ljethat..lr...tg.gk.katat..zat\"]}, {\"input\": \"dotkatudotatdotatatwlatiwatatdotwdotatcdotatdotatatatdotdotidotdotbatldotoxdotatdotdotudotdotvatatat\\r\\n\", \"output\": [\"dotk@u.at.atatwlatiwatat.w.atc.at.atatat..i..batl.ox.at..u..vatatat\"]}, {\"input\": \"edotdotdotsatoatedotatpdotatatfatpmdotdotdotatyatdotzjdoteuldotdottatdotatmtidotdotdotadotratqisat\\r\\n\", \"output\": [\"e...s@oate.atp.atatfatpm...atyat.zj.eul..tat.atmti...a.ratqisat\"]}, {\"input\": \"atcatiatdotncbdotatedotatoiataatydotoatihzatdotdotcatkdotdotudotodotxatatatatdotatdotnhdotdotatatat\\r\\n\", \"output\": [\"atc@iat.ncb.ate.atoiataaty.oatihzat..catk..u.o.xatatatat.at.nh..atatat\"]}, {\"input\": \"atodotdotatdotatdotvpndotatdotatdotadotatdotattnysatqdotatdotdotsdotcmdotdotdotdotywateatdotatgsdot\\r\\n\", \"output\": [\"ato..@.at.vpn.at.at.a.at.attnysatq.at..s.cm....ywateat.atgsdot\"]}, {\"input\": \"dotdotatlatnatdotjatxdotdotdotudotcdotdotatdotgdotatdotatdotatdotsatatcdatzhatdotatkdotbmidotdotudot\\r\\n\", \"output\": [\"dot.@latnat.jatx...u.c..at.g.at.at.at.satatcdatzhat.atk.bmi..udot\"]}, {\"input\": \"fatdotatdotydotatdotdotatdotdotdottatatdotdotatdotatatdotatadotdotqdotatatatidotdotatkecdotdotatdot\\r\\n\", \"output\": [\"f@.at.y.at..at...tatat..at.atat.ata..q.atatati..atkec..atdot\"]}, {\"input\": \"zdotatdotatatatiatdotrdotatatcatatatdotatmaatdottatatcmdotdotatdotatdotdottnuatdotfatatdotnathdota\\r\\n\", \"output\": [\"z.@.atatatiat.r.atatcatatat.atmaat.tatatcm..at.at..tnuat.fatat.nath.a\"]}, {\"input\": \"dotatdotatvdotjatatjsdotdotdotatsdotatatcdotatldottrdotoctvhatdotdotxeatdotfatdotratdotatfatatatdot\\r\\n\", \"output\": [\"dot@.atv.jatatjs...ats.atatc.atl.tr.octvhat..xeat.fat.rat.atfatatatdot\"]}, {\"input\": \"jdotypatdotatqatdothdotdqatadotkdotodotdotatdotdotdotdotdottdotdotatatatdotzndotodotdotkdotfdotatat\\r\\n\", \"output\": [\"j.yp@.atqat.h.dqata.k.o..at.....t..atatat.zn.o..k.f.atat\"]}, {\"input\": \"batatatgldotatatpatsatrdotatjdotatdotatfndotdotatzatuatrdotxiwatvhdatdatsyatatatratatxdothdotadotaty\\r\\n\", \"output\": [\"b@atatgl.atatpatsatr.atj.at.atfn..atzatuatr.xiwatvhdatdatsyatatatratatx.h.a.aty\"]}, {\"input\": \"atdotpgatgnatatatdotfoatdotatwatdotatmdotdotdotjnhatatdotatatdotatpdotatadotatatdotdotdotatdotdotdot\\r\\n\", \"output\": [\"at.pg@gnatatat.foat.atwat.atm...jnhatat.atat.atp.ata.atat...at..dot\"]}, {\"input\": \"atatat\\r\\n\", \"output\": [\"at@at\"]}, {\"input\": \"dotdotdotdotdatotdotdotdotatdotdotdotdotdotdotdotdotdotdotdotdotdotdotdotdot\\r\\n\", \"output\": [\"dot...d@ot...at...............dot\"]}, {\"input\": \"dotatdot\\r\\n\", \"output\": [\"dot@dot\"]}, {\"input\": \"dotatat\\r\\n\", \"output\": [\"dot@at\"]}, {\"input\": \"atatdot\\r\\n\", \"output\": [\"at@dot\"]}, {\"input\": \"atatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatat\\r\\n\", \"output\": [\"at@atatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatatat\"]}, {\"input\": \"dotdotdotdotdotdotdotdotdotdotdotdoatdotdotdotdotdotdotdotdotdotdotdotdotdotdotdotdotdotdotdotdotdot\\r\\n\", \"output\": [\"dot..........do@....................dot\"]}, {\"input\": \"dotdotdotdotdotdotdotdotdotdotdotdotdotatdotdotdotdotdotdotdotdotdotdotdotdotdotdotdotdotdotdotdot\\r\\n\", \"output\": [\"dot............@..................dot\"]}, {\"input\": \"sdfuiopguoidfbhuihsregftuioheguoatsfhgvuherasuihfsduphguphewruheruopsghuiofhbvjudfbdpiuthrupwrkgfhda\\r\\n\", \"output\": [\"sdfuiopguoidfbhuihsregftuioheguo@sfhgvuherasuihfsduphguphewruheruopsghuiofhbvjudfbdpiuthrupwrkgfhda\"]}, {\"input\": \"sdfuiopguoidfbhuihsregftuioheguodpsfhgvuherasuihfsduphguatwruheruopsghuiofhbvjudfbdpiuthrupwrkgfhdat\\r\\n\", \"output\": [\"sdfuiopguoidfbhuihsregftuioheguodpsfhgvuherasuihfsduphgu@wruheruopsghuiofhbvjudfbdpiuthrupwrkgfhdat\"]}, {\"input\": \"atatatat\\r\\n\", \"output\": [\"at@atat\"]}, {\"input\": \"atatatdot\\r\\n\", \"output\": [\"at@atdot\"]}, {\"input\": \"atatdotat\\r\\n\", \"output\": [\"at@.at\"]}, {\"input\": \"atatdotdot\\r\\n\", \"output\": [\"at@.dot\"]}, {\"input\": \"atdotatat\\r\\n\", \"output\": [\"at.@at\"]}, {\"input\": \"atdotatdot\\r\\n\", \"output\": [\"at.@dot\"]}, {\"input\": \"dotatatat\\r\\n\", \"output\": [\"dot@atat\"]}, {\"input\": \"dotatatdot\\r\\n\", \"output\": [\"dot@atdot\"]}, {\"input\": \"dotatdotat\\r\\n\", \"output\": [\"dot@.at\"]}, {\"input\": \"dotatdotdot\\r\\n\", \"output\": [\"dot@.dot\"]}, {\"input\": \"dotdotatat\\r\\n\", \"output\": [\"dot.@at\"]}, {\"input\": \"dotdotatdot\\r\\n\", \"output\": [\"dot.@dot\"]}]"} {"prob_desc_description":"Fangy collects cookies. Once he decided to take a box and put cookies into it in some way. If we take a square k\u2009\u00d7\u2009k in size, divided into blocks 1\u2009\u00d7\u20091 in size and paint there the main diagonal together with cells, which lie above it, then the painted area will be equal to the area occupied by one cookie k in size. Fangy also has a box with a square base 2n\u2009\u00d7\u20092n, divided into blocks 1\u2009\u00d7\u20091 in size. In a box the cookies should not overlap, and they should not be turned over or rotated. See cookies of sizes 2 and 4 respectively on the figure: To stack the cookies the little walrus uses the following algorithm. He takes out of the repository the largest cookie which can fit in some place in the box and puts it there. Everything could be perfect but alas, in the repository the little walrus has infinitely many cookies of size 2 and larger, and there are no cookies of size 1, therefore, empty cells will remain in the box. Fangy wants to know how many empty cells will be left in the end.","prob_desc_output_spec":"Print the single number, equal to the number of empty cells in the box. The answer should be printed modulo 106\u2009+\u20093.","lang_cluster":"","src_uid":"1a335a9638523ca0315282a67e18eec7","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math"],"prob_desc_created_at":"1301155200","prob_desc_sample_inputs":"[\"3\"]","prob_desc_notes":"NoteIf the box possesses the base of 23\u2009\u00d7\u200923 (as in the example), then the cookies will be put there in the following manner: ","exec_outcome":"","difficulty":1300.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"1 second","prob_desc_input_spec":"The first line contains a single integer n (0\u2009\u2264\u2009n\u2009\u2264\u20091000).","prob_desc_sample_outputs":"[\"9\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"3\\r\\n\", \"output\": [\"9\"]}, {\"input\": \"1\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"2\\r\\n\", \"output\": [\"3\"]}, {\"input\": \"4\\r\\n\", \"output\": [\"27\"]}, {\"input\": \"6\\r\\n\", \"output\": [\"243\"]}, {\"input\": \"11\\r\\n\", \"output\": [\"59049\"]}, {\"input\": \"14\\r\\n\", \"output\": [\"594320\"]}, {\"input\": \"15\\r\\n\", \"output\": [\"782957\"]}, {\"input\": \"7\\r\\n\", \"output\": [\"729\"]}, {\"input\": \"0\\r\\n\", \"output\": [\"1\"]}, {\"input\": \"1000\\r\\n\", \"output\": [\"691074\"]}, {\"input\": \"657\\r\\n\", \"output\": [\"874011\"]}, {\"input\": \"561\\r\\n\", \"output\": [\"842553\"]}, {\"input\": \"823\\r\\n\", \"output\": [\"858672\"]}, {\"input\": \"850\\r\\n\", \"output\": [\"557186\"]}, {\"input\": \"298\\r\\n\", \"output\": [\"999535\"]}, {\"input\": \"262\\r\\n\", \"output\": [\"946384\"]}, {\"input\": \"910\\r\\n\", \"output\": [\"678945\"]}, {\"input\": \"617\\r\\n\", \"output\": [\"247876\"]}, {\"input\": \"857\\r\\n\", \"output\": [\"562128\"]}, {\"input\": \"69\\r\\n\", \"output\": [\"327984\"]}, {\"input\": \"589\\r\\n\", \"output\": [\"889192\"]}, {\"input\": \"928\\r\\n\", \"output\": [\"794863\"]}, {\"input\": \"696\\r\\n\", \"output\": [\"695035\"]}, {\"input\": \"226\\r\\n\", \"output\": [\"376094\"]}]"} {"prob_desc_description":"For each positive integer n consider the integer \u03c8(n) which is obtained from n by replacing every digit a in the decimal notation of n with the digit (9\u2009\u2009-\u2009\u2009a). We say that \u03c8(n) is the reflection of n. For example, reflection of 192 equals 807. Note that leading zeros (if any) should be omitted. So reflection of 9 equals 0, reflection of 91 equals 8.Let us call the weight of the number the product of the number and its reflection. Thus, the weight of the number 10 is equal to 10\u00b789\u2009=\u2009890.Your task is to find the maximum weight of the numbers in the given range [l,\u2009r] (boundaries are included).","prob_desc_output_spec":"Output should contain single integer number: maximum value of the product n\u00b7\u03c8(n), where l\u2009\u2264\u2009n\u2009\u2264\u2009r. Please, do not use %lld specificator to read or write 64-bit integers in C++. It is preferred to use cout (also you may use %I64d).","lang_cluster":"","src_uid":"2c4b2a162563242cb2f43f6209b59d5e","code_uid":"","lang":"","prob_desc_output_to":"standard output","prob_desc_memory_limit":"256 megabytes","file_name":"prog_syn_val.jsonl","tags":["math"],"prob_desc_created_at":"1306077000","prob_desc_sample_inputs":"[\"3 7\", \"1 1\", \"8 10\"]","prob_desc_notes":"NoteIn the third sample weight of 8 equals 8\u00b71\u2009=\u20098, weight of 9 equals 9\u00b70\u2009=\u20090, weight of 10 equals 890.Thus, maximum value of the product is equal to 890.","exec_outcome":"","difficulty":1600.0,"prob_desc_input_from":"standard input","prob_desc_time_limit":"2 seconds","prob_desc_input_spec":"Input contains two space-separated integers l and r (1\u2009\u2264\u2009l\u2009\u2264\u2009r\u2009\u2264\u2009109) \u2014 bounds of the range.","prob_desc_sample_outputs":"[\"20\", \"8\", \"890\"]","source_code":"","hidden_unit_tests":"[{\"input\": \"3 7\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"1 1\\r\\n\", \"output\": [\"8\"]}, {\"input\": \"8 10\\r\\n\", \"output\": [\"890\"]}, {\"input\": \"4 6\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"10 100\\r\\n\", \"output\": [\"89900\"]}, {\"input\": \"1 999\\r\\n\", \"output\": [\"249500\"]}, {\"input\": \"40 60\\r\\n\", \"output\": [\"2450\"]}, {\"input\": \"66 74\\r\\n\", \"output\": [\"2178\"]}, {\"input\": \"27 71\\r\\n\", \"output\": [\"2450\"]}, {\"input\": \"66 95\\r\\n\", \"output\": [\"2178\"]}, {\"input\": \"48 51\\r\\n\", \"output\": [\"2450\"]}, {\"input\": \"9999999 9999999\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"555555 555555\\r\\n\", \"output\": [\"246913086420\"]}, {\"input\": \"942 572335596\\r\\n\", \"output\": [\"249999999500000000\"]}, {\"input\": \"2331 77424372\\r\\n\", \"output\": [\"2499999950000000\"]}, {\"input\": \"314 592188442\\r\\n\", \"output\": [\"249999999500000000\"]}, {\"input\": \"6277 181089912\\r\\n\", \"output\": [\"148296355590742344\"]}, {\"input\": \"163 306093048\\r\\n\", \"output\": [\"212400093659976648\"]}, {\"input\": \"9265 978077465\\r\\n\", \"output\": [\"249999999500000000\"]}, {\"input\": \"934 300539101\\r\\n\", \"output\": [\"210215349469572698\"]}, {\"input\": \"850 629417171\\r\\n\", \"output\": [\"249999999500000000\"]}, {\"input\": \"9015 34697316\\r\\n\", \"output\": [\"2265827827698828\"]}, {\"input\": \"595 416293084\\r\\n\", \"output\": [\"242993151797475860\"]}, {\"input\": \"3722 867350896\\r\\n\", \"output\": [\"249999999500000000\"]}, {\"input\": \"3019 712663676\\r\\n\", \"output\": [\"249999999500000000\"]}, {\"input\": \"74 25339\\r\\n\", \"output\": [\"1891809740\"]}, {\"input\": \"99 59212\\r\\n\", \"output\": [\"2499950000\"]}, {\"input\": \"90 19714\\r\\n\", \"output\": [\"1582738490\"]}, {\"input\": \"13 43460\\r\\n\", \"output\": [\"2457184940\"]}, {\"input\": \"79 12776\\r\\n\", \"output\": [\"1114361048\"]}, {\"input\": \"93 31801\\r\\n\", \"output\": [\"2168764598\"]}, {\"input\": \"2 36352\\r\\n\", \"output\": [\"2313695744\"]}, {\"input\": \"71990 79486\\r\\n\", \"output\": [\"2016367910\"]}, {\"input\": \"58067 66986\\r\\n\", \"output\": [\"2434865444\"]}, {\"input\": \"29426 33865\\r\\n\", \"output\": [\"2239627910\"]}, {\"input\": \"86189 88384\\r\\n\", \"output\": [\"1190270090\"]}, {\"input\": \"46811 52308\\r\\n\", \"output\": [\"2499950000\"]}, {\"input\": \"960440942 978948770\\r\\n\", \"output\": [\"37994137969711694\"]}, {\"input\": \"366632331 444054372\\r\\n\", \"output\": [\"246870086263631244\"]}, {\"input\": \"291070314 465398755\\r\\n\", \"output\": [\"248802753379051220\"]}, {\"input\": \"880006277 941096188\\r\\n\", \"output\": [\"105595228560592994\"]}, {\"input\": \"191970163 690033048\\r\\n\", \"output\": [\"249999999500000000\"]}, {\"input\": \"916069265 970899369\\r\\n\", \"output\": [\"76886365806290510\"]}, {\"input\": \"609160934 909699101\\r\\n\", \"output\": [\"238083889879086710\"]}, {\"input\": \"21640850 672697171\\r\\n\", \"output\": [\"249999999500000000\"]}, {\"input\": \"645009015 679697316\\r\\n\", \"output\": [\"228972384923720760\"]}, {\"input\": \"862630595 866814866\\r\\n\", \"output\": [\"118499050707315380\"]}, {\"input\": \"51473722 970290896\\r\\n\", \"output\": [\"249999999500000000\"]}, {\"input\": \"578453019 869566694\\r\\n\", \"output\": [\"243845123231332620\"]}, {\"input\": \"484380637 865372184\\r\\n\", \"output\": [\"249999999500000000\"]}, {\"input\": \"541659852 795298538\\r\\n\", \"output\": [\"248264456189678244\"]}, {\"input\": \"491257592 512099550\\r\\n\", \"output\": [\"249999999500000000\"]}, {\"input\": \"796685541 970363166\\r\\n\", \"output\": [\"161977688964851778\"]}, {\"input\": \"733403773 763985558\\r\\n\", \"output\": [\"195522678015960698\"]}, {\"input\": \"19971607 162619978\\r\\n\", \"output\": [\"136174720592659538\"]}, {\"input\": \"446235722 812546691\\r\\n\", \"output\": [\"249999999500000000\"]}, {\"input\": \"885351316 940613198\\r\\n\", \"output\": [\"101504362371716828\"]}, {\"input\": \"578176478 671720904\\r\\n\", \"output\": [\"243888437709339038\"]}, {\"input\": \"380300819 475584338\\r\\n\", \"output\": [\"249403874973517418\"]}, {\"input\": \"419917095 599395901\\r\\n\", \"output\": [\"249999999500000000\"]}, {\"input\": \"1 1000000000\\r\\n\", \"output\": [\"8999999999000000000\"]}, {\"input\": \"9999 100000001\\r\\n\", \"output\": [\"90000000699999998\"]}, {\"input\": \"999999998 999999999\\r\\n\", \"output\": [\"999999998\"]}, {\"input\": \"1000000000 1000000000\\r\\n\", \"output\": [\"8999999999000000000\"]}, {\"input\": \"999999999 1000000000\\r\\n\", \"output\": [\"8999999999000000000\"]}, {\"input\": \"1 2\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"91516955 100003356\\r\\n\", \"output\": [\"90002684688733908\"]}, {\"input\": \"91769999 100006528\\r\\n\", \"output\": [\"90005222257378688\"]}, {\"input\": \"91713375 100004340\\r\\n\", \"output\": [\"90003471881160060\"]}, {\"input\": \"91933994 100016179\\r\\n\", \"output\": [\"90012942838223780\"]}, {\"input\": \"91504334 100015113\\r\\n\", \"output\": [\"90012090071582118\"]}, {\"input\": \"91921683 100018777\\r\\n\", \"output\": [\"90015021147405494\"]}, {\"input\": \"91274316 100009110\\r\\n\", \"output\": [\"90007287816998790\"]}, {\"input\": \"91135741 100003483\\r\\n\", \"output\": [\"90002786287865228\"]}, {\"input\": \"2 2\\r\\n\", \"output\": [\"14\"]}, {\"input\": \"4999 4999\\r\\n\", \"output\": [\"24995000\"]}, {\"input\": \"4999 5000\\r\\n\", \"output\": [\"24995000\"]}, {\"input\": \"5000 5000\\r\\n\", \"output\": [\"24995000\"]}, {\"input\": \"6680315 7297787\\r\\n\", \"output\": [\"22176534820460\"]}, {\"input\": \"400000001 999999998\\r\\n\", \"output\": [\"249999999500000000\"]}, {\"input\": \"100000000 999999999\\r\\n\", \"output\": [\"249999999500000000\"]}, {\"input\": \"1 4\\r\\n\", \"output\": [\"20\"]}, {\"input\": \"999999999 999999999\\r\\n\", \"output\": [\"0\"]}, {\"input\": \"6 7\\r\\n\", \"output\": [\"18\"]}]"}