question
stringlengths
29
1.88k
test_input
listlengths
0
10
test_output
listlengths
0
10
test_time_limit
int64
1
1
test_method
stringclasses
1 value
Dreamoon loves summing up something for no reason. One day he obtains two integers a and b occasionally. He wants to calculate the sum of all nice integers. Positive integer x is called nice if $\operatorname{mod}(x, b) \neq 0$ and $\frac{\operatorname{div}(x, b)}{\operatorname{mod}(x, b)} = k$, where k is some integer number in range [1, a]. By $\operatorname{div}(x, y)$ we denote the quotient of integer division of x and y. By $\operatorname{mod}(x, y)$ we denote the remainder of integer division of x and y. You can read more about these operations here: http://goo.gl/AcsXhT. The answer may be large, so please print its remainder modulo 1 000 000 007 (10^9 + 7). Can you compute it faster than Dreamoon? -----Input----- The single line of the input contains two integers a, b (1 ≤ a, b ≤ 10^7). -----Output----- Print a single integer representing the answer modulo 1 000 000 007 (10^9 + 7). -----Examples----- Input 1 1 Output 0 Input 2 2 Output 8 -----Note----- For the first sample, there are no nice integers because $\operatorname{mod}(x, 1)$ is always zero. For the second sample, the set of nice integers is {3, 5}.
[ "1 1\n", "2 2\n", "4 1\n", "4 2\n", "4 3\n", "4 4\n", "3 4\n", "2 4\n", "1 4\n", "1000 1000\n" ]
[ "0\n", "8\n", "0\n", "24\n", "102\n", "264\n", "162\n", "84\n", "30\n", "247750000\n" ]
1
stdio
Tavak and Seyyed are good friends. Seyyed is very funny and he told Tavak to solve the following problem instead of longest-path. You are given l and r. For all integers from l to r, inclusive, we wrote down all of their integer divisors except 1. Find the integer that we wrote down the maximum number of times. Solve the problem to show that it's not a NP problem. -----Input----- The first line contains two integers l and r (2 ≤ l ≤ r ≤ 10^9). -----Output----- Print single integer, the integer that appears maximum number of times in the divisors. If there are multiple answers, print any of them. -----Examples----- Input 19 29 Output 2 Input 3 6 Output 3 -----Note----- Definition of a divisor: https://www.mathsisfun.com/definitions/divisor-of-an-integer-.html The first example: from 19 to 29 these numbers are divisible by 2: {20, 22, 24, 26, 28}. The second example: from 3 to 6 these numbers are divisible by 3: {3, 6}.
[ "19 29\n", "3 6\n", "39 91\n", "76 134\n", "93 95\n", "17 35\n", "94 95\n", "51 52\n", "47 52\n", "38 98\n" ]
[ "2\n", "2\n", "2\n", "2\n", "2\n", "2\n", "2\n", "2\n", "2\n", "2\n" ]
1
stdio
"QAQ" is a word to denote an expression of crying. Imagine "Q" as eyes with tears and "A" as a mouth. Now Diamond has given Bort a string consisting of only uppercase English letters of length n. There is a great number of "QAQ" in the string (Diamond is so cute!). $8$ illustration by 猫屋 https://twitter.com/nekoyaliu Bort wants to know how many subsequences "QAQ" are in the string Diamond has given. Note that the letters "QAQ" don't have to be consecutive, but the order of letters should be exact. -----Input----- The only line contains a string of length n (1 ≤ n ≤ 100). It's guaranteed that the string only contains uppercase English letters. -----Output----- Print a single integer — the number of subsequences "QAQ" in the string. -----Examples----- Input QAQAQYSYIOIWIN Output 4 Input QAQQQZZYNOIWIN Output 3 -----Note----- In the first example there are 4 subsequences "QAQ": "QAQAQYSYIOIWIN", "QAQAQYSYIOIWIN", "QAQAQYSYIOIWIN", "QAQAQYSYIOIWIN".
[ "QAQAQYSYIOIWIN\n", "QAQQQZZYNOIWIN\n", "QA\n", "IAQVAQZLQBQVQFTQQQADAQJA\n", "QQAAQASGAYAAAAKAKAQIQEAQAIAAIAQQQQQ\n", "AMVFNFJIAVNQJWIVONQOAOOQSNQSONOASONAONQINAONAOIQONANOIQOANOQINAONOQINAONOXJCOIAQOAOQAQAQAQAQWWWAQQAQ\n", "AAQQAXBQQBQQXBNQRJAQKQNAQNQVDQASAGGANQQQQTJFFQQQTQQA\n", "KAZXAVLPJQBQVQQQQQAPAQQGQTQVZQAAAOYA\n", "W\n", "DBA\n" ]
[ "4\n", "3\n", "0\n", "24\n", "378\n", "1077\n", "568\n", "70\n", "0\n", "0\n" ]
1
stdio
The Little Elephant has an integer a, written in the binary notation. He wants to write this number on a piece of paper. To make sure that the number a fits on the piece of paper, the Little Elephant ought to delete exactly one any digit from number a in the binary record. At that a new number appears. It consists of the remaining binary digits, written in the corresponding order (possible, with leading zeroes). The Little Elephant wants the number he is going to write on the paper to be as large as possible. Help him find the maximum number that he can obtain after deleting exactly one binary digit and print it in the binary notation. -----Input----- The single line contains integer a, written in the binary notation without leading zeroes. This number contains more than 1 and at most 10^5 digits. -----Output----- In the single line print the number that is written without leading zeroes in the binary notation — the answer to the problem. -----Examples----- Input 101 Output 11 Input 110010 Output 11010 -----Note----- In the first sample the best strategy is to delete the second digit. That results in number 11_2 = 3_10. In the second sample the best strategy is to delete the third or fourth digits — that results in number 11010_2 = 26_10.
[ "101\n", "110010\n", "10000\n", "1111111110\n", "10100101011110101\n", "111010010111\n", "11110111011100000000\n", "11110010010100001110110101110011110110100111101\n", "1001011111010010100111111\n", "1111111111\n" ]
[ "11\n", "11010\n", "1000\n", "111111111\n", "1100101011110101\n", "11110010111\n", "1111111011100000000\n", "1111010010100001110110101110011110110100111101\n", "101011111010010100111111\n", "111111111\n" ]
1
stdio
It is so boring in the summer holiday, isn't it? So Alice and Bob have invented a new game to play. The rules are as follows. First, they get a set of n distinct integers. And then they take turns to make the following moves. During each move, either Alice or Bob (the player whose turn is the current) can choose two distinct integers x and y from the set, such that the set doesn't contain their absolute difference |x - y|. Then this player adds integer |x - y| to the set (so, the size of the set increases by one). If the current player has no valid move, he (or she) loses the game. The question is who will finally win the game if both players play optimally. Remember that Alice always moves first. -----Input----- The first line contains an integer n (2 ≤ n ≤ 100) — the initial number of elements in the set. The second line contains n distinct space-separated integers a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ 10^9) — the elements of the set. -----Output----- Print a single line with the winner's name. If Alice wins print "Alice", otherwise print "Bob" (without quotes). -----Examples----- Input 2 2 3 Output Alice Input 2 5 3 Output Alice Input 3 5 6 7 Output Bob -----Note----- Consider the first test sample. Alice moves first, and the only move she can do is to choose 2 and 3, then to add 1 to the set. Next Bob moves, there is no valid move anymore, so the winner is Alice.
[ "2\n2 3\n", "2\n5 3\n", "3\n5 6 7\n", "10\n72 96 24 66 6 18 12 30 60 48\n", "10\n78 66 6 60 18 84 36 96 72 48\n", "10\n98 63 42 56 14 77 70 35 84 21\n", "2\n1 1000000000\n", "2\n1000000000 999999999\n", "3\n2 4 6\n", "2\n4 6\n" ]
[ "Alice\n", "Alice\n", "Bob\n", "Bob\n", "Bob\n", "Bob\n", "Bob\n", "Bob\n", "Bob\n", "Alice\n" ]
1
stdio
Limak is a little bear who loves to play. Today he is playing by destroying block towers. He built n towers in a row. The i-th tower is made of h_{i} identical blocks. For clarification see picture for the first sample. Limak will repeat the following operation till everything is destroyed. Block is called internal if it has all four neighbors, i.e. it has each side (top, left, down and right) adjacent to other block or to the floor. Otherwise, block is boundary. In one operation Limak destroys all boundary blocks. His paws are very fast and he destroys all those blocks at the same time. Limak is ready to start. You task is to count how many operations will it take him to destroy all towers. -----Input----- The first line contains single integer n (1 ≤ n ≤ 10^5). The second line contains n space-separated integers h_1, h_2, ..., h_{n} (1 ≤ h_{i} ≤ 10^9) — sizes of towers. -----Output----- Print the number of operations needed to destroy all towers. -----Examples----- Input 6 2 1 4 6 2 2 Output 3 Input 7 3 3 3 1 3 3 3 Output 2 -----Note----- The picture below shows all three operations for the first sample test. Each time boundary blocks are marked with red color. [Image] After first operation there are four blocks left and only one remains after second operation. This last block is destroyed in third operation.
[ "6\n2 1 4 6 2 2\n", "7\n3 3 3 1 3 3 3\n", "7\n5128 5672 5805 5452 5882 5567 5032\n", "10\n1 2 2 3 5 5 5 4 2 1\n", "14\n20 20 20 20 20 20 3 20 20 20 20 20 20 20\n", "50\n3 2 4 3 5 3 4 5 3 2 3 3 3 4 5 4 2 2 3 3 4 4 3 2 3 3 2 3 4 4 5 2 5 2 3 5 4 4 2 2 3 5 2 5 2 2 5 4 5 4\n", "1\n1\n", "1\n1000000000\n", "2\n1 1\n", "2\n1049 1098\n" ]
[ "3\n", "2\n", "4\n", "5\n", "5\n", "4\n", "1\n", "1\n", "1\n", "1\n" ]
1
stdio
Eighth-grader Vova is on duty today in the class. After classes, he went into the office to wash the board, and found on it the number n. He asked what is this number and the teacher of mathematics Inna Petrovna answered Vova that n is the answer to the arithmetic task for first-graders. In the textbook, a certain positive integer x was given. The task was to add x to the sum of the digits of the number x written in decimal numeral system. Since the number n on the board was small, Vova quickly guessed which x could be in the textbook. Now he wants to get a program which will search for arbitrary values of the number n for all suitable values of x or determine that such x does not exist. Write such a program for Vova. -----Input----- The first line contains integer n (1 ≤ n ≤ 10^9). -----Output----- In the first line print one integer k — number of different values of x satisfying the condition. In next k lines print these values in ascending order. -----Examples----- Input 21 Output 1 15 Input 20 Output 0 -----Note----- In the first test case x = 15 there is only one variant: 15 + 1 + 5 = 21. In the second test case there are no such x.
[ "21\n", "20\n", "1\n", "2\n", "3\n", "100000001\n", "1000000000\n", "999999979\n", "9\n", "10\n" ]
[ "1\n15\n", "0\n", "0\n", "1\n1\n", "0\n", "2\n99999937\n100000000\n", "1\n999999932\n", "2\n999999899\n999999908\n", "0\n", "1\n5\n" ]
1
stdio
You are given a non-empty string s consisting of lowercase English letters. You have to pick exactly one non-empty substring of s and shift all its letters 'z' $\rightarrow$ 'y' $\rightarrow$ 'x' $\rightarrow \ldots \rightarrow$ 'b' $\rightarrow$ 'a' $\rightarrow$ 'z'. In other words, each character is replaced with the previous character of English alphabet and 'a' is replaced with 'z'. What is the lexicographically minimum string that can be obtained from s by performing this shift exactly once? -----Input----- The only line of the input contains the string s (1 ≤ |s| ≤ 100 000) consisting of lowercase English letters. -----Output----- Print the lexicographically minimum string that can be obtained from s by shifting letters of exactly one non-empty substring. -----Examples----- Input codeforces Output bncdenqbdr Input abacaba Output aaacaba -----Note----- String s is lexicographically smaller than some other string t of the same length if there exists some 1 ≤ i ≤ |s|, such that s_1 = t_1, s_2 = t_2, ..., s_{i} - 1 = t_{i} - 1, and s_{i} < t_{i}.
[ "codeforces\n", "abacaba\n", "babbbabaababbaa\n", "bcbacaabcababaccccaaaabacbbcbbaa\n", "cabaccaacccabaacdbdcbcdbccbccbabbdadbdcdcdbdbcdcdbdadcbcda\n", "a\n", "eeeedddccbceaabdaecaebaeaecccbdeeeaadcecdbeacecdcdcceabaadbcbbadcdaeddbcccaaeebccecaeeeaebcaaccbdaccbdcadadaaeacbbdcbaeeaecedeeeedadec\n", "fddfbabadaadaddfbfecadfaefaefefabcccdbbeeabcbbddefbafdcafdfcbdffeeaffcaebbbedabddeaecdddffcbeaafffcddccccfffdbcddcfccefafdbeaacbdeeebdeaaacdfdecadfeafaeaefbfdfffeeaefebdceebcebbfeaccfafdccdcecedeedadcadbfefccfdedfaaefabbaeebdebeecaadbebcfeafbfeeefcfaecadfe\n", "aaaaaaaaaa\n", "abbabaaaaa\n" ]
[ "bncdenqbdr\n", "aaacaba\n", "aabbbabaababbaa\n", "abaacaabcababaccccaaaabacbbcbbaa\n", "babaccaacccabaacdbdcbcdbccbccbabbdadbdcdcdbdbcdcdbdadcbcda\n", "z\n", "ddddcccbbabdaabdaecaebaeaecccbdeeeaadcecdbeacecdcdcceabaadbcbbadcdaeddbcccaaeebccecaeeeaebcaaccbdaccbdcadadaaeacbbdcbaeeaecedeeeedadec\n", "ecceaabadaadaddfbfecadfaefaefefabcccdbbeeabcbbddefbafdcafdfcbdffeeaffcaebbbedabddeaecdddffcbeaafffcddccccfffdbcddcfccefafdbeaacbdeeebdeaaacdfdecadfeafaeaefbfdfffeeaefebdceebcebbfeaccfafdccdcecedeedadcadbfefccfdedfaaefabbaeebdebeecaadbebcfeafbfeeefcfaecadfe\n", "aaaaaaaaaz\n", "aaaabaaaaa\n" ]
1
stdio
Ivan wants to make a necklace as a present to his beloved girl. A necklace is a cyclic sequence of beads of different colors. Ivan says that necklace is beautiful relative to the cut point between two adjacent beads, if the chain of beads remaining after this cut is a palindrome (reads the same forward and backward). [Image] Ivan has beads of n colors. He wants to make a necklace, such that it's beautiful relative to as many cuts as possible. He certainly wants to use all the beads. Help him to make the most beautiful necklace. -----Input----- The first line of the input contains a single number n (1 ≤ n ≤ 26) — the number of colors of beads. The second line contains after n positive integers a_{i}   — the quantity of beads of i-th color. It is guaranteed that the sum of a_{i} is at least 2 and does not exceed 100 000. -----Output----- In the first line print a single number — the maximum number of beautiful cuts that a necklace composed from given beads may have. In the second line print any example of such necklace. Each color of the beads should be represented by the corresponding lowercase English letter (starting with a). As the necklace is cyclic, print it starting from any point. -----Examples----- Input 3 4 2 1 Output 1 abacaba Input 1 4 Output 4 aaaa Input 2 1 1 Output 0 ab -----Note----- In the first sample a necklace can have at most one beautiful cut. The example of such a necklace is shown on the picture. In the second sample there is only one way to compose a necklace.
[ "3\n4 2 1\n", "1\n4\n", "2\n1 1\n", "1\n2\n", "1\n3\n", "1\n5\n", "2\n2 2\n", "3\n1 2 4\n", "3\n3 3 3\n", "3\n3 3 6\n" ]
[ "1\naabcbaa\n", "4\naaaa\n", "0\nab\n", "2\naa\n", "3\naaa\n", "5\naaaaa\n", "2\nabba\n", "1\nbccaccb\n", "0\naaabbbccc\n", "0\naaabbbcccccc\n" ]
1
stdio
Students went into a class to write a test and sat in some way. The teacher thought: "Probably they sat in this order to copy works of each other. I need to rearrange them in such a way that students that were neighbors are not neighbors in a new seating." The class can be represented as a matrix with n rows and m columns with a student in each cell. Two students are neighbors if cells in which they sit have a common side. Let's enumerate students from 1 to n·m in order of rows. So a student who initially sits in the cell in row i and column j has a number (i - 1)·m + j. You have to find a matrix with n rows and m columns in which all numbers from 1 to n·m appear exactly once and adjacent numbers in the original matrix are not adjacent in it, or determine that there is no such matrix. -----Input----- The only line contains two integers n and m (1 ≤ n, m ≤ 10^5; n·m ≤ 10^5) — the number of rows and the number of columns in the required matrix. -----Output----- If there is no such matrix, output "NO" (without quotes). Otherwise in the first line output "YES" (without quotes), and in the next n lines output m integers which form the required matrix. -----Examples----- Input 2 4 Output YES 5 4 7 2 3 6 1 8 Input 2 1 Output NO -----Note----- In the first test case the matrix initially looks like this: 1 2 3 4 5 6 7 8 It's easy to see that there are no two students that are adjacent in both matrices. In the second test case there are only two possible seatings and in both of them students with numbers 1 and 2 are neighbors.
[ "2 4\n", "2 1\n", "1 1\n", "1 2\n", "1 3\n", "2 2\n", "2 3\n", "3 1\n", "3 2\n", "3 3\n" ]
[ "YES\n5 4 7 2 \n3 6 1 8 \n", "NO\n", "YES\n1\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "YES\n6 1 8\n7 5 3\n2 9 4\n" ]
1
stdio
We have a string of letters 'a' and 'b'. We want to perform some operations on it. On each step we choose one of substrings "ab" in the string and replace it with the string "bba". If we have no "ab" as a substring, our job is done. Print the minimum number of steps we should perform to make our job done modulo 10^9 + 7. The string "ab" appears as a substring if there is a letter 'b' right after the letter 'a' somewhere in the string. -----Input----- The first line contains the initial string consisting of letters 'a' and 'b' only with length from 1 to 10^6. -----Output----- Print the minimum number of steps modulo 10^9 + 7. -----Examples----- Input ab Output 1 Input aab Output 3 -----Note----- The first example: "ab" → "bba". The second example: "aab" → "abba" → "bbaba" → "bbbbaa".
[ "ab\n", "aab\n", "aaaaabaabababaaaaaba\n", "abaabaaabbabaabab\n", "abbaa\n", "abbaaabaabaaaaabbbbaababaaaaabaabbaaaaabbaabbaaaabbbabbbabb\n", "aababbaaaabbaabbbbbbbbabbababbbaaabbaaabbabbba\n", "aabbaababbabbbaabbaababaaaabbaaaabaaaaaababbaaaabaababbabbbb\n", "aaabaaaabbababbaabbababbbbaaaaaaabbabbba\n", "abbbbababbabbbbbabaabbbaabbbbbbbaaab\n" ]
[ "1\n", "3\n", "17307\n", "1795\n", "2\n", "690283580\n", "2183418\n", "436420225\n", "8431094\n", "8180\n" ]
1
stdio
Sonya was unable to think of a story for this problem, so here comes the formal description. You are given the array containing n positive integers. At one turn you can pick any element and increase or decrease it by 1. The goal is the make the array strictly increasing by making the minimum possible number of operations. You are allowed to change elements in any way, they can become negative or equal to 0. -----Input----- The first line of the input contains a single integer n (1 ≤ n ≤ 3000) — the length of the array. Next line contains n integer a_{i} (1 ≤ a_{i} ≤ 10^9). -----Output----- Print the minimum number of operation required to make the array strictly increasing. -----Examples----- Input 7 2 1 5 11 5 9 11 Output 9 Input 5 5 4 3 2 1 Output 12 -----Note----- In the first sample, the array is going to look as follows: 2 3 5 6 7 9 11 |2 - 2| + |1 - 3| + |5 - 5| + |11 - 6| + |5 - 7| + |9 - 9| + |11 - 11| = 9 And for the second sample: 1 2 3 4 5 |5 - 1| + |4 - 2| + |3 - 3| + |2 - 4| + |1 - 5| = 12
[ "7\n2 1 5 11 5 9 11\n", "5\n5 4 3 2 1\n", "2\n1 1000\n", "2\n1000 1\n", "5\n100 80 60 70 90\n", "10\n10 16 17 11 1213 1216 1216 1209 3061 3062\n", "20\n103 103 110 105 107 119 113 121 116 132 128 124 128 125 138 137 140 136 154 158\n", "1\n1\n", "5\n1 1 1 2 3\n", "1\n1000\n" ]
[ "9\n", "12\n", "0\n", "1000\n", "54\n", "16\n", "43\n", "0\n", "3\n", "0\n" ]
1
stdio
You are given an array $a$ of $n$ integers. You want to make all elements of $a$ equal to zero by doing the following operation exactly three times: Select a segment, for each number in this segment we can add a multiple of $len$ to it, where $len$ is the length of this segment (added integers can be different). It can be proven that it is always possible to make all elements of $a$ equal to zero. -----Input----- The first line contains one integer $n$ ($1 \le n \le 100\,000$): the number of elements of the array. The second line contains $n$ elements of an array $a$ separated by spaces: $a_1, a_2, \dots, a_n$ ($-10^9 \le a_i \le 10^9$). -----Output----- The output should contain six lines representing three operations. For each operation, print two lines: The first line contains two integers $l$, $r$ ($1 \le l \le r \le n$): the bounds of the selected segment. The second line contains $r-l+1$ integers $b_l, b_{l+1}, \dots, b_r$ ($-10^{18} \le b_i \le 10^{18}$): the numbers to add to $a_l, a_{l+1}, \ldots, a_r$, respectively; $b_i$ should be divisible by $r - l + 1$. -----Example----- Input 4 1 3 2 4 Output 1 1 -1 3 4 4 2 2 4 -3 -6 -6
[ "4\n1 3 2 4\n", "1\n34688642\n", "2\n-492673762 -496405053\n", "4\n-432300451 509430974 -600857890 -140418957\n", "16\n-15108237 489260742 681810357 -78861365 -416467743 -896443270 904192296 -932642644 173249302 402207268 -329323498 537696045 -899233426 902347982 -595589754 -480337024\n", "8\n-311553829 469225525 -933496047 -592182543 -29674334 -268378634 -985852520 -225395842\n", "3\n390029247 153996608 -918017777\n", "5\n450402558 -840167367 -231820501 586187125 -627664644\n", "6\n-76959846 -779700294 380306679 -340361999 58979764 -392237502\n", "7\n805743163 -181176136 454376774 681211377 988713965 -599336611 -823748404\n" ]
[ "1 4\n-4 -12 -8 0\n1 3\n3 9 6 \n4 4\n-4\n", "1 1\n-34688642\n1 1\n0\n1 1\n0\n", "1 2\n985347524 0\n1 1\n-492673762 \n2 2\n496405053\n", "1 4\n1729201804 -2037723896 2403431560 0\n1 3\n-1296901353 1528292922 -1802573670 \n4 4\n140418957\n", "1 16\n241731792 -7828171872 -10908965712 1261781840 6663483888 14343092320 -14467076736 14922282304 -2771988832 -6435316288 5269175968 -8603136720 14387734816 -14437567712 9529436064 0\n1 15\n-226623555 7338911130 10227155355 -1182920475 -6247016145 -13446649050 13562884440 -13989639660 2598739530 6033109020 -4939852470 8065440675 -13488501390 13535219730 -8933846310 \n16 16\n480337024\n", "1 8\n2492430632 -3753804200 7467968376 4737460344 237394672 2147029072 7886820160 0\n1 7\n-2180876803 3284578675 -6534472329 -4145277801 -207720338 -1878650438 -6900967640 \n8 8\n225395842\n", "1 3\n-1170087741 -461989824 0\n1 2\n780058494 307993216 \n3 3\n918017777\n", "1 5\n-2252012790 4200836835 1159102505 -2930935625 0\n1 4\n1801610232 -3360669468 -927282004 2344748500 \n5 5\n627664644\n", "1 6\n461759076 4678201764 -2281840074 2042171994 -353878584 0\n1 5\n-384799230 -3898501470 1901533395 -1701809995 294898820 \n6 6\n392237502\n", "1 7\n-5640202141 1268232952 -3180637418 -4768479639 -6920997755 4195356277 0\n1 6\n4834458978 -1087056816 2726260644 4087268262 5932283790 -3596019666 \n7 7\n823748404\n" ]
1
stdio
Little X has n distinct integers: p_1, p_2, ..., p_{n}. He wants to divide all of them into two sets A and B. The following two conditions must be satisfied: If number x belongs to set A, then number a - x must also belong to set A. If number x belongs to set B, then number b - x must also belong to set B. Help Little X divide the numbers into two sets or determine that it's impossible. -----Input----- The first line contains three space-separated integers n, a, b (1 ≤ n ≤ 10^5; 1 ≤ a, b ≤ 10^9). The next line contains n space-separated distinct integers p_1, p_2, ..., p_{n} (1 ≤ p_{i} ≤ 10^9). -----Output----- If there is a way to divide the numbers into two sets, then print "YES" in the first line. Then print n integers: b_1, b_2, ..., b_{n} (b_{i} equals either 0, or 1), describing the division. If b_{i} equals to 0, then p_{i} belongs to set A, otherwise it belongs to set B. If it's impossible, print "NO" (without the quotes). -----Examples----- Input 4 5 9 2 3 4 5 Output YES 0 0 1 1 Input 3 3 4 1 2 4 Output NO -----Note----- It's OK if all the numbers are in the same set, and the other one is empty.
[ "4 5 9\n2 3 4 5\n", "3 3 4\n1 2 4\n", "100 8883 915\n1599 4666 663 3646 754 2113 2200 3884 4082 1640 3795 2564 2711 2766 1122 4525 1779 2678 2816 2182 1028 2337 4918 1273 4141 217 2682 1756 309 4744 915 1351 3302 1367 3046 4032 4503 711 2860 890 2443 4819 4169 4721 3472 2900 239 3551 1977 2420 3361 3035 956 2539 1056 1837 477 1894 1762 1835 3577 2730 950 2960 1004 3293 2401 1271 2388 3950 1908 2804 2011 4952 3075 2507 2992 1883 1591 1095 959 1611 4749 3717 2245 207 814 4862 3525 2371 3277 817 701 574 2964 1278 705 1397 415 2892\n", "53 7311 233\n163 70 172 6330 5670 33 59 7 3432 199 197 3879 145 226 117 26 116 98 981 6054 114 48 36 135 174 185 7249 192 150 11 65 83 62 61 88 7291 222 41 1257 20 6551 119 34 7246 6830 200 760 207 1641 97 118 115 481\n", "70 416035 416023\n70034 70322 345689 345965 345701 70046 345737 345713 70166 345821 70010 345749 345677 345725 69962 345869 70178 70310 345785 69998 70070 69974 70058 346001 70106 345953 70226 70154 345929 69950 70298 346049 70346 345989 70286 69986 345893 70082 70238 345797 70250 345833 70334 345845 70094 70118 70202 345977 70262 70274 70190 345941 346025 345761 345773 70142 70022 70130 345881 345917 70358 345905 345665 346013 346061 345809 345857 346037 346073 70214\n", "1 2 2\n1\n", "1 2 3\n1\n", "2 2 3\n1 2\n", "1 527802320 589732288\n418859112\n", "1 1 1\n1\n" ]
[ "YES\n0 0 1 1\n", "NO\n", "NO\n", "NO\n", "YES\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\n", "YES\n0\n", "YES\n0\n", "YES\n1 1\n", "NO\n", "NO\n" ]
1
stdio
Nikita likes tasks on order statistics, for example, he can easily find the $k$-th number in increasing order on a segment of an array. But now Nikita wonders how many segments of an array there are such that a given number $x$ is the $k$-th number in increasing order on this segment. In other words, you should find the number of segments of a given array such that there are exactly $k$ numbers of this segment which are less than $x$. Nikita wants to get answer for this question for each $k$ from $0$ to $n$, where $n$ is the size of the array. -----Input----- The first line contains two integers $n$ and $x$ $(1 \le n \le 2 \cdot 10^5, -10^9 \le x \le 10^9)$. The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ $(-10^9 \le a_i \le 10^9)$ — the given array. -----Output----- Print $n+1$ integers, where the $i$-th number is the answer for Nikita's question for $k=i-1$. -----Examples----- Input 5 3 1 2 3 4 5 Output 6 5 4 0 0 0 Input 2 6 -5 9 Output 1 2 0 Input 6 99 -1 -1 -1 -1 -1 -1 Output 0 6 5 4 3 2 1
[ "5 3\n1 2 3 4 5\n", "2 6\n-5 9\n", "6 99\n-1 -1 -1 -1 -1 -1\n", "5 -2\n-1 -1 -4 -5 1\n", "5 -6\n-4 2 -7 -1 -5\n", "10 29\n88 57 -3 -9 16 48 -84 80 -73 -46\n", "1 1000000000\n1\n", "2 -1000000000\n465132 210\n", "10 -8\n7 -1 0 -8 8 -1 -10 -7 4 0\n", "10 9\n-2 6 0 -6 7 -8 -5 4 -3 3\n" ]
[ "6 5 4 0 0 0 ", "1 2 0 ", "0 6 5 4 3 2 1 ", "4 5 6 0 0 0 ", "6 9 0 0 0 0 ", "5 13 11 11 8 4 3 0 0 0 0 ", "0 1 ", "3 0 0 ", "27 28 0 0 0 0 0 0 0 0 0 ", "0 10 9 8 7 6 5 4 3 2 1 " ]
1
stdio
When Serezha was three years old, he was given a set of cards with letters for his birthday. They were arranged into words in the way which formed the boy's mother favorite number in binary notation. Serezha started playing with them immediately and shuffled them because he wasn't yet able to read. His father decided to rearrange them. Help him restore the original number, on condition that it was the maximum possible one. -----Input----- The first line contains a single integer $n$ ($1 \leqslant n \leqslant 10^5$) — the length of the string. The second line contains a string consisting of English lowercase letters: 'z', 'e', 'r', 'o' and 'n'. It is guaranteed that it is possible to rearrange the letters in such a way that they form a sequence of words, each being either "zero" which corresponds to the digit $0$ or "one" which corresponds to the digit $1$. -----Output----- Print the maximum possible number in binary notation. Print binary digits separated by a space. The leading zeroes are allowed. -----Examples----- Input 4 ezor Output 0 Input 10 nznooeeoer Output 1 1 0 -----Note----- In the first example, the correct initial ordering is "zero". In the second example, the correct initial ordering is "oneonezero".
[ "4\nezor\n", "10\nnznooeeoer\n", "4\neorz\n", "3\nnoe\n", "40\noeerzzozozzrezeezzzoroozrrreorrreereooeo\n", "32\noeonznzneeononnerooooooeeeneenre\n", "35\nozrorrooeoeeeozonoenzoeoreenzrzenen\n", "30\nooeoeneenneooeennnoeeonnooneno\n", "400\nzzzerrzrzzrozrezooreroeoeezerrzeerooereezeeererrezrororoorrzezoeerrorzrezzrzoerrzorrooerzrzeozrrorzzzzeoeereeroeozezeozoozooereoeorrzoroeoezooeerorreeorezeozeroerezoerooooeerozrrorzozeroereerozeozeoerroroereeeerzzrzeeozrezzozeoooeerzzzorozrzezrrorozezoorzzerzroeeeerorreeoezoeroeeezerrzeorzoeorzoeeororzezrzzorrreozzorzroozzoereorzzroozoreorrrorezzozzzzezorzzrzoooorzzzrrozeezrzzzezzoezeozoooezroozez\n", "356\neeroooreoeoeroenezononnenonrnrzenonooozrznrezonezeeoeezeoroenoezrrrzoeoeooeeeezrrorzrooorrenznoororoozzrezeroerzrnnoreoeoznezrznorznozoozeoneeezerrnronrernzzrneoeroezoorerzrneoeoozerenreeozrneoeozeoeonzernneoeozooeeoezoroeroeorzeeeeooozooorzeeorzreezeezooeeezeooeozreooeoooeoenzrezonrnzoezooeoneneeozrnozooooeoeozreezerzooroooernzneozzznnezeneennerzereonee\n" ]
[ "0 \n", "1 1 0 \n", "0 \n", "1 \n", "0 0 0 0 0 0 0 0 0 0 \n", "1 1 1 1 1 1 1 1 0 0 \n", "1 1 1 1 1 0 0 0 0 0 \n", "1 1 1 1 1 1 1 1 1 1 \n", "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \n", "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \n" ]
1
stdio
Permutation p is an ordered set of integers p_1, p_2, ..., p_{n}, consisting of n distinct positive integers not larger than n. We'll denote as n the length of permutation p_1, p_2, ..., p_{n}. Your task is to find such permutation p of length n, that the group of numbers |p_1 - p_2|, |p_2 - p_3|, ..., |p_{n} - 1 - p_{n}| has exactly k distinct elements. -----Input----- The single line of the input contains two space-separated positive integers n, k (1 ≤ k < n ≤ 10^5). -----Output----- Print n integers forming the permutation. If there are multiple answers, print any of them. -----Examples----- Input 3 2 Output 1 3 2 Input 3 1 Output 1 2 3 Input 5 2 Output 1 3 2 4 5 -----Note----- By |x| we denote the absolute value of number x.
[ "3 2\n", "3 1\n", "5 2\n", "5 4\n", "10 4\n", "10 3\n", "10 9\n", "2 1\n", "4 1\n", "4 2\n" ]
[ "1 3 2\n", "1 2 3\n", "1 3 2 4 5\n", "1 5 2 4 3\n", "1 10 2 9 8 7 6 5 4 3\n", "1 10 2 3 4 5 6 7 8 9\n", "1 10 2 9 3 8 4 7 5 6\n", "1 2\n", "1 2 3 4\n", "1 4 3 2\n" ]
1
stdio
Little Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya is wondering in how many ways he can choose three distinct points so that the distance between the two farthest of them doesn't exceed d. Note that the order of the points inside the group of three chosen points doesn't matter. -----Input----- The first line contains two integers: n and d (1 ≤ n ≤ 10^5; 1 ≤ d ≤ 10^9). The next line contains n integers x_1, x_2, ..., x_{n}, their absolute value doesn't exceed 10^9 — the x-coordinates of the points that Petya has got. It is guaranteed that the coordinates of the points in the input strictly increase. -----Output----- Print a single integer — the number of groups of three points, where the distance between two farthest points doesn't exceed d. Please do not use the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier. -----Examples----- Input 4 3 1 2 3 4 Output 4 Input 4 2 -3 -2 -1 0 Output 2 Input 5 19 1 10 20 30 50 Output 1 -----Note----- In the first sample any group of three points meets our conditions. In the seconds sample only 2 groups of three points meet our conditions: {-3, -2, -1} and {-2, -1, 0}. In the third sample only one group does: {1, 10, 20}.
[ "4 3\n1 2 3 4\n", "4 2\n-3 -2 -1 0\n", "5 19\n1 10 20 30 50\n", "10 5\n31 36 43 47 48 50 56 69 71 86\n", "10 50\n1 4 20 27 65 79 82 83 99 100\n", "10 90\n24 27 40 41 61 69 73 87 95 97\n", "100 100\n-98 -97 -96 -93 -92 -91 -90 -87 -86 -84 -81 -80 -79 -78 -76 -75 -73 -71 -69 -67 -65 -64 -63 -62 -61 -54 -51 -50 -49 -48 -46 -45 -44 -37 -36 -33 -30 -28 -27 -16 -15 -13 -12 -10 -9 -7 -6 -5 -4 2 3 5 8 9 10 11 13 14 15 16 17 19 22 24 25 26 27 28 30 31 32 36 40 43 45 46 47 50 51 52 53 58 60 63 69 70 73 78 80 81 82 85 88 89 90 91 95 96 97 99\n", "1 14751211\n847188590\n", "2 1000000000\n-907894512 -289906312\n", "2 1000000000\n-14348867 1760823\n" ]
[ "4\n", "2\n", "1\n", "2\n", "25\n", "120\n", "79351\n", "0\n", "0\n", "0\n" ]
1
stdio
Mike is the president of country What-The-Fatherland. There are n bears living in this country besides Mike. All of them are standing in a line and they are numbered from 1 to n from left to right. i-th bear is exactly a_{i} feet high. [Image] A group of bears is a non-empty contiguous segment of the line. The size of a group is the number of bears in that group. The strength of a group is the minimum height of the bear in that group. Mike is a curious to know for each x such that 1 ≤ x ≤ n the maximum strength among all groups of size x. -----Input----- The first line of input contains integer n (1 ≤ n ≤ 2 × 10^5), the number of bears. The second line contains n integers separated by space, a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ 10^9), heights of bears. -----Output----- Print n integers in one line. For each x from 1 to n, print the maximum strength among all groups of size x. -----Examples----- Input 10 1 2 3 4 5 4 3 2 1 6 Output 6 4 4 3 3 2 2 1 1 1
[ "10\n1 2 3 4 5 4 3 2 1 6\n", "3\n524125987 923264237 374288891\n", "5\n585325539 365329221 412106895 291882089 564718673\n", "20\n452405440 586588704 509061481 552472140 16115810 148658854 66743034 628305150 677780684 519361360 208050516 401554301 954478790 346543678 387546138 832279893 641889899 80960260 717802881 588066499\n", "1\n1376\n", "2\n10 10\n", "2\n10 9\n", "3\n1 2 3\n", "3\n1 3 2\n", "10\n802030518 598196518 640274071 983359971 71550121 96204862 799843967 446173607 796619138 402690754\n" ]
[ "6 4 4 3 3 2 2 1 1 1 \n", "923264237 524125987 374288891 \n", "585325539 365329221 365329221 291882089 291882089 \n", "954478790 641889899 519361360 452405440 346543678 346543678 208050516 208050516 208050516 208050516 80960260 80960260 80960260 66743034 66743034 16115810 16115810 16115810 16115810 16115810 \n", "1376 \n", "10 10 \n", "10 9 \n", "3 2 1 \n", "3 2 1 \n", "983359971 640274071 598196518 598196518 96204862 71550121 71550121 71550121 71550121 71550121 \n" ]
1
stdio
Kyoya Ootori has a bag with n colored balls that are colored with k different colors. The colors are labeled from 1 to k. Balls of the same color are indistinguishable. He draws balls from the bag one by one until the bag is empty. He noticed that he drew the last ball of color i before drawing the last ball of color i + 1 for all i from 1 to k - 1. Now he wonders how many different ways this can happen. -----Input----- The first line of input will have one integer k (1 ≤ k ≤ 1000) the number of colors. Then, k lines will follow. The i-th line will contain c_{i}, the number of balls of the i-th color (1 ≤ c_{i} ≤ 1000). The total number of balls doesn't exceed 1000. -----Output----- A single integer, the number of ways that Kyoya can draw the balls from the bag as described in the statement, modulo 1 000 000 007. -----Examples----- Input 3 2 2 1 Output 3 Input 4 1 2 3 4 Output 1680 -----Note----- In the first sample, we have 2 balls of color 1, 2 balls of color 2, and 1 ball of color 3. The three ways for Kyoya are: 1 2 1 2 3 1 1 2 2 3 2 1 1 2 3
[ "3\n2\n2\n1\n", "4\n1\n2\n3\n4\n", "10\n100\n100\n100\n100\n100\n100\n100\n100\n100\n100\n", "5\n10\n10\n10\n10\n10\n", "11\n291\n381\n126\n39\n19\n20\n3\n1\n20\n45\n2\n", "1\n1\n", "13\n67\n75\n76\n80\n69\n86\n75\n86\n81\n84\n73\n72\n76\n", "25\n35\n43\n38\n33\n47\n44\n40\n36\n41\n42\n33\n30\n49\n42\n62\n39\n40\n35\n43\n31\n42\n46\n42\n34\n33\n", "47\n20\n21\n16\n18\n24\n20\n25\n13\n20\n22\n26\n24\n17\n18\n21\n22\n21\n23\n17\n15\n24\n19\n18\n21\n20\n19\n26\n25\n20\n17\n17\n17\n26\n32\n20\n21\n25\n28\n24\n21\n21\n17\n28\n20\n20\n31\n19\n", "3\n343\n317\n337\n" ]
[ "3\n", "1680\n", "12520708\n", "425711769\n", "902382672\n", "1\n", "232242896\n", "362689152\n", "295545118\n", "691446102\n" ]
1
stdio
Hamed has recently found a string t and suddenly became quite fond of it. He spent several days trying to find all occurrences of t in other strings he had. Finally he became tired and started thinking about the following problem. Given a string s how many ways are there to extract k ≥ 1 non-overlapping substrings from it such that each of them contains string t as a substring? More formally, you need to calculate the number of ways to choose two sequences a_1, a_2, ..., a_{k} and b_1, b_2, ..., b_{k} satisfying the following requirements: k ≥ 1 $\forall i(1 \leq i \leq k) 1 \leq a_{i}, b_{i} \leq|s|$ $\forall i(1 \leq i \leq k) b_{i} \geq a_{i}$ $\forall i(2 \leq i \leq k) a_{i} > b_{i - 1}$ $\forall i(1 \leq i \leq k)$  t is a substring of string s_{a}_{i}s_{a}_{i} + 1... s_{b}_{i} (string s is considered as 1-indexed). As the number of ways can be rather large print it modulo 10^9 + 7. -----Input----- Input consists of two lines containing strings s and t (1 ≤ |s|, |t| ≤ 10^5). Each string consists of lowercase Latin letters. -----Output----- Print the answer in a single line. -----Examples----- Input ababa aba Output 5 Input welcometoroundtwohundredandeightytwo d Output 274201 Input ddd d Output 12
[ "ababa\naba\n", "welcometoroundtwohundredandeightytwo\nd\n", "ddd\nd\n", "vnssnssnssnssnssnssnssnssnssnssnssnssnssnssnssnssn\nnssnssns\n", "kpjmawawawawawawawawawawawawawawawawawawawawawawaw\nwawawawa\n", "vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\nvvvvvvvv\n", "a\na\n", "a\naa\n", "a\nb\n", "ababababab\nabab\n" ]
[ "5\n", "274201\n", "12\n", "943392\n", "834052\n", "2728075\n", "1\n", "0\n", "0\n", "35\n" ]
1
stdio
You are given several queries. Each query consists of three integers $p$, $q$ and $b$. You need to answer whether the result of $p/q$ in notation with base $b$ is a finite fraction. A fraction in notation with base $b$ is finite if it contains finite number of numerals after the decimal point. It is also possible that a fraction has zero numerals after the decimal point. -----Input----- The first line contains a single integer $n$ ($1 \le n \le 10^5$) — the number of queries. Next $n$ lines contain queries, one per line. Each line contains three integers $p$, $q$, and $b$ ($0 \le p \le 10^{18}$, $1 \le q \le 10^{18}$, $2 \le b \le 10^{18}$). All numbers are given in notation with base $10$. -----Output----- For each question, in a separate line, print Finite if the fraction is finite and Infinite otherwise. -----Examples----- Input 2 6 12 10 4 3 10 Output Finite Infinite Input 4 1 1 2 9 36 2 4 12 3 3 5 4 Output Finite Finite Finite Infinite -----Note----- $\frac{6}{12} = \frac{1}{2} = 0,5_{10}$ $\frac{4}{3} = 1,(3)_{10}$ $\frac{9}{36} = \frac{1}{4} = 0,01_2$ $\frac{4}{12} = \frac{1}{3} = 0,1_3$
[ "2\n6 12 10\n4 3 10\n", "4\n1 1 2\n9 36 2\n4 12 3\n3 5 4\n", "10\n10 5 3\n1 7 10\n7 5 7\n4 4 9\n6 5 2\n6 7 5\n9 9 7\n7 5 5\n6 6 4\n10 8 2\n", "10\n1 3 10\n6 2 6\n2 3 9\n7 8 4\n5 6 10\n1 2 7\n0 3 6\n9 3 4\n4 4 9\n10 9 10\n", "10\n10 8 5\n0 6 9\n0 7 6\n5 7 3\n7 6 8\n0 4 8\n2 6 3\n10 2 9\n6 7 9\n9 1 4\n", "10\n5 8 2\n0 5 8\n5 9 7\n0 7 2\n6 7 2\n10 3 7\n8 1 10\n9 1 8\n0 7 10\n9 1 4\n", "1\n1 864691128455135232 2\n", "11\n1 1000000000000000000 10000000\n2 999 9\n2 999 333111\n0 9 7\n17 128 2\n13 311992186885373952 18\n1971402979058461 750473176484995605 75\n14 19 23\n3 21914624432020321 23\n3 21914624432020321 46\n3 21914624432020321 47\n", "1\n1 100000000000000000 10000000000000000\n", "1\n1 4294967297 4294967296\n" ]
[ "Finite\nInfinite\n", "Finite\nFinite\nFinite\nInfinite\n", "Finite\nInfinite\nInfinite\nFinite\nInfinite\nInfinite\nFinite\nFinite\nFinite\nFinite\n", "Infinite\nFinite\nFinite\nFinite\nInfinite\nInfinite\nFinite\nFinite\nFinite\nInfinite\n", "Infinite\nFinite\nFinite\nInfinite\nInfinite\nFinite\nFinite\nFinite\nInfinite\nFinite\n", "Finite\nFinite\nInfinite\nFinite\nInfinite\nInfinite\nFinite\nFinite\nFinite\nFinite\n", "Infinite\n", "Finite\nInfinite\nFinite\nFinite\nFinite\nFinite\nFinite\nInfinite\nFinite\nFinite\nInfinite\n", "Finite\n", "Infinite\n" ]
1
stdio
You are given a set of size $m$ with integer elements between $0$ and $2^{n}-1$ inclusive. Let's build an undirected graph on these integers in the following way: connect two integers $x$ and $y$ with an edge if and only if $x \& y = 0$. Here $\&$ is the bitwise AND operation. Count the number of connected components in that graph. -----Input----- In the first line of input there are two integers $n$ and $m$ ($0 \le n \le 22$, $1 \le m \le 2^{n}$). In the second line there are $m$ integers $a_1, a_2, \ldots, a_m$ ($0 \le a_{i} < 2^{n}$) — the elements of the set. All $a_{i}$ are distinct. -----Output----- Print the number of connected components. -----Examples----- Input 2 3 1 2 3 Output 2 Input 5 5 5 19 10 20 12 Output 2 -----Note----- Graph from first sample: $0$ Graph from second sample: [Image]
[ "2 3\n1 2 3\n", "5 5\n5 19 10 20 12\n", "3 5\n3 5 0 6 7\n", "0 1\n0\n", "1 1\n1\n", "1 1\n0\n", "6 30\n3 8 13 16 18 19 21 22 24 25 26 28 29 31 33 42 44 46 49 50 51 53 54 57 58 59 60 61 62 63\n", "6 35\n5 7 10 11 13 14 17 18 25 27 28 29 30 31 33 35 36 37 39 40 41 43 46 47 50 52 55 56 57 58 59 60 61 62 63\n", "6 22\n21 23 26 28 31 35 38 39 41 42 44 45 47 50 51 52 54 55 56 59 62 63\n", "6 19\n15 23 27 29 30 31 43 46 47 51 53 55 57 58 59 60 61 62 63\n" ]
[ "2\n", "2\n", "1\n", "1\n", "1\n", "1\n", "10\n", "13\n", "20\n", "19\n" ]
1
stdio
In order to fly to the Moon Mister B just needs to solve the following problem. There is a complete indirected graph with n vertices. You need to cover it with several simple cycles of length 3 and 4 so that each edge is in exactly 2 cycles. We are sure that Mister B will solve the problem soon and will fly to the Moon. Will you? -----Input----- The only line contains single integer n (3 ≤ n ≤ 300). -----Output----- If there is no answer, print -1. Otherwise, in the first line print k (1 ≤ k ≤ n^2) — the number of cycles in your solution. In each of the next k lines print description of one cycle in the following format: first print integer m (3 ≤ m ≤ 4) — the length of the cycle, then print m integers v_1, v_2, ..., v_{m} (1 ≤ v_{i} ≤ n) — the vertices in the cycle in the traverse order. Each edge should be in exactly two cycles. -----Examples----- Input 3 Output 2 3 1 2 3 3 1 2 3 Input 5 Output 6 3 5 4 2 3 3 1 5 4 4 5 2 3 4 4 3 2 1 3 4 2 1 3 3 1 5
[ "3\n", "5\n", "4\n", "5\n", "6\n", "7\n", "8\n", "9\n", "10\n", "11\n" ]
[ "2\n3 1 2 3\n3 1 2 3\n", "6\n3 1 2 3\n3 2 3 4\n3 3 4 5\n3 4 5 1\n4 2 1 3 5\n4 5 1 4 2\n", "4\n3 4 1 2\n3 2 3 4\n3 1 2 3\n3 3 4 1\n", "6\n3 1 2 3\n3 2 3 4\n3 3 4 5\n3 4 5 1\n4 2 1 3 5\n4 5 1 4 2\n", "9\n3 6 1 2\n4 6 2 5 3\n3 3 4 5\n3 1 2 3\n4 1 3 6 4\n3 4 5 6\n3 2 3 4\n4 2 4 1 5\n3 5 6 1\n", "12\n4 2 3 1 4\n4 3 4 2 5\n4 4 5 3 6\n4 5 6 4 7\n4 6 7 5 1\n4 7 1 6 2\n3 2 5 6\n3 1 5 4\n3 3 6 7\n3 7 4 3\n3 3 2 1\n3 7 1 2\n", "16\n3 8 1 2\n4 8 2 7 3\n4 7 3 6 4\n3 4 5 6\n3 1 2 3\n4 1 3 8 4\n4 8 4 7 5\n3 5 6 7\n3 2 3 4\n4 2 4 1 5\n4 1 5 8 6\n3 6 7 8\n3 3 4 5\n4 3 5 2 6\n4 2 6 1 7\n3 7 8 1\n", "20\n3 1 2 3\n4 1 3 9 4\n3 2 3 4\n4 2 4 1 5\n3 3 4 5\n4 3 5 2 6\n3 4 5 6\n4 4 6 3 7\n3 5 6 7\n4 5 7 4 8\n3 6 7 8\n4 6 8 5 9\n3 7 8 9\n4 7 9 6 1\n3 8 9 1\n4 8 1 7 2\n4 2 1 5 9\n4 9 1 6 2\n4 3 9 4 8\n4 8 2 7 3\n", "25\n3 10 1 2\n4 10 2 9 3\n4 9 3 8 4\n4 8 4 7 5\n3 5 6 7\n3 1 2 3\n4 1 3 10 4\n4 10 4 9 5\n4 9 5 8 6\n3 6 7 8\n3 2 3 4\n4 2 4 1 5\n4 1 5 10 6\n4 10 6 9 7\n3 7 8 9\n3 3 4 5\n4 3 5 2 6\n4 2 6 1 7\n4 1 7 10 8\n3 8 9 10\n3 4 5 6\n4 4 6 3 7\n4 3 7 2 8\n4 2 8 1 9\n3 9 10 1\n", "30\n4 2 3 1 4\n4 1 4 11 5\n4 3 4 2 5\n4 2 5 1 6\n4 4 5 3 6\n4 3 6 2 7\n4 5 6 4 7\n4 4 7 3 8\n4 6 7 5 8\n4 5 8 4 9\n4 7 8 6 9\n4 6 9 5 10\n4 8 9 7 10\n4 7 10 6 11\n4 9 10 8 11\n4 8 11 7 1\n4 10 11 9 1\n4 9 1 8 2\n4 11 1 10 2\n4 10 2 9 3\n3 2 7 8\n3 1 7 6\n3 3 8 9\n3 11 6 5\n3 4 9 10\n3 10 5 4\n3 3 2 1\n3 11 1 2\n3 4 3 11\n3 10 11 3\n" ]
1
stdio
Jon Snow is on the lookout for some orbs required to defeat the white walkers. There are k different types of orbs and he needs at least one of each. One orb spawns daily at the base of a Weirwood tree north of the wall. The probability of this orb being of any kind is equal. As the north of wall is full of dangers, he wants to know the minimum number of days he should wait before sending a ranger to collect the orbs such that the probability of him getting at least one of each kind of orb is at least $\frac{p_{i} - \epsilon}{2000}$, where ε < 10^{ - 7}. To better prepare himself, he wants to know the answer for q different values of p_{i}. Since he is busy designing the battle strategy with Sam, he asks you for your help. -----Input----- First line consists of two space separated integers k, q (1 ≤ k, q ≤ 1000) — number of different kinds of orbs and number of queries respectively. Each of the next q lines contain a single integer p_{i} (1 ≤ p_{i} ≤ 1000) — i-th query. -----Output----- Output q lines. On i-th of them output single integer — answer for i-th query. -----Examples----- Input 1 1 1 Output 1 Input 2 2 1 2 Output 2 2
[ "1 1\n1\n", "2 2\n1\n2\n", "3 5\n1\n4\n20\n50\n300\n", "4 5\n2\n4\n30\n100\n1000\n", "5 6\n1\n2\n3\n4\n5\n6\n", "6 6\n10\n20\n30\n40\n50\n60\n", "990 1\n990\n", "7 10\n100\n200\n300\n400\n500\n600\n700\n800\n900\n1000\n", "8 10\n50\n150\n250\n350\n450\n550\n650\n750\n850\n950\n", "1 1\n1000\n" ]
[ "1\n", "2\n2\n", "3\n3\n3\n3\n3\n", "4\n4\n4\n4\n7\n", "5\n5\n5\n5\n5\n5\n", "6\n6\n6\n7\n7\n7\n", "7177\n", "9\n10\n11\n12\n13\n14\n14\n15\n16\n17\n", "10\n12\n13\n14\n15\n16\n17\n18\n19\n19\n", "1\n" ]
1
stdio
Consider a sequence [a_1, a_2, ... , a_{n}]. Define its prefix product sequence $[ a_{1} \operatorname{mod} n,(a_{1} a_{2}) \operatorname{mod} n, \cdots,(a_{1} a_{2} \cdots a_{n}) \operatorname{mod} n ]$. Now given n, find a permutation of [1, 2, ..., n], such that its prefix product sequence is a permutation of [0, 1, ..., n - 1]. -----Input----- The only input line contains an integer n (1 ≤ n ≤ 10^5). -----Output----- In the first output line, print "YES" if such sequence exists, or print "NO" if no such sequence exists. If any solution exists, you should output n more lines. i-th line contains only an integer a_{i}. The elements of the sequence should be different positive integers no larger than n. If there are multiple solutions, you are allowed to print any of them. -----Examples----- Input 7 Output YES 1 4 3 6 5 2 7 Input 6 Output NO -----Note----- For the second sample, there are no valid sequences.
[ "7\n", "6\n", "7137\n", "1941\n", "55004\n", "1\n", "2\n", "3\n", "4\n", "5\n" ]
[ "YES\n1\n2\n5\n6\n3\n4\n7\n", "NO\n", "NO\n", "NO\n", "NO\n", "YES\n1\n", "YES\n1\n2\n", "YES\n1\n2\n3\n", "YES\n1\n3\n2\n4", "YES\n1\n2\n4\n3\n5\n" ]
1
stdio
You are given a prime number $p$, $n$ integers $a_1, a_2, \ldots, a_n$, and an integer $k$. Find the number of pairs of indexes $(i, j)$ ($1 \le i < j \le n$) for which $(a_i + a_j)(a_i^2 + a_j^2) \equiv k \bmod p$. -----Input----- The first line contains integers $n, p, k$ ($2 \le n \le 3 \cdot 10^5$, $2 \le p \le 10^9$, $0 \le k \le p-1$). $p$ is guaranteed to be prime. The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($0 \le a_i \le p-1$). It is guaranteed that all elements are different. -----Output----- Output a single integer — answer to the problem. -----Examples----- Input 3 3 0 0 1 2 Output 1 Input 6 7 2 1 2 3 4 5 6 Output 3 -----Note----- In the first example: $(0+1)(0^2 + 1^2) = 1 \equiv 1 \bmod 3$. $(0+2)(0^2 + 2^2) = 8 \equiv 2 \bmod 3$. $(1+2)(1^2 + 2^2) = 15 \equiv 0 \bmod 3$. So only $1$ pair satisfies the condition. In the second example, there are $3$ such pairs: $(1, 5)$, $(2, 3)$, $(4, 6)$.
[ "3 3 0\n0 1 2\n", "6 7 2\n1 2 3 4 5 6\n", "5 5 3\n3 0 4 1 2\n", "7 7 3\n4 0 5 3 1 2 6\n", "2 2 1\n1 0\n", "3 3 0\n0 2 1\n", "2 2 0\n1 0\n", "3 3 1\n0 2 1\n", "3 3 2\n0 1 2\n" ]
[ "1", "3", "1", "0", "1", "1", "0", "1", "1" ]
1
stdio
Let's assume that v(n) is the largest prime number, that does not exceed n; u(n) is the smallest prime number strictly greater than n. Find $\sum_{i = 2}^{n} \frac{1}{v(i) u(i)}$. -----Input----- The first line contains integer t (1 ≤ t ≤ 500) — the number of testscases. Each of the following t lines of the input contains integer n (2 ≤ n ≤ 10^9). -----Output----- Print t lines: the i-th of them must contain the answer to the i-th test as an irreducible fraction "p/q", where p, q are integers, q > 0. -----Examples----- Input 2 2 3 Output 1/6 7/30
[ "2\n2\n3\n", "1\n1000000000\n", "5\n3\n6\n9\n10\n5\n", "5\n5\n8\n18\n17\n17\n", "5\n7\n40\n37\n25\n4\n", "5\n72\n72\n30\n75\n11\n", "5\n79\n149\n136\n194\n124\n", "6\n885\n419\n821\n635\n63\n480\n", "1\n649580447\n" ]
[ "1/6\n7/30\n", "999999941999999673/1999999887999999118\n", "7/30\n5/14\n61/154\n9/22\n23/70\n", "23/70\n59/154\n17/38\n287/646\n287/646\n", "57/154\n39/82\n1437/3034\n615/1334\n3/10\n", "71/146\n71/146\n29/62\n5615/11534\n119/286\n", "6393/13114\n22199/44998\n135/274\n37631/76042\n14121/28702\n", "781453/1566442\n175559/352798\n674039/1351366\n403199/808942\n3959/8174\n232303/466546\n", "421954771415489597/843909545429301074\n" ]
1
stdio
Jzzhu has picked n apples from his big apple tree. All the apples are numbered from 1 to n. Now he wants to sell them to an apple store. Jzzhu will pack his apples into groups and then sell them. Each group must contain two apples, and the greatest common divisor of numbers of the apples in each group must be greater than 1. Of course, each apple can be part of at most one group. Jzzhu wonders how to get the maximum possible number of groups. Can you help him? -----Input----- A single integer n (1 ≤ n ≤ 10^5), the number of the apples. -----Output----- The first line must contain a single integer m, representing the maximum number of groups he can get. Each of the next m lines must contain two integers — the numbers of apples in the current group. If there are several optimal answers you can print any of them. -----Examples----- Input 6 Output 2 6 3 2 4 Input 9 Output 3 9 3 2 4 6 8 Input 2 Output 0
[ "6\n", "9\n", "2\n", "10\n", "100\n", "1\n", "3\n", "5\n" ]
[ "2\n6 3\n2 4\n", "3\n9 3\n2 4\n6 8\n", "0\n", "4\n2 4\n6 8\n10 5\n9 3\n", "44\n33 27\n22 11\n25 5\n64 66\n42 44\n31 62\n58 29\n43 86\n15 21\n6 99\n8 12\n85 65\n7 49\n23 46\n16 14\n20 18\n90 92\n48 50\n40 36\n74 37\n35 55\n10 95\n56 60\n47 94\n45 39\n93 87\n88 84\n72 76\n28 24\n75 81\n78 80\n54 52\n38 19\n3 9\n32 30\n91 77\n70 68\n63 69\n2 4\n57 51\n82 41\n17 34\n13 26\n96 98\n", "0\n", "0\n", "1\n2 4\n" ]
1
stdio
You are given a sequence a consisting of n integers. Find the maximum possible value of $a_{i} \operatorname{mod} a_{j}$ (integer remainder of a_{i} divided by a_{j}), where 1 ≤ i, j ≤ n and a_{i} ≥ a_{j}. -----Input----- The first line contains integer n — the length of the sequence (1 ≤ n ≤ 2·10^5). The second line contains n space-separated integers a_{i} (1 ≤ a_{i} ≤ 10^6). -----Output----- Print the answer to the problem. -----Examples----- Input 3 3 4 5 Output 2
[ "3\n3 4 5\n", "3\n1 2 4\n", "1\n1\n", "1\n1000000\n", "2\n1000000 999999\n", "12\n4 4 10 13 28 30 41 43 58 61 70 88\n", "7\n2 13 22 32 72 91 96\n", "5\n5 11 12 109 110\n" ]
[ "2\n", "0\n", "0\n", "0\n", "1\n", "30\n", "27\n", "10\n" ]
1
stdio
You are given a string S of length n with each character being one of the first m lowercase English letters. Calculate how many different strings T of length n composed from the first m lowercase English letters exist such that the length of LCS (longest common subsequence) between S and T is n - 1. Recall that LCS of two strings S and T is the longest string C such that C both in S and T as a subsequence. -----Input----- The first line contains two numbers n and m denoting the length of string S and number of first English lowercase characters forming the character set for strings (1 ≤ n ≤ 100 000, 2 ≤ m ≤ 26). The second line contains string S. -----Output----- Print the only line containing the answer. -----Examples----- Input 3 3 aaa Output 6 Input 3 3 aab Output 11 Input 1 2 a Output 1 Input 10 9 abacadefgh Output 789 -----Note----- For the first sample, the 6 possible strings T are: aab, aac, aba, aca, baa, caa. For the second sample, the 11 possible strings T are: aaa, aac, aba, abb, abc, aca, acb, baa, bab, caa, cab. For the third sample, the only possible string T is b.
[ "3 3\naaa\n", "3 3\naab\n", "1 2\na\n", "10 9\nabacadefgh\n", "15 3\nabababababababa\n", "100 26\njysrixyptvsesnapfljeqkytlpeepjopspmkviqdqbdkylvfiawhdjjdvqqvcjmmsgfdmpjwahuwhgsyfcgnefzmqlvtvqqfbfsf\n", "1 26\nz\n" ]
[ "6\n", "11\n", "1\n", "789\n", "345\n", "237400\n", "25\n" ]
1
stdio
You are given a sequence a = \{a_1, ..., a_N\} with all zeros, and a sequence b = \{b_1, ..., b_N\} consisting of 0 and 1. The length of both is N. You can perform Q kinds of operations. The i-th operation is as follows: - Replace each of a_{l_i}, a_{l_i + 1}, ..., a_{r_i} with 1. Minimize the hamming distance between a and b, that is, the number of i such that a_i \neq b_i, by performing some of the Q operations. -----Constraints----- - 1 \leq N \leq 200,000 - b consists of 0 and 1. - 1 \leq Q \leq 200,000 - 1 \leq l_i \leq r_i \leq N - If i \neq j, either l_i \neq l_j or r_i \neq r_j. -----Input----- Input is given from Standard Input in the following format: N b_1 b_2 ... b_N Q l_1 r_1 l_2 r_2 : l_Q r_Q -----Output----- Print the minimum possible hamming distance. -----Sample Input----- 3 1 0 1 1 1 3 -----Sample Output----- 1 If you choose to perform the operation, a will become \{1, 1, 1\}, for a hamming distance of 1.
[ "3\n1 0 1\n1\n1 3\n", "3\n1 0 1\n2\n1 1\n3 3\n", "3\n1 0 1\n2\n1 1\n2 3\n", "5\n0 1 0 1 0\n1\n1 5\n", "9\n0 1 0 1 1 1 0 1 0\n3\n1 4\n5 8\n6 7\n", "15\n1 1 0 0 0 0 0 0 1 0 1 1 1 0 0\n9\n4 10\n13 14\n1 7\n4 14\n9 11\n2 6\n7 8\n3 12\n7 13\n", "10\n0 0 0 1 0 0 1 1 1 0\n7\n1 4\n2 5\n1 3\n6 7\n9 9\n1 5\n7 9\n" ]
[ "1\n", "0\n", "1\n", "2\n", "3\n", "5\n", "1\n" ]
1
stdio
Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he named XORinacci numbers. He defined them as follows: $f(0) = a$; $f(1) = b$; $f(n) = f(n-1) \oplus f(n-2)$ when $n > 1$, where $\oplus$ denotes the bitwise XOR operation. You are given three integers $a$, $b$, and $n$, calculate $f(n)$. You have to answer for $T$ independent test cases. -----Input----- The input contains one or more independent test cases. The first line of input contains a single integer $T$ ($1 \le T \le 10^3$), the number of test cases. Each of the $T$ following lines contains three space-separated integers $a$, $b$, and $n$ ($0 \le a, b, n \le 10^9$) respectively. -----Output----- For each test case, output $f(n)$. -----Example----- Input 3 3 4 2 4 5 0 325 265 1231232 Output 7 4 76 -----Note----- In the first example, $f(2) = f(0) \oplus f(1) = 3 \oplus 4 = 7$.
[ "3\n3 4 2\n4 5 0\n325 265 1231232\n", "10\n0 0 1000000000\n1002 2003 36523\n233 5656 898989\n0 2352 0\n21132 23256 2323256\n12313 454878 11000\n1213 0 21\n11 1 1\n1 1 98532\n1000000000 1000000000 1000000000\n", "1\n25369 85223 58963241\n", "2\n168342 440469 517112\n841620 806560 140538\n", "10\n669924290 408119795 804030560\n663737793 250734602 29671646\n431160679 146708815 289491233\n189259304 606497663 379372476\n707829111 49504411 81710658\n54555019 65618101 626948607\n578351356 288589794 974275296\n400531973 205638174 323247740\n219131617 178762989 799964854\n825160173 502080627 608216046\n", "1\n1 2 3\n" ]
[ "7\n4\n76\n", "0\n2003\n233\n0\n2132\n442567\n1213\n1\n1\n1000000000\n", "77822\n", "272643\n841620\n", "1069371953\n696139211\n286024744\n189259304\n707829111\n54555019\n578351356\n463366171\n178762989\n825160173\n", "1\n" ]
1
stdio
The country has n cities and n - 1 bidirectional roads, it is possible to get from every city to any other one if you move only along the roads. The cities are numbered with integers from 1 to n inclusive. All the roads are initially bad, but the government wants to improve the state of some roads. We will assume that the citizens are happy about road improvement if the path from the capital located in city x to any other city contains at most one bad road. Your task is — for every possible x determine the number of ways of improving the quality of some roads in order to meet the citizens' condition. As those values can be rather large, you need to print each value modulo 1 000 000 007 (10^9 + 7). -----Input----- The first line of the input contains a single integer n (2 ≤ n ≤ 2·10^5) — the number of cities in the country. Next line contains n - 1 positive integers p_2, p_3, p_4, ..., p_{n} (1 ≤ p_{i} ≤ i - 1) — the description of the roads in the country. Number p_{i} means that the country has a road connecting city p_{i} and city i. -----Output----- Print n integers a_1, a_2, ..., a_{n}, where a_{i} is the sought number of ways to improve the quality of the roads modulo 1 000 000 007 (10^9 + 7), if the capital of the country is at city number i. -----Examples----- Input 3 1 1 Output 4 3 3 Input 5 1 2 3 4 Output 5 8 9 8 5
[ "3\n1 1\n", "5\n1 2 3 4\n", "31\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "29\n1 2 2 4 4 6 6 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28\n", "2\n1\n", "3\n1 2\n" ]
[ "4 3 3", "5 8 9 8 5", "73741817 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913 536870913", "191 380 191 470 236 506 254 506 504 500 494 486 476 464 450 434 416 396 374 350 324 296 266 234 200 164 126 86 44", "2 2", "3 4 3" ]
1
stdio
For strings s and t, we will say that s and t are prefix-free when neither is a prefix of the other. Let L be a positive integer. A set of strings S is a good string set when the following conditions hold true: - Each string in S has a length between 1 and L (inclusive) and consists of the characters 0 and 1. - Any two distinct strings in S are prefix-free. We have a good string set S = \{ s_1, s_2, ..., s_N \}. Alice and Bob will play a game against each other. They will alternately perform the following operation, starting from Alice: - Add a new string to S. After addition, S must still be a good string set. The first player who becomes unable to perform the operation loses the game. Determine the winner of the game when both players play optimally. -----Constraints----- - 1 \leq N \leq 10^5 - 1 \leq L \leq 10^{18} - s_1, s_2, ..., s_N are all distinct. - { s_1, s_2, ..., s_N } is a good string set. - |s_1| + |s_2| + ... + |s_N| \leq 10^5 -----Input----- Input is given from Standard Input in the following format: N L s_1 s_2 : s_N -----Output----- If Alice will win, print Alice; if Bob will win, print Bob. -----Sample Input----- 2 2 00 01 -----Sample Output----- Alice If Alice adds 1, Bob will be unable to add a new string.
[ "2 2\n00\n01\n", "2 2\n00\n11\n", "3 3\n0\n10\n110\n", "2 1\n0\n1\n", "1 2\n11\n", "2 3\n101\n11\n" ]
[ "Alice\n", "Bob\n", "Alice\n", "Bob\n", "Alice\n", "Bob\n" ]
1
stdio
A bracket sequence is a string containing only characters "(" and ")". A regular bracket sequence is a bracket sequence that can be transformed into a correct arithmetic expression by inserting characters "1" and "+" between the original characters of the sequence. For example, bracket sequences "()()" and "(())" are regular (the resulting expressions are: "(1)+(1)" and "((1+1)+1)"), and ")(", "(" and ")" are not. Subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements. You are given a regular bracket sequence $s$ and an integer number $k$. Your task is to find a regular bracket sequence of length exactly $k$ such that it is also a subsequence of $s$. It is guaranteed that such sequence always exists. -----Input----- The first line contains two integers $n$ and $k$ ($2 \le k \le n \le 2 \cdot 10^5$, both $n$ and $k$ are even) — the length of $s$ and the length of the sequence you are asked to find. The second line is a string $s$ — regular bracket sequence of length $n$. -----Output----- Print a single string — a regular bracket sequence of length exactly $k$ such that it is also a subsequence of $s$. It is guaranteed that such sequence always exists. -----Examples----- Input 6 4 ()(()) Output ()() Input 8 8 (()(())) Output (()(()))
[ "6 4\n()(())\n", "8 8\n(()(()))\n", "20 10\n((()))()((()()(())))\n", "40 30\n((((((((()()()))))))))((())((()())))(())\n", "2 2\n()\n" ]
[ "()()\n", "(()(()))\n", "((()))()()\n", "((((((((()()()))))))))(())()()\n", "()\n" ]
1
stdio
The Bubble Cup hypothesis stood unsolved for $130$ years. Who ever proves the hypothesis will be regarded as one of the greatest mathematicians of our time! A famous mathematician Jerry Mao managed to reduce the hypothesis to this problem: Given a number $m$, how many polynomials $P$ with coefficients in set ${\{0,1,2,3,4,5,6,7\}}$ have: $P(2)=m$? Help Jerry Mao solve the long standing problem! -----Input----- The first line contains a single integer $t$ $(1 \leq t \leq 5\cdot 10^5)$ - number of test cases. On next line there are $t$ numbers, $m_i$ $(1 \leq m_i \leq 10^{18})$ - meaning that in case $i$ you should solve for number $m_i$. -----Output----- For each test case $i$, print the answer on separate lines: number of polynomials $P$ as described in statement such that $P(2)=m_i$, modulo $10^9 + 7$. -----Example----- Input 2 2 4 Output 2 4 -----Note----- In first case, for $m=2$, polynomials that satisfy the constraint are $x$ and $2$. In second case, for $m=4$, polynomials that satisfy the constraint are $x^2$, $x + 2$, $2x$ and $4$.
[ "2\n2 4\n", "1\n9\n", "5\n4 1 8 3 9\n", "6\n8 7 8 6 8 9\n", "8\n1 1 7 6 1 5 8 7\n", "7\n9 6 3 1 3 1 7\n", "3\n9 2 8\n", "5\n3 7 3 4 7\n", "5\n4 8 3 2 6\n", "5\n2 7 4 8 3\n" ]
[ "2\n4\n", "9\n", "4\n1\n9\n2\n9\n", "9\n6\n9\n6\n9\n9\n", "1\n1\n6\n6\n1\n4\n9\n6\n", "9\n6\n2\n1\n2\n1\n6\n", "9\n2\n9\n", "2\n6\n2\n4\n6\n", "4\n9\n2\n2\n6\n", "2\n6\n4\n9\n2\n" ]
1
stdio
Let's denote as $\text{popcount}(x)$ the number of bits set ('1' bits) in the binary representation of the non-negative integer x. You are given multiple queries consisting of pairs of integers l and r. For each query, find the x, such that l ≤ x ≤ r, and $\text{popcount}(x)$ is maximum possible. If there are multiple such numbers find the smallest of them. -----Input----- The first line contains integer n — the number of queries (1 ≤ n ≤ 10000). Each of the following n lines contain two integers l_{i}, r_{i} — the arguments for the corresponding query (0 ≤ l_{i} ≤ r_{i} ≤ 10^18). -----Output----- For each query print the answer in a separate line. -----Examples----- Input 3 1 2 2 4 1 10 Output 1 3 7 -----Note----- The binary representations of numbers from 1 to 10 are listed below: 1_10 = 1_2 2_10 = 10_2 3_10 = 11_2 4_10 = 100_2 5_10 = 101_2 6_10 = 110_2 7_10 = 111_2 8_10 = 1000_2 9_10 = 1001_2 10_10 = 1010_2
[ "3\n1 2\n2 4\n1 10\n", "55\n1 1\n1 2\n1 3\n1 4\n1 5\n1 6\n1 7\n1 8\n1 9\n1 10\n2 2\n2 3\n2 4\n2 5\n2 6\n2 7\n2 8\n2 9\n2 10\n3 3\n3 4\n3 5\n3 6\n3 7\n3 8\n3 9\n3 10\n4 4\n4 5\n4 6\n4 7\n4 8\n4 9\n4 10\n5 5\n5 6\n5 7\n5 8\n5 9\n5 10\n6 6\n6 7\n6 8\n6 9\n6 10\n7 7\n7 8\n7 9\n7 10\n8 8\n8 9\n8 10\n9 9\n9 10\n10 10\n", "18\n1 10\n1 100\n1 1000\n1 10000\n1 100000\n1 1000000\n1 10000000\n1 100000000\n1 1000000000\n1 10000000000\n1 100000000000\n1 1000000000000\n1 10000000000000\n1 100000000000000\n1 1000000000000000\n1 10000000000000000\n1 100000000000000000\n1 1000000000000000000\n", "3\n0 0\n1 3\n2 4\n", "17\n0 0\n0 8\n1 8\n36 39\n3 4\n3 7\n2 17\n8 12\n9 12\n10 12\n10 15\n6 14\n8 15\n9 15\n15 15\n100000000000000000 1000000000000000000\n99999999999999999 1000000000000000000\n" ]
[ "1\n3\n7\n", "1\n1\n3\n3\n3\n3\n7\n7\n7\n7\n2\n3\n3\n3\n3\n7\n7\n7\n7\n3\n3\n3\n3\n7\n7\n7\n7\n4\n5\n5\n7\n7\n7\n7\n5\n5\n7\n7\n7\n7\n6\n7\n7\n7\n7\n7\n7\n7\n7\n8\n9\n9\n9\n9\n10\n", "7\n63\n511\n8191\n65535\n524287\n8388607\n67108863\n536870911\n8589934591\n68719476735\n549755813887\n8796093022207\n70368744177663\n562949953421311\n9007199254740991\n72057594037927935\n576460752303423487\n", "0\n3\n3\n", "0\n7\n7\n39\n3\n7\n15\n11\n11\n11\n15\n7\n15\n15\n15\n576460752303423487\n576460752303423487\n" ]
1
stdio
AtCoDeer the deer found N rectangle lying on the table, each with height 1. If we consider the surface of the desk as a two-dimensional plane, the i-th rectangle i(1≤i≤N) covers the vertical range of [i-1,i] and the horizontal range of [l_i,r_i], as shown in the following figure: AtCoDeer will move these rectangles horizontally so that all the rectangles are connected. For each rectangle, the cost to move it horizontally by a distance of x, is x. Find the minimum cost to achieve connectivity. It can be proved that this value is always an integer under the constraints of the problem. -----Constraints----- - All input values are integers. - 1≤N≤10^5 - 1≤l_i<r_i≤10^9 -----Partial Score----- - 300 points will be awarded for passing the test set satisfying 1≤N≤400 and 1≤l_i<r_i≤400. -----Input----- The input is given from Standard Input in the following format: N l_1 r_1 l_2 r_2 : l_N r_N -----Output----- Print the minimum cost to achieve connectivity. -----Sample Input----- 3 1 3 5 7 1 3 -----Sample Output----- 2 The second rectangle should be moved to the left by a distance of 2.
[ "3\n1 3\n5 7\n1 3\n", "3\n2 5\n4 6\n1 4\n", "5\n999999999 1000000000\n1 2\n314 315\n500000 500001\n999999999 1000000000\n", "5\n123456 789012\n123 456\n12 345678901\n123456 789012\n1 23\n", "1\n1 400\n" ]
[ "2\n", "0\n", "1999999680\n", "246433\n", "0\n" ]
1
stdio
In number world, two different numbers are friends if they have a lot in common, but also each one has unique perks. More precisely, two different numbers $a$ and $b$ are friends if $gcd(a,b)$, $\frac{a}{gcd(a,b)}$, $\frac{b}{gcd(a,b)}$ can form sides of a triangle. Three numbers $a$, $b$ and $c$ can form sides of a triangle if $a + b > c$, $b + c > a$ and $c + a > b$. In a group of numbers, a number is lonely if it doesn't have any friends in that group. Given a group of numbers containing all numbers from $1, 2, 3, ..., n$, how many numbers in that group are lonely? -----Input----- The first line contains a single integer $t$ $(1 \leq t \leq 10^6)$ - number of test cases. On next line there are $t$ numbers, $n_i$ $(1 \leq n_i \leq 10^6)$ - meaning that in case $i$ you should solve for numbers $1, 2, 3, ..., n_i$. -----Output----- For each test case, print the answer on separate lines: number of lonely numbers in group $1, 2, 3, ..., n_i$. -----Example----- Input 3 1 5 10 Output 1 3 3 -----Note----- For first test case, $1$ is the only number and therefore lonely. For second test case where $n=5$, numbers $1$, $3$ and $5$ are lonely. For third test case where $n=10$, numbers $1$, $5$ and $7$ are lonely.
[ "3\n1 5 10\n", "6\n12 432 21 199 7 1\n", "7\n1 10 100 1000 10000 100000 1000000\n", "100\n42 486 341 527 189 740 490 388 989 489 711 174 305 844 971 492 998 954 832 442 424 619 906 154 293 395 439 735 738 915 453 748 786 550 871 932 693 326 53 904 732 835 354 364 691 669 157 719 282 875 573 672 695 790 58 872 732 751 557 779 329 39 213 844 289 137 50 951 284 671 474 829 906 736 395 366 22 133 418 552 649 636 109 974 775 852 971 384 945 335 961 472 651 335 543 560 135 85 952 558\n", "100\n838 147 644 688 727 940 991 309 705 409 27 774 951 92 277 835 804 589 103 529 11 304 171 655 378 792 679 590 36 65 378 152 958 746 980 434 139 222 26 349 473 300 781 394 960 918 242 768 246 607 429 971 534 44 430 198 901 624 781 657 428 366 652 558 570 490 623 46 606 375 302 867 384 32 601 46 376 223 688 509 290 739 54 2 445 966 907 792 146 468 732 908 673 506 825 424 325 624 836 524\n", "100\n324 624 954 469 621 255 536 588 821 334 231 20 850 642 5 735 199 506 97 358 554 589 344 513 456 226 472 625 601 816 813 297 609 819 38 185 493 646 557 305 45 204 209 687 966 198 835 911 176 523 219 637 297 76 349 669 389 891 894 462 899 163 868 418 903 31 333 670 32 705 561 505 920 414 81 723 603 513 25 896 879 703 415 799 271 440 8 596 207 296 116 458 646 781 842 963 174 157 747 207\n", "100\n996 361 371 721 447 566 438 566 449 522 176 79 740 757 156 436 296 23 704 542 572 455 886 962 194 219 301 437 315 122 513 299 468 760 133 713 348 692 792 276 318 380 217 74 913 819 834 966 318 784 350 578 670 11 482 149 220 243 137 164 541 471 185 477 57 681 319 466 271 45 181 540 750 670 200 322 479 51 171 33 806 915 976 399 213 629 504 419 324 850 364 900 397 180 845 99 495 326 526 186\n", "100\n791 303 765 671 210 999 106 489 243 635 807 104 558 628 545 926 35 3 75 196 35 460 523 621 748 45 501 143 240 318 78 908 207 369 436 6 285 200 236 864 731 786 915 672 293 563 141 708 698 646 48 128 603 716 681 329 389 489 683 616 875 510 20 493 141 176 803 106 92 928 20 762 203 336 586 258 56 781 172 115 890 104 595 491 607 489 628 653 635 960 449 549 909 977 124 621 741 275 206 558\n" ]
[ "1\n3\n3\n", "4\n76\n7\n41\n4\n1\n", "1\n3\n22\n158\n1205\n9528\n78331\n", "11\n85\n62\n92\n37\n123\n86\n69\n156\n86\n119\n35\n56\n137\n154\n87\n158\n153\n137\n78\n75\n106\n145\n32\n56\n70\n78\n122\n122\n147\n80\n124\n129\n93\n141\n149\n117\n60\n13\n145\n121\n137\n65\n65\n117\n113\n33\n120\n55\n141\n97\n113\n117\n130\n13\n141\n121\n125\n94\n129\n60\n10\n42\n137\n55\n29\n12\n152\n56\n113\n84\n137\n145\n122\n70\n65\n7\n28\n73\n93\n110\n107\n26\n154\n129\n137\n154\n69\n151\n61\n152\n84\n110\n61\n92\n94\n28\n20\n152\n94\n", "137\n30\n109\n116\n121\n150\n157\n57\n118\n73\n7\n129\n152\n21\n54\n137\n131\n99\n24\n91\n4\n56\n34\n111\n67\n130\n115\n99\n9\n15\n67\n32\n153\n124\n155\n77\n30\n42\n7\n64\n84\n56\n129\n70\n153\n147\n48\n127\n48\n103\n75\n154\n91\n12\n75\n40\n145\n106\n129\n111\n75\n65\n110\n94\n96\n86\n106\n12\n102\n67\n56\n141\n69\n9\n102\n12\n67\n43\n116\n90\n55\n123\n13\n2\n79\n152\n146\n130\n30\n84\n121\n146\n114\n89\n135\n75\n60\n106\n137\n92\n", "60\n106\n153\n84\n106\n49\n91\n99\n134\n61\n45\n7\n137\n108\n3\n122\n41\n89\n22\n65\n93\n99\n62\n90\n80\n43\n84\n106\n102\n133\n133\n56\n103\n133\n10\n37\n87\n109\n94\n56\n12\n41\n41\n116\n152\n40\n137\n147\n35\n92\n42\n107\n56\n18\n64\n113\n70\n145\n145\n82\n145\n34\n141\n73\n145\n9\n61\n113\n9\n118\n94\n89\n148\n73\n19\n120\n102\n90\n7\n145\n142\n118\n73\n131\n53\n78\n4\n100\n41\n56\n27\n81\n109\n129\n137\n152\n35\n33\n124\n41\n", "157\n65\n66\n120\n79\n95\n77\n95\n80\n91\n35\n19\n123\n126\n32\n77\n56\n8\n118\n92\n97\n80\n144\n152\n39\n42\n56\n77\n59\n26\n90\n56\n84\n126\n28\n119\n63\n117\n130\n53\n60\n68\n42\n18\n147\n133\n137\n152\n60\n129\n64\n98\n113\n4\n85\n31\n42\n48\n29\n34\n92\n84\n37\n84\n13\n115\n60\n83\n53\n12\n37\n91\n124\n113\n41\n60\n85\n12\n34\n9\n131\n147\n154\n71\n42\n106\n89\n74\n60\n137\n65\n145\n71\n36\n137\n22\n87\n60\n92\n37\n", "130\n56\n127\n113\n41\n158\n24\n86\n48\n107\n131\n24\n94\n106\n92\n148\n9\n3\n18\n39\n9\n81\n92\n106\n124\n12\n88\n30\n47\n60\n18\n146\n41\n66\n77\n3\n56\n41\n46\n141\n121\n129\n147\n113\n56\n95\n30\n118\n117\n109\n13\n27\n102\n119\n115\n60\n70\n86\n116\n104\n141\n90\n7\n87\n30\n35\n131\n24\n21\n148\n7\n127\n41\n61\n98\n50\n13\n129\n34\n27\n145\n24\n100\n87\n103\n86\n106\n111\n107\n153\n80\n93\n146\n155\n26\n106\n123\n53\n41\n94\n" ]
1
stdio
You are given an array a with n distinct integers. Construct an array b by permuting a such that for every non-empty subset of indices S = {x_1, x_2, ..., x_{k}} (1 ≤ x_{i} ≤ n, 0 < k < n) the sums of elements on that positions in a and b are different, i. e. $\sum_{i = 1}^{k} a_{x_{i}} \neq \sum_{i = 1}^{k} b_{x_{i}}$ -----Input----- The first line contains one integer n (1 ≤ n ≤ 22) — the size of the array. The second line contains n space-separated distinct integers a_1, a_2, ..., a_{n} (0 ≤ a_{i} ≤ 10^9) — the elements of the array. -----Output----- If there is no such array b, print -1. Otherwise in the only line print n space-separated integers b_1, b_2, ..., b_{n}. Note that b must be a permutation of a. If there are multiple answers, print any of them. -----Examples----- Input 2 1 2 Output 2 1 Input 4 1000 100 10 1 Output 100 1 1000 10 -----Note----- An array x is a permutation of y, if we can shuffle elements of y such that it will coincide with x. Note that the empty subset and the subset containing all indices are not counted.
[ "2\n1 2\n", "4\n1000 100 10 1\n", "5\n1 3 4 5 2\n", "1\n10000000\n", "4\n1 5 8 4\n", "3\n1 3 2\n", "4\n3 1 2 4\n", "12\n7 1 62 12 3 5 8 9 10 22 23 0\n", "17\n1 3 2 5 4 6 7 8 10 9 13 11 12 14 15 16 18\n", "22\n1 3 5 7 22 2 4 6 8 9 10 11 12 13 15 14 17 18 16 20 19 23\n" ]
[ "2 1 \n", "100 1 1000 10\n", "5 2 3 4 1 \n", "10000000 \n", "8 4 5 1 \n", "3 2 1 \n", "2 4 1 3 \n", "5 0 23 10 1 3 7 8 9 12 22 62 \n", "18 2 1 4 3 5 6 7 9 8 12 10 11 13 14 15 16 \n", "23 2 4 6 20 1 3 5 7 8 9 10 11 12 14 13 16 17 15 19 18 22 \n" ]
1
stdio
On the xy-plane, Snuke is going to travel from the point (x_s, y_s) to the point (x_t, y_t). He can move in arbitrary directions with speed 1. Here, we will consider him as a point without size. There are N circular barriers deployed on the plane. The center and the radius of the i-th barrier are (x_i, y_i) and r_i, respectively. The barriers may overlap or contain each other. A point on the plane is exposed to cosmic rays if the point is not within any of the barriers. Snuke wants to avoid exposure to cosmic rays as much as possible during the travel. Find the minimum possible duration of time he is exposed to cosmic rays during the travel. -----Constraints----- - All input values are integers. - -10^9 ≤ x_s, y_s, x_t, y_t ≤ 10^9 - (x_s, y_s) ≠ (x_t, y_t) - 1≤N≤1,000 - -10^9 ≤ x_i, y_i ≤ 10^9 - 1 ≤ r_i ≤ 10^9 -----Input----- The input is given from Standard Input in the following format: x_s y_s x_t y_t N x_1 y_1 r_1 x_2 y_2 r_2 : x_N y_N r_N -----Output----- Print the minimum possible duration of time Snuke is exposed to cosmic rays during the travel. The output is considered correct if the absolute or relative error is at most 10^{-9}. -----Sample Input----- -2 -2 2 2 1 0 0 1 -----Sample Output----- 3.6568542495 An optimal route is as follows:
[ "-2 -2 2 2\n1\n0 0 1\n", "-2 0 2 0\n2\n-1 0 2\n1 0 2\n", "4 -2 -2 4\n3\n0 0 2\n4 0 1\n0 4 1\n", "-1000000000 -1000000000 1000000000 1000000000\n1\n-1000000000 1000000000 1\n", "-1000000000 -1000000000 1000000000 1000000000\n1\n0 0 1\n", "-79535040 915543494 814343766 427961683\n983\n793251728 432429299 2120563\n-291936102 -325010318 7917793\n416428083 -200944474 10082482\n-224743329 -457313601 2070861\n-570440332 452521003 18352874\n-619985225 -347246640 19119473\n-887191929 798586548 12964271\n410596752 -880081363 16644023\n-467811837 212745374 10573566\n445272068 527759371 6025157\n-969070274 -699523685 18767080\n477602994 611511598 1475822\n-411446061 482274811 11917965\n800043400 105296131 1160276\n-146197779 786463552 3021753\n773778450 334072626 5762668\n981237097 -287406663 21935010\n-475753634 575296890 24569050\n756064501 -339460888 12889399\n560332785 -535822896 12818045\n-595961128 1815473 9318198\n-468118414 601169093 13960007\n224959100 809279069 37019868\n788605314 45374792 14506962\n367993191 -871828657 1608119\n-313073910 -755802754 1288115\n485824841 274088487 4783923\n-684427042 -369982665 32566561\n83257689 677211312 66139980\n-500515301 -91340071 806064\n316139755 238877505 2659005\n947695313 -513657389 571394\n372809612 -685940725 18359407\n40909458 447395535 2972877\n-857474191 143672974 418663\n499167345 -235461053 8012888\n338374217 266338407 34171531\n-111750709 -641020778 7231553\n401012433 596016354 23752586\n480359207 503277806 9569378\n757792579 -183869829 20657391\n285633423 -517341127 4219322\n251406331 363126094 20249137\n-233665515 -705846130 6301291\n-32408744 464816489 2342119\n-35622241 163857680 3524417\n874140713 -608956110 6072500\n-179040086 -203334837 2135099\n-80879546 206103512 1290025\n280055502 -411475505 4534495\n-561607883 824700791 5469607\n729010463 -737494958 8986769\n632274051 -298792196 4353557\n-769907715 958827440 2478821\n641633374 894640468 28813867\n-453917990 -810155440 3405182\n2009801 768713736 26985740\n393357048 -182111573 14351038\n552500790 385553385 14917562\n-689480409 -596043117 16381371\n450034636 -585684196 2580446\n270109509 813475569 14147149\n-803654014 -842742590 18258665\n443479361 -651501059 7366259\n-514248036 -462481180 9758271\n-795207539 -895271090 3860131\n55817965 -776374235 1136673\n909965183 -159685005 20123280\n-957457611 -651985111 363594\n-435844028 993295126 15833936\n931878174 -717213674 2933367\n-647319657 13709991 6690476\n-794446313 -570881885 9409885\n370694748 -976569742 2021124\n529646901 145587538 1541018\n-178364629 884210145 7783414\n-70273822 684455358 18097030\n503004982 150122766 7995196\n-1085085 430457168 1473783\n-212668378 -843471369 4244300\n-974629336 -764221312 8792449\n-745895158 6199445 4976629\n155780877 108403759 32455961\n-117942971 171275450 4880351\n-286578545 -58293489 6414384\n-412420559 -52426377 15744221\n-830280434 -269364801 9899324\n727863013 648632274 5354416\n-784530100 -816404624 10963592\n-635643386 221371708 1220822\n285574863 136779913 612849\n124398915 -672415674 6416752\n-649695736 -41936142 3292493\n-431224879 -970665621 11708877\n264784240 -575324414 1300332\n-258323500 205143031 17055881\n-250938594 -493798947 8244674\n-586126146 746853299 16122845\n538740260 -615502482 12603381\n424992445 775503882 12224328\n630057728 881820094 25448022\n147962216 -145175428 23424278\n771588157 -869270054 8035470\n530000726 928554448 29647\n871808656 -857176149 3300348\n986758942 802205861 5690971\n764267120 -909157562 11808461\n72804049 -613546285 9166079\n195591534 276832665 78643\n-545489960 451951275 13952834\n831847973 683716069 907850\n-167315643 -691393768 11052626\n563517493 -149307809 16983096\n949189264 466145655 34991684\n189424792 115100066 4793090\n-948967927 225991809 15782118\n-887181430 -199103677 18310929\n15653849 -900651154 5769391\n-328962707 637754505 21063000\n908840143 -237550564 56207\n498543736 -342957163 14676571\n694022473 -112129464 13695654\n-417615060 -831735055 7866301\n-76646060 -534307307 6645304\n702880419 14297450 27190009\n107940823 -225614692 17951156\n-865442434 -468016500 3203230\n-227610738 129099318 1387151\n163471303 270114187 35172136\n-289959262 -738346694 14484312\n129055141 -938051891 1896335\n-750748558 112618548 10230816\n212972981 733322107 10200936\n-442778032 761296687 3589824\n953889404 535224867 8338511\n926980115 127802975 3772323\n-671732500 283553671 10916933\n-372624185 -13684256 299391\n-671416641 -94330076 9190275\n281453467 713199479 11697028\n543146645 353719783 9004121\n-900336771 -706683962 3873882\n541335077 -774730445 7773417\n-11153466 841120779 8494684\n133997536 -490457636 3838987\n650801962 410382679 27302457\n270393681 478407774 3561448\n825833834 -399724141 305414\n414998942 644346685 30941319\n-950990812 -913499796 2109686\n676011459 683498508 25562233\n-473092099 -278219191 3014932\n-805421968 -226840160 16905183\n-18967007 558778391 27392691\n641827838 683051768 6612071\n779123263 -411784507 10325886\n-806299487 -209074050 36255980\n168102674 511280973 28716745\n-525674839 -935680413 27605040\n-271071926 -848221955 36331690\n-178698641 -195200184 1565540\n-843002094 158907111 19730750\n526498322 -614399668 2008518\n-691628630 255662669 3033709\n496238249 -665410335 12259939\n797602853 -586625863 2361209\n707935433 -620402812 1599734\n-856027806 -46291054 4646637\n573262291 -285066957 17914802\n953528889 50866526 740912\n804522171 -353299073 5594521\n-48612114 -102248232 8119804\n518378638 -772350739 5839865\n-852831624 157991246 12241233\n-463424087 909982870 11389742\n-705349571 -457374934 6091427\n-927506062 818025020 31783820\n-649589228 -54996041 4439998\n89278959 -436837029 16429951\n-394765042 283483442 15077927\n-99312059 291252655 1935039\n-819386337 -623963300 9229015\n-297708559 839185878 2729054\n-774037280 773253631 16164952\n372396385 -921988166 5322091\n-623793279 -163649160 3668413\n476230200 497003626 5955109\n307479028 206705130 15777547\n-421769452 822503124 19626870\n102661077 657389998 31991030\n125040809 -19651623 13063357\n393905185 -388592353 5599252\n170216017 -632369896 10225669\n368444696 233913227 11461106\n384716998 92355404 3996605\n620242828 -450328171 21674854\n938041696 -459662838 3079856\n280771907 902984718 38712960\n-312186873 -278035346 1015675\n155233577 540412284 3229354\n239767911 -874579031 758357\n721057566 -172678903 27162706\n467069021 -822428330 2281931\n396607000 100056452 3206505\n-781152164 563853438 1517753\n-549206106 -326955694 9024009\n362274500 -744576512 47003250\n556243585 301403590 16469195\n964942216 -553907381 3509456\n-283905264 -335810426 16978217\n-456818147 484259408 18861690\n410976734 325586261 8331325\n888781791 -674066801 10473849\n-251806589 506432838 17202156\n-520457956 -222840769 3307755\n451918768 -136269360 20625481\n311354562 232559023 22835299\n-442933873 -294513304 16399709\n804227615 -118298639 1517206\n797816632 149305758 4385066\n191094404 -200526990 721718\n515662993 507491510 1081163\n738888062 679169090 2997474\n881916596 485103509 589401\n-525282261 962832112 5605712\n497909030 119440867 15991493\n-513405924 -790353691 6788042\n-534031804 627715245 29166936\n758056021 49481853 25010550\n249154771 -410232395 1452669\n548931948 -726963040 11557184\n-547295229 -952117527 1334032\n-159732683 -692097075 5992778\n252962264 292824916 4838064\n570830514 -145446245 3037039\n857917491 231916257 11400539\n-630766338 196532156 2579483\n953733275 529895309 29018575\n746004742 -60113681 3727700\n-970246842 635057501 401199\n-855481280 -859256230 6990846\n-672762933 610586969 4641467\n870721922 778357600 7559062\n-874740342 -624395428 3052296\n-868227921 903582091 67877\n-950504203 -436282463 10770619\n-338321260 682452079 28797281\n388894306 844977220 968058\n2407788 19883655 17378474\n-226304982 -587719278 11938729\n818770493 -869760541 1516337\n-496954201 559949831 8551162\n-636574669 -173102631 5394958\n-559191137 -80400835 15423611\n-770181723 -603645043 1634216\n27154519 660834544 17308230\n376574781 -233888156 19007653\n-374112588 -844835368 11133495\n647728705 -671356702 29780687\n252781982 508436736 3071711\n19962918 298570735 3694480\n-141481060 -40194454 1596646\n-825701715 -840775236 30009784\n94109185 143923526 12552835\n-64060011 -312957523 42182409\n-686753001 -608157983 3924706\n-666292096 -769950042 13676843\n-904050969 -970883990 5452838\n255406294 267746179 1740695\n-365769697 -25807155 15285699\n-943093893 -380243045 5583337\n478266707 -304636591 1932340\n-417165819 -878628603 1863852\n246287784 332772458 2939624\n602355886 -857647201 308482\n-283394841 -564796884 1172254\n-677001682 -565450251 73358617\n-12614887 7526294 1773869\n808720468 9308199 16246290\n466068132 -673033495 67973203\n338350394 666800754 702734\n542930627 -889456063 1884237\n454337167 231445982 3061780\n719004874 -758567360 7339845\n8761067 305730699 14377381\n188496106 903856048 1721104\n-383256713 760293930 9787465\n740108925 -244176827 3998974\n-285649258 -128399317 1883074\n595748540 1133407 1895520\n640883400 810968685 3674486\n-571133783 -791319174 26000506\n753095582 -998311614 6394114\n309467739 12335723 312381\n-901475317 6520663 28554315\n486844100 136064064 19751767\n180673867 767248657 30902991\n864550789 -150130380 4649899\n-416650692 901947423 25157456\n94447912 530646489 25930643\n-47647451 322506127 2196617\n911730824 -608779861 8304278\n-186709984 -147802078 14431472\n-450111794 53993333 655628\n886146950 -981859847 19956061\n353959150 317215911 4562156\n-722466561 -149197160 6808154\n-524355918 -675737837 7850750\n-888650036 160049546 7915583\n-122906616 674055705 1698271\n731195930 266909838 36399065\n-171329498 584326715 4281176\n677952075 -688673762 23420620\n922715179 -656663895 17633377\n227801423 357862359 14689471\n-680856235 758515513 20560653\n-857551763 -307677096 18030853\n294781439 -897449234 9855474\n961955101 364844649 17990508\n-358174405 -776761634 2752275\n339967326 920736918 50100540\n924334743 -670962045 17846\n-853764165 152612148 38103573\n331675160 -978945464 447248\n-65539315 -252785522 26788461\n-925535392 322739424 11561458\n939912119 711698791 5095319\n680871544 169786468 12715724\n652123181 185342742 7103036\n285582501 -711660656 630695\n-363083426 -959503199 3464414\n-957625694 -11039719 163878\n-879385165 -779277824 21048601\n788826485 513848775 7841192\n888604686 -333830379 8891682\n-223815355 204744555 10434278\n93993005 -468591476 2992545\n-550595630 869125596 5856184\n931371079 -291857016 3181056\n947713201 163894456 11755844\n798029183 500786322 12864349\n52483761 603817700 4049746\n928833064 701484986 36011560\n-973589173 565127120 720500\n460858592 -458561301 7947005\n-242609737 63820028 12168178\n188143720 -354579592 3332411\n474048242 -849620272 5917519\n-952168969 520731188 8829632\n-621934590 777583014 15593520\n-296249325 -804016602 1451281\n175815801 -343376435 1994582\n-72957581 374224061 5151751\n-434996047 -870782231 13804366\n330683256 -28055950 12654311\n-628220765 653419095 2309217\n224703787 -705206542 9576689\n-500942693 725922288 17206465\n772733369 -21502324 4590555\n959694898 -689758460 8534118\n641439120 993252092 3462972\n705641650 271780580 35881186\n-820564190 -955248928 3786768\n-387465151 -320408923 3790919\n41302664 -639563689 3905332\n59537531 751809834 12973017\n-485137862 755695557 103675\n-672019798 -20119815 10616799\n756619618 -49600199 2817234\n316384484 -995346303 458739\n-37665831 174398994 5490028\n948088502 263273144 17261482\n-765547337 877454567 9386208\n493280506 -561789865 2309531\n-319315924 -676576707 288309\n-872017234 -241506930 2932575\n-523087624 -557158932 11553104\n-454764487 356631307 3003522\n334208110 -962092040 7238226\n-71562539 -79666321 5073818\n111607053 570586042 3801108\n-932929422 -737009534 6361091\n-588270073 -430695325 25244234\n229269158 434798448 6759438\n-136584617 986981962 13794425\n-530315733 708390715 10103084\n-20334482 -188814658 7929924\n369071408 -404692186 9522302\n732980268 -533092290 3793898\n364555520 -442528932 27831022\n-839558657 485840064 9054134\n875564342 499089944 8658550\n-848848362 -98262420 18800065\n-646399271 -66710405 5303624\n707560097 -407093865 41302875\n917741150 -251659445 3354433\n-641047982 -272595275 3223738\n517729692 297594703 9692380\n-342719246 -370373608 20385272\n923093029 -383645143 4276768\n-128751939 -714241430 10491695\n204169555 560235322 4355265\n-236648184 -901299503 7328556\n-643051013 -240016685 4467716\n459349584 905436509 10576248\n-555622412 224736431 19800243\n431785764 -102604162 5063770\n-94687461 -169391578 6885777\n505138257 210584046 10961466\n-844653079 -910646750 357555\n497940317 -393594958 9274278\n-188601938 709434489 3484021\n-418347350 417819199 10928149\n-121489814 121092049 2696976\n824301564 -346233546 2590570\n-203934418 -163223353 10757877\n-83102181 -456249883 5230202\n18116310 -502564906 3032962\n317857217 -721648692 15217299\n584231133 552536739 547771\n867867211 240039324 1979572\n-241716407 440940524 16741064\n876499338 -733318824 7786432\n-117310076 721972068 1492508\n864920949 574582185 8605326\n836992694 -412760816 28323464\n59373130 70245470 2104840\n-275480329 85820369 2917875\n79254996 -520229489 22078907\n76237602 262811846 12846195\n-815463747 -504657751 327595\n246476096 747494245 17412391\n24429975 -211626679 12211800\n-858098396 75152977 6072854\n244356211 190136775 6428482\n542973287 -240419247 12334604\n760083235 -387679485 25694597\n-417172166 260923437 3614557\n-821596511 753870432 2209403\n257626953 108203898 3467972\n-160800947 326521529 5400663\n233384244 928702287 446416\n943715921 970638891 4501022\n93402513 401141640 19608987\n583950034 -655155808 1827403\n892335513 81042781 18655542\n-570781838 -986279013 2153040\n636820456 -856495819 9802615\n758419481 -654769743 831872\n-381259895 776686592 21610076\n-307906987 294518304 8490256\n756710914 -468299578 12880001\n-832842962 -580907796 13802893\n315352113 643956656 13875446\n628026428 -580608131 2818299\n-823871520 -558111986 1491183\n-985201294 617733872 9061823\n-531541293 905850062 15394684\n-689546180 42591342 10917322\n923242307 684903646 33285531\n-764043346 177666875 2975556\n832694375 348083438 15320594\n666514856 -914243002 25497178\n950517522 726906183 910502\n175930092 120765252 4588134\n326932274 -253054850 12921999\n741915438 932841384 44255237\n-214480080 389261404 16982498\n-780960829 -94968114 1271280\n-236558889 -586790147 12190001\n754189019 903970550 3411152\n-233065179 691098064 879295\n-968161609 -519503035 1561783\n34946238 -907494647 22542584\n-889458441 462939274 1984938\n-935705952 -525967446 6440088\n-558995724 145565571 16259655\n703816646 -35067563 3386012\n842820560 -507449941 1952838\n-391903017 -910019063 12694667\n679504898 -171256823 40907867\n562598494 -164328622 6589630\n-131401698 391248370 2916093\n549518192 -714025949 5876938\n902427083 778729263 14130386\n-248736 568834225 13157761\n34313157 -797168926 26365000\n620115635 -40418156 15444578\n994493670 539694585 3730214\n-881375863 708517156 11652193\n444716803 -304559065 17827969\n-540389126 607830506 47456\n144416355 956122333 12201650\n768948589 -378634125 15838462\n709837804 125167834 3999818\n-260471912 864952056 40270296\n-85521365 464143378 3436432\n-854079459 -841813351 12781111\n-302443031 -957747696 21047282\n983550166 128784061 7966503\n279126232 845465624 2806081\n-940516109 870154287 3338810\n-607958857 -494152082 8737955\n-978407497 -963811828 398467\n-466267667 -474306865 16898230\n998445325 -118592188 12290421\n224428313 -742121264 12893442\n812839599 377338486 5798185\n63407703 757041527 41043815\n764990227 420532472 13268934\n-659602496 -593851090 11037970\n-189666979 171256590 5150991\n8411761 -190420551 11138723\n995457103 -625907160 9268996\n124277879 202647842 7524037\n-323638732 -366942023 541577\n-151134877 431635764 17084478\n691265125 -902511482 1878497\n-445275584 143198729 3350994\n-242819146 -525861993 3388851\n-517232117 961218338 13951934\n-198217828 -73815431 16370439\n516101415 -280814953 5332378\n-67068994 496039541 27373211\n363623542 498528938 15839866\n902649059 -159150029 13334556\n-38577548 -359262940 3492420\n-808125529 -903749805 13531703\n410331749 104964992 8811346\n305484956 -792187852 23078248\n235151313 263396370 22577777\n-964428148 -829701398 12114193\n594773006 -621293181 703323\n-493424651 654238038 533413\n932447277 994137079 3513796\n938336572 -855596766 9029947\n-563769894 776006222 2749379\n333690960 584781260 15108793\n-821774388 44942089 3285683\n-178485067 -502320285 48655588\n817505449 -180298766 11189246\n777698991 487504690 836324\n133377125 -173014130 20485433\n840787620 -497084592 14058657\n-26400978 424112745 10113598\n37332146 -814973856 35239896\n800081593 -148048669 2506935\n49761816 -651672878 4165855\n-920650836 136680490 13389258\n827381877 686583090 7867249\n-827903809 349663421 8627256\n707136549 712394136 4232654\n951245246 -405169375 8696740\n669806678 1590610 2214803\n-858754883 -34604734 10501139\n527748287 934293553 1307099\n-231812168 -33390672 1784005\n-358480894 -87624582 515479\n-745503425 964696683 9671677\n-834627188 -860118542 3584777\n155501401 982529732 3372485\n315092628 -855944711 1213696\n989761765 383206292 10239052\n602141818 583995140 20352668\n-237297602 -302177206 5998665\n-407715352 -996159946 2696880\n30408681 173544432 30524395\n-554260661 99474041 11485199\n-385614880 857488944 1585356\n119776176 -68788976 44397168\n71132973 -235449402 437132\n332661551 -157386069 1418368\n-480060372 -871013335 16590756\n-791747991 782450050 6002057\n-304570900 -224115803 2350675\n823117214 -101421972 11667526\n452114435 -951305943 15847616\n-151275632 -142471060 21195450\n-118274885 -224170506 106754\n986017058 213746967 9405318\n873759407 -271302374 8887902\n25636244 965172346 8416491\n719512386 621063679 6349241\n-129965649 514549366 2694009\n61790838 921575674 29475149\n889550596 226426296 1306732\n727645606 434095591 4837717\n-876062804 -896901657 6679708\n-358401013 435676222 417771\n667463234 -722746317 38566402\n-520938454 23295599 691267\n-306165973 359806993 7921317\n-774121259 692262129 11990199\n-111406269 -541509626 16689902\n-836579666 435617983 25255259\n715854292 -257145054 44251\n-91145842 109716189 1570338\n912721392 -309425089 4922090\n208301197 -781390954 439829\n-808081377 -609031502 22991864\n479336728 811259809 16593670\n-256865302 -462432691 42150104\n344668890 625874193 61022542\n862051402 -441526292 46463355\n-641105515 232851792 25556511\n-265956197 -554160171 1175384\n973182985 133298171 5052410\n-490204094 62635415 26878885\n22572867 463320231 8137723\n520102245 -327967645 1507494\n319606839 21813645 14218575\n406891862 308043170 2922015\n-519269240 -571649993 8945014\n-835071968 -144211956 4939466\n-732967807 -137961899 10185806\n672774231 838214397 16208964\n466034269 324466277 1038532\n-679192644 705576224 303596\n-163359523 970735631 20872294\n204252219 -601036564 14368964\n67572615 -600061582 7856281\n840393234 -476387102 5938111\n-51538156 18098144 7709029\n-463101582 989996512 49071\n-631539562 302334226 3347208\n705628427 -105113568 27573613\n18324172 943932179 1094201\n736757724 -437288301 16011453\n-316766626 302818784 13340729\n465814369 -660250781 5155347\n-619697642 -513079957 7269442\n-786602351 710747083 2800119\n-442654589 61746458 6116343\n209174365 -308258149 54467539\n-974486805 904374191 8910319\n-891792883 843959487 2842357\n-127808804 -24032069 2303072\n772810228 558962755 8927467\n-504820660 -757137581 3774328\n-612345817 -497522910 17165003\n241959892 280792786 11633114\n351882806 -786207656 731613\n-540997618 573378749 7261665\n-522819081 -803345574 29446059\n148299805 -969476710 12041898\n-635649606 728138762 4139021\n463062557 87673722 465260\n947750572 8366493 296437\n304801920 -610956660 9960356\n-635633645 835313940 5073048\n205761418 635735167 4224119\n630617187 187323354 13831712\n112469497 324560497 9732864\n711101754 95126796 17579083\n-294147606 -401868914 9426904\n-450284630 121135654 10575922\n-148295450 915989359 7783845\n-400585516 -405873990 15709408\n97885033 -731500929 211517\n-204480809 737492203 9198639\n553567803 747749155 22420215\n-342000665 284054615 1858361\n-52511413 -570281963 21916946\n-112393322 -837397861 10157805\n-743229832 188896193 7711867\n-661053472 -187089465 8758309\n206618678 -101903032 680264\n-292645562 -682549214 64765471\n-155552008 160291921 5512745\n-560184523 -61523821 423050\n816036819 -253597799 13233233\n-247189988 -89264685 10920710\n-687067001 739456638 31531204\n526763794 848574232 45780\n239777132 -905284693 8040004\n756225421 722677312 8432772\n-674934372 132968788 28309576\n-230610569 628637826 6844443\n-503575512 -747045928 1440956\n477057520 -638490452 9864648\n356187170 169923629 7530006\n11207485 -921967397 1522580\n-478372360 -893358299 2809856\n165695998 -254745179 1268512\n-206469311 -862076382 35243500\n168953421 2862081 7518968\n276445181 491006749 2987825\n114427314 465513428 39522893\n372736038 -903900850 4865959\n-82270171 853732588 4189955\n749268625 -740703016 14481375\n16016047 16559492 5386214\n751531377 -99916204 15448882\n234506879 -229371866 332748\n-831668118 -379286873 4701660\n241852919 -341711048 2286815\n317409951 431223882 9571197\n800407824 402947751 24450962\n972551544 751155436 21645284\n-153926935 -842760384 12154386\n-687335842 -849209996 8420246\n-832182217 -923185347 22153221\n301093087 582952511 10072510\n-874229517 -625817316 509500\n208245201 -110882518 8791725\n8981989 -141984935 11514632\n655923650 153759434 20216342\n913291482 -240735468 18671722\n-513420700 -250641315 8593039\n586185767 -458889690 33551276\n758631579 -322886007 7344251\n987008399 460200948 29331963\n-889678406 692212640 782926\n-868484630 -102722969 694201\n893051511 883951919 4667423\n-351944088 -434499676 1436369\n634080398 -884065619 8444227\n954910051 -900446354 1364108\n-734308640 -350868746 483970\n989792148 -810200856 5934039\n-398456128 963842313 7214870\n-749540668 935585596 8200291\n8790739 451237018 597972\n616761776 -548854973 5237297\n652156736 -113658963 23750413\n456278341 480945598 31068450\n-914880685 -318718034 5943805\n536442775 -679920580 5493042\n475428130 200337065 614898\n31106420 -726759747 984809\n277623260 499182077 4857596\n455657419 572748342 6183001\n-65035899 -573985868 3574131\n-695633577 194426547 12217092\n-787464362 -931439769 5049168\n-556836892 -756142026 22281759\n208352488 472939879 2166077\n-645721922 -68545757 2565242\n443155888 -313406923 9506103\n801270572 -905316262 25118445\n-167674669 -664474888 16684862\n-241127097 -971911541 323432\n-730398692 -511038963 10046533\n113597943 939615393 2004384\n956277493 -687833682 5579785\n147686190 829143728 15393792\n327262609 -233869117 9377555\n-512200491 -611655317 27753451\n118092298 -687232905 16228581\n-974554058 971472762 6918175\n703164541 -607054019 1923093\n-453651341 666884663 59368084\n-527686786 660543497 3954376\n469671312 823745753 3482772\n-747400080 -555690976 12978063\n-769404043 -569695906 2303520\n823965388 -448728703 23988932\n-110783181 107261373 5703403\n-16390911 -946849233 4473768\n-403813655 -427815202 14731203\n-933375649 256689299 8700659\n-33614098 -513539513 29452490\n99725171 429165430 9536839\n-920951245 792383101 6733581\n-348961372 62071037 1092638\n349494477 -587919072 2186349\n-426590584 639168255 11834874\n725568287 318024993 37678801\n-860766524 449017963 24466912\n-121816484 -817054775 1790865\n804070978 884820776 1235328\n-968978933 203846204 6656799\n-164856351 681033301 8074079\n-184120976 22919087 21327854\n362468147 834079240 821072\n872009829 -790046569 18003089\n974916991 523212257 15014131\n759346081 713982309 6144620\n627674408 595192667 6941182\n470494878 301381123 14533079\n-484028600 31854695 11743912\n171030183 -455048554 4836119\n488362909 -851227519 1927630\n-294801686 -192113894 36469299\n9544608 -500068324 13894757\n815200588 588226973 620996\n-827216597 -888068556 5274618\n690158685 -20622862 210025\n627081712 295917706 48321839\n371890992 -189016781 2009026\n-921937686 614029447 4374037\n547450094 -614025217 4781688\n-334579741 835024000 2372677\n229549625 928523160 11788511\n-770699025 -422794994 12368190\n206232792 584927095 63599811\n308574453 -147851017 2271660\n512329814 710540654 20817942\n944184691 -969079889 930257\n-627146031 120661749 10769505\n-470725640 238248750 18420885\n-174124609 541033235 21890317\n726364054 -263764303 22241164\n-762016944 -440119590 12250655\n819860417 462286260 10568261\n-914525925 -175439528 1512581\n-916643886 -76869699 14273289\n-5137554 -604431187 2159798\n-118997308 -414360045 9029845\n-701143930 100044695 5733367\n163373547 -854962517 8581272\n-670926612 756792216 15090651\n335867844 -639765621 8166212\n736527767 607017551 363240\n-487513132 -936362120 7726853\n445603390 58777982 2785526\n426471798 121966516 11384108\n257484758 395552523 7010902\n593323323 561390840 7372087\n807821363 -155733145 6555469\n970097915 846388426 2443776\n782251541 -430932544 10849052\n-528325701 400119204 9199467\n-423823880 -654538493 3383547\n-657011369 -871859722 7079406\n782248345 16909803 3804297\n361662805 611809220 705589\n-331962564 861716912 790798\n-243704533 -595190264 1862447\n-590971324 -485363251 3777176\n567136337 -25580886 8088937\n-331411692 342104739 21254099\n1018987 -721350077 6732086\n-855006490 -629702806 73039614\n-189957028 954432860 822824\n-317541362 177166569 33315445\n384566695 -967954986 245175\n373393869 528249339 3682520\n-875612084 -339685754 7838449\n-715083764 750197033 8406578\n-655537162 -318831106 4236445\n554979246 -155434086 6272240\n-925101005 927000413 4512004\n841025097 -390402594 14408120\n-680313097 -384546496 9547439\n-144444765 -638256289 6387589\n712175556 566503140 20873901\n-834974359 142308668 5164901\n-573830972 283656317 3080520\n-609767124 -253762663 6893968\n511125347 -186224323 9702018\n-777320347 -93300261 698312\n865951563 -256629608 4545473\n-736979601 320977161 980823\n-905662855 -930633317 22516059\n-4669733 -731293669 6828980\n547626812 284193469 47270\n385223555 225854094 17521605\n281433476 -503076155 4362435\n-555335197 -325425647 467266\n-743354631 -303884688 5402896\n-375507086 -154144137 4300391\n389254034 516069860 5386673\n-786992978 -112506483 4405040\n-128003076 76914603 22954951\n-39896414 -281459879 7329995\n125402299 67173287 34147191\n-589230360 188534585 4408617\n-532869073 330569554 9200679\n846138005 -582682039 11592473\n-972861032 -920798567 49297510\n-328602634 -311353781 633249\n750930699 707912344 1046323\n-228100143 -106398993 13158754\n364637378 -957542897 2496407\n-661222021 -341604589 6402644\n-194756583 839229181 2477937\n-250375084 -629411122 3521283\n-479870528 686419085 499212\n789704225 297875962 10033286\n134695326 -458699563 27771155\n405730906 -542448297 3047803\n464627607 -439841626 11782947\n966737406 910466897 12137454\n856541372 392823734 14027484\n-731221172 -78538726 9453525\n-654430847 -800689495 1861365\n-740943619 -488712608 12928127\n-865608306 -402804253 23002767\n978116132 958086234 339610\n17931546 -530656079 43426901\n85427691 458092775 20161819\n-25701279 955723511 3153824\n-56745590 -978638872 24792860\n334764849 -700980568 5940846\n-943807056 -580532098 1565923\n-730493967 -148111499 8460686\n-103383388 -74714134 7323204\n524715529 -177464217 49080983\n-11364155 696311070 13894009\n189588211 779045711 12080488\n-445336451 -492742821 2817689\n551650696 531784885 13321159\n-422699308 -963247863 6033841\n-925887985 -809846451 20037159\n-590178491 521665395 10179547\n718475473 -668035225 21595789\n-629110828 427476757 15078828\n-130302823 -625952070 31215491\n574969736 -143983560 11199775\n-79450920 36865276 23009066\n-648154597 -65716797 3328684\n181646593 872629538 1341842\n682902072 -123081450 55868\n-196676507 392631364 1168284\n-947639556 -394196675 7685451\n-544791286 -531810132 11423219\n-95247288 -9156571 12147852\n-852776100 -559227504 10910631\n-788304324 -510942374 53961202\n-140203946 55418948 38813126\n-498349896 994055734 4187631\n-276545200 -403714879 17267243\n120261382 -859035053 240197\n-690826414 -605919125 34343526\n888657725 -169032072 12634767\n916275949 -164126071 5133420\n-560944122 432551303 2870344\n972828260 -13450927 35861704\n302521220 -129328414 23929889\n322041981 980611716 12041792\n-418887719 722300854 19729880\n963485084 739974667 9376629\n614352332 799900799 2501459\n714611022 229769378 4041308\n204207604 -105608622 4505069\n213213785 -168078161 8466591\n-243544561 -159310479 3985620\n685354900 -141511460 13766850\n-930163102 223088670 8303597\n-479954700 -925096817 4873431\n660168926 230068264 10707755\n734483897 -185449568 12228173\n-232048690 880806298 3120538\n-507736983 -190200555 15522800\n456453546 -172604734 5844012\n-442854203 -940286080 6172913\n-395689941 297461643 33499763\n146692354 -107240937 10353925\n220242940 -735178727 18258390\n571824007 -424133047 17893994\n729157444 -263179551 36097849\n693365627 -560668353 16605597\n916000871 -354402107 32043324\n-17404271 610208344 631025\n-661576748 942775845 6330397\n633138634 -922976524 3443401\n-662128819 -44206902 7115020\n-390649896 -698242002 5912398\n286402135 -90756043 13908575\n-486583439 -215121292 974763\n709935760 749218026 12688328\n272669861 836456982 2388750\n-17363170 112413581 24918340\n204575042 169212128 8034530\n404394415 -851605347 4433759\n900682237 -119028939 4246128\n42176291 308546967 10179871\n-479831016 -599169941 29565645\n-568516276 453280439 38006843\n-232046827 581554289 24044300\n31913189 769556150 4140708\n-910711550 -807946296 8049136\n82393849 331509679 7497266\n-71998082 282976078 7351876\n-136643066 223374817 1181816\n-782545093 -55268807 9628296\n-357079655 75352250 19798078\n-767144877 -928277786 19766316\n-194766936 -997863447 2074859\n-92573797 -919990846 3801547\n137496931 -501665127 8785316\n-346117494 -47936474 1737278\n", "732143556 -756544678 -698936808 821148830\n991\n-2723321 -137026615 17667354\n619572088 -428530254 24775686\n306838914 592309520 7663794\n-696040313 778634485 21107349\n828240360 -909997939 2382090\n-622548623 -679468623 27440242\n912861998 -716427788 20121133\n801743864 506012838 26354516\n790482281 -678253374 35274581\n707537895 762399093 36513489\n77076777 294231342 2008749\n-485235169 704624141 13179399\n-867239578 333004211 6691642\n553677822 611291951 10515865\n-648444549 14475171 6515865\n-123389000 -500274493 17160398\n-982556846 -918354682 5867748\n-719613671 -814494333 9078198\n851541255 -62005570 24273029\n961640923 232812018 4684651\n472846629 236627728 35464654\n89812732 248082292 43085881\n-262221549 -520794921 559417\n368281050 910676585 12783358\n89773749 52033363 5892447\n-989774248 -917024223 14533929\n-186797444 201053618 1482762\n602428062 -298480686 19479683\n542305685 -964231884 17118920\n-758112304 691341973 39103734\n-712647478 781907479 1710280\n820472230 -186338858 17424595\n-745052152 -62022209 15957701\n-393237130 -572356259 9053118\n-565964487 -102348001 7318443\n-614515036 -361351434 13222891\n442702758 206691031 9981101\n430155464 252274235 14937559\n-99995957 -134731369 2058715\n123834851 -264553830 9533891\n-880665515 148382675 43004447\n-750870107 54454322 6076115\n-308378637 365276303 16422797\n949292937 -256209881 756746\n458043026 -611104832 23717176\n-561896414 -604539246 59893886\n-787029451 80453333 4423225\n870378147 314342387 106521723\n-643540372 374338666 14317860\n-347361675 754326005 2662835\n-733788039 -85383433 30533306\n333301728 -819159350 81880532\n325372793 -103150458 4364295\n-778868126 485558436 15950781\n265085844 145989108 73862042\n774929473 -501925164 70869996\n535388868 -748280552 441518\n-805819843 316969177 46810951\n-859300891 472812038 13446463\n398261734 -357645990 7512760\n281440227 -836890015 60196055\n-541751031 954790094 65413460\n810485192 -350317521 24962038\n45210764 -169985785 23103892\n341382723 145023790 21528317\n-965640737 412167551 59168052\n614648986 -519942839 87375713\n629158084 -789829966 62087156\n186522403 629135347 59767614\n-325205643 633530706 110781817\n-296252897 -452524142 1578073\n-848239214 169252585 3070251\n71690642 -577479168 29492637\n-821606150 644927038 52786463\n-556121921 -386287487 32143962\n-976205971 499363787 22532823\n665370605 -438912782 1304561\n889520320 -665902874 110166397\n-156316646 896404873 27050581\n-998129795 245912862 12970357\n-262830482 -100309240 44528753\n-361864574 91969690 3543819\n-405600218 -386258587 2403745\n638389546 121672197 9947774\n953608111 814517188 6778726\n-178298222 -115801451 6199607\n718001884 -913118156 4725736\n808742372 453739676 7013824\n692858995 617484114 13199965\n-622713836 -659237364 90569429\n646528258 -584631684 77339772\n-380771139 436210605 8239912\n741366917 20422507 1661237\n135069996 -246568093 12413146\n-709664515 961164112 15783326\n619664089 890542548 10928594\n-176408946 409679682 22171152\n-850999642 -922833221 7991831\n380205199 -196465283 10391586\n720091322 844797923 29056906\n-117784849 -509745979 15690984\n67205180 780276342 18546419\n13044854 462101717 39772919\n-747516904 -829822777 38513120\n75088077 -915990863 61717983\n13408939 407038095 52501624\n-735630988 731256605 35605107\n-619578182 -235326786 19338271\n-127949350 649444497 4053866\n658240617 600530690 5754903\n-787401052 -235127298 47498691\n338855424 -373575752 12373897\n669174129 495131531 9993574\n418742923 -824982686 2570640\n420264344 529504391 55067521\n-316552707 263186405 28341192\n-22912636 -743225042 45457333\n-380195789 -822965966 10915186\n-92091295 874554729 1903088\n351702683 375163577 31423372\n-349033649 293019947 39816938\n787525212 133171887 17656073\n452969754 -597690459 34181342\n-481174470 -92021272 2046162\n761796173 366572568 111472147\n-37497846 291455701 9914837\n-73436065 -998288548 9933820\n-931606432 -859166154 81831018\n-697313517 300953065 2762365\n780237019 -967914837 8166964\n-501670728 -329151330 5226314\n356338363 -128357428 11731151\n67892136 587423751 49461791\n-504267754 461063716 44768558\n775949858 -98030773 29072269\n-213198776 543619708 7956374\n-447794632 741127631 1948915\n-120291465 -904181596 14807146\n-658036533 -374291952 105757574\n-558033445 -476529727 259361\n-832866022 -546337500 91730647\n-660884246 -337134157 22547431\n-864408108 513993870 4396551\n384310343 326841071 8892933\n-935832201 -178874179 40985425\n79255553 449767765 11970733\n-862736714 445973021 1202848\n10095175 837865677 100248091\n768517823 665721346 13385976\n-12902746 244130725 6872458\n998812606 -493192606 43737000\n705300063 676996988 22575925\n649697402 790508807 25661535\n-623350855 -563907227 19222548\n-122737873 -718801779 19412543\n-21536218 76814715 41638520\n-506346783 341465547 19318422\n752206910 -830215066 78271737\n-710636594 -770680334 58927087\n300703378 -866785282 6568836\n828217089 -330039619 25070348\n-148166140 949314459 2075411\n-703431499 -670762926 17170559\n243375006 790965840 74797899\n283868934 -751351819 21944509\n139002995 251317839 35266303\n909383872 -316924285 4689119\n-607300030 259960685 8393942\n-487381713 364928484 6067425\n252587179 -883855789 7657965\n-53816027 -509652578 1046909\n914459875 -124345674 98188753\n260273067 970793176 11874467\n563144738 -206680380 40268048\n-62236423 614073462 23044566\n663482124 530719053 6631441\n-597708895 -431407761 4162802\n233864645 -398766115 16202045\n730580993 168448091 6793464\n111415919 933359817 14327198\n994888364 905216212 23211029\n-436215263 -686827445 57964827\n-461760906 -193975954 4917414\n99186896 -111067489 19546321\n386891225 -815594582 135264840\n-453743498 502901685 50478260\n-669910086 172306978 2139634\n828723874 763858995 13127649\n-598763242 -326873159 15710456\n544558971 28009606 91126465\n106371013 -918453626 27147503\n617627962 -542307253 164826564\n-170565211 -672402041 22159480\n-457043644 -344554544 10923144\n-328319796 -213239770 22233057\n-326422572 -141377794 9556099\n-854489708 -603841212 14022836\n932127789 314012256 14799338\n-951973796 -165871066 4386307\n-82968483 -941176546 36675921\n420258530 47234128 69962411\n-344396931 517698529 51548658\n-883603178 -971318536 45781182\n-744232174 -345453945 40228127\n-55659738 -426797790 6706332\n51316556 -526481173 118280882\n531984318 926195481 25290442\n40657614 -459871192 1051531\n188630836 -772497306 19426246\n78702658 633117409 28499972\n-613789265 504377224 7485263\n-228185559 -440230401 62459053\n-841287335 -125747811 11843215\n-894242777 -725142365 44364444\n-865391097 -422891951 42572390\n814139655 527360047 32281436\n-462933230 -863170998 20695522\n969399119 -753984341 16226647\n855597249 -762123762 47662428\n-162079993 -261855336 9536470\n645385908 533421358 35949330\n-541550254 -534575431 35135661\n-585709460 928598705 5833513\n563421064 -648219653 59615358\n698303607 -550237201 3248496\n-341564049 -375220456 34790729\n-417867646 793281293 41213562\n175560184 -196839570 27761444\n104827408 -845101284 10816518\n898537093 460699252 64217460\n769606526 263414505 127342524\n-83986193 379062169 19460663\n55748654 -763409729 29237424\n-754449565 -223948391 15982937\n992832263 442620936 23854558\n-337326785 441770517 98994031\n486600689 -500640658 3560130\n305444007 595825412 21108942\n409995708 -49655782 15027263\n-424745782 357905904 6607215\n954299656 -870972289 24117360\n-907277583 571881928 1200459\n566648612 -289119778 3713089\n90488707 -710849145 18246862\n101856462 238239356 5456099\n-828720022 -954648707 44063038\n-87205920 -545714410 12512412\n-641534242 670218459 36886703\n709524351 -117865218 9678413\n673144244 704921170 38810728\n-751423436 -635951274 83789127\n-790030759 -184399296 9506754\n-769920099 -271314318 124370\n-919587410 271193408 2191409\n204767488 685794847 60597475\n357204234 162759136 131679873\n-843226774 540349874 2961278\n-710818054 -655437138 36698358\n645623927 322088009 18348247\n-405570323 899696765 43423000\n-956620057 775086783 37750247\n899957102 -941524458 6669000\n676042382 39968704 31978267\n907818611 113549720 30766138\n-630734833 774781955 4520477\n-873164632 -382605765 37002513\n-516759561 -5570572 63389131\n79227803 -43963182 117893393\n-252261818 -593567082 7955794\n673197428 -29313480 64947629\n-210720429 -785874861 13689390\n632781040 -274527128 4582697\n531364828 -878427567 12066389\n247576246 -798414887 30961295\n-83354926 440234488 22488593\n-24780171 -701590263 25937180\n545078656 -85766683 39177237\n-655678335 795926944 22004396\n-511836625 -620053695 6422950\n728597633 -886023023 17114392\n801899362 226366859 15452166\n670670938 -679976189 57325913\n-30880541 573641328 102407270\n730291811 -949818633 9363625\n-822056634 -570842020 7707332\n324067293 -372691152 16138293\n-310592468 -309614712 20078363\n-14156426 615765234 6217300\n698750387 -588188134 36830655\n-854835254 -70167146 65915217\n-537092168 74334773 58274602\n765510479 -773224221 7223423\n630464573 474150083 32746516\n222528177 -844064824 7225772\n772662429 470359674 10638102\n399935519 78925100 26908591\n-182138427 544554075 8494382\n1370893 548437809 16833911\n775482843 597881010 4199610\n-893981604 -356639876 81563114\n-517681610 -270467282 6822027\n-230090021 -945174521 8467746\n680122849 -249069141 17514641\n846386835 -643457607 32416717\n-844019201 164024221 5130561\n617785383 -361742076 48460201\n45633649 775632885 67545244\n-884332505 584145754 27500602\n-215227055 614563400 16505719\n763907727 890758084 46580300\n-720448972 -984557220 8551739\n-399904796 89523739 8950332\n254933151 497952016 32726879\n659705526 -44816468 16938787\n87723535 -126646878 16475558\n480831074 338599221 60946660\n-681190231 -141165055 32661276\n-383158434 95818480 47740069\n-590703434 -672940433 4822685\n891733227 -534436153 18757944\n-44329636 764029814 4678607\n-850645395 -44298417 63307363\n-768239376 -702131876 33772262\n622087987 223170638 38017622\n-573415105 -360340352 40394715\n495458178 161641068 13260896\n714617486 124028506 48066379\n-950803518 386254639 53594833\n975090032 -133982575 67869459\n-876937192 -784047794 21250518\n459474487 -932758054 35816769\n-709558854 -446277005 38835104\n-607107995 761170138 42450980\n-734906561 74465198 97475344\n-98757647 529348046 11219998\n-916619881 295845351 55245673\n39987299 211000742 36292851\n-745034200 -534838789 54247846\n-699615457 -541408752 23390763\n347466320 723624940 52940736\n-702568366 -712029463 34954404\n-331644874 -844608535 21572834\n-863694284 -188432149 62292803\n-76106712 -18407415 16672154\n352447153 -470847202 7060996\n536267358 142221412 6556776\n-746477159 -383638174 25042757\n-39984916 827055136 34998436\n-340308503 128505058 1126524\n759263889 -716423552 12483336\n319998344 -774326445 55227697\n402875886 352867078 17630511\n-744731440 548999503 85350913\n-405911779 -777271456 6982552\n-97872271 -327608697 18152595\n-826256926 536380587 55737752\n854109159 450707847 41433255\n-633699732 -419003364 105141532\n701626267 204886107 80965344\n-194059997 282012464 26418500\n315671677 398650483 9810991\n-217568780 14482120 3172090\n-443151710 -555645596 2858061\n410604902 -953756127 31672635\n-157774637 -102895031 1266293\n-827303992 353094764 13802137\n921759665 -70378677 10824944\n842781291 -203651810 63011368\n89915256 110705901 29270795\n673258470 -375333194 4754274\n294702551 -728297316 10249754\n-758605390 -229732715 16145122\n360121445 -821242036 1020713\n-328105097 994559914 21486564\n-821875048 -120405067 21075665\n75067606 738189551 76972602\n-804257902 -430520550 73681047\n55822391 118050526 16367811\n-896960286 -293982349 59150356\n-780966573 -409616583 12190831\n-163860455 -549079286 7569542\n-927147312 356334785 3577139\n-703455704 398874543 31699056\n749511285 -733401707 20423772\n64968239 599877532 597014\n-457906888 -627947063 58475572\n-709131630 -125991515 36848362\n387454316 -751267485 6746053\n-836892537 -17804718 3171943\n-864169574 -430021811 22525182\n336855612 -348933631 12840585\n-206335989 -223572836 1377808\n-173179637 949472949 20587152\n246500742 -528176339 13189817\n-279286493 156908360 43750212\n159221565 -680854733 56199400\n-261274030 519487048 40785875\n-978255235 771896607 101765888\n461654226 -238707321 30928\n-852569356 -260500493 23479903\n169021976 -435409983 630522\n-73737781 -624652970 4751498\n464929610 496089681 1229240\n-968533451 103779270 67056554\n345384402 -514919852 53402914\n-645872267 -46079296 1577270\n448042783 700314887 64118682\n-870273424 690522145 8039905\n-600958073 -564179310 22832322\n413502095 787260625 93578063\n879868339 486855805 4130627\n189460435 -429397990 8460913\n727005469 -373164959 31975875\n-228472477 494283003 67165703\n-971079035 823955181 44534430\n-632092888 207295564 27408606\n214998791 -564923965 19789296\n-211610603 396485217 28101135\n-853809006 -910843772 44783931\n329352446 490879250 14691860\n-22651561 108130294 115837951\n896970245 542312806 16209802\n-899590669 266989047 6893513\n104643187 -954946071 23809792\n-566977009 -483915600 3671290\n397352454 997777574 54417599\n775888004 -285095310 29192687\n390227582 205632044 18231396\n-339559400 478005520 62862780\n777224092 159031634 32464582\n-87518646 179073687 35306123\n-136275763 -947793433 17041094\n-157764196 429034293 32507410\n196067366 -790205465 88977614\n-865552729 806276734 117141141\n-269033418 -342109542 29247513\n-222282198 -337114655 49272684\n335793157 -71421807 4366952\n687341490 102083880 8748964\n-585798291 -199443537 35982355\n384799046 -318009353 21258307\n145094301 271367333 6610696\n626275549 818596592 17385741\n101454122 -698721554 7507985\n510331294 -290928256 27870706\n-454497576 -781820328 28158458\n410259624 -58080999 11410961\n-235392486 -569325445 152022252\n868649087 575892096 5558651\n570877104 -708932493 440114\n583304242 230600830 16808690\n-531066798 -469731602 39444048\n-534055628 -679410404 9088190\n605668604 864247586 36157139\n504877811 -332671218 38207506\n-12405678 -746560254 9872442\n557187832 -560019455 16753894\n-274406310 -153484770 57110686\n495546083 -435681242 11404496\n-93419060 -294438304 20383586\n-771637516 -223288049 18427868\n-990983957 -878700500 17763246\n501821175 108848256 16169100\n-395086615 703971299 511633\n908770286 -637956096 52306676\n-103872675 -600055679 51065449\n315521579 11418283 24838221\n-171356726 976293953 46315522\n372340116 659543491 13488773\n-29721936 648859663 19396644\n897829484 441444198 2440459\n276209570 898799195 45017023\n-520437389 -202818673 33564041\n-764321846 -524072942 26759818\n212798161 455039574 47846459\n-306971238 207520484 36182361\n-940590011 835558364 3865159\n-885731665 893516990 21890446\n111417660 479171631 44727032\n-170134952 -594152386 27115887\n-818610102 634378282 687690\n905021493 -242920481 11552436\n-888429497 -584058370 7074027\n-958633018 61880885 46433535\n-264582540 -18435352 3591716\n-423689695 695176297 18798842\n639834783 -349534306 10942782\n490913659 -465965514 83700927\n773919009 -524469373 14883282\n915330412 646630363 14608189\n-717512372 999164098 12006861\n-178170865 -518750906 25391416\n946653585 954667112 42801343\n-647462059 397692319 3020768\n-132072944 -825263681 80565902\n-537391984 749532815 15579022\n286555265 -155439194 2993009\n655762019 -621461430 10723499\n-790190310 527060733 6871360\n928205148 -852882221 12617803\n798405744 731457533 26147684\n-428234090 -254052641 10481232\n478193432 657437911 37485442\n446082409 -40352795 108395514\n-692067444 212089732 27195588\n699708931 -773531751 2070815\n-59939169 -433038599 27740932\n-45885528 395264752 48670761\n-157108766 381277784 45057094\n628915198 544534014 7619911\n612682374 -768087430 12461153\n332509799 303678544 580258\n-586285431 -586178975 3685560\n9114108 136374794 64019185\n-701348953 -729085983 26671590\n-509105165 938663524 23559333\n565340779 -999114568 20317888\n-329051617 -220493058 94613695\n-858719111 390650435 23834978\n802722238 -844001183 980388\n-139903075 650028469 17454131\n-969448638 454214866 55907891\n-896879485 -419297723 40764440\n795253449 -362667209 9853804\n704095105 -47215098 20381594\n35719014 305377820 19978023\n456072859 -396511143 13870968\n-191976755 496231549 44210434\n-620422505 -119263588 39910512\n361510947 -960343211 6413555\n-837415251 -360168168 57392379\n-717354835 395220350 24322144\n344987370 -346393713 837238\n-468593757 688405783 59595144\n-9466360 277161483 32268244\n-62376121 -327030859 24542328\n749244724 -285478631 35378533\n-953861192 260267356 6001851\n-982728899 54536827 43095960\n137960812 129434481 4315185\n-395382299 492778395 3167672\n403281483 -37088532 13945824\n903091511 232969120 60090758\n-588451579 927512485 29138825\n715000585 -749107577 18125466\n282472271 -359601496 28329397\n222320625 -885372483 44011122\n742428312 65247332 14804523\n-930566929 767160778 7129784\n293937513 561271547 24227078\n669667315 -640847097 68497703\n-310154252 -188321773 72958415\n548655232 741033202 89881987\n-822083302 795028862 28347588\n573688924 62551789 47960044\n432269218 242518528 13767842\n-589947729 -763206287 26166567\n-840079546 373624733 29339310\n-179231333 -107987561 22828867\n918025641 -479286966 38198305\n25380722 411310010 64142744\n716975551 389209190 7705219\n983221689 685937486 5468451\n-29908426 376551834 14450163\n-612378658 -467950470 10744498\n-814426067 -513626714 44269498\n-692092344 630398370 34973360\n697650278 -102377889 79073374\n665324488 -162209689 3907259\n-971270173 -687895332 70971918\n831788098 266555071 33175491\n378906776 816142522 11247275\n-339248951 -537465481 53049284\n-539282686 889613913 2342423\n-564128759 764682316 36043578\n-799272979 344118007 108199299\n-865702689 -484997449 23831680\n218581798 397919734 69360323\n-724350532 428142335 13098372\n-301474962 152465138 59807148\n-312665287 -547081414 74696894\n-986233670 -357805864 10287765\n595563523 427267933 5537207\n927019247 -842355968 31182059\n-597455399 290350742 23437334\n691440064 -831672053 6485423\n639974485 923293938 6293279\n393280530 913126999 30710589\n983806514 -746136706 48169919\n-554386456 112242423 24239623\n-731549645 186752350 3991539\n408550861 487745153 7544091\n-805344553 877799170 22598939\n-202158945 -603430887 19513036\n-123112491 -992161359 21175582\n797511765 -769309548 25385156\n-712261214 -198725582 8334110\n-54916106 258406707 73962289\n-526570820 -421793871 32609756\n986788974 -316215270 81565050\n393526896 279878507 16283342\n454766942 -524580341 12157004\n-753953676 -228772053 52617506\n-49873292 -96040315 8624970\n-689420339 350762232 58737313\n135540240 -591089188 6417237\n896083565 -213169551 3891908\n-694465444 -31652581 15374503\n-731894684 757536895 41314783\n-889136214 199571782 24559814\n772748321 -947247359 31626024\n151098574 -552349925 4714527\n474469390 127117419 38853944\n-667399158 277023015 14378904\n-993903055 -158956419 32977547\n223748664 676506361 23211199\n797003847 864223476 104618733\n-844832792 -146269223 11108100\n-628190179 -27773870 3335745\n970697133 594376510 30860809\n-625353094 722693375 3394608\n615352630 836870206 68154913\n979977778 -61828056 29721846\n897931784 487827963 15788866\n-736950775 -519602695 4282951\n-196917235 -160468783 24082321\n-878487083 -750451696 33103730\n-391889400 -225298628 21205142\n434549938 -938911113 1369286\n508593024 166020839 12426134\n-361400421 251010476 3148343\n-868927427 967861511 38715058\n259192974 649872108 51760581\n-934935276 109899731 87911750\n868826437 331541218 11762039\n-647015757 300268200 7394869\n31591711 385718530 106055785\n324679421 410590366 7405335\n867333856 -721640002 35170556\n-442540532 -948508458 92936471\n893425948 -941171319 10404478\n-4839755 -699207437 8032664\n214191263 -313947689 52180547\n482651472 -54010138 8033726\n286734427 -440488499 26882042\n970912985 567524805 10537580\n825074447 -461966293 6611038\n536715336 -869653769 20867991\n-527382347 -676553281 736326\n36755783 715119845 24699584\n-837163021 -488962056 1324138\n-81032081 -626024657 1697637\n716475888 770784931 40099416\n-988386785 771216581 8219563\n-808770215 -13129444 66693090\n-63863244 -461490932 1531243\n130462870 690134934 4814600\n468951041 280683059 22397214\n396502819 220744892 15118344\n-560684460 -611150981 50199101\n170414006 44625159 293237\n-69703605 -303242757 33731278\n491357235 788383859 23030207\n-959629947 -685555754 18822723\n-907225107 -871491504 19608189\n-388291029 -476458402 58747756\n-660866154 -908765625 84000506\n-670013656 -993094329 29329596\n-983427505 -453315155 11686741\n909413872 -181292973 1231840\n-998606909 -819168359 6300417\n246201218 600666488 18912694\n-178651423 572866088 3360207\n673002767 -616484044 53210009\n124659065 -396320349 41419844\n-973117145 996086143 94210076\n107644347 -579532051 21715277\n-619110954 -288525589 35433273\n-89868186 23377496 43858526\n-14553970 -258115866 2825684\n-992980195 -172576578 70399380\n-968939999 941035930 92312443\n131404916 -60587230 13087195\n247198440 532432956 67050611\n-203201583 -163002019 850687\n-545550228 13385418 4552574\n161671991 -553442997 28226280\n-915180175 -875602793 59996446\n364717433 -723267363 4569740\n181618024 -648228396 28952182\n-76647048 -819122224 26229567\n-681943374 41778270 38840539\n615572464 -797497681 2082102\n830076673 -705884604 20698359\n-513876167 429090558 23703883\n618242376 648498276 49148945\n-411638149 856576337 8147366\n-801695765 381015259 25490321\n-930946562 -482595084 5072316\n636635363 931988317 23249172\n947420618 683894561 27709547\n-45012496 936995147 15875474\n-263065455 -799607973 18073289\n604898369 -17885096 309087\n-400022510 772211645 15405232\n-357093321 -49251126 21538311\n357194321 -497620420 27102573\n-625548297 -874368335 38960922\n-330974646 281650314 16865155\n789670517 669783452 1348384\n-995822480 493637661 457988\n-501482925 -199707894 13647766\n-416448484 950350199 23641993\n231919165 -897139853 6062613\n-449627471 787010131 21095592\n-785542076 612787331 14680707\n-978182510 528754480 1975477\n-641441397 -196611266 1431645\n726184889 -644286214 13553989\n984191693 -34044274 19468450\n374429998 -153298918 43441708\n-958934707 765502954 29675678\n369699332 832974395 9681138\n-989611713 357798023 5104328\n-946240255 581670451 1863898\n-650645292 -297859967 10639124\n297792466 -755791420 30075003\n-159034704 856286990 2393142\n-62394562 598715127 12568838\n487409180 625562649 30591630\n289644624 -742356867 39660419\n156436001 -439016933 211325000\n-428922376 -28177232 2242116\n417673626 742539184 2846237\n746123503 136896885 52302293\n916050532 -83141434 17949897\n-280449650 -955564693 79026043\n-889405475 -303374059 20444400\n686052924 401465892 6954975\n-473773945 -262320569 80403520\n573901404 916338290 57846740\n555427923 -774019989 2111248\n-549730721 30381856 18097688\n-185020405 -177071404 15205480\n-713651999 735447455 24869570\n961770266 924551308 22769034\n3214267 -834863109 5874838\n-321546324 -924553601 30560583\n-770984430 -719064 97069033\n-89708737 69766425 55638324\n72267690 727697846 27225797\n303376195 -461467985 5909593\n-398694360 -551916637 17211336\n463162700 716709052 3122024\n-342314274 116459958 15913408\n364467438 818679040 26568927\n129720086 -402467018 47690783\n947921023 430078760 9985710\n-933630451 -64540017 44577893\n130103109 352284558 7431518\n-442375096 -424241634 42656414\n-459991097 -480467337 1312403\n-788351211 813607841 6748481\n-766660956 940612669 2459613\n-517014786 721101293 9555495\n85154121 500215889 70833470\n-187761017 363426311 20669460\n545995010 432546503 16779281\n780560522 -947716376 4309638\n855367518 440745730 30519877\n-337938520 -541605762 7792034\n-224064306 -911300145 9801906\n-674447976 439294404 12115210\n829879171 -500593356 54716138\n744183868 625372118 13021517\n-749231999 -129130324 31542273\n-173239662 773863553 1772834\n546416292 83142532 34783329\n392566278 -672854359 1446098\n-105480438 -160500657 2477934\n652098453 -926160148 390556\n-684038384 -525006595 6249064\n61821848 -248346681 7121584\n593534371 891326409 20351966\n759486358 -508868749 43618354\n-511652104 485784081 10139801\n404368100 115209365 10053207\n818787570 566863582 30056919\n-919112209 711937504 48651822\n90757858 544316671 63173125\n-972420417 119435047 43381675\n-284692718 717382306 19406842\n945487731 297210810 12529927\n-990094911 783430857 11754010\n73086426 483916373 145121\n-336137104 -703651803 28489436\n14431542 486665736 17692111\n346652922 -841582555 15311849\n-328266766 -663020863 17630773\n498176020 -747276361 13084090\n481724497 548814285 60812886\n-859870185 -65770394 39999383\n220064429 669371074 78377462\n391837404 -323162571 32114934\n-700127882 508434965 22273177\n-139216188 784144932 37508924\n32142640 -679433310 22569738\n-531773092 496897034 586571\n853037679 -984033213 3298541\n376537153 503490510 7437016\n-610402772 -727514118 12103842\n96188728 720406975 29496711\n-982647471 766458778 21231367\n-342046790 -23305025 28059870\n-236436979 896191889 110612441\n670820950 354381386 13343056\n-793989880 946234646 45322076\n-144710886 -293246739 45509365\n373596265 182616063 48834031\n489021869 704361568 16850890\n395144910 -321567507 63766843\n-207860167 993547536 1058279\n990955832 -182089887 10039676\n-98566886 -465170020 56138117\n-480489072 -758788353 33220968\n689923120 697973000 14624382\n-249283983 -725426767 18376599\n-191017898 361456876 44113920\n-99241342 20707370 47780953\n-696456675 132171347 9774021\n904898650 706755113 8634250\n553078419 841242455 113659472\n-521458709 722969649 886920\n574204174 753371931 25625832\n790416436 -858236691 57089170\n-208917585 -483362745 84253875\n-433231858 -600225946 5656618\n-180265083 -565002977 94042548\n-375450957 -484768433 40646684\n765981073 509926895 35294084\n-384769429 -10567304 97311248\n925396137 56719187 50897971\n815338000 637497846 1557873\n320120837 -604025916 23716790\n-749096780 99699687 10804829\n-207070983 568445630 11929632\n183167926 852620106 34647888\n341365104 -420343883 6546597\n551392916 70133001 50712276\n-636855716 -319151818 133735962\n-135307534 591958539 19391696\n71727081 -978451878 37406113\n-532837448 -332394585 14992923\n-830641920 -112960363 7560287\n430685908 -974152421 39167804\n-554066002 -637758275 11328529\n-782393376 325571328 36665139\n-642244650 990403952 5859085\n-490891924 -829294911 12550437\n70726391 -927689155 14079632\n432782751 649848727 19433876\n396894167 721398130 34584378\n-107126260 359653830 28281670\n489247772 -297627747 54059128\n-884875125 -497407037 55218165\n-512998777 -929729236 37924208\n147817225 297336198 4373073\n-572810398 963305870 19203427\n528718305 -179986787 41593344\n-443044779 -124912099 6681634\n-404232946 337840638 76983850\n516213151 -731859264 30924064\n-537167055 855327909 4313658\n-176603972 777152771 10088338\n474179168 -42274867 5129656\n-436435826 315623772 5955073\n741896213 673417186 7783581\n801125919 -408762048 61003494\n928784221 983762451 107827332\n-816899130 -969135376 31155232\n697838632 615036268 8422937\n724668606 -153020627 11447716\n-286418416 -466674136 3312737\n997659764 -23295871 34870919\n-717902684 219074238 8569582\n912408813 -321229909 6819475\n861649539 339346440 48185573\n-327952332 671443995 38882748\n-799049343 307363084 4967086\n375747802 651224959 1296821\n795529008 264140458 16212662\n599110030 -846430034 63912020\n245205956 534254257 8417454\n-125437042 728757713 3427204\n259412330 95956909 26082918\n257101780 319753740 10563023\n-882509962 799499413 72921572\n970855928 -570322124 3008060\n75456700 -740390537 32084349\n337196469 -771174510 6891263\n628772704 819616056 54949501\n490607535 -814822454 20696373\n-34390462 465305561 4428006\n519456339 -503006210 784457\n-308743313 715356828 1776981\n-624989655 -719612237 9567224\n-143893253 -993944192 8653063\n-442442973 361761467 12701012\n-156052027 72760394 4414766\n-755545562 568395396 15311899\n78810061 333661799 2493519\n578760400 -69563649 1713914\n937702770 -555155564 62848376\n-543110283 917144543 753732\n927812042 -887468943 12829107\n-204279014 -565545193 28566686\n-699573239 481772003 41532046\n286615172 -296623884 26670655\n-19560434 961196887 52256879\n87578165 304959031 24270916\n612647096 714200587 27362874\n-541072810 -599193922 54282919\n-797237976 -60610502 23486655\n61996079 -275668778 8398617\n276672664 343329014 142606223\n871043941 -838317052 4265082\n-452482124 199838818 28519768\n-336404664 573308494 21516458\n349773127 924337928 2425893\n497635017 621682359 10778280\n-849219205 504442466 58548899\n-547757049 104161920 45999618\n-665743750 182287345 12006235\n671153823 866471329 10646568\n284521047 -132340544 8412932\n-866140363 603329902 8397855\n477028226 693884229 33279913\n-686016145 -624304259 46546433\n701171126 732275276 5529909\n-75761848 -357750942 19028356\n538751361 -895318017 43299161\n48393224 -85938610 42569087\n730603787 909578504 4041164\n-721300389 -989556079 47388735\n-471942666 8342415 6675415\n348538167 -821776560 678665\n289115347 552294126 59581885\n-573706598 956726926 5433845\n-214840000 127106039 2460992\n-898459417 -591085675 2209079\n928003675 508851663 54683740\n-125730210 814423434 10539401\n503502476 -639370333 13243661\n-227841329 -727335280 45279676\n844284567 -128470055 28530458\n-550875935 562405476 13953496\n746141096 -258530250 92741463\n514671239 -138582562 59486537\n-110293181 -142636376 11423589\n-105421157 -526063946 634901\n-763364359 -216962746 77993323\n-14038238 228516048 28817434\n-898375890 994659509 16065659\n40815762 951917338 7138157\n933928167 399566145 9563124\n-985742115 -2667830 2235624\n-489542151 625584699 15219621\n-909778677 -221283704 36746113\n-254752737 -87067223 27191833\n420766294 -501308977 17428880\n520151550 849403403 10206523\n361815640 -938940892 23304329\n999044677 -51745354 11199995\n761790864 -745556653 14154860\n-230385281 -990807263 11801529\n228083514 -697770884 6443343\n-261020876 -196960402 8794299\n209685716 629088186 7217067\n691757619 -428122082 14747721\n-701810494 -885327399 24120051\n916717773 -807777682 28528651\n-80581471 254252436 21315168\n-97750655 21682750 16167159\n939189081 752101380 36297252\n-164517804 -28606512 4155260\n690385554 -778885057 2772313\n-363555179 -609646006 7936891\n-713662837 389560832 19494994\n-577497458 -511575350 32276060\n415830237 -271489472 5520610\n866214151 -629490016 97852507\n", "-379310624 -172680094 -37885264 835717075\n989\n259802985 -16301316 12571861\n303310271 39948738 26895123\n-372124951 757320720 18178988\n362503797 624120289 13894550\n373180622 -624004367 138858371\n710854630 -775797552 28879423\n364910475 285633188 114643373\n-780867770 -178453837 78224391\n-206212587 -707440514 81145400\n-349469343 -72046846 28609877\n-435835670 -651176259 11587782\n-122284244 -6679564 90919867\n692475858 -889587993 58488552\n203067717 304761160 30951090\n-282499326 652377104 167660427\n89727464 -549224033 17490306\n982851612 907597714 29769632\n-908135903 -960189494 154411298\n632072655 987573368 32576680\n806569280 837912678 67761260\n832116688 173934669 34294632\n706802766 392409454 81463112\n-222116092 452762642 50511683\n8941140 397579229 60253836\n-967720 517452562 256763026\n-308756682 447201327 30359785\n-536867498 -388733670 50045618\n-53296845 -299496738 20078585\n-177036277 -347738715 115232710\n834205571 -825364 61263380\n479227243 241459914 25083346\n870548066 52037434 19199782\n-590652794 -876783040 865883\n984205268 -206928340 20679664\n733849540 -993082554 33237948\n790322019 -910665533 5128681\n27830175 -741863788 178060092\n293827980 -52576927 163408731\n-355307407 -755433727 113619813\n274489955 845935484 37895964\n297617647 11087286 47162297\n481991015 -919798843 19151837\n38317796 723766086 205887743\n738676712 -680399849 11456041\n-122188775 -952415959 35994725\n-815637713 668311592 59789591\n37186121 -186414563 97449314\n-38851875 -124233661 34765777\n-285021847 -710995978 14528970\n-211439359 43095722 56970245\n-826981078 403217769 52502783\n354776086 557116889 32987299\n-308373630 -736894311 62959484\n-926832134 383560117 86896573\n-194395733 189775638 104736604\n789396333 -296350797 6561979\n-610093260 94642872 163685125\n808786111 -568337721 201990116\n280406062 968298230 1503685\n229646983 992972444 88629670\n-284619621 168364537 20431964\n-346608305 -57674982 60103222\n482320646 -695034179 68340307\n-207501600 274937686 141921163\n-755910965 442927358 29158662\n123391690 97918018 9141273\n-34181741 -310731363 50286900\n998683457 -278123240 81087838\n864519446 966637334 810996\n-193575999 572434031 126602736\n-773863654 -84123225 30894949\n434606768 661900571 23520576\n-223635513 440181074 157574035\n103643204 -113533255 122743320\n366704251 -508701196 162552022\n417012057 829107914 93496717\n912141331 426456408 191235895\n369875730 -855787196 37788829\n541858328 -658348532 151263453\n413064729 -671306254 12025189\n-955849238 -569722901 50541266\n-329837292 -96471553 105430261\n-657292033 -815657521 134564699\n99010744 -282722527 13146583\n-411431181 -807250937 22379611\n-861002318 -973342984 106042932\n-654403420 304344817 56436484\n611416879 -806582564 149556015\n-196759714 123870097 74085553\n858402761 -48954317 17745846\n-946190635 -245915622 38727744\n-711291132 682385926 14580646\n338269339 283231430 16120309\n899754382 -974981704 61873353\n-859670967 -136871343 22001974\n1760229 385943257 6010650\n-174709941 -947308126 130121446\n-807695283 -149779745 11597190\n18128516 -267594458 48262438\n-998754025 -756163099 271548764\n-918890073 894828463 5876521\n626271792 -70905937 11737095\n767050707 -407612631 35703656\n592967377 -604266179 1522268\n-727310056 -463029358 111078735\n910830988 -873299056 15238423\n75163019 352509313 48052198\n-645501002 -635075633 2557284\n322900006 804988326 7964807\n482458166 -891330225 48391686\n-739767664 815973658 115979344\n235531824 -456359904 159003067\n755131134 -80648837 54124113\n-806311330 -343729892 33603781\n-29501034 -40168663 46755533\n-855981944 -789267159 114302819\n920365815 475831412 11579765\n-467281101 6105072 34142519\n613100651 -261019416 82678259\n597015758 -223182153 60995011\n465302361 127586491 176258729\n596605759 950770642 22781032\n-602559010 25194875 23395499\n262564540 63558151 26638490\n382937066 63168908 106428653\n182616665 -398452409 241576321\n-196928382 -803939233 45815693\n-654907348 496667562 88767936\n291980775 -657636038 112834019\n539323761 899864725 316041\n8478694 260420121 9071154\n408025814 334745840 112707323\n922255074 -29534958 11413399\n581465148 737584281 62522602\n730112938 -993413302 18069489\n168084056 -198400261 150212698\n846318940 11293454 98972787\n57491386 372324572 296280332\n-926727972 258448245 92329329\n356877139 -940291338 72285905\n766381340 375325722 64132066\n721001259 9624848 11799414\n713866683 -229423179 64524690\n-553910861 748698337 26204477\n500203880 266725435 79733574\n806536614 780716539 5987087\n321847561 -546171445 61335653\n-40087180 -548711014 17327124\n396125498 -328827521 54086912\n644427732 -291718816 75272396\n-224328222 -267539123 47973949\n-634693600 790218603 40171122\n-155876290 705127589 173910834\n238333336 -311513223 96102509\n-379409906 -89829208 103611252\n466467641 -797738566 36808069\n-861856598 950164377 268729056\n-488885064 657511612 101013275\n128422317 -468549710 21623981\n307719159 -864238837 139459492\n-826037682 -26745592 87207013\n661325108 -64348126 37633379\n527425808 618932762 57694355\n400362585 -771280739 36825093\n468339318 -991856568 28982038\n-333030675 445893177 2668762\n637325052 -389313721 136853648\n520759184 448304681 57706970\n-480153532 -390064263 292268356\n-313061890 -660694741 33128593\n655980071 519536925 71097491\n-981029908 -781962208 20722662\n66169831 -180771299 79239445\n194239220 -606512415 127210972\n789728966 491832277 62989394\n-775783739 186795658 60257503\n593370959 -552281643 31703479\n-649016422 -84953949 34410007\n750312033 9895627 213724466\n-382214388 -602402263 3286418\n858089322 371920221 37513231\n-222537904 871118582 115643863\n517254237 -250758212 82003336\n-376991811 -103131452 21064273\n-870655178 -996389368 14955318\n42737603 -192869441 3670315\n925831711 337658866 94398444\n702432786 95460585 176672908\n-983645790 857999172 139117357\n271750235 428645515 3078495\n272615659 468853169 20776370\n-843524267 -699784550 5846078\n539397329 694528743 10286742\n-804367628 -15239191 93363436\n-721059817 -204109062 18691260\n433824464 644730543 40511231\n126603321 573571604 136037464\n-663382080 164401342 114910720\n-672027957 -213344017 340496511\n-754112659 433948175 71771852\n547582842 346210737 14548536\n750999419 519686183 22266729\n-984558919 -196277377 63294999\n139679748 -98041250 28616903\n-123148414 306605426 55860804\n106889830 -479411229 115260677\n492583144 910810043 93515045\n119453984 210748997 33975086\n-698620916 529074016 34415166\n48497554 -698226048 159832605\n-564820753 -203376857 12122260\n888455734 23067141 447327\n262074097 -916842745 88738965\n193875307 297713896 6743449\n209741373 -871260167 32143103\n-928504560 -385105961 17158798\n-450290015 -620146528 202020553\n341474822 527007093 65280800\n-989548988 -470488184 12460439\n-651633209 214353841 74048044\n948830048 -360096324 96538928\n-858131245 453175407 21997570\n651251092 -923523508 190293589\n815300786 -353897346 36073466\n-436999006 -50010431 8614233\n293713270 404428379 9692402\n-983694765 911513030 19698888\n653267783 430386806 30292680\n-279270239 139083276 18856406\n-542398107 -410435499 83415726\n-814338476 533470186 27602375\n-880239131 371759057 9298686\n-851705603 736856174 15791484\n-41406575 -397382096 49796833\n-91982729 -709628450 26406635\n-313409680 -765365121 5294240\n256966019 651372154 296063501\n622668137 618900935 15035046\n-894883093 731810311 21447782\n771078603 -832086959 109243336\n607251377 -474726315 33099553\n739048793 133971600 15124529\n-752788160 391739931 79534856\n872730597 366900595 15557207\n412165011 -916108886 95813\n-412798923 -259876340 31928849\n-414947320 666776565 96211774\n594707182 -877240814 29071840\n-888058705 -239599807 30966894\n497414790 913898459 114450456\n-2792141 54255283 13592555\n745493912 -764287642 42656466\n-36169246 -290956596 43330846\n-855832613 -36455614 66325410\n-362667886 -147305916 49906875\n-465648657 635807833 212555769\n660002522 142793695 29284628\n851153291 939031131 29167176\n-509044861 739544427 103767767\n-324896547 -124890309 193654548\n-708417429 -682907472 9107552\n-154546865 585439528 19816491\n-410294549 -566183418 14163787\n-618556862 -275926255 47293161\n-651162606 778502237 73096133\n-53950877 -160842604 61040998\n503946226 -416953180 157952987\n-218450261 282695931 83976208\n460222366 993855427 136117538\n-260773605 -142348782 38668561\n137457978 891605048 19172847\n-704034253 814242442 143407279\n-189497612 -365843027 37472633\n-100947204 708888869 2124226\n515349200 -772014571 127704248\n440369481 544573145 49816240\n481123133 -684565639 172290806\n199311879 580988399 22258164\n451525302 29079340 62147336\n291264959 440795275 2451126\n-155807947 -461081771 87410989\n750395800 -633729627 61643588\n264144110 266565196 365968278\n-504495830 -917478232 131075871\n-443257079 -459626612 5784\n390116645 -621531461 13553138\n165601405 -174693480 45810379\n-415724060 -510135552 43956726\n-478707693 812822003 220719594\n947932471 197069802 277090245\n205212651 993793347 82014012\n-138339419 -382251234 4048244\n368592507 407299970 95589348\n-260039900 -246808952 177995571\n-841053464 592685743 116333239\n-887463185 -174764013 48196646\n772738186 -132995205 45706143\n709891305 -353491444 79923336\n-952204641 -718779389 291432\n2367718 593056195 9642795\n-485227478 -521345 297476777\n16425988 856963388 98374159\n76805161 507832350 16449342\n-49716961 483650144 253874389\n674639141 648225335 198942578\n178174982 56190617 81075497\n283747469 -458157829 69089170\n470023138 594606569 512030\n-158737668 131039991 47591797\n-82555974 861116430 100763999\n-841712422 -383847340 36342997\n687968325 956086974 52613517\n645451335 463139116 17171393\n96182924 -685313235 77566496\n-917754518 -168889780 10600514\n105960616 149314716 166737787\n620701925 -323407075 4265758\n-955913433 -776450522 78378540\n798595976 184732951 86124693\n-247857746 599194147 21794642\n-406502813 722242705 88196378\n61147730 733667007 23269961\n-110849753 -728038173 14896563\n136309257 876935488 53376519\n135308161 -423071615 13471318\n-500269059 855633751 8325351\n-976247859 -342416053 4273596\n92639735 23020508 8828052\n601862908 -593928831 16910948\n-442532130 -959032827 5786761\n303757835 642367882 39415891\n-692323841 -479501889 68084427\n-141486463 -609961159 15334875\n-280507163 139275430 55811672\n868301603 -676306560 34259706\n-272497539 -236096174 26994305\n779050161 722061154 12008242\n-688577711 -448197541 139735260\n187192240 172049000 15404334\n261854848 522343876 4603475\n-321048468 153701678 45600997\n-262812008 -292595959 83143025\n551311614 715743613 5842050\n835629893 813482654 27081153\n822439593 644879132 81878368\n442189576 156247156 47161107\n-388341037 630656548 464434\n-199894891 474883294 66912883\n976572626 -644703867 216734217\n16835066 -270320573 69253946\n783481531 547689385 25214082\n752418050 930608103 118708234\n-760957783 991479123 33987612\n354289093 725683921 97367151\n537788941 677321148 6995413\n618021309 -782758690 112055654\n-464770328 -819904101 9034785\n281082943 761793569 225978861\n997069455 624355958 120728797\n184487150 -505902438 75234743\n-620543129 -522854311 16722822\n-230847806 452466880 50112529\n-411792664 -765832915 52196061\n792853045 -909028363 121224910\n-651649742 353671663 18050011\n171297243 -380071882 53571666\n259995497 678934604 46718029\n149529531 875079061 90369364\n486592440 -276726439 7420018\n4061153 275386067 34574819\n634660310 929334070 68576346\n564689192 332659279 54999171\n662732983 533253274 77579189\n-305954091 986642484 24292934\n-250079320 -867548573 17981651\n-177957946 973747155 95242873\n-620489812 -738462358 96837693\n875092825 504588039 187286102\n738977476 -129616546 52615953\n-848096648 -275308042 60012394\n-916826904 -323785723 59070963\n-690015592 -276369354 72726650\n-618316998 190477665 148048695\n-743245211 11825086 19321476\n-408088340 891877071 55120228\n621534042 808026362 53449627\n182863636 422414630 153535521\n370692113 298548843 140699955\n-739293680 -835498547 109167346\n-192538799 876188931 163912307\n453473428 988351158 30808372\n-836159043 912205008 73602514\n-357053836 313454157 266350283\n692169468 -620395640 19820848\n-958694379 -852113801 17679770\n899274222 -145522164 25620390\n464015664 -166905947 166521524\n-457651089 290560334 1796352\n-232530893 -858371710 25805114\n-754792127 -392607573 66079906\n280320384 540584670 48652717\n-964457652 -565177495 57943431\n894288771 663542534 117877182\n-361367525 -839563154 90901239\n-607845767 946510500 33207105\n545052706 -607722903 237519861\n159377578 -432963711 23297311\n-956032705 -496153258 50677093\n-510981323 745438972 171374521\n-684510433 -934024758 11291588\n608135735 -920187340 63468394\n455581861 -598001575 24415548\n-176369755 849891155 126327139\n952587910 -269426869 62344006\n-626178595 240489566 68381471\n468551507 547624399 114946787\n910331243 -380329140 29670407\n-969818588 -44194263 74160966\n939641999 -264308462 131464240\n-831040829 923970115 187624579\n-614215813 -100930063 9671789\n27493263 926037355 89690238\n726108765 -209367085 122648724\n-272717192 107257274 226368478\n-616371598 221000239 139904229\n-657899805 -520004660 118144813\n-888422232 -328808626 90879625\n752678995 205310866 3083042\n-146760838 417020563 28167465\n871997683 941745162 35729932\n257229697 58978585 29585376\n-661131329 255913624 25144855\n85630765 66172024 65800510\n-617204602 895920320 116093041\n957257853 778231337 9363854\n-469792397 642830559 45511493\n-103308381 -325465163 96579217\n886367810 -169424448 1800420\n-506550275 -488736414 58293278\n141034948 -676287789 2969017\n-102452093 393122477 9794105\n-158363798 987801766 82801268\n577698444 196754563 230253666\n-743483320 962459498 66662126\n92148197 127465424 34490647\n653362951 239301801 23245\n251413730 736491003 22835717\n821928990 416229983 106385786\n774901258 -213662539 92593673\n-891994622 92636987 155864388\n453545753 -770466970 30978985\n655031707 716732466 40886608\n656314498 -997034272 51628046\n-623672983 725961590 47421894\n-317334025 685795241 74309136\n668064206 613532839 41729942\n-156366368 -363011958 76079000\n934194307 446521675 191365116\n680159365 777375252 253671964\n-928204261 248195967 43604390\n-186397822 62560115 159753\n121124423 61492542 99587835\n-525051820 -432979132 24631672\n-522332329 335692910 20905597\n-495641770 663518027 8048549\n-986828966 505002616 16762621\n583773654 673929020 39651130\n131126554 54940020 60101672\n933176784 969599260 60473839\n-367097114 416278742 23992574\n-773557905 884826328 49693003\n537050985 -111573077 3577895\n476059084 839727356 71613498\n116901221 -227212806 75810243\n903020440 520054888 4383517\n-875421619 -385225279 63767895\n287452258 -876357648 13927045\n-650057763 745059097 5521005\n530165037 306681761 62269823\n-730298668 -762862048 42398952\n80432637 -47529252 26444449\n120245801 914799849 61422786\n627890236 606124181 1033888\n-621214406 -166694315 21933918\n521269388 768394087 20863490\n-471638294 119071615 22000921\n354650667 -255787670 760344\n288375819 868594140 26318938\n-125882451 727533978 128698995\n-841019292 -983435740 31080265\n-656195505 -882284747 14978463\n924254729 632021677 225891424\n-356865635 581292395 261719006\n-392865457 72723501 37477861\n269986816 -905598342 11369887\n961001449 185844330 6327873\n449446680 364840009 41138647\n-876310242 -615186194 47901440\n-130956555 -541353046 174381675\n-761233750 463968630 38850334\n-458227428 202580034 450043164\n731679438 259500885 8958909\n831965558 -6269157 240732694\n-554296137 424450666 55995061\n-878606696 -761207368 21346479\n909188126 626950932 78771698\n-939424297 408817998 50807121\n-425551944 728462304 106652809\n-69310196 654569558 31441889\n-279790879 -2217566 276441485\n-437948332 -370651230 41175017\n888380633 -832394917 15941564\n987096158 284173326 112438574\n103840752 -63351252 33194565\n481367614 593006868 45737467\n-153391616 -855318389 33331513\n447872880 -133266071 29403805\n-672428235 -31700258 29411719\n739619188 -673821276 2602757\n341886638 559215745 53481\n-949159894 -385690804 5652523\n607865604 -563001671 100783210\n22999264 241587985 234618635\n300268731 996244670 137988088\n693242608 -979459426 98584550\n-951500374 199431007 78216820\n649937789 156376193 13257283\n280038540 -208970534 58056166\n596834745 879181751 173214605\n418691283 684099123 143542901\n-505114539 685176176 5426046\n777749297 -588407297 32171085\n871509235 -708746549 14149252\n156387575 -868463841 13012773\n-396066153 291527353 39752056\n455894205 -820283497 28180898\n-669623284 982863245 60274312\n18824530 563980509 106162277\n-389979252 -481315126 101286230\n-853599119 516028320 48742986\n-442658953 -709310426 44566660\n147664875 -27215116 105321505\n-159031182 -697944043 27539750\n-797255985 -647081851 52101270\n-178620525 -825993977 16784199\n-261086719 769243105 65574516\n145890852 190419961 30528874\n-438002051 -673220090 38238839\n927751712 -832637206 166244633\n-683005316 79485161 30721022\n-833424892 -906443414 48684782\n679384145 -192169231 32670882\n-340598489 602960534 85860284\n-87935781 -622710303 18812164\n560175227 -751258994 59935892\n134427753 -872255687 25223040\n-372832236 -370666650 52570295\n261003707 -939996889 193306023\n-37481291 287690509 259976575\n144558153 619613842 73701895\n811758545 -551850839 80498848\n-951626588 976292777 174538403\n-654703645 -484564977 46678523\n225935711 166562652 31548437\n325299359 72967229 71957003\n-792079036 -561882878 38665771\n-567499455 298278086 13199013\n787836897 -398153260 90604053\n-576642021 475991499 190927534\n-278349598 740858341 41452191\n-573096957 314459618 119558334\n781691622 418706195 60541792\n447669347 566061873 121139229\n-255690995 698473322 49032558\n-557374768 245927455 52164839\n152633776 130603309 19019526\n-771220433 752509651 247772197\n-625098776 875591895 63102731\n-102682064 -517649483 67847169\n452514446 909709067 95077568\n-821685490 681084861 46786820\n-139414193 738984005 19174411\n608393970 -917825279 113476741\n-720454855 -235695244 3682610\n298533497 161250296 60685596\n847049279 658043776 51843851\n304270258 -560388637 8662635\n423747320 284266817 9836928\n-519442312 197842739 191417270\n253364788 -52961130 9486951\n-733168462 -186268651 163165102\n743044885 981413840 36012695\n983597584 928308953 3278295\n-662425696 -26171497 37782550\n201759688 -201310189 47994454\n-953948889 -907808522 45502179\n539506961 -222799920 78267070\n-535357239 469410343 74400654\n-202845815 -983962094 111869667\n914890454 -471772551 27889187\n863960132 -515215933 131920044\n618711563 -848391976 110914085\n-119934130 310258964 56306544\n322249340 -113617462 3152549\n-785152358 99119514 29571157\n-745133393 -312940846 13400432\n648557636 287981117 33576253\n58470725 91516487 26266510\n730644330 51896384 30637466\n-34662202 -668152359 50136746\n-818350550 506084831 40513210\n-457681335 800330276 9254875\n-115668493 -274082514 114446350\n-374600998 531867414 7423206\n-285174352 333035609 115803478\n528122228 -110916382 38918478\n251525288 -453571676 73595099\n-307417484 435117502 104060480\n-606911474 -656100410 46815437\n614358786 -692015467 104439295\n199952931 533841813 99725528\n172839421 -881983912 123073233\n-426450126 -557508546 56672393\n691647826 -613942196 29666466\n-919260679 417661711 21271962\n-695120783 50181899 54947110\n911280700 551282947 104721050\n507310594 297958498 11667947\n-775633879 -895856328 10281303\n-452810932 -198847643 10932902\n938613736 -798774969 25589168\n-688953244 -554223638 118958406\n393217996 -983424530 87161832\n-210467661 138241609 10859519\n-782770676 164906621 52245082\n759476965 -494433562 83935678\n-36156390 773286657 171336886\n814053361 552110387 164226373\n845944666 -596853099 42869283\n-737514541 -291172957 20008816\n-641044809 -266417750 4141681\n85768397 -467951780 52109456\n693116017 -200002061 282290920\n989905465 851341460 68853500\n-452823802 -407224626 184551320\n231050229 786741446 51959819\n214911678 752083859 31239590\n665745403 -70985539 169126389\n-848560972 -681654862 68428210\n209732356 -446062061 9070009\n-921765150 -336105643 80662805\n-109402071 -461252915 112407860\n-242783706 931740175 7370918\n85235296 765706567 64624098\n97766513 -379195638 83764772\n-220484576 431126101 5779545\n-32813514 -127524474 56892767\n782926579 164557562 43112809\n-10864535 -682533334 95407763\n-269956999 370878730 48849612\n268424545 44895504 97087602\n80371170 665400177 3897055\n708352782 566796965 90201084\n-965079838 278682106 4014235\n338246580 -650861409 72136602\n69327237 -972464439 6881121\n597748543 -273347347 61838027\n553878556 367222079 49506483\n-357228552 -440904671 50648506\n155508276 991732237 61988614\n460670090 262228497 28675311\n-205463833 -139939561 205647240\n-963072275 -15694469 230082925\n978872743 950302890 116040207\n182931319 -4597932 32283254\n600474148 218580202 295075558\n-630393812 84757927 30175795\n283193975 558783806 59350592\n613832170 121004908 31918909\n-261879626 -39064186 72073542\n877686414 -754823398 229666409\n852588563 606099960 113592334\n-620688001 967376167 4958120\n-812443041 229797829 44335194\n595909139 -40269502 37697248\n647555122 -296353809 155385745\n-639068486 472625284 179707460\n784217249 517724857 5360346\n-686126167 330549556 95673040\n417792147 587375428 20741017\n-915473342 833924801 24496277\n-219358508 37009083 84084385\n288181975 944482986 71930910\n-2538140 -6127014 15476333\n748684232 232181030 60302948\n-566347376 228478394 6913451\n554153491 -282536745 53718756\n288097846 508953167 48217899\n657991687 498552513 93924232\n-793669469 -303970916 51561179\n715456915 732367504 39222105\n-261195826 -381014757 7014090\n-790861975 864304873 184944013\n-505350880 -899998161 171272392\n-706217176 -176306149 69064034\n761862719 -859779762 2206218\n-891919838 308890164 6689861\n-262654946 997173789 32992338\n218334168 495265895 46352472\n780327550 14006492 118010799\n699384287 -669343264 50038189\n-835715319 565839447 35157237\n-36968738 -599486325 132049732\n-439274188 769260791 237657005\n934815818 772106169 21665991\n63173321 -406946675 13516962\n-911105288 -109133293 14436765\n378821952 250329751 242832074\n-64626643 938345347 39230541\n670563040 153825169 15639202\n-353284986 -218209167 2770821\n-6039628 -587379051 90084376\n-549551851 -518564392 18542990\n-942842578 754832978 100085652\n-973011168 -714451004 72043056\n-751495419 -452135474 3657140\n262024623 264508281 6950948\n311270426 -787158850 6733373\n716529869 -742934789 71004686\n-807249184 -132303625 24104905\n155136578 -153980068 138667795\n-382309863 -307305942 32498246\n-4626475 -357000065 35979551\n-585923105 537133002 27743537\n-911940022 908574898 43891245\n-267298976 -316300481 30279473\n57906396 -461391091 54477699\n-878344168 -678312402 57396560\n204120197 -736271178 20075272\n-891966434 -592964635 51798037\n210266679 905771023 13559109\n932245013 106775756 60144126\n256034030 931613530 21380464\n895207791 -567972358 4098290\n188540831 415597508 51239296\n152720073 279450495 266605484\n-464195791 768507947 84502930\n-95748266 -511487591 100309496\n253992469 -85226434 8267257\n-843067088 359023731 1650099\n170787925 671559728 51480805\n195139481 944005861 6351905\n665261277 -274066105 215558721\n511679256 223455657 3651785\n311468407 98356237 49858784\n-204182391 142547029 50568471\n-976700518 529507430 91110323\n-143818529 433547301 119109500\n-247471274 833033729 25632575\n-646517673 -500811289 67889158\n-563304524 182080921 20486972\n952463736 496865296 142639807\n-291483898 -830385414 25263361\n384027770 -374257453 91595102\n-410702904 -515793564 14076747\n-957824027 491937361 54747462\n-856314533 721218060 48204381\n-559352011 -992584218 80497654\n636629056 -615425414 83417191\n188549391 545135316 69671444\n439642495 581390481 35212152\n364444358 232707273 107858448\n-367174502 606631691 11418976\n267446654 -470843701 154290114\n-547829349 525180034 5950393\n-541355926 -396276633 6940076\n-785245901 244808116 55778995\n-242922721 483581117 40299726\n-285309508 -40292692 18286990\n-153738848 -3661906 131611052\n-152046488 -499931913 46225946\n-49083188 155453438 57043280\n87465115 350650558 60110236\n757093362 645198299 177460915\n-10950777 998270061 2289571\n-585946888 -963186534 70060101\n392656654 -359837934 101391264\n88717861 305381432 7828668\n694989422 -313681674 12370561\n-491954108 -602605497 84694996\n-761187634 989759771 38328348\n345747107 688135953 45848248\n-503195697 543194612 52319011\n-430575001 889556316 97097975\n322794721 -754812137 4729544\n-614608946 722583963 19070683\n-203824531 386481834 85400081\n187806017 791976065 70608191\n536618574 539547890 4553355\n-671241264 -116860290 15788753\n367212613 -95750663 159670488\n-497077001 -471140148 110629506\n-723391127 278975171 2775516\n893603699 -173455612 123436\n-121751690 -199076544 32324006\n-430569824 -391718045 84497235\n358496747 -154023627 110228353\n809574365 -448355577 149248969\n979401228 -952070105 30623774\n-684469483 172035022 76069700\n441787030 813632844 52968131\n623881357 311756324 1502897\n659624480 619288550 9531800\n540279857 772616896 109446906\n560821055 979783142 55511327\n-681457246 910858421 41731213\n526029696 569515773 174669930\n539740468 -842868552 122149963\n-952470479 446895126 101231035\n473471739 31637435 73720073\n9334702 -749681032 36165609\n419294295 -909008203 99062368\n-543681264 -100785630 77889661\n-176323573 75609377 34777398\n-263477494 16357111 15422648\n-394284526 749676970 149225042\n819516609 -130177742 245505679\n669555779 928725360 153593703\n-330962178 -666668271 71984483\n68711572 -480710829 59614627\n755586434 -897260778 14901333\n876819179 853497715 264655628\n33723393 203075979 82110884\n-537537385 436617457 71533323\n-896076962 -268452731 34069767\n497054855 474475961 17089722\n-22156524 -987022623 75329296\n885281283 597728452 92763956\n868453751 -312457500 53380305\n995742279 653608324 167194791\n542841199 -627389741 2530232\n959728160 374597534 137327472\n236345235 844629454 23183075\n679898652 543925355 35825372\n-144392706 862521608 2572377\n-876797385 -537144063 20479921\n174334641 563533159 3580861\n314510381 -307789820 45154550\n-750858461 -885633770 9995206\n92809106 595504601 40308859\n912608130 -970532057 8701641\n248099189 -985773411 4246143\n-244800825 538547787 13688176\n755626315 -400359641 110836085\n68781847 113376504 67669388\n451782989 470744131 35873128\n17886645 -995261925 39844899\n413997368 -865933514 37907084\n956811279 89534646 70669548\n-248389592 847891595 45024671\n-127857919 799967005 199668485\n-358165718 -25023926 149773459\n5242148 876041406 36216142\n910697700 169813696 81270437\n158500037 -720555331 179349556\n959699913 44063288 133894345\n725483886 -393581920 101888566\n-749549998 813133178 101177004\n-923471813 36716102 43130049\n-381553096 -81363688 4292813\n43727388 724826391 136665333\n463971240 499246916 277716319\n-917900092 -314000331 205208903\n-905833717 123015660 19436751\n577255908 -247853262 3789717\n-275360405 -897173420 85377542\n-965591481 74174445 88990065\n233238607 252352273 12750183\n908954286 406524032 108057921\n-726577257 -488740346 86916237\n-797320717 -611854621 14683438\n-492249863 447998794 30819118\n267189487 -5375478 206290768\n-734679598 646028057 42669787\n-577608781 652128959 128104060\n-245493031 -689270505 65918617\n16558565 -326304302 186120367\n102639262 -331941151 122341933\n-643154326 457104796 43316008\n-403998682 607654510 951567\n546761639 827594715 61104987\n864731419 644034447 78291248\n670569162 -450206311 32164287\n-911727866 729673150 116772084\n-6332895 833356537 29958438\n-886849052 375318586 4912969\n383464555 47102313 143378927\n644141812 855285745 12094770\n-877739931 999667035 7060478\n-49020100 -703726779 210960881\n23584308 -295478427 6690943\n-76524505 -183531617 33189223\n-505653966 -373814917 31443192\n-460356683 -872263642 14941356\n172269034 988550686 136582830\n-542085262 -476863027 31569601\n629284580 -447931924 6847582\n800138787 967468756 78038926\n-298615561 620717704 110017597\n653861723 -373266868 41625153\n-58108606 -834829221 33037718\n-337166220 -915312790 93713161\n304025750 322597245 45781333\n367381757 74541855 89202343\n-84341303 39749625 25170408\n993520784 904672540 84361855\n-122860317 -802951403 117348137\n117931711 -926352891 12433499\n821003744 -244848254 18902422\n-256339964 301142738 150008546\n675763109 -178146689 69694079\n674711734 509456619 103197345\n925415718 -515123198 24519163\n-786153727 215880005 30134775\n679476516 -813065476 33990701\n505464448 41468063 64946336\n466215071 146328744 153231656\n-618439552 -656004305 60202379\n732388068 753263807 60521041\n205133288 430662342 20523028\n780228659 552643698 63401722\n436876588 -744011378 98932380\n205096923 140784543 25873713\n216186925 110114346 115118924\n-453034981 -782465320 2416348\n701034468 -66938179 47282810\n710431967 -30045555 22285780\n-960064681 881011241 137354382\n-215647999 -443823535 99894523\n-194852688 -845560318 42979373\n116840460 -184449892 100448078\n164246833 786657020 9478939\n-782596035 299681075 110917126\n-688040854 -758016232 74409453\n366857782 -906956440 122619349\n143265243 747653516 9311230\n-352488330 237259708 52382571\n-438621279 -164715717 128552544\n540872099 767070786 24206984\n-819081203 125810097 149949003\n-86981654 -4599969 37329791\n324219366 -516905166 15849622\n557836881 -869190464 65900621\n-452309051 270818652 16814752\n819633757 -505644967 30238216\n912358661 963855209 76265261\n-838860612 639747982 200616587\n-36898658 -158763553 2432072\n167095424 -405310683 35843380\n-354977724 502479662 82905106\n580649890 153884716 92524324\n59275455 -581956385 63219363\n93308529 492962545 53771432\n-30697791 818224962 106248611\n78289364 898724698 24602129\n11193565 266163181 6555395\n-598569716 -850335355 141270911\n-282948792 -612411998 14603811\n-582045443 -768663789 53121192\n399051088 60963785 67101016\n-368565187 -331869447 6162686\n-285902299 -99472528 36545112\n-770418325 843844701 10647023\n-320681534 -341179740 19806526\n145952853 58369865 133415649\n435537456 398594868 157846411\n81214435 -873099330 46553857\n690806842 155452069 219006608\n-754352766 -424155816 84728543\n620106666 -344266764 11891338\n94109402 -759817636 245802316\n979740581 -328785358 113679338\n-742525742 -265791369 7453412\n-676948823 465549233 101401452\n-749929389 577935939 68532520\n216094882 -863700411 153079887\n449662027 331948858 146911938\n-750585766 -722390010 118612760\n294823766 -865934250 33120958\n", "648543914 -653829565 191841714 -663951269\n994\n-974090069 22557313 3635428\n538615362 -920684103 96167762\n-790580573 878383765 48539492\n533296788 -906500512 6128080\n875107508 -686973003 12552228\n-727540133 794568102 43526449\n646273839 512239111 2929403\n-111394495 -2166404 5640516\n852606238 824005151 41617002\n-953978995 -664689593 61680884\n-51651598 245157129 140011629\n-557168559 -733243975 45679373\n-289075699 79359736 168017012\n-483609455 533616752 15987561\n-604191653 -205287872 62303029\n-330358470 -615947003 1064358\n-348407237 447475418 900341\n169333462 -523364670 34047542\n271023467 -633366029 41649617\n-148925110 -290123766 25810383\n505208494 -741687700 50068599\n-717853884 375924092 154252155\n432742556 -499726851 34943462\n306077218 -333866235 11274468\n-318975731 837250059 27063860\n48403969 -236560978 4021827\n-887401644 -567848603 101983880\n-44707028 324371934 27978607\n469553556 446400318 5456669\n-488322141 898122974 14245873\n-273983359 -320056245 30355393\n705401612 598667911 13841138\n-177957721 -369469753 1160692\n948762862 257850385 58284771\n-736483513 384287207 26199456\n-798536392 257374372 17801591\n991863909 -17426641 16050554\n296834925 -30077664 19955332\n-285722254 288834770 76525214\n-447524063 -326134388 16225981\n-189039735 730194432 57399178\n325136851 105522111 57599160\n28336856 259571070 14765971\n-167783655 444496099 5222884\n-953508576 -308371895 8691981\n-570641360 908701370 14401011\n731945 184779732 23077052\n-181651467 -534040427 7661385\n-255385769 179588282 2360563\n-62552428 97356800 16185839\n752759587 -987047817 13360705\n-311369850 -617509519 19809093\n-517408187 -358014260 13367627\n108665862 467919511 32291153\n-788059838 240066591 9557175\n925023837 -417440451 3610246\n381096537 -296326173 28974102\n50123431 9178469 19785512\n-389821362 386871434 59809421\n808517924 900590954 26628256\n-901605252 747795769 620390\n697131916 308153046 9845113\n316743124 -266398295 80139562\n-124416210 730257406 116646452\n-693097932 -863290238 19514622\n-357341086 -603304576 31602127\n545291472 -908253859 85469834\n-462792139 -483307368 19974743\n971509440 204768442 92922845\n64929096 545668655 21703091\n-140355238 -520260121 4527826\n-413935671 -643164307 52229818\n612908982 898386447 8618119\n-22925767 -254508132 722257\n-417028495 764904714 17156901\n-216970660 575323596 82963573\n-876392555 663282719 20739637\n510822057 722013228 34686229\n-582115652 397586059 99921015\n849820341 201894091 96793830\n-849625250 953884890 27112299\n-289120768 -947428586 48281633\n887511523 -479259765 34798545\n601389963 925533808 21897125\n384351132 -776886709 53190388\n-621307204 935825047 54746849\n-600257160 -293996402 24782647\n-163017870 -826670856 81479631\n-877537496 279049664 41755188\n-311002014 -577064844 13540848\n-73261373 11305641 6758239\n877890691 -910880090 1421978\n411877854 346541230 362872\n-325998271 -978344717 20303149\n319681392 -551293795 11105438\n224503290 458371057 58521386\n-212337263 786318858 1281348\n484907398 423498062 2755336\n754455994 19331615 8920812\n109203536 -360084525 32696246\n-416121292 248876602 66738474\n310945261 996527793 4997271\n-873755366 195307688 6198365\n111714014 -60383472 28661299\n637009320 782659891 2001677\n-420345676 496324044 9004949\n895825562 240366350 22515120\n172246580 -989390882 9275860\n426301106 775852006 8245360\n-561765702 -358553826 9222001\n600699142 156264014 21419016\n749275980 -180041581 5380014\n140507208 618904753 2345938\n678620209 -726317309 49102530\n686857746 303390968 7430702\n-523729624 867526530 68930290\n-364127656 608837437 27714856\n-415030927 -180701428 38188605\n-763656967 -955970408 2307144\n474552947 -951121210 80592312\n557348902 -632018562 31070793\n-658542086 150371043 32449307\n-371415167 701205376 4196641\n708270168 -628108263 28002865\n-106676602 633703141 45476044\n423908942 420757510 3512529\n945721950 998859570 16965186\n978274944 -875258714 1263207\n727589755 650428825 29606171\n287437029 76124305 804568\n-757037358 305720906 48646031\n-309446937 -147869686 25476884\n-776143598 964603365 99198690\n364369132 -985689953 13296625\n67509178 -895202278 57916105\n-917816845 974410647 36102204\n-232495418 -90416092 1745662\n875629253 -80416738 52763927\n-763000384 847623208 28402123\n-480114699 498995076 34992592\n352612120 -326195024 41723728\n-845683957 -800673640 16917867\n695671657 -529310529 7347326\n-857830743 -659605710 8384991\n-764104916 6935891 19083192\n-934510309 749941606 7611856\n-873378860 -632209106 14247348\n-350363942 -201993022 84762985\n-725921276 -749765732 52011278\n119892086 -561771488 9816455\n-780294972 620461069 36969294\n440021257 350895022 20644890\n-975310949 -796397058 53461980\n665278149 612527642 38451696\n-329881683 -369031316 123981470\n-813300884 309173164 1603545\n834542673 15205659 55605529\n2412808 -607393752 3116618\n-59078405 -811511369 13609087\n834073763 -881858577 17595205\n-146351850 994597568 140996582\n497883158 -48470781 24513139\n-363280290 -423012410 2110251\n-892024039 477394766 16450316\n-79259573 -652829082 63666300\n783911124 -377887557 36682009\n281094080 27592227 28333016\n331225184 466176684 19443260\n637120901 950995778 12197283\n573718236 353937774 6757277\n-274669264 409819002 27676643\n425379997 672365472 11745049\n-178913846 -331580985 18471344\n676568699 288292287 23987945\n90099503 905196238 13786477\n-638392527 467068273 26443057\n759992218 568496225 5070903\n165877483 -934582964 4706631\n-53030499 -770776214 5323894\n767899095 992094369 48492937\n-318824112 -303808981 176239788\n-249513282 398288443 28425155\n930306505 -120954900 19856433\n-63122234 -405415405 14541699\n652101129 671100532 60928422\n711946465 649417697 20909294\n22813706 662695947 1888601\n-48490173 -903238888 42716892\n78330373 613864212 10347383\n-550755090 -231518303 11277651\n58400583 -536907030 16712908\n589914455 -951988547 36502811\n-627162802 -30169675 1328985\n-897997825 -2694573 57667458\n188259818 -26733871 31204551\n442511152 -234078034 7109914\n-153304270 452356845 8183671\n235802734 238206390 3527890\n369618114 80335396 28756476\n-194393613 -208919472 10559713\n-280376854 -392865692 56507900\n-918397413 942169624 23489175\n242916425 157125165 23566340\n244384869 -999718797 30392096\n408955932 321681472 111128287\n926507374 -376836939 16199239\n564842807 352190041 39354184\n503010669 20552065 38491571\n385771611 907728826 26457338\n150409397 -219952023 7578854\n729465974 -554582322 19732344\n521390842 633059309 1382699\n603588911 -619479832 7067881\n-222707938 -202369254 1380457\n-212161063 -66189193 82432580\n803882941 146082265 27873108\n-623068258 -901498334 6266314\n-437640962 -953521185 19594893\n-196594554 -489884202 4273142\n63935736 94121910 95350271\n-896715195 -587756278 8143640\n380604620 -525531971 9272538\n328121749 181999088 53819924\n565504574 -125720698 39961612\n-595891851 -96598261 66961293\n954017042 84014653 46917111\n-26206409 104274442 1126974\n-362682099 996665397 29615414\n-946315265 -727013724 4256672\n317248624 57712952 8361688\n912879552 190333558 27452499\n649564042 332586990 39213955\n856387205 -554031232 32900842\n-229393151 -782488226 2283267\n-419203740 -256959747 22541861\n111832065 -343327659 2937327\n368549982 -386548390 140132376\n-28225573 812157398 14810234\n993517867 -353140057 25992120\n-122792562 95231841 9702308\n-513358570 -186096476 41225826\n-133758303 143230638 30191564\n-635079595 -479743023 9392373\n-7157611 602160207 67020403\n-88353967 733249656 6053916\n700394316 -845375041 73367016\n-176080003 -152614250 14099214\n-311096810 36928240 1676646\n-423349746 899903992 35763577\n-575407004 652226393 13137234\n507397042 -362000262 43565016\n634368126 -835563360 33435620\n203855142 -302993264 1985973\n-998553268 307772132 30504023\n175706009 44910909 3214139\n-291437416 -548083593 1099487\n165356003 -633995715 35655353\n-55343931 -772292319 10415330\n578127442 638423888 2092742\n-330964779 532998361 37869365\n-539989838 -976649997 27148100\n503049858 -290322384 43178681\n-634473601 678698570 15569940\n-190392437 143775960 26068828\n-539501796 301854777 72375702\n901608166 631433489 2320515\n-956087072 -63638403 13471578\n-750948532 759599693 18248692\n316576023 314296385 50115919\n638221414 666381888 10427844\n-825648656 507616302 16687614\n14918761 466449806 29084994\n-652259507 -703963058 12004232\n-928208301 -431015371 53066054\n-616829396 -458567164 11543549\n-900458364 137217935 11367925\n453242249 261002198 1274260\n-326567563 -144060861 6807461\n539296449 121794474 42155684\n-193992604 -107772598 58267507\n99533386 675826820 6670229\n885475317 -208688792 17990620\n-647152099 -586957143 13911647\n-787954358 89344322 17468104\n560565983 -540542922 13497372\n941018361 -747332557 24810468\n646570855 983941463 4127926\n477765565 -813925828 39756492\n-669074850 -861739870 5054563\n-538807795 176851539 17473730\n139337268 994267901 5049203\n-802180727 -598162641 9917055\n661960828 -819029830 39327101\n414549537 -233111125 10045243\n-474906576 -239297194 11274055\n-109517526 -913936973 27724678\n753461745 -233683647 24825728\n-932115492 765643473 36488601\n-362520118 -667123617 103998746\n64948467 -441146874 71136682\n673640323 -305734721 40178158\n111912615 -882880423 1750576\n735181847 -158760751 24098954\n-575537862 789850003 13853280\n709768641 872079532 30255554\n541640545 435295266 508622\n-564470677 403510867 69510560\n38912079 -184633379 38807627\n544494460 -570208647 53704043\n657512705 85980287 47782905\n101217591 221566772 18186269\n-409623564 -690877403 23549674\n-988140256 702509780 18159332\n867318507 -209464321 67604590\n951437192 -265750094 83230201\n-243546287 -786404412 47480761\n-490776023 593545662 30878096\n687953897 -693011889 28539711\n745301054 280600449 4331279\n-206716872 -217552533 18051419\n14343661 251930818 57113251\n186102435 -904909716 13420754\n70968094 362211973 9400805\n-595096820 837203230 621711\n856982206 250961098 28337089\n254137706 -112569505 910723\n293590127 461171717 3894168\n541270072 207739815 1064792\n799073979 254452651 67691066\n297640708 78576736 24073100\n783484697 -644654208 26725906\n303935437 -557735630 69182803\n-941587851 524492977 3906645\n332202220 -166669269 3341064\n774253469 -83234580 9303637\n853920851 -456675570 21746201\n-428081114 616580800 10981846\n-405470990 484867662 13932581\n-681593242 -747332867 4328194\n-176766584 -276253360 27727832\n810359874 -740627108 51325907\n-124937268 -532109907 31254064\n-940398717 346458330 31260914\n854273654 -563593025 59285206\n14271529 596260135 2744733\n215142823 -350403115 24596708\n88254840 -420714204 31839789\n770879073 -843534761 20597296\n-656335709 479535845 49856876\n-637257068 862995530 27335247\n-568707010 -156496975 9293553\n-540515706 479300474 48972777\n-697554426 -938113792 12099241\n2600618 352429675 48018130\n351499645 -375543555 32350564\n36250477 24618061 19201326\n859579723 57121643 74571118\n-809002811 634063032 12437729\n-753959749 -959573281 92688587\n194551203 318698757 51674155\n-825716720 -849422705 45324741\n-253396846 -290965601 70856116\n-719583709 115722343 30972932\n-436168394 -656139449 39100218\n573212705 309435651 7031003\n747971569 907043084 20749934\n-991844477 811673295 67065801\n360264749 -272865923 15552007\n-768471587 830598841 36444526\n188619247 830276959 1807282\n-161969532 30661923 740331\n-119298801 -865757087 36629097\n82104047 -797514944 19405221\n258864966 -227569848 22636311\n620673208 708216679 24389870\n317215228 -708521253 19241120\n-415561175 -545795440 6215833\n995150509 938335929 34461785\n-788705870 701334805 3961821\n401952503 -799729069 18659601\n-581866759 -179431196 14005117\n947017294 507933747 1820582\n661455989 -916030336 121345505\n-923360903 -22148997 45044511\n-222135640 -547412302 54557598\n973317708 146479422 22151112\n-894490876 214837111 13033083\n707164079 -906435945 31122543\n-858710491 240671640 13967312\n-78101912 333854002 54081318\n-841379003 382812148 58370373\n-369326983 -656965314 31944623\n278897199 -640897382 29367696\n988505596 271295545 56101843\n146057877 352065052 17569928\n312550341 -585476336 62755005\n8669364 -940020522 39924311\n-404543429 -464224695 52529995\n-230898076 261459720 25797810\n371796818 126761077 15389784\n810043228 -122830864 4462726\n115690995 607453247 86160632\n309055981 -78722186 14762678\n-732309047 392255810 4743563\n-731187365 -925146748 9521357\n199175908 -155696033 32159149\n800687489 126685183 13567296\n669377112 557104569 9169182\n-771852215 -990077718 33705494\n20429470 55713467 13195928\n507912088 -555520380 17547547\n73978568 126524886 22453961\n-680585852 -389544444 14213947\n593924401 -567614807 23349293\n666228314 725135336 7096306\n-230215766 -789348658 40303326\n-984126658 370298004 89425731\n208552720 9862040 14302741\n544589901 74196151 12435441\n916596825 -253066037 17514908\n-795382032 -190970315 53235790\n839792572 819743145 16307155\n274144641 575018131 2836841\n-931136211 -451373098 33825028\n693477034 17578992 4737361\n93360940 -736712758 120574\n180193962 -809745702 25523034\n198337366 21780778 4625130\n573247727 -245828917 9774571\n-256355684 156824975 58269733\n-830679742 -441872864 38449716\n981233332 539895358 12518884\n-146739176 194806352 41217017\n-725429588 -785719445 3446680\n831054210 -569351552 16182461\n-731884254 4757372 4627067\n305034860 433655095 7065126\n-120636422 -664569516 453653\n-597103413 217409623 73254492\n-1837959 206386785 21511688\n-853023195 386666039 17517083\n-527812715 -305540928 30611901\n201407694 912144498 133588086\n499318994 303248410 64905954\n-810234822 769389006 5308945\n705337609 613402309 28905011\n-479305456 -160161440 6105928\n-536281178 106699035 10058980\n682218105 159258128 52102381\n-539173707 -249189295 6671145\n820946998 -656601238 26782890\n19511283 -735318586 46729855\n636057728 -60842088 9045795\n902621868 85915105 71363702\n45798353 489072349 6640189\n-952548888 487973255 481185\n-651992083 -339951758 56349736\n110861426 -650421938 3694612\n742480604 54968236 2651344\n-466492797 -913336089 17010068\n-2596623 35913961 10357246\n575080275 -76115885 71885921\n109522652 -49137622 11744433\n648260422 -925285058 36911418\n89193161 541336469 8078030\n839387543 -624150738 865708\n412484793 -806413402 1150599\n19008246 -693043424 25727236\n-570891855 -620618222 2828953\n-246001804 833669850 15920885\n375529406 -310477626 6428083\n-325010180 -227338802 42114191\n-677439277 983966672 6113159\n-323668015 250573021 23065576\n462208741 477865974 93814629\n-933619910 592131534 12705100\n-241991675 631793256 46631682\n561281887 -893936930 31749967\n47818031 -690366730 3935364\n196698386 -690357691 44215330\n247107966 -175131400 10191407\n388601436 847182064 14775329\n-981508803 -37781743 44082221\n959268196 290605945 26858653\n-366042379 -304982529 10871089\n903963979 -382402797 25496962\n-814525227 -793267509 58182315\n179323390 -757632144 597528\n-14749525 -376075783 10699830\n134054791 -953484399 12517767\n-376835097 -635075488 14622940\n165273070 94691710 15686361\n893734548 -352093548 173149641\n-424870076 815388416 505704\n-929488702 -752145474 72092258\n630246947 -953522842 26974882\n-765882745 188969841 8452723\n-927235693 -403198036 28811147\n621820772 -62887267 522387\n-877076518 947375778 9233556\n915200990 923111654 22934495\n-849885978 76039663 12237697\n-387855476 -977218912 18425718\n-668887111 386231815 16264831\n146985138 -253623421 1442457\n972902095 -157517895 29173096\n997715257 -354276469 31420363\n378412178 -280376646 8235198\n-287357333 -364384762 10168422\n653279140 435814713 11318858\n374962631 65081629 26903641\n-153817933 865074604 34062100\n-655862030 164058523 28275371\n484636682 -856187340 10452629\n876740782 911601257 37718222\n816875676 -577314605 12279201\n-862195537 279811026 40465133\n380672975 651265628 9279749\n-748272315 -540109300 17823919\n77788673 772952218 9394287\n762010909 -708837549 2065527\n-508970337 409048537 10483292\n2526511 278583145 74474649\n829789563 -641682771 46713030\n-643045505 -407567280 86466138\n520798440 -208222838 46212206\n817040989 12716221 14108975\n-3782294 -852344375 13125532\n529882952 130851459 26001968\n-18046358 909084007 81096893\n-58433466 969281206 49565425\n578129232 520638264 116223570\n-507325532 990775362 42998657\n917381902 226416554 21753895\n589979966 -579689838 8815221\n-908596956 157664642 5509107\n-661627103 -569203180 122178712\n-162209870 -500013788 20616375\n-307092632 -95297410 21162347\n-475303185 -929304367 6949029\n284035639 234835070 24717342\n83729304 -163550330 52792185\n59230806 395790068 31275178\n-657975879 -755101240 29157602\n-522376322 720454316 3408045\n-81550048 911181711 11043895\n206576679 -226279517 31982504\n-957397565 396881151 22662132\n-2246525 636638035 29383753\n345621265 476650724 16391382\n-82892646 811724596 12124544\n-790865535 -953760967 11404648\n-668229840 -174463831 21423214\n-656603699 85243532 55222250\n-2713084 -866746745 26528699\n207957974 591905451 20443941\n199305016 -50022177 13696366\n-751840591 -467087363 3020748\n-366632238 526191508 15577113\n57414671 302294993 2218713\n-23521718 -432151222 3994797\n-997666271 -111714811 34084737\n608892698 -667780971 5869314\n700571710 819095940 9283400\n836737396 959107104 3949922\n-884873687 166568692 9393962\n491212477 -939021630 1951007\n819195550 332873077 2009695\n-93068253 -533142773 63467073\n223756586 -547557319 81818118\n359073768 -600385036 69691679\n927358714 134345230 29288285\n-536394139 522284551 5364636\n950981523 512755539 1321087\n896716191 -489942287 37012136\n16033418 -937585974 6469385\n141685887 -521255400 15230890\n77140888 518379210 39217390\n293238159 -741984233 6721467\n903174057 -985325699 58396552\n860971910 -837168200 5185828\n564718274 301473418 40739909\n507491219 -491130784 102270855\n-680738222 850662041 6570722\n-377429352 -916589487 8982249\n534379709 -601422931 33356490\n174557398 574922605 64265903\n-443563532 721879187 16567253\n587810688 320390352 7690679\n-978804656 -536207426 16330255\n-724692530 -852149313 47937717\n839960594 737499171 39714084\n893422275 719632208 21442270\n703722559 -997483647 16007378\n-372084504 125678526 21049281\n195102827 -408093521 74009159\n-735224680 454101862 12671503\n881199397 -120685555 24220691\n-414827693 178429925 43759774\n42063370 -928118514 16923883\n120716237 -877809415 16396455\n457063441 -51666499 54859390\n-324376268 247253126 37195116\n-66540992 -828931894 55333536\n-386496403 -433181439 36974264\n286923966 -797198770 4064106\n-388162481 86300134 6929399\n588524509 -545283481 21691545\n-713802287 -497652935 20262707\n38475330 -892357949 15087485\n210025065 -752725206 1730520\n150940823 861675448 2929269\n109271159 182471436 13503538\n-630980591 808035051 33625869\n-464956386 -762093010 38931228\n531036816 -257921015 33194795\n-260375389 297438969 17541445\n558533478 468925498 24019299\n-814446041 409131818 56950030\n-106860841 -919025909 3485784\n-645895531 695077088 3178846\n338058704 -211361072 640282\n448722577 713802330 18846567\n-636959749 -867398278 6430221\n766653206 -380524570 25205071\n412353627 -471448105 24158469\n274678352 -352969098 82996414\n103384632 941102040 11903289\n-77602638 898158136 26449103\n465994429 -353008643 52081091\n322113296 -952162274 58295602\n-148481437 359118712 19172616\n-748879842 -483256822 34344317\n-235405808 849608432 63313980\n-710783814 909090843 23813687\n-172919289 -152128024 5301558\n-738867455 -733821837 4096421\n-802736860 411244022 4488423\n-188967771 500448605 81777657\n848272562 899839147 24767046\n648065751 -442103952 25947520\n547711813 905881703 147396767\n-381686284 221621182 21937129\n480715027 -610908713 37512971\n938364750 -838505865 19339568\n-144217792 351753399 25577009\n-352236492 760388642 17662266\n-24817492 125945863 8173571\n963756051 -189279066 36327801\n-117032706 -269138978 15756072\n-256809728 215281427 37417079\n949152328 38363754 948123\n751886314 -322389565 40413141\n325851148 -737670934 50656138\n-269312633 -625073330 5059180\n228364254 -312598432 48626590\n759745986 513568396 20521412\n82464029 -757555100 3773319\n545435418 496117419 8221335\n-983846567 425809121 18106680\n262614169 580967866 6992855\n550217581 267790834 27797572\n76868085 -909126824 13311703\n699092764 605565002 31895123\n595622210 -790694156 23958820\n-569973492 759264691 81263667\n-307800527 868877877 54630903\n821846367 -103890734 21621458\n-266781401 851289258 26059536\n-815209196 -193657834 9651186\n156567893 -492932389 8638468\n-320249544 88887459 7501308\n606258413 -216197249 27219447\n283024392 -301633005 7799501\n-354745019 -312828555 35041717\n-760375173 108872966 14251114\n332782315 833513988 3155605\n-623734909 352478973 34913923\n-873287191 -766681006 40875290\n-622937694 733089660 59253551\n691290943 -767917910 78740208\n213730158 -114035949 3758072\n-911031369 32232556 10879711\n315401187 -833574482 37953775\n622307730 600714946 16803921\n-68988769 41059563 1240754\n-867400669 913367207 137716842\n896648209 -265021624 77580604\n946477519 195576807 45722528\n855201193 -748535114 6480384\n-6117692 -78949104 12634275\n-275545130 -838352084 31292674\n449035788 -999148750 9707548\n-683816745 -783054753 46770603\n-360361581 243181929 21892053\n681715674 6392792 54286810\n-37811165 840894706 46725068\n873604988 -243273054 9298038\n266610385 -595785437 29345750\n-956339414 540681845 115195552\n172437283 301267791 7413573\n955863680 -891880769 63065667\n-668572709 580150153 59457549\n626283520 -735212702 2997379\n-898680397 -301130509 22299403\n283080586 469096801 30305915\n-753764423 796038334 18612165\n922783865 -196674015 460530\n864755937 -227029486 3092666\n-953653557 -636662720 58358099\n-370243828 -476728172 4572834\n-649632045 -581893228 21839086\n391813150 -213894685 41689878\n-93802746 935091251 1515158\n-248431859 217405830 7635700\n589030925 191771619 27800888\n-156582095 -175308984 933522\n403253022 -581650757 27329287\n375976478 -888966124 39493130\n-915837843 -509427337 2245638\n-372420727 957057396 73866607\n826304320 -921367714 6117124\n66043609 -461059781 42634234\n-835570068 221621542 5898851\n-756587040 -670737280 57731329\n-195581855 -521064036 44367659\n-286691952 -874173162 10346155\n657151150 -587857815 4788090\n296550112 620779739 90408178\n727093397 408626805 16435904\n-847027094 -381221386 1874908\n268946438 694228987 132324402\n975163984 -597775130 27833627\n-254627550 49372541 8232263\n-499700169 607280441 25294856\n-993554008 -377163295 2574509\n798409545 839956555 17666645\n199419005 633095114 7925117\n380795959 -495591191 7953296\n-222311971 998776484 44786657\n-9959840 8829145 8497166\n-7064340 -922081530 103540508\n-505675509 -729259293 49383983\n857613693 158597196 14371741\n616381492 -772976659 45012772\n114652971 234291243 13788296\n461082944 501761455 43787066\n720926784 -348552892 27361066\n499104074 82895559 59542821\n576663596 -864056188 8771353\n-520042977 -666730533 43989959\n-226414639 649805548 54132030\n410922657 -552970699 45812016\n-369050135 -210528164 45861912\n924458411 770851209 32523466\n-59290002 -956472128 20106051\n872479986 -780825090 1378303\n-655153430 797839820 8102004\n331371379 -164125681 20796062\n-18322424 211373618 26123265\n-206180950 -352894266 98125195\n-671280916 -442237614 81026073\n-54249632 -422806152 39682537\n-463845125 -560088314 9962732\n231211987 494521124 92383733\n-327529968 748315026 1561719\n950156408 -754975164 24165187\n44615757 -851321656 33823193\n275846991 200212102 12908188\n788949984 -783457110 53043264\n540365153 677024884 15061908\n-479559718 24654883 34404611\n932553537 547554344 29806362\n592159518 564393125 4948014\n-606454219 -667602858 7198674\n427558211 138889208 61906758\n-85400370 402496548 27500706\n-461668905 -307653794 2464499\n590108522 542739353 27048011\n254658632 -107414031 18096582\n-675018164 -448328451 10278607\n95956239 234765375 19749025\n-868789320 -373226185 65159760\n824302611 983628427 30268844\n669308458 -121475671 59704955\n-903513486 117233084 39844665\n-255764491 -964334482 38363333\n987427032 -811114952 9111283\n-750704387 650307136 36626198\n-49323606 149647151 39509903\n6699494 720817078 47671377\n-841525205 -937339811 16699241\n885657464 929579158 21384696\n410594393 718004471 40566424\n910691059 -959412379 37301647\n407462580 390874160 30020369\n960729395 -86155250 2962137\n-639340495 -994763021 39318251\n-808649168 -503705649 25210738\n-670890639 378741403 1477141\n585170276 581412768 35094173\n188867810 649664805 7029385\n115542580 -777272990 24656170\n312930976 -729988870 558141\n794092601 -14892006 48269578\n190761331 302044822 38678163\n-798545930 832396222 13980138\n-319378448 -508411872 16581273\n841131061 929522069 22266038\n-660900486 -121283282 51441284\n426016199 480014461 3515504\n-697232056 383466331 54494020\n480315310 -830110060 172121\n970000641 -888464201 4625711\n704038352 189874178 44826502\n-233892024 -382812879 2819083\n734048258 774762298 5655859\n929333577 -1992884 10213813\n-887422108 264711481 39601352\n-817681571 -507342123 5961796\n-226387228 -4805205 1400791\n-736746858 172629086 1577761\n585472975 -396689085 13800354\n719745513 302252227 12818267\n82866733 574006840 4639903\n-727244968 -548511419 12435599\n-974576896 -105275227 11066188\n-712983828 -864253709 12369564\n535937354 933233981 4552009\n-886498433 765857720 16738828\n-320584889 488846196 48859334\n330267571 -121675975 51971100\n786675962 930140632 35922088\n-780358858 757350881 67994965\n346640220 723946815 23400337\n-331427126 341247105 20510258\n-399157219 55861278 33386143\n473981079 -152014069 81893894\n-759243054 849426653 104646264\n504070604 21411010 71171080\n247406265 -131796541 2247677\n386725190 245168377 17371123\n701198811 382979787 32438204\n-805924303 -16254433 7550295\n-17284028 707177132 6141561\n-680316180 930317916 54986171\n348361311 110559440 10306246\n-908000765 -131987010 8241186\n-593666544 7023592 67880484\n-732786523 -970253341 17336026\n-532574745 887961349 90551248\n46872810 -547196042 18933728\n-521192630 328062835 54423799\n-567722858 320299978 8435742\n-654227504 -685790252 12881248\n-880105904 -568722267 9922236\n754892027 545443691 5327758\n-579593930 -466523462 36607341\n29976097 324973379 29368778\n964552158 -440727169 15542416\n-629671143 -257939433 230685\n-359840446 646481499 41852576\n-241173713 -12276425 22996535\n-39356693 -704699575 36028566\n-900737171 139021544 16624199\n-557225803 -614780730 60356599\n-268349543 -390467656 2182754\n570518347 -241959815 5602715\n92186337 -458737555 5234892\n891835629 975743093 14610098\n7007579 -661677365 5868713\n-9246071 191527271 108798713\n993018766 -73924139 7561659\n-630526776 799566212 8158368\n288455813 783967113 18078444\n566769553 495352775 15784724\n-994925297 777298120 9859609\n-374718440 580490113 3512959\n-309534700 710460896 17643652\n-925583797 177890640 19942808\n894681694 -498007796 68907415\n900854724 -274539288 79764424\n-91254029 -289897417 7183783\n-140643646 -748143228 5734076\n381496586 -463884023 20881234\n485318684 -56762186 20543130\n220891028 184780511 1649083\n-502556378 894640062 1815594\n-369325495 -788929062 7700613\n-594288861 229046057 259287\n-660767346 689932251 59739096\n356751742 -585894565 23650467\n-84254068 747942239 27001806\n-720268129 770132714 13051363\n820805879 -414475262 19244168\n-331573838 -889363973 36433435\n588350519 -938003951 23616352\n972511340 876265828 52955658\n719102816 490975594 9801718\n-569026025 380104193 2748599\n336163710 995365333 26576045\n-961506384 434536548 7550811\n-856060438 -861980054 6068996\n807201629 988430256 134045399\n593918109 838610454 15475497\n668138741 366333606 2100696\n-38716455 598864445 6243618\n424075085 -921284648 80386103\n-10645411 21330436 29052530\n14078496 162699630 8540743\n-65965095 -913432084 6645026\n853777687 -984028270 9500234\n92857117 859921843 53952611\n-773351229 293140693 160414348\n-468277471 -900557864 41247576\n-170053298 131876168 6507877\n-549699429 340101572 50013839\n358561431 278626828 34395441\n-367699940 746562157 69268216\n-836744492 -619741403 44959021\n997862000 -778305516 37573458\n988499888 762560626 115658454\n-561407230 147148133 13485792\n-309029216 -548078347 65248852\n414647402 951195967 41206087\n-401346303 -491137143 3760617\n914837562 -707340976 78816539\n987989299 -385721679 10578080\n380646213 -300315623 77825904\n601925133 -213913749 14325912\n987888498 -306725978 77162245\n-393562040 765909209 35458607\n-254774827 899839455 56088377\n-268440768 -92155199 4152701\n312079972 -195991553 24533144\n-691023172 10330792 49800249\n217581742 555539817 8062445\n-301455740 681503592 3494803\n40635361 -378495591 21034474\n755759016 -776642078 4825684\n-607579325 -609924151 42112743\n287184343 753922786 114581\n-926984017 369453532 82603252\n-797006056 131548734 21738434\n609880338 -852265822 3493209\n-238381799 696040697 47601001\n263982255 516981301 55209829\n-120040298 -725005422 2084689\n-70478006 826856708 20380037\n-728576179 -957657469 37366731\n-225519667 392258265 4578317\n-716920137 336876839 84167135\n23640392 268370018 59625277\n-816134894 -97628399 4340334\n414152431 218730714 12705548\n81321078 136253836 18280128\n-971266440 465451900 123930684\n-678235792 -344460953 8374834\n984282867 698272996 36151966\n642954994 -987842167 5237302\n136462672 511326737 82454863\n-155334476 -957976222 52367619\n882431682 -883526754 15111958\n-876434030 411482741 117355\n563548869 -138917532 10401070\n-284242691 -293789191 184818\n329357743 358602742 11431906\n-434816732 -732893951 10706678\n692648427 945672593 751313\n-128673216 744190866 16420242\n-450868770 -505542884 4406610\n-240926022 -323752764 1013097\n-533966829 507255116 22792449\n659455871 204834917 90941993\n990947962 -634507419 43276734\n682476782 -967492308 49927990\n187131838 -7826935 23513392\n994020666 -311261365 37618152\n-465563934 133385204 4829047\n469986863 590135008 20493530\n-948227250 223528754 16864353\n535196832 -787313606 27167031\n-142198167 85237074 8370246\n222884528 852046193 11592824\n-478655708 160219908 29065153\n886515175 368769544 31189791\n359559439 172277947 21820918\n530829042 809036268 13343218\n689862697 -799880878 82773151\n633038905 86481004 104482755\n758270512 -410150601 33829908\n-697450528 -722660165 44688050\n42379286 -464774392 19937725\n-686221283 -805253665 57237035\n", "-974806572 714941974 759322700 -635006782\n984\n-980982781 -287696121 199864913\n-968701918 -959457494 292820313\n383682231 311274573 185998923\n269314008 982571784 191944881\n821070327 856966049 162418613\n101451094 -524098815 117474382\n575570503 260218909 18197103\n16040973 801288227 41452964\n-221176859 -505744588 80419082\n-107687407 412606813 300286200\n-971937270 527741426 451382860\n-385613913 -920005131 265536171\n-367782204 195909040 434982378\n-187938998 492427385 522681438\n23405440 -26243552 84547688\n644608832 864097790 65287299\n-365214245 686423594 673875562\n990045732 566471725 47446364\n267747040 -135558734 381199506\n962343509 709015435 383017591\n381480197 -433596120 267575900\n-943422018 764496007 332657754\n-39892046 232041767 52042565\n-53623485 -682029555 434115337\n-763847669 -793239037 395687836\n-541895483 -274925209 340842127\n723020263 -23644054 377604652\n-592325671 789897583 62265467\n-911851685 -613955169 98368540\n300200519 991342731 200002872\n297903169 754877918 80704297\n39882231 -828134454 12024478\n630190731 -385575480 331179065\n-583130285 -853239944 355647333\n747573940 864709656 297447460\n295023342 -85289864 354896632\n140444267 132682217 528830023\n375939423 -968871247 130453024\n91995510 546945579 22515501\n434132059 911282985 139349878\n-623252514 507331334 229658439\n486990469 -657395846 563993473\n66126518 834318586 651239793\n57131862 -334919247 751316813\n-718364142 -456602407 206240931\n575928914 -297933090 209278170\n-650765318 -274943347 243838939\n259356762 -654275229 286715864\n61715785 -858279249 141068074\n-586984415 550041697 334573063\n185923856 -607430831 183359849\n396233444 418609023 20055674\n430313528 320468995 237943913\n574386125 136132185 184121850\n693262312 171605897 214318742\n-744837841 -103939998 111045281\n-7234206 355200146 250769274\n813716840 167593118 308465043\n649942691 -428394254 245745703\n950843103 -685470178 269156940\n189040255 -946649962 127184330\n-824953904 820109602 334219602\n661398808 -227229688 171997888\n-963274226 892573798 115118440\n-739366275 891097283 447999003\n564983228 431383911 38428722\n-593907270 408317627 63244544\n819626252 -334327945 35595342\n833534733 -644858889 287205080\n781102947 745467214 15839700\n-115047402 -902758554 102945299\n-697798265 -23788827 62701531\n-966910684 203299342 30602671\n-978432472 123491227 49934034\n953424124 -962590277 73596450\n-608705296 122855151 179993194\n917064362 115512760 57725199\n-755486233 -793299095 750272170\n592347888 -54352265 189052759\n894753403 -280794993 59933747\n277454333 -2679730 166131966\n-866370223 -823884051 191988599\n791143979 334588663 45897513\n935277827 977950786 110855244\n193804944 -509269038 192666222\n-90571568 -985571892 171380659\n-176235869 871880754 286194658\n964837347 286296863 66194616\n-740214794 606862722 38199891\n-214846803 520264124 329724431\n-326347763 486853134 147972862\n237609837 -520172679 429881381\n312621338 815874780 561828223\n-767655468 -992365007 476210556\n-124035959 -421352834 90446365\n-553929667 -534120843 13096774\n-366347843 141293403 656449371\n217379255 -941460283 123427912\n301996408 -619904336 99876659\n132110595 -69363003 214302754\n968818201 267636113 96071736\n475615507 -514046844 599697550\n997428005 4028637 259552268\n-167774236 159475685 311685855\n797487124 888277735 586593712\n-77413739 198823130 235265114\n43372316 -312033830 232476385\n453228661 -671488482 2160032\n312899374 360262346 467012813\n-808841353 596765756 175773414\n866033204 929288717 9088238\n-988054754 590605601 118381817\n579480434 772180288 550450349\n365208543 937907994 575065551\n-608688784 817819721 152207281\n610451068 -537965407 34514841\n-739468231 -831859174 558079479\n276122613 757355651 408151524\n-436463860 443965727 205206125\n-853970683 105398601 236440381\n926319320 -29223940 29909364\n-488196592 106949056 223793562\n72577504 -934276350 175388534\n-811668074 780757668 134985382\n-471765413 -246457390 283373066\n192012323 641241365 60111179\n932465290 -269247593 144585729\n445634114 73401709 536751102\n-378849518 -601227568 87877009\n-48372829 337113442 151444990\n-567313436 204254094 358668835\n266548508 -943878227 332533626\n580503756 423789597 455910616\n982432050 4226436 176750751\n667697132 157464682 384414905\n321168676 -780075175 297828591\n325746692 -961481271 180894167\n-309756902 728206423 217394964\n10760542 -238449455 77083544\n992237287 -270566978 71213231\n-90078795 -558874950 93784453\n-596364048 -145887337 64822960\n685049893 -243133222 215407302\n-822579144 -930023531 80286109\n90369732 -571172113 111921964\n317095511 692989554 146978389\n-453042971 59851921 418235850\n-654608705 232835058 381257880\n691488310 -558016697 46436043\n-304269923 -973312972 2695687\n104424742 -474179244 2432984\n-612479681 -309231890 436703031\n-667972741 -557067100 264997761\n-68193724 89151286 109649647\n-517496014 -683905459 106368262\n-978067980 -422073428 220392713\n161775036 18342636 83623322\n-761233642 -719104257 758624187\n561354880 469313285 361766075\n442589786 420771757 11432125\n-426159252 -697626051 182175836\n760646185 -595836984 434280964\n514791500 799233611 711286070\n-93402874 -93413631 328450237\n759878160 -435732061 181007671\n51566953 727903960 50297598\n-670992121 -637598256 379665428\n372461788 -98763726 176414284\n-17953278 -687163460 56358455\n569514521 907535767 216614669\n456863931 869473162 146885985\n-911591041 147369837 608339304\n633637414 -406573698 267812604\n-57669431 -677758090 134675149\n-516444138 615481614 12634980\n-865264351 -774476720 246514966\n-610250582 -838290979 339172761\n-627925958 368154225 19524498\n980121730 994783651 40300038\n-16339338 467828371 297254155\n250756956 -915334585 522996142\n-216829760 -616496129 28385588\n-547165402 69942412 93339475\n363201959 815396574 441098588\n-599532498 680808330 90028590\n791928604 -443605652 205223624\n-212795547 -852570471 414838265\n-565252061 -920872199 127057053\n190176467 196720574 269295558\n-154877323 -586909514 120356875\n-732499937 321050780 212297829\n-464502011 -808181552 215070144\n-999640453 -381510196 355507997\n-481652561 -837602917 370719916\n355790281 -309574134 206307003\n72776752 824439588 399088942\n-21972087 -655237644 5550572\n166426959 987299493 141099587\n-135530256 583208205 13848470\n-334302066 457465406 210117774\n-967095744 -380509029 652938719\n72192857 -655887294 221263876\n-352215839 -147687921 35346873\n635779390 942342793 38983900\n605874481 -368303843 356536055\n-630365768 657352699 64142410\n-93266067 626061451 239718904\n651905222 -62460882 449983004\n878064211 -509021796 68641524\n-842446240 549784161 269413757\n763566541 -419045288 300724993\n426959504 -343121064 1935953\n558039095 157889094 132643008\n-119549259 15459069 120086202\n-344451283 588253498 231597873\n-413355677 -722192431 9395182\n438574336 -829190206 227532355\n-773504767 -349439804 256649091\n268217908 570706661 747878981\n-70331128 744592842 459223363\n798991185 -631873235 21458346\n-486118135 986473390 101756825\n-581610667 -307190701 36523730\n-986699032 -408245121 174283122\n-995040292 -283072444 329383972\n141654454 -123556764 5879353\n754375933 -582357836 267860778\n638244199 -904604491 491874465\n-877159013 601479201 10165243\n655037896 -872301550 173377748\n530013996 -665205686 413583458\n-865546875 -151169190 245016694\n-562608578 -543966806 291326523\n-96966211 89144425 34625601\n-448592377 -492799746 10942220\n-647241792 666589696 234061778\n-389363298 -731705357 221887712\n-524741146 -470088114 319261248\n874456094 847852105 284611050\n668675554 377282024 822355769\n-456948538 532891270 226529896\n13040467 394564058 454483203\n-240553578 75923367 477026187\n957853777 365910183 43472473\n-307293154 371635639 141795221\n217328885 -401381141 377715590\n210497908 -410098429 291057506\n-812818093 -857994260 317243898\n835184920 -94164423 124530371\n-373807115 -568530968 410264336\n587450705 188134296 263252980\n-180626316 838380539 546518146\n632723355 845731381 36975563\n-546890555 -360578712 27191616\n983141429 -496812333 425961436\n151454588 -559909980 96900885\n37479967 -363019891 321513372\n322408935 742603028 211638499\n-312765061 -691118846 28733759\n437698049 -812082696 697904590\n-954619668 951287262 279982713\n-838401827 -892524691 421714640\n203494120 -791194762 743306690\n-319352257 10983426 118561675\n-478766540 -649694884 59509294\n-533712298 522413621 585062980\n-222719826 28619135 60442385\n592479437 -470164519 449338158\n-681159623 -801903138 293904199\n871731347 -824904250 13771849\n-72776197 -109650811 185887695\n-91678382 444165965 175023341\n702519811 588971436 78918799\n-72153737 -601513885 227483306\n359111446 196424668 50334686\n634638208 -385565801 190707527\n737680557 -195579878 519715808\n884329914 -136214037 290153085\n208228432 -486485494 355838039\n-596057414 166860371 335008282\n939275477 77109221 157338064\n-84599397 325808378 619815066\n763481745 -487474013 112788595\n-418099865 -458901544 264682697\n561610139 299792756 404066965\n985412008 247415429 161458076\n570057620 -797234935 101321528\n-447333388 -570066919 68018684\n598412145 -423071064 461183492\n529222897 503470724 79405828\n-522674661 753122486 237677573\n256069761 589755346 513107325\n904787482 -200911599 233737680\n-473243341 295061867 240697100\n-844458952 66226482 297210342\n-167858220 443454511 217580279\n745059778 752558481 511076377\n969006152 770258048 224638351\n510253894 -113035433 694516683\n-245925969 956195230 133893086\n957985668 -795199828 161986755\n846736168 -422839342 157799277\n-310837835 -886318212 27222448\n324593885 22319575 164057727\n-444155350 149343787 24418967\n-438520207 -428317762 291780294\n230262138 344878123 31710944\n950872529 564655557 190774106\n-749594783 211732310 341439180\n599037569 -930502218 141778036\n-505744180 -77900895 199503503\n-975208786 -459993607 178019153\n-414280549 -581845766 358007529\n-228922379 -675976334 251617609\n-343794479 295001846 240620822\n-996118479 410865400 135697667\n-457353937 -750859764 394610171\n-888873065 -391177828 74289849\n-437923067 812747489 174607692\n40157206 988946400 111116730\n-78870256 826898502 273696326\n822101050 -412942139 353482949\n82594755 455859380 23553871\n579949122 -649514464 616853386\n731073910 -322613785 34677709\n807999123 -910732031 350001304\n-658596276 237656494 127652815\n-858866479 -698996852 102856875\n820007686 814826883 749779374\n-215870458 -994748040 68463926\n529060794 417349269 443935965\n-570352471 -618227329 16217253\n-839873882 -111565865 157726613\n-321284934 -841403693 353753207\n61641057 -62058716 245951417\n-483080979 578209319 333443180\n-393647249 -184614025 243025525\n642118651 -227351867 16164940\n283619537 330602910 248900599\n573016152 -578452234 192599907\n-343830112 705498428 143226648\n291440312 -77749664 379849894\n-38224670 965923736 228397986\n445989819 -59978829 69739577\n846200388 -32998192 144797522\n148212783 -116561834 50668602\n414257386 -866248153 377575489\n-597458470 787726943 214388755\n817225098 -272667130 2825076\n-472474663 -362319481 347029453\n653471300 563941781 332669921\n377649192 873728532 11564329\n206925412 402548689 251055465\n505308313 562969445 613366114\n-839188080 -505338488 359167194\n780745964 195482763 24533348\n-26383965 291183834 6570684\n-573130477 -35750716 189063945\n342831675 888725134 433066879\n121349466 794418348 288577189\n-136376242 210875113 556343818\n-103111580 300771447 100641198\n657701799 -343831856 343548219\n-303767691 797640782 41611328\n-528470067 575481142 295824153\n-943661691 405317953 15322510\n-374295574 -467270526 271621173\n-927665702 730030760 83045452\n-33498159 -531264490 54521408\n-5472405 339993608 157528446\n9940945 -514869977 291551113\n-299387500 -128863607 435741582\n-177770005 -587292004 69020799\n-559512667 671724440 256086914\n-490974308 -719368458 173772779\n-437168182 744743273 478518192\n-508731490 375775432 51006117\n977090345 -412008288 243465852\n-843342322 427427216 239870645\n-88110675 340825665 22669247\n-249344699 -546321363 329778171\n301675420 360365407 193198476\n-233722818 385639712 144620575\n-909973668 553864884 367105507\n585779790 754899339 234258959\n-230641963 -368336518 133985305\n521541450 -769417032 22759911\n-716158102 -828974446 179366863\n264909596 543068026 122731653\n-264096001 -759913637 103771045\n415453874 -870553998 63983298\n668288459 279622815 122866981\n580492080 884049681 105403860\n-456141927 -49851470 624047473\n-713203231 865073237 442068328\n605830329 286518288 70028329\n-114447836 739585909 247741293\n356451575 -245449913 385562887\n-685432639 320972548 104848833\n-32406677 685569923 255200675\n116463751 -912282748 233010550\n-790554903 -457738564 58116162\n532223010 -762012207 205616148\n617191835 103253774 718070116\n-440539588 -352782329 154235882\n-269622225 -390815150 51187109\n893812316 928529589 127215913\n-51455962 -206087791 635568473\n354216527 430723062 82216499\n611264981 -557131486 312954128\n-647887493 140477782 226741585\n-967787384 846833446 95570664\n-18487497 483287347 376532013\n-999159454 240862015 207552453\n36789985 -738379019 3766454\n281469953 -132186931 522873284\n-348488503 266148069 201556100\n-426361876 -699426446 202128697\n351244618 871243965 192087426\n-243847410 -937278715 61678918\n-271021522 -134086935 471667226\n805473062 706562816 304875151\n-736686546 -226427357 345977298\n-670739616 -300139029 109238523\n969564002 681860312 145962680\n516023467 -905952917 430946665\n504676229 780118481 51608626\n-935594592 792000204 322849972\n180771326 -285847049 131623284\n696377846 52190298 6650900\n967628364 788474932 753909161\n585203001 323153212 4453761\n152439453 413928806 603564786\n-856706117 633082947 324322388\n-573203209 -586947038 19130410\n-4296054 -212698236 58724601\n286488309 736843696 589901464\n198981233 -386387464 526909517\n327007490 694615670 831824585\n662107134 561075147 263805248\n-918372232 -956468483 589179029\n553965609 118630104 245361604\n-9940572 66341082 68581015\n-906166148 794001426 27547802\n-73874964 -34916267 25241802\n-107845631 4422397 313456319\n-197721325 -460356777 444062786\n-998607139 -923531897 356273924\n975950264 -723637935 591405976\n-304519342 -844354898 204951916\n-853655075 456959184 219211890\n-222804363 -611230019 316238429\n461686139 372269335 115206747\n925514967 872854379 466073893\n649641575 -233335481 631519974\n243992459 582915490 682041004\n201040550 144993609 271361165\n-85078233 368048580 211661253\n417056064 940969909 818756569\n-294252677 988504484 464237643\n-565375878 -233016569 268304002\n844529348 -356437041 58444131\n654230409 694995286 202168699\n-664582575 681814149 198783913\n349973538 -706731519 422277202\n705081908 -952679108 283481022\n118669989 -403449398 8649572\n-311476225 -77048728 406413341\n490863732 845873689 1738716\n-558696403 -449875301 61186031\n-635812687 897467232 361364356\n547660508 32628467 34291455\n434784650 -731322553 35938721\n-316081327 -359059484 185550731\n-748570103 359951991 79308697\n905584522 -672571968 454886970\n870415814 -921298276 300318763\n-93319453 -320013312 240864889\n256632227 134764752 313342661\n989551287 -820633156 281775123\n-667271574 718663322 380478025\n-648291172 -14563840 101575791\n495827736 275973262 45680949\n373201678 -971041933 152315437\n-425279241 601956242 53607351\n565085645 -214276873 38759455\n454372829 -548186909 295277474\n388565459 27249739 140927011\n273628467 553896739 550903294\n413980037 127369464 89714849\n644012630 -196672505 267169683\n506036859 -122260712 612141253\n433411982 -964042508 183144162\n598602565 885368051 112741084\n611238371 -323978626 254996278\n968247759 26689915 314353167\n-198138302 643305828 419686808\n411058782 416444267 413688893\n-443607625 -642160179 442837984\n919776920 -784482915 599942071\n-88956848 248795977 294020518\n-873821073 222970507 643092893\n208676416 772282226 256940364\n48021533 563237694 53777185\n265434004 -787264690 119140742\n576846493 101666519 399571400\n163465200 197398125 219409357\n-92205170 155443162 74499201\n-373501159 197479571 576917556\n883641220 -669145415 358226695\n-408929630 457706346 463626727\n602441057 -52484225 180391031\n-8229111 256966901 28178260\n320205116 -785227063 131314725\n626401142 -259734239 450510764\n-946438941 507428770 23242372\n194677254 -30445541 273887291\n772925060 26957462 291372958\n305286517 -511961762 49895509\n-446592406 -849737099 4556752\n-504261546 -927166807 138539502\n672763249 950134400 491015091\n-201329107 940134253 117623982\n519633450 -441151750 675340530\n-704734217 -285949645 226073094\n696759106 -164266065 302309701\n619148447 -43827315 236781461\n189287064 683472139 105233931\n441960242 497480542 41737450\n-22112818 -487596758 460054001\n837257559 452075612 257235768\n-81933129 96174157 126354841\n-553341536 63705320 413207967\n917683639 -511342993 329950168\n572887876 488435580 375593207\n900485189 597696885 248009946\n702623692 937185236 609756032\n647590969 747577262 185976122\n861824311 -502002447 266590404\n552930129 976145122 109116153\n170679829 753726949 339330013\n186314052 366983998 312192544\n532517400 -554637647 218387798\n492696309 818155271 20917122\n-803157627 666749302 205917387\n383195844 801176533 43211101\n282755386 778114993 34422640\n772017130 -211971386 694175459\n109745574 -67757648 237644715\n-344282088 -372398755 479258387\n574347804 541918861 121267785\n-508121101 151202574 220884773\n-439845675 200301569 108795686\n821884334 505175918 194086332\n214332756 -202787904 63874531\n431923327 38112896 742781588\n-154510077 -403851980 245389462\n-621553933 927689606 373863450\n-943218835 -492077513 116069218\n-953615977 978653719 240191463\n548638765 677385327 17658406\n-769245168 -787740138 263453492\n374577998 -695375992 215913914\n55606276 -115965167 439244348\n-134846870 -329418591 329642678\n652954397 171719643 36690180\n-357695332 -974973197 39669037\n-826682813 -469666976 239076586\n-424073306 -440596083 191993733\n-288275194 104374212 243464128\n799397414 -329428894 55776443\n865437390 605434248 390146392\n415562729 -179195769 147321317\n618586060 -777451970 448920009\n814251681 -846792852 127189241\n355267083 373165727 79585795\n-572090276 63637722 186525973\n-730290110 965210777 92768395\n187389311 -606838602 518683645\n938706084 -193475991 142440863\n826886142 -324916233 160464893\n-256140658 -941637816 3266391\n487117117 708490264 486084914\n-287760645 -484101457 127716280\n466194656 631873247 231654260\n-568116398 -694613557 105340127\n432739226 -183725072 188307822\n-912743182 166507817 67654734\n934504660 -714121763 407659729\n-289404366 100466220 434312764\n230151034 -595191658 440351394\n604412943 -827975790 404144010\n-945073150 -438750372 432225430\n249217746 533768815 136203624\n-871072052 159399014 330788800\n-433054898 31818471 247749320\n200435585 681219830 13937208\n154768201 504492365 16908395\n-836776905 94859959 1767538\n-393530882 -643815947 167730665\n803216185 -772058777 78523627\n-119106978 -195074058 80182205\n-189897033 -245293182 308935089\n221211405 184769799 426712301\n274771738 392483694 433172166\n129915960 -794283933 401755606\n-713314695 -520994429 138382810\n879273898 -350130213 229202870\n-468056175 -386706767 183962969\n-42430278 -29974396 300996519\n547256636 699004547 265910229\n817569676 -836410827 230137166\n174039883 135465878 173934344\n-673930973 999413845 66117985\n368791934 -455964535 91663190\n-411953890 380133664 174622877\n-778360960 362595364 47174856\n-141902291 709110828 634590847\n-951688404 695188062 457175625\n629419828 228284835 134564303\n-342201052 -322012042 240078245\n-137337123 48692617 422442013\n552489757 -833421721 104679888\n-582732438 -973179219 520752921\n-947489394 894303275 456053293\n445234123 308226762 111594916\n-475251156 845949668 99798706\n168190841 -621113130 328852726\n-581712060 -834181535 217724355\n811058602 -575695529 517056777\n-312120493 -259927350 247839728\n667233741 518578364 180016052\n944649775 -310125372 179424504\n-480776505 228135336 62942318\n866596881 -950054034 254750879\n-527157561 -751536918 51151493\n115358611 -321620166 257164416\n949339088 -762868889 132562269\n-546999784 -779865574 1053304\n-6216404 24426624 73255392\n-611519259 396332925 170402988\n937952557 -446699261 242637697\n400700306 -771967166 111828273\n182180264 -383698496 229890622\n-510928159 260225889 65919948\n234930531 925477633 18172256\n509031532 50365090 259192342\n321535348 217862433 189940562\n639183042 937326454 234109313\n904724949 -40416242 89861809\n202113152 445965536 331615742\n-966742185 325710454 415660797\n220002874 -405639866 60471964\n-490042286 118165743 734285965\n-99604060 -9217286 139863462\n930081775 211456941 390668703\n-171083159 608730894 95599496\n-350508680 271358540 118626576\n536015842 715993794 40758510\n-376824362 947718488 176735910\n-418533663 -937005777 546728837\n-304843895 -907096580 63450218\n-787032648 -786534777 105591853\n562505551 -126191379 65301015\n667879767 368621018 450238565\n-819490652 -833562642 248914003\n328304140 245496716 121867823\n-424788751 161246996 112889226\n813917195 -320818695 347031463\n207148184 -358559080 20166581\n366997231 -362661594 466169139\n-800676551 325395110 344436316\n-641007499 -837336065 472007913\n513986280 -720375826 743164040\n-455961953 -202505311 24382320\n220825600 -357154689 244015876\n559975939 -289739241 492152588\n607363080 321442446 98972201\n-747853523 -188733259 191321766\n-189787459 3863081 353009074\n-399140319 818891562 34639581\n-353742441 932793044 174582838\n-429540923 632368400 267389544\n-103466130 454249816 32264728\n-520141131 -714230734 90890762\n-985876202 -847124433 224296395\n-973520996 -691582156 79452504\n596830507 -663272082 339853476\n-947918586 -638466579 8103190\n-598630040 -643470353 601723208\n-628248613 -599858170 609795167\n657716365 505176917 22967471\n-306428353 -323597311 146770467\n42895367 998876458 19039426\n396399780 -625564630 162041093\n970215391 633176024 78114005\n-181699842 578019751 463954665\n-275919560 -451654199 497701\n-755999025 671635819 591245117\n-935484614 -266434029 553622303\n-704717041 131131756 220567622\n191063155 126098684 226289805\n641127160 -604567759 510599316\n309615876 -288883039 185770924\n58720632 984799420 132550390\n235652167 -561787077 247141198\n804237162 -472340266 673869533\n34228852 -823403882 110685852\n-498217795 861074969 101394241\n-318380797 339821012 384173651\n392122024 -550149039 55061465\n-568640473 -925240288 546401593\n651476429 889759447 614903246\n793424097 721125416 214019985\n832009304 -438289050 169432562\n293098871 905323355 810301060\n-684869824 -555151797 258593155\n-832236761 442921405 54666563\n843850994 766874998 164501436\n-587527909 -340754302 808059625\n848187363 -503758453 383749410\n-598554234 443521335 150204425\n-311533929 -584921249 202068669\n458266723 -357274750 163356500\n937787574 113423493 562046709\n872203231 358960026 19751385\n-306768809 -492427269 85841419\n449555961 512649655 294602868\n348797293 -278845426 543896406\n-322375243 822855248 150198101\n-135650790 -722700803 202788726\n-960538460 665072874 107837812\n-854140723 714524899 60221223\n556076061 -605977702 410819152\n297455847 -821161096 9487320\n527063516 832135903 504801312\n-388884639 -516591086 346196887\n605378055 400742531 25510361\n107815933 716383554 520424587\n124388778 -201679066 455221380\n886416598 -701879136 277911403\n703587882 -609450046 190950689\n-90887221 167634717 72381037\n-193477854 122121786 173346065\n-573479492 -819006518 59877975\n331614184 350655903 193967645\n-846366190 75605017 100798224\n-296554905 -689617132 50311931\n-173545781 887333206 96024193\n46793619 -426606092 215590057\n485979701 -381617508 699732496\n-805433901 -573840104 485175559\n-299119870 -465009387 410520451\n827907498 239111600 6938554\n306423325 831196370 90599427\n-774194695 -590231566 216178960\n-599859722 130173816 348489296\n709358983 -685626981 11005361\n-385291262 105814977 106995982\n788569179 -275305974 82672902\n-65400317 994392504 79679812\n-646551285 583072103 274237410\n635873316 264598153 339659768\n-36098540 -813135215 20120674\n174370618 421136523 563890260\n110432477 -850550518 481755516\n72678111 588248827 48976032\n-221171908 -771780626 402085275\n-572082567 -546785107 177765430\n-99383266 -22264574 66176396\n228735765 -604779831 261130558\n727621625 778605340 334672855\n-737585438 -603528815 114901163\n825700869 584823209 60756469\n-797765662 640004677 172207780\n-679219936 467621714 573063959\n591461494 -824305674 75284948\n601280135 898526971 612688681\n161684668 -69100177 105591252\n-475813822 -611550260 165504935\n-801788566 -930658845 323915345\n-803613147 883044230 189556811\n-528582176 -919958448 242941710\n445176474 961879099 109027318\n-740127965 -344518214 268932496\n17145125 133226511 40284010\n-744728675 -593375905 125202704\n-275818172 -947793725 432448913\n952010983 958543313 109917279\n541547134 63887356 98594158\n529707606 -962354694 4798596\n-117830974 317364237 83828863\n537281961 -26719894 663153231\n762895026 661443027 49406734\n435438978 100338749 118006124\n654920757 -816492868 19181528\n-923487754 642942339 359276724\n447357065 548489819 263663843\n153253736 -704069190 545532425\n802493431 -580105528 26345100\n-870845003 -329681009 161231616\n-580711430 -264563740 886979665\n266573096 -145415065 82198984\n991438627 523407325 52946387\n-930144277 -556018900 386310420\n-591996046 -791874259 170398715\n682788127 -802652691 216511905\n-279849388 772540291 239845149\n132531052 -641097957 452007184\n-341493655 -293188385 108967816\n-945448157 -334831428 12874844\n-500815933 -35998355 267583926\n-116583261 -275952898 122790657\n-446237357 -671444532 183247054\n-889480439 -651270463 225097174\n753602121 644612409 42799421\n23110302 678530457 375341295\n658261071 -477834744 43703521\n484953891 360148890 51609569\n-515126241 324111962 454435869\n-407335884 910215633 219380031\n-830269861 -397527120 153843467\n-850187376 -126953560 738884939\n-931277219 862598867 228253389\n-643671025 581314294 148990192\n195888198 945592027 715236071\n-216684712 -734686101 125078960\n-347282982 -533280414 54936794\n-174691742 -915393602 328259611\n-604322694 997268207 748762420\n813083808 -548538030 181602707\n-318862827 612606163 423853276\n632151 -308846901 26995963\n131241089 -310627394 275921458\n256352188 580343875 225641863\n-638335248 -735805331 81035952\n-144022130 466836243 304908909\n754653693 -402649812 272199811\n89402729 -934574217 37000721\n-497338017 763554346 53433500\n832263595 674234843 391187151\n-201898263 -764886518 399167647\n687429687 188395251 231397147\n-79661000 -647893534 273762544\n354274331 437032243 187304747\n-255657629 310714724 5429965\n-995355350 -725581082 293169142\n-392347576 -51674302 328012312\n454510742 138988286 618519453\n-449754760 378967001 113812756\n-99147727 -509856581 146294897\n-771672948 -797185603 302233078\n-751555094 642657446 98698321\n183732965 341488845 36556598\n-268379320 428060380 305370752\n-984978706 516802710 29939605\n388185043 787584198 456002999\n-675508468 -896426560 505486781\n-864736469 249833959 515608902\n-110254636 -746380221 107765478\n-697365714 610384831 154317451\n922192161 -959073755 458960129\n-390603964 51521780 21427698\n-852613283 -815778992 412101605\n-968438939 -601685051 171058129\n458978446 -396635903 23599066\n-484066306 -116793459 337097842\n6802818 -964216740 45280796\n-309664717 551678654 312268545\n773839071 -818407284 403380702\n15898737 -459419195 714528469\n-985139946 -843114631 112466611\n-833377938 -644423415 94754299\n499966916 942911138 213722488\n-498205310 446892739 164129312\n819827749 -225974879 25780418\n283608037 -601079102 774160903\n498757183 695909575 77820153\n2662755 704465810 164449299\n-515429850 -565610648 61044539\n-531477549 243702422 320723949\n-940137023 864615471 176176303\n-840538481 -740411136 268755432\n-760851635 25862183 321816342\n491143317 -589943498 66763131\n771652331 -807165068 248514729\n-249722612 -501680969 427890647\n90044635 487641367 214075906\n893209368 -821126577 293226253\n134257587 -732620637 17039837\n80814975 -154365297 205529543\n-662289857 999976552 493606536\n91213312 -783911570 66425575\n-758082996 -529820702 110205030\n-738242762 -303439470 13814510\n-952530021 -27319199 119859258\n-489384838 172844125 233494708\n847030546 355846332 17651203\n389174522 -792297474 496010060\n-646484223 -449873537 118214690\n205738755 -925480990 259585622\n304537236 982656161 453093860\n782819248 -792738114 198420776\n-543062082 -406073223 148974625\n-60715794 -379233130 10245251\n145116416 -716830933 284968557\n-971675413 -708079111 76880753\n-192090374 -283626884 34628566\n-36110385 -259509049 635460447\n149922244 233190049 488577830\n-446035524 192161800 82975159\n336436328 -693402038 520066700\n507371232 689742034 359995947\n-735978683 -659901187 372232814\n10009609 820205791 64517171\n-63295769 -581548605 472046219\n-940154553 -302159693 255858925\n786484917 -955108665 219816587\n563446386 -694153280 562734677\n-402059001 109642120 294255252\n110120264 796482688 470229978\n-902784876 -770988701 12413119\n-784583675 8471817 19421460\n808394767 -85492488 101032191\n286490068 -729871765 70556855\n-853177079 959690418 72084085\n510484105 746339161 626560582\n995548095 -827684430 244041013\n-552233941 435253012 717660455\n713077874 877929471 180717528\n961745359 -609697970 262015790\n99615374 -997354727 110906827\n271955682 962622478 616834973\n-981406538 -424203125 768996000\n899982460 -671891295 93883255\n211845422 164319669 400356753\n27040430 591061110 53689767\n-683346455 859281790 66180285\n153480975 830390155 190294318\n888087532 312587549 756043869\n-828220380 -637794002 47575108\n-467527982 408784518 263326712\n610937 541415384 66617501\n-206102626 -800957324 177700942\n-771995177 646328958 447356363\n144051503 780866307 109865914\n125171301 121807161 113184161\n443963865 -700748317 74340391\n-776298258 -267971733 195797556\n-242494889 -516331127 554687025\n787935437 284671191 859160177\n390206828 -159153283 108124268\n-300985274 -67125916 32734978\n569364813 -600164619 115461338\n-750823747 -868642984 300608461\n341513791 132335379 19961719\n-628054946 540878212 82785371\n-95805543 -391881094 244686524\n-216267916 -744065752 320358095\n421741874 -903708634 526669344\n-245606288 745409483 193713459\n229369622 -581634408 360758735\n-756250642 -607182325 7177148\n-569630007 -209448372 402648052\n-452630948 -27737266 195722032\n332415117 -168905358 286742236\n-4180021 471246449 16140759\n734720732 -233989437 315760579\n871673916 -130133030 446335909\n-948721501 679381793 375125692\n-680093043 -798643700 382171288\n-546002846 301099030 67717750\n303440350 302085688 149737267\n-29034538 504021794 318383851\n-192146323 310856982 163326079\n-269815723 354398459 1979322\n-617911726 -528569568 41137569\n-779009149 982362703 584787572\n-981208103 -292410974 401458387\n426941354 356176151 534399547\n-734543984 -948067760 7058892\n242927300 90206002 552525772\n476603146 -916345460 252748972\n-579515147 788247556 157312890\n" ]
[ "3.6568542495\n", "0.0000000000\n", "4.0000000000\n", "2828427124.7461901000\n", "2828427122.7461901000\n", "425674041.2906273600\n", "32149365.5833579970\n", "0.0000000000\n", "27033675.3832434190\n", "0.0000000000\n" ]
1
stdio
Given positive integers N, K and M, solve the following problem for every integer x between 1 and N (inclusive): - Find the number, modulo M, of non-empty multisets containing between 0 and K (inclusive) instances of each of the integers 1, 2, 3 \cdots, N such that the average of the elements is x. -----Constraints----- - 1 \leq N, K \leq 100 - 10^8 \leq M \leq 10^9 + 9 - M is prime. - All values in input are integers. -----Input----- Input is given from Standard Input in the following format: N K M -----Output----- Use the following format: c_1 c_2 : c_N Here, c_x should be the number, modulo M, of multisets such that the average of the elements is x. -----Sample Input----- 3 1 998244353 -----Sample Output----- 1 3 1 Consider non-empty multisets containing between 0 and 1 instance(s) of each of the integers between 1 and 3. Among them, there are: - one multiset such that the average of the elements is k = 1: \{1\}; - three multisets such that the average of the elements is k = 2: \{2\}, \{1, 3\}, \{1, 2, 3\}; - one multiset such that the average of the elements is k = 3: \{3\}.
[ "3 1 998244353\n", "1 2 1000000007\n", "10 8 861271909\n", "2 1 905589253\n", "14 19 964292983\n", "24 26 804695321\n", "39 36 991399517\n", "46 46 961455263\n", "60 55 931711961\n", "64 64 879068783\n" ]
[ "1\n3\n1\n", "2\n", "8\n602\n81827\n4054238\n41331779\n41331779\n4054238\n81827\n602\n8\n", "1\n1\n", "19\n40239\n116285439\n44188045\n615501833\n534054421\n694441861\n694441861\n534054421\n615501833\n44188045\n116285439\n40239\n19\n", "26\n316385\n587325446\n562348028\n259395159\n735586658\n540711096\n448382968\n646169129\n665286086\n740680401\n638151860\n638151860\n740680401\n665286086\n646169129\n448382968\n540711096\n735586658\n259395159\n562348028\n587325446\n316385\n26\n", "36\n3667920\n990929167\n858401463\n60493630\n785191252\n714265038\n453588092\n382455915\n582064241\n401317628\n441250455\n403968890\n230277786\n432651121\n410095141\n951960058\n916461902\n641905774\n948722200\n641905774\n916461902\n951960058\n410095141\n432651121\n230277786\n403968890\n441250455\n401317628\n582064241\n382455915\n453588092\n714265038\n785191252\n60493630\n858401463\n990929167\n3667920\n36\n", "46\n30370929\n166679864\n575290604\n194798504\n252130064\n445139667\n765778720\n850511791\n84674874\n116060159\n145552585\n387190100\n700612085\n942254961\n156013598\n731283537\n729273362\n945901131\n779104366\n172673174\n208486221\n861159317\n861159317\n208486221\n172673174\n779104366\n945901131\n729273362\n731283537\n156013598\n942254961\n700612085\n387190100\n145552585\n116060159\n84674874\n850511791\n765778720\n445139667\n252130064\n194798504\n575290604\n166679864\n30370929\n46\n", "55\n167152439\n128555668\n452169460\n643905949\n564166013\n107864137\n829142158\n441763502\n504605298\n881084581\n745369157\n165726026\n347696005\n335989092\n224952495\n581117185\n108036073\n23523713\n890135712\n292644259\n89593977\n548089517\n38923823\n577648100\n401357148\n249060686\n489717600\n558942321\n63131721\n63131721\n558942321\n489717600\n249060686\n401357148\n577648100\n38923823\n548089517\n89593977\n292644259\n890135712\n23523713\n108036073\n581117185\n224952495\n335989092\n347696005\n165726026\n745369157\n881084581\n504605298\n441763502\n829142158\n107864137\n564166013\n643905949\n452169460\n128555668\n167152439\n55\n", "64\n800028839\n273410689\n196010624\n312953380\n227966059\n861538616\n217255633\n551899524\n272244211\n529845574\n363735259\n82493642\n864217314\n260504844\n624735861\n777035883\n168402978\n60765332\n70545429\n703637526\n112727240\n298194780\n873071920\n613410636\n624439078\n129940147\n656653400\n554594139\n519526204\n586168365\n613826896\n613826896\n586168365\n519526204\n554594139\n656653400\n129940147\n624439078\n613410636\n873071920\n298194780\n112727240\n703637526\n70545429\n60765332\n168402978\n777035883\n624735861\n260504844\n864217314\n82493642\n363735259\n529845574\n272244211\n551899524\n217255633\n861538616\n227966059\n312953380\n196010624\n273410689\n800028839\n64\n" ]
1
stdio
An accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening bracket (ASCII code $091$), a colon (ASCII code $058$), some (possibly zero) vertical line characters (ASCII code $124$), another colon, and a closing bracket (ASCII code $093$). The length of the accordion is the number of characters in it. For example, [::], [:||:] and [:|||:] are accordions having length $4$, $6$ and $7$. (:|:), {:||:}, [:], ]:||:[ are not accordions. You are given a string $s$. You want to transform it into an accordion by removing some (possibly zero) characters from it. Note that you may not insert new characters or reorder existing ones. Is it possible to obtain an accordion by removing characters from $s$, and if so, what is the maximum possible length of the result? -----Input----- The only line contains one string $s$ ($1 \le |s| \le 500000$). It consists of lowercase Latin letters and characters [, ], : and |. -----Output----- If it is not possible to obtain an accordion by removing some characters from $s$, print $-1$. Otherwise print maximum possible length of the resulting accordion. -----Examples----- Input |[a:b:|] Output 4 Input |]:[|:] Output -1
[ "|[a:b:|]\n", "|]:[|:]\n", ":][:\n", ":[]:\n", "[[:]]\n", "[::]\n", "]:|:[\n", ":::::]\n", "::::]\n", "::[]\n" ]
[ "4\n", "-1\n", "-1\n", "-1\n", "-1\n", "4\n", "-1\n", "-1\n", "-1\n", "-1\n" ]
1
stdio
Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits. Your task is to help Anton and to find the integer that interests him. If there are several such integers, determine the biggest of them. -----Input----- The first line contains the positive integer x (1 ≤ x ≤ 10^18) — the integer which Anton has. -----Output----- Print the positive integer which doesn't exceed x and has the maximum sum of digits. If there are several such integers, print the biggest of them. Printed integer must not contain leading zeros. -----Examples----- Input 100 Output 99 Input 48 Output 48 Input 521 Output 499
[ "100\n", "48\n", "521\n", "1\n", "2\n", "3\n", "39188\n", "5\n", "6\n", "7\n" ]
[ "99\n", "48\n", "499\n", "1\n", "2\n", "3\n", "38999\n", "5\n", "6\n", "7\n" ]
1
stdio
Apart from having lots of holidays throughout the year, residents of Berland also have whole lucky years. Year is considered lucky if it has no more than 1 non-zero digit in its number. So years 100, 40000, 5 are lucky and 12, 3001 and 12345 are not. You are given current year in Berland. Your task is to find how long will residents of Berland wait till the next lucky year. -----Input----- The first line contains integer number n (1 ≤ n ≤ 10^9) — current year in Berland. -----Output----- Output amount of years from the current year to the next lucky one. -----Examples----- Input 4 Output 1 Input 201 Output 99 Input 4000 Output 1000 -----Note----- In the first example next lucky year is 5. In the second one — 300. In the third — 5000.
[ "4\n", "201\n", "4000\n", "9\n", "10\n", "1\n", "100000000\n", "900000000\n", "999999999\n", "1000000000\n" ]
[ "1\n", "99\n", "1000\n", "1\n", "10\n", "1\n", "100000000\n", "100000000\n", "1\n", "1000000000\n" ]
1
stdio
On the planet Mars a year lasts exactly n days (there are no leap years on Mars). But Martians have the same weeks as earthlings — 5 work days and then 2 days off. Your task is to determine the minimum possible and the maximum possible number of days off per year on Mars. -----Input----- The first line of the input contains a positive integer n (1 ≤ n ≤ 1 000 000) — the number of days in a year on Mars. -----Output----- Print two integers — the minimum possible and the maximum possible number of days off per year on Mars. -----Examples----- Input 14 Output 4 4 Input 2 Output 0 2 -----Note----- In the first sample there are 14 days in a year on Mars, and therefore independently of the day a year starts with there will be exactly 4 days off . In the second sample there are only 2 days in a year on Mars, and they can both be either work days or days off.
[ "14\n", "2\n", "1\n", "3\n", "4\n", "5\n", "6\n", "7\n", "8\n", "9\n" ]
[ "4 4\n", "0 2\n", "0 1\n", "0 2\n", "0 2\n", "0 2\n", "1 2\n", "2 2\n", "2 3\n", "2 4\n" ]
1
stdio
Vasya likes everything infinite. Now he is studying the properties of a sequence s, such that its first element is equal to a (s_1 = a), and the difference between any two neighbouring elements is equal to c (s_{i} - s_{i} - 1 = c). In particular, Vasya wonders if his favourite integer b appears in this sequence, that is, there exists a positive integer i, such that s_{i} = b. Of course, you are the person he asks for a help. -----Input----- The first line of the input contain three integers a, b and c ( - 10^9 ≤ a, b, c ≤ 10^9) — the first element of the sequence, Vasya's favorite number and the difference between any two neighbouring elements of the sequence, respectively. -----Output----- If b appears in the sequence s print "YES" (without quotes), otherwise print "NO" (without quotes). -----Examples----- Input 1 7 3 Output YES Input 10 10 0 Output YES Input 1 -4 5 Output NO Input 0 60 50 Output NO -----Note----- In the first sample, the sequence starts from integers 1, 4, 7, so 7 is its element. In the second sample, the favorite integer of Vasya is equal to the first element of the sequence. In the third sample all elements of the sequence are greater than Vasya's favorite integer. In the fourth sample, the sequence starts from 0, 50, 100, and all the following elements are greater than Vasya's favorite integer.
[ "1 7 3\n", "10 10 0\n", "1 -4 5\n", "0 60 50\n", "1 -4 -5\n", "0 1 0\n", "10 10 42\n", "-1000000000 1000000000 -1\n", "10 16 4\n", "-1000000000 1000000000 5\n" ]
[ "YES\n", "YES\n", "NO\n", "NO\n", "YES\n", "NO\n", "YES\n", "NO\n", "NO\n", "YES\n" ]
1
stdio
Petya recieved a gift of a string s with length up to 10^5 characters for his birthday. He took two more empty strings t and u and decided to play a game. This game has two possible moves: Extract the first character of s and append t with this character. Extract the last character of t and append u with this character. Petya wants to get strings s and t empty and string u lexicographically minimal. You should write a program that will help Petya win the game. -----Input----- First line contains non-empty string s (1 ≤ |s| ≤ 10^5), consisting of lowercase English letters. -----Output----- Print resulting string u. -----Examples----- Input cab Output abc Input acdb Output abdc
[ "cab\n", "acdb\n", "a\n", "ab\n", "ba\n", "dijee\n", "bhrmc\n", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n", "bababaaababaabbbbbabbbbbbaaabbabaaaaabbbbbaaaabbbbabaabaabababbbabbabbabaaababbabbababaaaaabaaaabbba\n", "bccbbcccbccbacacbaccaababcbaababaaaaabcaaabcaacbabcaababaabaccacacccbacbcacbbbaacaaccccabbbbacbcbbba\n" ]
[ "abc\n", "abdc\n", "a\n", "ab\n", "ab\n", "deeji\n", "bcmrh\n", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbcbcbbbbcccccbbbccbcbccccccbbbcbbccbcbbbbcbbccbccbccbcccbbccb\n" ]
1
stdio
Karen is getting ready for a new school day! [Image] It is currently hh:mm, given in a 24-hour format. As you know, Karen loves palindromes, and she believes that it is good luck to wake up when the time is a palindrome. What is the minimum number of minutes she should sleep, such that, when she wakes up, the time is a palindrome? Remember that a palindrome is a string that reads the same forwards and backwards. For instance, 05:39 is not a palindrome, because 05:39 backwards is 93:50. On the other hand, 05:50 is a palindrome, because 05:50 backwards is 05:50. -----Input----- The first and only line of input contains a single string in the format hh:mm (00 ≤ hh ≤ 23, 00 ≤ mm ≤ 59). -----Output----- Output a single integer on a line by itself, the minimum number of minutes she should sleep, such that, when she wakes up, the time is a palindrome. -----Examples----- Input 05:39 Output 11 Input 13:31 Output 0 Input 23:59 Output 1 -----Note----- In the first test case, the minimum number of minutes Karen should sleep for is 11. She can wake up at 05:50, when the time is a palindrome. In the second test case, Karen can wake up immediately, as the current time, 13:31, is already a palindrome. In the third test case, the minimum number of minutes Karen should sleep for is 1 minute. She can wake up at 00:00, when the time is a palindrome.
[ "05:39\n", "13:31\n", "23:59\n", "13:32\n", "14:40\n", "14:00\n", "05:50\n", "12:22\n", "12:34\n", "05:30\n" ]
[ "11\n", "0\n", "1\n", "69\n", "1\n", "41\n", "0\n", "69\n", "57\n", "20\n" ]
1
stdio
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half. [Image] English alphabet You are given a string s. Check if the string is "s-palindrome". -----Input----- The only line contains the string s (1 ≤ |s| ≤ 1000) which consists of only English letters. -----Output----- Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise. -----Examples----- Input oXoxoXo Output TAK Input bod Output TAK Input ER Output NIE
[ "oXoxoXo\n", "bod\n", "ER\n", "o\n", "a\n", "opo\n", "HCMoxkgbNb\n", "vMhhXCMWDe\n", "iIcamjTRFH\n", "WvoWvvWovW\n" ]
[ "TAK\n", "TAK\n", "NIE\n", "TAK\n", "NIE\n", "NIE\n", "NIE\n", "NIE\n", "NIE\n", "TAK\n" ]
1
stdio
You are given two positive integer numbers a and b. Permute (change order) of the digits of a to construct maximal number not exceeding b. No number in input and/or output can start with the digit 0. It is allowed to leave a as it is. -----Input----- The first line contains integer a (1 ≤ a ≤ 10^18). The second line contains integer b (1 ≤ b ≤ 10^18). Numbers don't have leading zeroes. It is guaranteed that answer exists. -----Output----- Print the maximum possible number that is a permutation of digits of a and is not greater than b. The answer can't have any leading zeroes. It is guaranteed that the answer exists. The number in the output should have exactly the same length as number a. It should be a permutation of digits of a. -----Examples----- Input 123 222 Output 213 Input 3921 10000 Output 9321 Input 4940 5000 Output 4940
[ "123\n222\n", "3921\n10000\n", "4940\n5000\n", "23923472834\n23589234723\n", "102391019\n491010301\n", "123456789123456789\n276193619183618162\n", "1000000000000000000\n1000000000000000000\n", "1\n1000000000000000000\n", "999999999999999999\n1000000000000000000\n", "2475345634895\n3455834583479\n" ]
[ "213\n", "9321\n", "4940\n", "23498743322\n", "399211100\n", "276193618987554432\n", "1000000000000000000\n", "1\n", "999999999999999999\n", "3455834579642\n" ]
1
stdio
You are given matrix with n rows and n columns filled with zeroes. You should put k ones in it in such a way that the resulting matrix is symmetrical with respect to the main diagonal (the diagonal that goes from the top left to the bottom right corner) and is lexicographically maximal. One matrix is lexicographically greater than the other if the first different number in the first different row from the top in the first matrix is greater than the corresponding number in the second one. If there exists no such matrix then output -1. -----Input----- The first line consists of two numbers n and k (1 ≤ n ≤ 100, 0 ≤ k ≤ 10^6). -----Output----- If the answer exists then output resulting matrix. Otherwise output -1. -----Examples----- Input 2 1 Output 1 0 0 0 Input 3 2 Output 1 0 0 0 1 0 0 0 0 Input 2 5 Output -1
[ "2 1\n", "3 2\n", "2 5\n", "1 0\n", "1 1\n", "20 401\n", "100 10001\n", "2 3\n", "4 5\n", "5 6\n" ]
[ "1 0 \n0 0 \n", "1 0 0 \n0 1 0 \n0 0 0 \n", "-1\n", "0 \n", "1 \n", "-1\n", "-1\n", "1 1 \n1 0 \n", "1 1 1 0 \n1 0 0 0 \n1 0 0 0 \n0 0 0 0 \n", "1 1 1 0 0 \n1 1 0 0 0 \n1 0 0 0 0 \n0 0 0 0 0 \n0 0 0 0 0 \n" ]
1
stdio
You are given two arithmetic progressions: a_1k + b_1 and a_2l + b_2. Find the number of integers x such that L ≤ x ≤ R and x = a_1k' + b_1 = a_2l' + b_2, for some integers k', l' ≥ 0. -----Input----- The only line contains six integers a_1, b_1, a_2, b_2, L, R (0 < a_1, a_2 ≤ 2·10^9, - 2·10^9 ≤ b_1, b_2, L, R ≤ 2·10^9, L ≤ R). -----Output----- Print the desired number of integers x. -----Examples----- Input 2 0 3 3 5 21 Output 3 Input 2 4 3 0 6 17 Output 2
[ "2 0 3 3 5 21\n", "2 4 3 0 6 17\n", "2 0 4 2 -39 -37\n", "1 9 3 11 49 109\n", "3 81 5 72 -1761 501\n", "8 -89 20 67 8771 35222\n", "1 -221 894 86403 -687111 141371\n", "1 -1074 271 17741 -2062230 1866217\n", "3 2408 819 119198 -8585197 7878219\n", "1 341 8581 3946733 -59420141 33253737\n" ]
[ "3\n", "2\n", "0\n", "20\n", "28\n", "661\n", "62\n", "6821\n", "9474\n", "3416\n" ]
1
stdio
The flag of Berland is such rectangular field n × m that satisfies following conditions: Flag consists of three colors which correspond to letters 'R', 'G' and 'B'. Flag consists of three equal in width and height stripes, parralel to each other and to sides of the flag. Each stripe has exactly one color. Each color should be used in exactly one stripe. You are given a field n × m, consisting of characters 'R', 'G' and 'B'. Output "YES" (without quotes) if this field corresponds to correct flag of Berland. Otherwise, print "NO" (without quotes). -----Input----- The first line contains two integer numbers n and m (1 ≤ n, m ≤ 100) — the sizes of the field. Each of the following n lines consisting of m characters 'R', 'G' and 'B' — the description of the field. -----Output----- Print "YES" (without quotes) if the given field corresponds to correct flag of Berland . Otherwise, print "NO" (without quotes). -----Examples----- Input 6 5 RRRRR RRRRR BBBBB BBBBB GGGGG GGGGG Output YES Input 4 3 BRG BRG BRG BRG Output YES Input 6 7 RRRGGGG RRRGGGG RRRGGGG RRRBBBB RRRBBBB RRRBBBB Output NO Input 4 4 RRRR RRRR BBBB GGGG Output NO -----Note----- The field in the third example doesn't have three parralel stripes. Rows of the field in the fourth example are parralel to each other and to borders. But they have different heights — 2, 1 and 1.
[ "6 5\nRRRRR\nRRRRR\nBBBBB\nBBBBB\nGGGGG\nGGGGG\n", "4 3\nBRG\nBRG\nBRG\nBRG\n", "6 7\nRRRGGGG\nRRRGGGG\nRRRGGGG\nRRRBBBB\nRRRBBBB\nRRRBBBB\n", "4 4\nRRRR\nRRRR\nBBBB\nGGGG\n", "1 3\nGRB\n", "3 1\nR\nG\nB\n", "4 3\nRGB\nGRB\nGRB\nGRB\n", "4 6\nGGRRBB\nGGRRBB\nGGRRBB\nRRGGBB\n", "100 3\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nRGB\nGRB\n", "3 100\nBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\nGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG\nRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRG\n" ]
[ "YES\n", "YES\n", "NO\n", "NO\n", "YES\n", "YES\n", "NO\n", "NO\n", "NO\n", "NO\n" ]
1
stdio
Ayrat is looking for the perfect code. He decided to start his search from an infinite field tiled by hexagons. For convenience the coordinate system is introduced, take a look at the picture to see how the coordinates of hexagon are defined: [Image] [Image] Ayrat is searching through the field. He started at point (0, 0) and is moving along the spiral (see second picture). Sometimes he forgets where he is now. Help Ayrat determine his location after n moves. -----Input----- The only line of the input contains integer n (0 ≤ n ≤ 10^18) — the number of Ayrat's moves. -----Output----- Print two integers x and y — current coordinates of Ayrat coordinates. -----Examples----- Input 3 Output -2 0 Input 7 Output 3 2
[ "3\n", "7\n", "39\n", "14\n", "94\n", "60\n", "60\n", "59\n", "181994\n", "486639\n" ]
[ "-2 0\n", "3 2\n", "5 6\n", "-2 -4\n", "8 8\n", "8 0\n", "8 0\n", "7 -2\n", "154 -492\n", "-33 806\n" ]
1
stdio
Dante is engaged in a fight with "The Savior". Before he can fight it with his sword, he needs to break its shields. He has two guns, Ebony and Ivory, each of them is able to perform any non-negative number of shots. For every bullet that hits the shield, Ebony deals a units of damage while Ivory deals b units of damage. In order to break the shield Dante has to deal exactly c units of damage. Find out if this is possible. -----Input----- The first line of the input contains three integers a, b, c (1 ≤ a, b ≤ 100, 1 ≤ c ≤ 10 000) — the number of units of damage dealt by Ebony gun and Ivory gun, and the total number of damage required to break the shield, respectively. -----Output----- Print "Yes" (without quotes) if Dante can deal exactly c damage to the shield and "No" (without quotes) otherwise. -----Examples----- Input 4 6 15 Output No Input 3 2 7 Output Yes Input 6 11 6 Output Yes -----Note----- In the second sample, Dante can fire 1 bullet from Ebony and 2 from Ivory to deal exactly 1·3 + 2·2 = 7 damage. In the third sample, Dante can fire 1 bullet from ebony and no bullets from ivory to do 1·6 + 0·11 = 6 damage.
[ "4 6 15\n", "3 2 7\n", "6 11 6\n", "3 12 15\n", "5 5 10\n", "6 6 7\n", "1 1 20\n", "12 14 19\n", "15 12 26\n", "2 4 8\n" ]
[ "No\n", "Yes\n", "Yes\n", "Yes\n", "Yes\n", "No\n", "Yes\n", "No\n", "No\n", "Yes\n" ]
1
stdio
You are given the set of vectors on the plane, each of them starting at the origin. Your task is to find a pair of vectors with the minimal non-oriented angle between them. Non-oriented angle is non-negative value, minimal between clockwise and counterclockwise direction angles. Non-oriented angle is always between 0 and π. For example, opposite directions vectors have angle equals to π. -----Input----- First line of the input contains a single integer n (2 ≤ n ≤ 100 000) — the number of vectors. The i-th of the following n lines contains two integers x_{i} and y_{i} (|x|, |y| ≤ 10 000, x^2 + y^2 > 0) — the coordinates of the i-th vector. Vectors are numbered from 1 to n in order of appearing in the input. It is guaranteed that no two vectors in the input share the same direction (but they still can have opposite directions). -----Output----- Print two integer numbers a and b (a ≠ b) — a pair of indices of vectors with the minimal non-oriented angle. You can print the numbers in any order. If there are many possible answers, print any. -----Examples----- Input 4 -1 0 0 -1 1 0 1 1 Output 3 4 Input 6 -1 0 0 -1 1 0 1 1 -4 -5 -4 -6 Output 6 5
[ "4\n-1 0\n0 -1\n1 0\n1 1\n", "6\n-1 0\n0 -1\n1 0\n1 1\n-4 -5\n-4 -6\n", "10\n8 6\n-7 -3\n9 8\n7 10\n-3 -8\n3 7\n6 -8\n-9 8\n9 2\n6 7\n", "20\n-9 8\n-7 3\n0 10\n3 7\n6 -9\n6 8\n7 -6\n-6 10\n-10 3\n-8 -10\n10 -2\n1 -8\n-8 10\n10 10\n10 6\n-5 6\n5 -8\n5 -9\n-9 -1\n9 2\n", "2\n351 -4175\n-328 -657\n", "3\n620 -1189\n8101 -2770\n3347 3473\n", "4\n-7061 -5800\n-3471 -9470\n-7639 2529\n5657 -6522\n", "5\n-7519 -3395\n-32 -257\n-4827 -1889\n9545 -7037\n2767 583\n", "6\n-5120 -3251\n8269 -7984\n841 3396\n3136 -7551\n-1280 -3013\n-3263 -3278\n", "7\n-2722 6597\n-3303 200\n6508 -1021\n-1107 -1042\n6875 7616\n-3047 6749\n662 -1979\n" ]
[ "3 4\n", "5 6\n", "1 3\n", "13 16\n", "2 1\n", "1 2\n", "1 2\n", "3 1\n", "1 6\n", "1 6\n" ]
1
stdio
You are given positive integer number n. You should create such strictly increasing sequence of k positive numbers a_1, a_2, ..., a_{k}, that their sum is equal to n and greatest common divisor is maximal. Greatest common divisor of sequence is maximum of such numbers that every element of sequence is divisible by them. If there is no possible sequence then output -1. -----Input----- The first line consists of two numbers n and k (1 ≤ n, k ≤ 10^10). -----Output----- If the answer exists then output k numbers — resulting sequence. Otherwise output -1. If there are multiple answers, print any of them. -----Examples----- Input 6 3 Output 1 2 3 Input 8 2 Output 2 6 Input 5 3 Output -1
[ "6 3\n", "8 2\n", "5 3\n", "1 1\n", "1 2\n", "2 1\n", "2 10000000000\n", "5 1\n", "6 2\n", "24 2\n" ]
[ "1 2 3\n", "2 6\n", "-1\n", "1\n", "-1\n", "2\n", "-1\n", "5\n", "2 4\n", "8 16\n" ]
1
stdio
Bizon the Champion isn't just charming, he also is very smart. While some of us were learning the multiplication table, Bizon the Champion had fun in his own manner. Bizon the Champion painted an n × m multiplication table, where the element on the intersection of the i-th row and j-th column equals i·j (the rows and columns of the table are numbered starting from 1). Then he was asked: what number in the table is the k-th largest number? Bizon the Champion always answered correctly and immediately. Can you repeat his success? Consider the given multiplication table. If you write out all n·m numbers from the table in the non-decreasing order, then the k-th number you write out is called the k-th largest number. -----Input----- The single line contains integers n, m and k (1 ≤ n, m ≤ 5·10^5; 1 ≤ k ≤ n·m). -----Output----- Print the k-th largest number in a n × m multiplication table. -----Examples----- Input 2 2 2 Output 2 Input 2 3 4 Output 3 Input 1 10 5 Output 5 -----Note----- A 2 × 3 multiplication table looks like this: 1 2 3 2 4 6
[ "2 2 2\n", "2 3 4\n", "1 10 5\n", "1 1 1\n", "10 1 7\n", "10 10 33\n", "500000 500000 1\n", "500000 500000 250000000000\n", "3 3 1\n", "3 3 2\n" ]
[ "2\n", "3\n", "5\n", "1\n", "7\n", "14\n", "1\n", "250000000000\n", "1\n", "2\n" ]
1
stdio
Let's write all the positive integer numbers one after another from $1$ without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718192021222324252627282930313233343536... Your task is to print the $k$-th digit of this sequence. -----Input----- The first and only line contains integer $k$ ($1 \le k \le 10^{12}$) — the position to process ($1$-based index). -----Output----- Print the $k$-th digit of the resulting infinite sequence. -----Examples----- Input 7 Output 7 Input 21 Output 5
[ "7\n", "21\n", "1\n", "2\n", "3\n", "4\n", "5\n", "6\n", "8\n", "9\n" ]
[ "7\n", "5\n", "1\n", "2\n", "3\n", "4\n", "5\n", "6\n", "8\n", "9\n" ]
1
stdio
A string a of length m is called antipalindromic iff m is even, and for each i (1 ≤ i ≤ m) a_{i} ≠ a_{m} - i + 1. Ivan has a string s consisting of n lowercase Latin letters; n is even. He wants to form some string t that will be an antipalindromic permutation of s. Also Ivan has denoted the beauty of index i as b_{i}, and the beauty of t as the sum of b_{i} among all indices i such that s_{i} = t_{i}. Help Ivan to determine maximum possible beauty of t he can get. -----Input----- The first line contains one integer n (2 ≤ n ≤ 100, n is even) — the number of characters in s. The second line contains the string s itself. It consists of only lowercase Latin letters, and it is guaranteed that its letters can be reordered to form an antipalindromic string. The third line contains n integer numbers b_1, b_2, ..., b_{n} (1 ≤ b_{i} ≤ 100), where b_{i} is the beauty of index i. -----Output----- Print one number — the maximum possible beauty of t. -----Examples----- Input 8 abacabac 1 1 1 1 1 1 1 1 Output 8 Input 8 abaccaba 1 2 3 4 5 6 7 8 Output 26 Input 8 abacabca 1 2 3 4 4 3 2 1 Output 17
[ "8\nabacabac\n1 1 1 1 1 1 1 1\n", "8\nabaccaba\n1 2 3 4 5 6 7 8\n", "8\nabacabca\n1 2 3 4 4 3 2 1\n", "100\nbaaacbccbccaccaccaaabcabcabccacaabcbccbccabbabcbcbbaacacbacacacaacccbcbbbbacccababcbacacbacababcacbc\n28 28 36 36 9 53 7 54 66 73 63 30 55 53 54 74 60 2 34 36 72 56 13 63 99 4 44 54 29 75 9 68 80 49 74 94 42 22 43 4 41 88 87 44 85 76 20 5 5 36 50 90 78 63 84 93 47 33 64 60 11 67 70 7 14 45 48 88 12 95 65 53 37 15 49 50 47 57 15 84 96 18 63 23 93 14 85 26 55 58 8 49 54 94 3 10 61 24 68 1\n", "100\ncccccaacccbaaababacbbacbbbcbccaccaccbcccbbaabababcacbccaacacaababacbcbcccabcacbccccbccaaabcabcaaabcc\n95 91 11 97 2 16 42 33 22 1 26 52 47 45 96 96 53 99 38 61 27 53 6 13 12 77 76 19 69 60 88 85 61 29 81 65 52 47 23 12 93 76 46 30 71 11 96 3 80 79 71 93 17 57 57 20 71 75 58 41 34 99 54 27 88 12 37 37 3 73 72 25 28 35 35 55 37 56 61 1 11 59 89 52 81 13 13 53 7 83 90 61 36 58 77 4 41 33 13 84\n", "100\ncabaabbacacabbbababcbcbccaccbcaabcbbcabbacccbacbaabbaccabcaccbaacacaaabbaababbcababcbcbacbcacbbccbaa\n68 65 4 76 17 74 33 92 47 72 10 17 20 4 20 57 99 47 7 17 32 46 8 47 89 75 33 27 64 74 36 90 62 77 23 62 35 68 82 80 55 29 53 41 26 81 75 90 65 97 90 15 43 55 31 48 69 86 43 15 23 21 1 23 93 53 93 88 47 22 13 61 69 98 54 69 87 7 23 70 29 40 50 41 85 79 14 44 44 46 27 59 65 89 81 52 39 53 45 7\n", "100\nbaaabbccbadabbaccdbbdacacaacbcccbbbacbabbaacabbbbaddaacbbdcdccaaddddbbadcddbbbabdccbcadbbdcaccabdbad\n76 26 64 3 47 52 77 89 81 23 38 18 27 57 17 96 72 29 84 39 89 80 54 90 66 28 19 45 35 16 44 96 55 39 73 3 5 8 57 44 38 27 5 22 9 67 37 14 91 6 94 13 82 48 87 3 30 17 32 99 40 38 65 45 58 48 44 86 69 45 63 68 46 24 43 75 73 1 8 85 56 87 34 74 38 73 38 25 65 38 6 6 75 96 25 98 30 21 97 74\n", "100\nbaccccbcbdcddcddbbdcacaddabdbaaaacbadabdbcbbababddadbacddabdcddbcaadadbcbdcdbabbbcbbbadadcaacdbaaacd\n49 100 65 90 73 14 68 48 5 94 21 91 99 7 45 57 13 82 48 95 91 66 56 28 46 22 87 56 29 34 88 2 60 74 23 7 92 25 16 13 4 76 16 29 67 33 16 13 76 24 8 35 13 45 61 35 28 24 16 69 29 48 13 33 58 89 88 37 14 90 3 3 86 83 62 80 11 48 66 63 78 68 83 67 42 51 34 12 6 100 44 7 100 36 32 45 28 37 29 85\n", "10\ncaabacddad\n86 47 85 37 79 63 55 19 62 27\n", "100\nadebebcdacabaadcbcdebcccdaadaeeedecdbcbdeddcbcaeedbecaeeabaabbdccaebdebabbabdcebbbdaabdbddcadaddadad\n52 62 28 18 100 84 16 53 43 52 49 92 10 64 50 95 90 52 21 14 60 3 94 63 31 70 74 62 93 75 100 96 58 36 76 40 62 74 91 77 92 78 65 11 50 18 79 29 10 25 4 24 44 39 4 91 81 63 97 65 50 65 77 51 19 87 43 31 40 8 57 14 67 17 47 94 96 46 59 69 96 11 75 100 87 36 70 1 22 92 31 50 2 35 68 95 19 96 89 52\n" ]
[ "8\n", "26\n", "17\n", "4382\n", "4494\n", "4540\n", "4466\n", "4425\n", "486\n", "5112\n" ]
1
stdio
Vanya has a scales for weighing loads and weights of masses w^0, w^1, w^2, ..., w^100 grams where w is some integer not less than 2 (exactly one weight of each nominal value). Vanya wonders whether he can weight an item with mass m using the given weights, if the weights can be put on both pans of the scales. Formally speaking, your task is to determine whether it is possible to place an item of mass m and some weights on the left pan of the scales, and some weights on the right pan of the scales so that the pans of the scales were in balance. -----Input----- The first line contains two integers w, m (2 ≤ w ≤ 10^9, 1 ≤ m ≤ 10^9) — the number defining the masses of the weights and the mass of the item. -----Output----- Print word 'YES' if the item can be weighted and 'NO' if it cannot. -----Examples----- Input 3 7 Output YES Input 100 99 Output YES Input 100 50 Output NO -----Note----- Note to the first sample test. One pan can have an item of mass 7 and a weight of mass 3, and the second pan can have two weights of masses 9 and 1, correspondingly. Then 7 + 3 = 9 + 1. Note to the second sample test. One pan of the scales can have an item of mass 99 and the weight of mass 1, and the second pan can have the weight of mass 100. Note to the third sample test. It is impossible to measure the weight of the item in the manner described in the input.
[ "3 7\n", "100 99\n", "100 50\n", "1000000000 1\n", "100 10002\n", "4 7\n", "4 11\n", "5 781\n", "7 9\n", "5077 5988\n" ]
[ "YES\n", "YES\n", "NO\n", "YES\n", "NO\n", "NO\n", "YES\n", "YES\n", "NO\n", "NO\n" ]
1
stdio
After making bad dives into swimming pools, Wilbur wants to build a swimming pool in the shape of a rectangle in his backyard. He has set up coordinate axes, and he wants the sides of the rectangle to be parallel to them. Of course, the area of the rectangle must be positive. Wilbur had all four vertices of the planned pool written on a paper, until his friend came along and erased some of the vertices. Now Wilbur is wondering, if the remaining n vertices of the initial rectangle give enough information to restore the area of the planned swimming pool. -----Input----- The first line of the input contains a single integer n (1 ≤ n ≤ 4) — the number of vertices that were not erased by Wilbur's friend. Each of the following n lines contains two integers x_{i} and y_{i} ( - 1000 ≤ x_{i}, y_{i} ≤ 1000) —the coordinates of the i-th vertex that remains. Vertices are given in an arbitrary order. It's guaranteed that these points are distinct vertices of some rectangle, that has positive area and which sides are parallel to the coordinate axes. -----Output----- Print the area of the initial rectangle if it could be uniquely determined by the points remaining. Otherwise, print - 1. -----Examples----- Input 2 0 0 1 1 Output 1 Input 1 1 1 Output -1 -----Note----- In the first sample, two opposite corners of the initial rectangle are given, and that gives enough information to say that the rectangle is actually a unit square. In the second sample there is only one vertex left and this is definitely not enough to uniquely define the area.
[ "2\n0 0\n1 1\n", "1\n1 1\n", "1\n-188 17\n", "1\n71 -740\n", "4\n-56 -858\n-56 -174\n778 -858\n778 -174\n", "2\n14 153\n566 -13\n", "2\n-559 894\n314 127\n", "1\n-227 -825\n", "2\n-187 583\n25 13\n", "2\n-337 451\n32 -395\n" ]
[ "1\n", "-1\n", "-1\n", "-1\n", "570456\n", "91632\n", "669591\n", "-1\n", "120840\n", "312174\n" ]
1
stdio
You have an array a consisting of n integers. Each integer from 1 to n appears exactly once in this array. For some indices i (1 ≤ i ≤ n - 1) it is possible to swap i-th element with (i + 1)-th, for other indices it is not possible. You may perform any number of swapping operations any order. There is no limit on the number of times you swap i-th element with (i + 1)-th (if the position is not forbidden). Can you make this array sorted in ascending order performing some sequence of swapping operations? -----Input----- The first line contains one integer n (2 ≤ n ≤ 200000) — the number of elements in the array. The second line contains n integers a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ 200000) — the elements of the array. Each integer from 1 to n appears exactly once. The third line contains a string of n - 1 characters, each character is either 0 or 1. If i-th character is 1, then you can swap i-th element with (i + 1)-th any number of times, otherwise it is forbidden to swap i-th element with (i + 1)-th. -----Output----- If it is possible to sort the array in ascending order using any sequence of swaps you are allowed to make, print YES. Otherwise, print NO. -----Examples----- Input 6 1 2 5 3 4 6 01110 Output YES Input 6 1 2 5 3 4 6 01010 Output NO -----Note----- In the first example you may swap a_3 and a_4, and then swap a_4 and a_5.
[ "6\n1 2 5 3 4 6\n01110\n", "6\n1 2 5 3 4 6\n01010\n", "6\n1 6 3 4 5 2\n01101\n", "6\n2 3 1 4 5 6\n01111\n", "4\n2 3 1 4\n011\n", "2\n2 1\n0\n", "5\n1 2 4 5 3\n0101\n", "5\n1 2 4 5 3\n0001\n", "5\n1 4 5 2 3\n0110\n", "5\n4 5 1 2 3\n0111\n" ]
[ "YES\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n", "NO\n" ]
1
stdio
One day Kefa found n baloons. For convenience, we denote color of i-th baloon as s_{i} — 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 — print «YES», if he can, and «NO», otherwise. Note, that Kefa's friend will not upset, if he doesn't get baloons at all. -----Input----- The first line contains two integers n and k (1 ≤ n, k ≤ 100) — the number of baloons and friends. Next line contains string s — colors of baloons. -----Output----- Answer to the task — «YES» or «NO» in a single line. You can choose the case (lower or upper) for each letter arbitrary. -----Examples----- Input 4 2 aabb Output YES Input 6 3 aacaab Output NO -----Note----- In 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 «NO».
[ "4 2\naabb\n", "6 3\naacaab\n", "2 2\nlu\n", "5 3\novvoo\n", "36 13\nbzbzcffczzcbcbzzfzbbfzfzzbfbbcbfccbf\n", "81 3\nooycgmvvrophvcvpoupepqllqttwcocuilvyxbyumdmmfapvpnxhjhxfuagpnntonibicaqjvwfhwxhbv\n", "100 100\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n", "100 1\nnubcvvjvbjgnjsdkajimdcxvewbcytvfkihunycdrlconddlwgzjasjlsrttlrzsumzpyumpveglfqzmaofbshbojmwuwoxxvrod\n", "100 13\nvyldolgryldqrvoldvzvrdrgorlorszddtgqvrlisxxrxdxlqtvtgsrqlzixoyrozxzogqxlsgzdddzqrgitxxritoolzolgrtvl\n", "18 6\njzwtnkvmscqhmdlsxy\n" ]
[ "YES\n", "NO\n", "YES\n", "YES\n", "YES\n", "NO\n", "YES\n", "NO\n", "YES\n", "YES\n" ]
1
stdio
You are given an array of n integer numbers a_0, a_1, ..., a_{n} - 1. Find the distance between two closest (nearest) minimums in it. It is guaranteed that in the array a minimum occurs at least two times. -----Input----- The first line contains positive integer n (2 ≤ n ≤ 10^5) — size of the given array. The second line contains n integers a_0, a_1, ..., a_{n} - 1 (1 ≤ a_{i} ≤ 10^9) — elements of the array. It is guaranteed that in the array a minimum occurs at least two times. -----Output----- Print the only number — distance between two nearest minimums in the array. -----Examples----- Input 2 3 3 Output 1 Input 3 5 6 5 Output 2 Input 9 2 1 3 5 4 1 2 3 1 Output 3
[ "2\n3 3\n", "3\n5 6 5\n", "9\n2 1 3 5 4 1 2 3 1\n", "6\n4 6 7 8 6 4\n", "2\n1000000000 1000000000\n", "42\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\n", "2\n10000000 10000000\n", "5\n100000000 100000001 100000000 100000001 100000000\n", "9\n4 3 4 3 4 1 3 3 1\n", "3\n10000000 1000000000 10000000\n" ]
[ "1\n", "2\n", "3\n", "5\n", "1\n", "1\n", "1\n", "2\n", "3\n", "2\n" ]
1
stdio
Dima loves representing an odd number as the sum of multiple primes, and Lisa loves it when there are at most three primes. Help them to represent the given number as the sum of at most than three primes. More formally, you are given an odd numer n. Find a set of numbers p_{i} (1 ≤ i ≤ k), such that 1 ≤ k ≤ 3 p_{i} is a prime $\sum_{i = 1}^{k} p_{i} = n$ The numbers p_{i} do not necessarily have to be distinct. It is guaranteed that at least one possible solution exists. -----Input----- The single line contains an odd number n (3 ≤ n < 10^9). -----Output----- In the first line print k (1 ≤ k ≤ 3), showing how many numbers are in the representation you found. In the second line print numbers p_{i} in any order. If there are multiple possible solutions, you can print any of them. -----Examples----- Input 27 Output 3 5 11 11 -----Note----- A prime is an integer strictly larger than one that is divisible only by one and by itself.
[ "27\n", "3\n", "25\n", "9\n", "91\n", "57\n", "31\n", "555\n", "700000001\n", "5\n" ]
[ "3\n2 2 23", "1\n3", "2\n2 23", "2\n2 7", "2\n2 89", "3\n2 2 53", "1\n31", "3\n3 5 547", "1\n700000001", "1\n5" ]
1
stdio
You are given a description of a depot. It is a rectangular checkered field of n × m size. Each cell in a field can be empty (".") or it can be occupied by a wall ("*"). You have one bomb. If you lay the bomb at the cell (x, y), then after triggering it will wipe out all walls in the row x and all walls in the column y. You are to determine if it is possible to wipe out all walls in the depot by placing and triggering exactly one bomb. The bomb can be laid both in an empty cell or in a cell occupied by a wall. -----Input----- The first line contains two positive integers n and m (1 ≤ n, m ≤ 1000) — the number of rows and columns in the depot field. The next n lines contain m symbols "." and "*" each — the description of the field. j-th symbol in i-th of them stands for cell (i, j). If the symbol is equal to ".", then the corresponding cell is empty, otherwise it equals "*" and the corresponding cell is occupied by a wall. -----Output----- If it is impossible to wipe out all walls by placing and triggering exactly one bomb, then print "NO" in the first line (without quotes). Otherwise print "YES" (without quotes) in the first line and two integers in the second line — the coordinates of the cell at which the bomb should be laid. If there are multiple answers, print any of them. -----Examples----- Input 3 4 .*.. .... .*.. Output YES 1 2 Input 3 3 ..* .*. *.. Output NO Input 6 5 ..*.. ..*.. ***** ..*.. ..*.. ..*.. Output YES 3 3
[ "3 4\n.*..\n....\n.*..\n", "3 3\n..*\n.*.\n*..\n", "6 5\n..*..\n..*..\n*****\n..*..\n..*..\n..*..\n", "1 10\n**********\n", "10 1\n*\n*\n*\n*\n*\n*\n*\n*\n*\n*\n", "10 10\n.........*\n.........*\n........**\n.........*\n.........*\n.........*\n.........*\n.........*\n.........*\n.........*\n", "10 10\n..........\n..........\n....*.....\n..........\n..........\n**..*.****\n....*.....\n....*.....\n....*.....\n..........\n", "10 10\n.........*\n.........*\n.........*\n.........*\n.........*\n.........*\n.........*\n.........*\n.........*\n.........*\n", "10 10\n..........\n..........\n....*.....\n..........\n..........\n..........\n....*.....\n....*.....\n....*.....\n..........\n", "10 10\n..........\n..........\n.**....***\n..........\n..........\n..........\n..........\n..........\n..........\n..........\n" ]
[ "YES\n1 2\n", "NO\n", "YES\n3 3\n", "YES\n1 1\n", "YES\n1 1\n", "YES\n3 10\n", "YES\n6 5\n", "YES\n1 10\n", "YES\n1 5\n", "YES\n3 2\n" ]
1
stdio
Neko loves divisors. During the latest number theory lesson, he got an interesting exercise from his math teacher. Neko has two integers $a$ and $b$. His goal is to find a non-negative integer $k$ such that the least common multiple of $a+k$ and $b+k$ is the smallest possible. If there are multiple optimal integers $k$, he needs to choose the smallest one. Given his mathematical talent, Neko had no trouble getting Wrong Answer on this problem. Can you help him solve it? -----Input----- The only line contains two integers $a$ and $b$ ($1 \le a, b \le 10^9$). -----Output----- Print the smallest non-negative integer $k$ ($k \ge 0$) such that the lowest common multiple of $a+k$ and $b+k$ is the smallest possible. If there are many possible integers $k$ giving the same value of the least common multiple, print the smallest one. -----Examples----- Input 6 10 Output 2 Input 21 31 Output 9 Input 5 10 Output 0 -----Note----- In the first test, one should choose $k = 2$, as the least common multiple of $6 + 2$ and $10 + 2$ is $24$, which is the smallest least common multiple possible.
[ "6 10\n", "21 31\n", "5 10\n", "1924 5834\n", "9911 666013\n", "1 1\n", "69 4295\n", "948248258 533435433\n", "953 1349\n", "999999973 800000007\n" ]
[ "2", "9", "0", "31", "318140", "0", "2044", "296190217", "235", "199999823" ]
1
stdio
Let's denote d(n) as the number of divisors of a positive integer n. You are given three integers a, b and c. Your task is to calculate the following sum: $\sum_{i = 1}^{a} \sum_{j = 1}^{b} \sum_{k = 1}^{c} d(i \cdot j \cdot k)$ Find the sum modulo 1073741824 (2^30). -----Input----- The first line contains three space-separated integers a, b and c (1 ≤ a, b, c ≤ 100). -----Output----- Print a single integer — the required sum modulo 1073741824 (2^30). -----Examples----- Input 2 2 2 Output 20 Input 5 6 7 Output 1520 -----Note----- For the first example. d(1·1·1) = d(1) = 1; d(1·1·2) = d(2) = 2; d(1·2·1) = d(2) = 2; d(1·2·2) = d(4) = 3; d(2·1·1) = d(2) = 2; d(2·1·2) = d(4) = 3; d(2·2·1) = d(4) = 3; d(2·2·2) = d(8) = 4. So the result is 1 + 2 + 2 + 3 + 2 + 3 + 3 + 4 = 20.
[ "2 2 2\n", "5 6 7\n", "91 42 25\n", "38 47 5\n", "82 29 45\n", "40 15 33\n", "35 5 21\n", "71 2 1\n", "22 44 41\n", "73 19 29\n" ]
[ "20\n", "1520\n", "3076687\n", "160665\n", "3504808\n", "460153\n", "55282\n", "811\n", "1063829\n", "1047494\n" ]
1
stdio
Gerald bought two very rare paintings at the Sotheby's auction and he now wants to hang them on the wall. For that he bought a special board to attach it to the wall and place the paintings on the board. The board has shape of an a_1 × b_1 rectangle, the paintings have shape of a a_2 × b_2 and a_3 × b_3 rectangles. Since the paintings are painted in the style of abstract art, it does not matter exactly how they will be rotated, but still, one side of both the board, and each of the paintings must be parallel to the floor. The paintings can touch each other and the edges of the board, but can not overlap or go beyond the edge of the board. Gerald asks whether it is possible to place the paintings on the board, or is the board he bought not large enough? -----Input----- The first line contains two space-separated numbers a_1 and b_1 — the sides of the board. Next two lines contain numbers a_2, b_2, a_3 and b_3 — the sides of the paintings. All numbers a_{i}, b_{i} in the input are integers and fit into the range from 1 to 1000. -----Output----- If the paintings can be placed on the wall, print "YES" (without the quotes), and if they cannot, print "NO" (without the quotes). -----Examples----- Input 3 2 1 3 2 1 Output YES Input 5 5 3 3 3 3 Output NO Input 4 2 2 3 1 2 Output YES -----Note----- That's how we can place the pictures in the first test: [Image] And that's how we can do it in the third one. [Image]
[ "3 2\n1 3\n2 1\n", "5 5\n3 3\n3 3\n", "4 2\n2 3\n1 2\n", "3 3\n1 1\n1 1\n", "1000 1000\n999 999\n1 1000\n", "7 7\n5 5\n2 4\n", "3 3\n2 2\n2 2\n", "2 9\n5 1\n3 2\n", "9 9\n3 8\n5 2\n", "10 10\n10 5\n4 3\n" ]
[ "YES\n", "NO\n", "YES\n", "YES\n", "YES\n", "YES\n", "NO\n", "YES\n", "YES\n", "YES\n" ]
1
stdio
Today Tavas got his test result as an integer score and he wants to share it with his girlfriend, Nafas. His phone operating system is Tavdroid, and its keyboard doesn't have any digits! He wants to share his score with Nafas via text, so he has no choice but to send this number using words. [Image] He ate coffee mix without water again, so right now he's really messed up and can't think. Your task is to help him by telling him what to type. -----Input----- The first and only line of input contains an integer s (0 ≤ s ≤ 99), Tavas's score. -----Output----- In the first and only line of output, print a single string consisting only from English lowercase letters and hyphens ('-'). Do not use spaces. -----Examples----- Input 6 Output six Input 99 Output ninety-nine Input 20 Output twenty -----Note----- You can find all you need to know about English numerals in http://en.wikipedia.org/wiki/English_numerals .
[ "6\n", "99\n", "20\n", "10\n", "15\n", "27\n", "40\n", "63\n", "0\n", "1\n" ]
[ "six\n", "ninety-nine\n", "twenty\n", "ten\n", "fifteen\n", "twenty-seven\n", "forty\n", "sixty-three\n", "zero\n", "one\n" ]
1
stdio
Top-model Izabella participates in the competition. She wants to impress judges and show her mathematical skills. Her problem is following: for given string, consisting of only 0 and 1, tell if it's possible to remove some digits in such a way, that remaining number is a representation of some positive integer, divisible by 64, in the binary numerical system. -----Input----- In the only line given a non-empty binary string s with length up to 100. -----Output----- Print «yes» (without quotes) if it's possible to remove digits required way and «no» otherwise. -----Examples----- Input 100010001 Output yes Input 100 Output no -----Note----- In the first test case, you can get string 1 000 000 after removing two ones which is a representation of number 64 in the binary numerical system. You can read more about binary numeral system representation here: https://en.wikipedia.org/wiki/Binary_system
[ "100010001\n", "100\n", "0000001000000\n", "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\n", "1111111111111111111111111111111111111111111111111111111111111111111111110111111111111111111111111111\n", "0111111101111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\n", "1111011111111111111111111111110111110111111111111111111111011111111111111110111111111111111111111111\n", "1111111111101111111111111111111111111011111111111111111111111101111011111101111111111101111111111111\n", "0110111111111111111111011111111110110111110111111111111111111111111111111111111110111111111111111111\n", "1100110001111011001101101000001110111110011110111110010100011000100101000010010111100000010001001101\n" ]
[ "yes", "no", "yes", "no", "no", "no", "no", "yes", "yes", "yes" ]
1
stdio
You are given a string s consisting of |s| small english letters. In one move you can replace any character of this string to the next character in alphabetical order (a will be replaced with b, s will be replaced with t, etc.). You cannot replace letter z with any other letter. Your target is to make some number of moves (not necessary minimal) to get string abcdefghijklmnopqrstuvwxyz (english alphabet) as a subsequence. Subsequence of the string is the string that is obtained by deleting characters at some positions. You need to print the string that will be obtained from the given string and will be contain english alphabet as a subsequence or say that it is impossible. -----Input----- The only one line of the input consisting of the string s consisting of |s| (1 ≤ |s| ≤ 10^5) small english letters. -----Output----- If you can get a string that can be obtained from the given string and will contain english alphabet as a subsequence, print it. Otherwise print «-1» (without quotes). -----Examples----- Input aacceeggiikkmmooqqssuuwwyy Output abcdefghijklmnopqrstuvwxyz Input thereisnoanswer Output -1
[ "aacceeggiikkmmooqqssuuwwyy\n", "thereisnoanswer\n", "jqcfvsaveaixhioaaeephbmsmfcgdyawscpyioybkgxlcrhaxs\n", "rtdacjpsjjmjdhcoprjhaenlwuvpfqzurnrswngmpnkdnunaendlpbfuylqgxtndhmhqgbsknsy\n", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n", "abcdefghijklmnopqrstuvwxxx\n", "abcdefghijklmnopqrstuvwxya\n", "aaaaaaaaaaaaaaaaaaaaaaaaaa\n", "cdaaaaaaaaabcdjklmnopqrstuvwxyzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\n", "zazaaaaaaaaaaaaaaaaaaaaaaaaa\n" ]
[ "abcdefghijklmnopqrstuvwxyz\n", "-1\n", "-1\n", "-1\n", "abcdefghijklmnopqrstuvwxyzaaaaaaaaaaaaaaaaaa\n", "abcdefghijklmnopqrstuvwxyz\n", "abcdefghijklmnopqrstuvwxyz\n", "abcdefghijklmnopqrstuvwxyz\n", "cdabcdefghijklmnopqrstuvwxyzxyzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\n", "zazbcdefghijklmnopqrstuvwxyz\n" ]
1
stdio
You are given two integers n and k. Find k-th smallest divisor of n, or report that it doesn't exist. Divisor of n is any such natural number, that n can be divided by it without remainder. -----Input----- The first line contains two integers n and k (1 ≤ n ≤ 10^15, 1 ≤ k ≤ 10^9). -----Output----- If n has less than k divisors, output -1. Otherwise, output the k-th smallest divisor of n. -----Examples----- Input 4 2 Output 2 Input 5 3 Output -1 Input 12 5 Output 6 -----Note----- In the first example, number 4 has three divisors: 1, 2 and 4. The second one is 2. In the second example, number 5 has only two divisors: 1 and 5. The third divisor doesn't exist, so the answer is -1.
[ "4 2\n", "5 3\n", "12 5\n", "1 1\n", "866421317361600 26880\n", "866421317361600 26881\n", "1000000000000000 1000000000\n", "1000000000000000 100\n", "1 2\n", "4 3\n" ]
[ "2\n", "-1\n", "6\n", "1\n", "866421317361600\n", "-1\n", "-1\n", "1953125\n", "-1\n", "4\n" ]
1
stdio
Absent-minded Masha got set of n cubes for her birthday. At each of 6 faces of each cube, there is exactly one digit from 0 to 9. Masha became interested what is the largest natural x such she can make using her new cubes all integers from 1 to x. To make a number Masha can rotate her cubes and put them in a row. After that, she looks at upper faces of cubes from left to right and reads the number. The number can't contain leading zeros. It's not required to use all cubes to build a number. Pay attention: Masha can't make digit 6 from digit 9 and vice-versa using cube rotations. -----Input----- In first line integer n is given (1 ≤ n ≤ 3) — the number of cubes, Masha got for her birthday. Each of next n lines contains 6 integers a_{i}_{j} (0 ≤ a_{i}_{j} ≤ 9) — number on j-th face of i-th cube. -----Output----- Print single integer — maximum number x such Masha can make any integers from 1 to x using her cubes or 0 if Masha can't make even 1. -----Examples----- Input 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 Output 87 Input 3 0 1 3 5 6 8 1 2 4 5 7 8 2 3 4 6 7 9 Output 98 -----Note----- In the first test case, Masha can build all numbers from 1 to 87, but she can't make 88 because there are no two cubes with digit 8.
[ "3\n0 1 2 3 4 5\n6 7 8 9 0 1\n2 3 4 5 6 7\n", "3\n0 1 3 5 6 8\n1 2 4 5 7 8\n2 3 4 6 7 9\n", "3\n0 1 2 3 4 5\n0 1 2 3 4 5\n0 1 2 3 4 5\n", "3\n1 2 3 7 8 9\n9 8 7 1 2 3\n7 9 2 3 1 8\n", "1\n5 2 2 5 6 7\n", "1\n7 6 5 8 9 0\n", "1\n2 5 9 6 7 9\n", "1\n6 3 1 9 4 9\n", "1\n1 9 8 3 7 8\n", "2\n1 7 2 0 4 3\n5 2 3 6 1 0\n" ]
[ "87", "98", "5", "3", "0", "0", "0", "1", "1", "7" ]
1
stdio
For a given positive integer n denote its k-rounding as the minimum positive integer x, such that x ends with k or more zeros in base 10 and is divisible by n. For example, 4-rounding of 375 is 375·80 = 30000. 30000 is the minimum integer such that it ends with 4 or more zeros and is divisible by 375. Write a program that will perform the k-rounding of n. -----Input----- The only line contains two integers n and k (1 ≤ n ≤ 10^9, 0 ≤ k ≤ 8). -----Output----- Print the k-rounding of n. -----Examples----- Input 375 4 Output 30000 Input 10000 1 Output 10000 Input 38101 0 Output 38101 Input 123456789 8 Output 12345678900000000
[ "375 4\n", "10000 1\n", "38101 0\n", "123456789 8\n", "1 0\n", "2 0\n", "100 0\n", "1000000000 0\n", "160 2\n", "3 0\n" ]
[ "30000\n", "10000\n", "38101\n", "12345678900000000\n", "1\n", "2\n", "100\n", "1000000000\n", "800\n", "3\n" ]
1
stdio
The Bad Luck Island is inhabited by three kinds of species: r rocks, s scissors and p papers. At some moments of time two random individuals meet (all pairs of individuals can meet equiprobably), and if they belong to different species, then one individual kills the other one: a rock kills scissors, scissors kill paper, and paper kills a rock. Your task is to determine for each species what is the probability that this species will be the only one to inhabit this island after a long enough period of time. -----Input----- The single line contains three integers r, s and p (1 ≤ r, s, p ≤ 100) — the original number of individuals in the species of rock, scissors and paper, respectively. -----Output----- Print three space-separated real numbers: the probabilities, at which the rocks, the scissors and the paper will be the only surviving species, respectively. The answer will be considered correct if the relative or absolute error of each number doesn't exceed 10^{ - 9}. -----Examples----- Input 2 2 2 Output 0.333333333333 0.333333333333 0.333333333333 Input 2 1 2 Output 0.150000000000 0.300000000000 0.550000000000 Input 1 1 3 Output 0.057142857143 0.657142857143 0.285714285714
[ "2 2 2\n", "2 1 2\n", "1 1 3\n", "3 2 1\n", "100 100 100\n", "1 100 100\n", "100 1 100\n", "100 100 1\n", "1 100 99\n", "99 1 100\n" ]
[ "0.333333333333 0.333333333333 0.333333333333\n", "0.150000000000 0.300000000000 0.550000000000\n", "0.057142857143 0.657142857143 0.285714285714\n", "0.487662337662 0.072077922078 0.440259740260\n", "0.333333333333 0.333333333333 0.333333333333\n", "0.366003713151 0.633996286849 0.000000000000\n", "0.000000000000 0.366003713151 0.633996286849\n", "0.633996286849 0.000000000000 0.366003713151\n", "0.369700913626 0.630299086374 0.000000000000\n", "0.000000000000 0.369700913626 0.630299086374\n" ]
1
stdio
Today an outstanding event is going to happen in the forest — hedgehog Filya will come to his old fried Sonya! Sonya is an owl and she sleeps during the day and stay awake from minute l_1 to minute r_1 inclusive. Also, during the minute k she prinks and is unavailable for Filya. Filya works a lot and he plans to visit Sonya from minute l_2 to minute r_2 inclusive. Calculate the number of minutes they will be able to spend together. -----Input----- The only line of the input contains integers l_1, r_1, l_2, r_2 and k (1 ≤ l_1, r_1, l_2, r_2, k ≤ 10^18, l_1 ≤ r_1, l_2 ≤ r_2), providing the segments of time for Sonya and Filya and the moment of time when Sonya prinks. -----Output----- Print one integer — the number of minutes Sonya and Filya will be able to spend together. -----Examples----- Input 1 10 9 20 1 Output 2 Input 1 100 50 200 75 Output 50 -----Note----- In the first sample, they will be together during minutes 9 and 10. In the second sample, they will be together from minute 50 to minute 74 and from minute 76 to minute 100.
[ "1 10 9 20 1\n", "1 100 50 200 75\n", "6 6 5 8 9\n", "1 1000000000 1 1000000000 1\n", "5 100 8 8 8\n", "1 1000000000000000000 2 99999999999999999 1000000000\n", "1 1 1 1 1\n", "1 2 3 4 5\n", "1 1000000000 2 999999999 3141592\n", "24648817341102 41165114064236 88046848035 13602161452932 10000831349205\n" ]
[ "2\n", "50\n", "1\n", "999999999\n", "0\n", "99999999999999997\n", "0\n", "0\n", "999999997\n", "0\n" ]
1
stdio
Vasya has an array a consisting of positive integer numbers. Vasya wants to divide this array into two non-empty consecutive parts (the prefix and the suffix) so that the sum of all elements in the first part equals to the sum of elements in the second part. It is not always possible, so Vasya will move some element before dividing the array (Vasya will erase some element and insert it into an arbitrary position). Inserting an element in the same position he was erased from is also considered moving. Can Vasya divide the array after choosing the right element to move and its new position? -----Input----- The first line contains single integer n (1 ≤ n ≤ 100000) — the size of the array. The second line contains n integers a_1, a_2... a_{n} (1 ≤ a_{i} ≤ 10^9) — the elements of the array. -----Output----- Print YES if Vasya can divide the array after moving one element. Otherwise print NO. -----Examples----- Input 3 1 3 2 Output YES Input 5 1 2 3 4 5 Output NO Input 5 2 2 3 4 5 Output YES -----Note----- In the first example Vasya can move the second element to the end of the array. In the second example no move can make the division possible. In the third example Vasya can move the fourth element by one position to the left.
[ "3\n1 3 2\n", "5\n1 2 3 4 5\n", "5\n2 2 3 4 5\n", "5\n72 32 17 46 82\n", "6\n26 10 70 11 69 57\n", "7\n4 7 10 7 5 5 1\n", "8\n9 5 5 10 4 9 5 8\n", "10\n9 6 8 5 5 2 8 9 2 2\n", "15\n4 8 10 3 1 4 5 9 3 2 1 7 7 3 8\n", "20\n71 83 54 6 10 64 91 98 94 49 65 68 14 39 91 60 74 100 17 13\n" ]
[ "YES\n", "NO\n", "YES\n", "NO\n", "NO\n", "NO\n", "NO\n", "YES\n", "NO\n", "NO\n" ]
1
stdio
While swimming at the beach, Mike has accidentally dropped his cellphone into the water. There was no worry as he bought a cheap replacement phone with an old-fashioned keyboard. The keyboard has only ten digital equal-sized keys, located in the following way: [Image] Together with his old phone, he lost all his contacts and now he can only remember the way his fingers moved when he put some number in. One can formally consider finger movements as a sequence of vectors connecting centers of keys pressed consecutively to put in a number. For example, the finger movements for number "586" are the same as finger movements for number "253": [Image] [Image] Mike has already put in a number by his "finger memory" and started calling it, so he is now worrying, can he be sure that he is calling the correct number? In other words, is there any other number, that has the same finger movements? -----Input----- The first line of the input contains the only integer n (1 ≤ n ≤ 9) — the number of digits in the phone number that Mike put in. The second line contains the string consisting of n digits (characters from '0' to '9') representing the number that Mike put in. -----Output----- If there is no other phone number with the same finger movements and Mike can be sure he is calling the correct number, print "YES" (without quotes) in the only line. Otherwise print "NO" (without quotes) in the first line. -----Examples----- Input 3 586 Output NO Input 2 09 Output NO Input 9 123456789 Output YES Input 3 911 Output YES -----Note----- You can find the picture clarifying the first sample case in the statement above.
[ "3\n586\n", "2\n09\n", "9\n123456789\n", "3\n911\n", "3\n089\n", "3\n159\n", "9\n000000000\n", "4\n0874\n", "6\n235689\n", "2\n10\n" ]
[ "NO\n", "NO\n", "YES\n", "YES\n", "NO\n", "YES\n", "NO\n", "NO\n", "NO\n", "YES\n" ]
1
stdio
Ivan is collecting coins. There are only $N$ different collectible coins, Ivan has $K$ of them. He will be celebrating his birthday soon, so all his $M$ freinds decided to gift him coins. They all agreed to three terms: Everyone must gift as many coins as others. All coins given to Ivan must be different. Not less than $L$ coins from gifts altogether, must be new in Ivan's collection. But his friends don't know which coins have Ivan already got in his collection. They don't want to spend money so they want to buy minimum quantity of coins, that satisfy all terms, irrespective of the Ivan's collection. Help them to find this minimum number of coins or define it's not possible to meet all the terms. -----Input----- The only line of input contains 4 integers $N$, $M$, $K$, $L$ ($1 \le K \le N \le 10^{18}$; $1 \le M, \,\, L \le 10^{18}$) — quantity of different coins, number of Ivan's friends, size of Ivan's collection and quantity of coins, that must be new in Ivan's collection. -----Output----- Print one number — minimal number of coins one friend can gift to satisfy all the conditions. If it is impossible to satisfy all three conditions print "-1" (without quotes). -----Examples----- Input 20 15 2 3 Output 1 Input 10 11 2 4 Output -1 -----Note----- In the first test, one coin from each friend is enough, as he will be presented with 15 different coins and 13 of them will definitely be new. In the second test, Ivan has 11 friends, but there are only 10 different coins. So all friends can't present him different coins.
[ "20 15 2 3\n", "10 11 2 4\n", "2 1 1 1\n", "10 2 9 7\n", "530897800469409942 582203276934671957 137373076313041391 377446491430894140\n", "1000000000000000000 1 1 1000000000000000000\n", "48295947839584738 12 49503958 47108947578469711\n", "100 20 98 2\n", "1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000\n", "100 100 1 1\n" ]
[ "1", "-1", "2", "-1", "-1", "-1", "3925745635664473", "5", "-1", "1" ]
1
stdio
Katya studies in a fifth grade. Recently her class studied right triangles and the Pythagorean theorem. It appeared, that there are triples of positive integers such that you can construct a right triangle with segments of lengths corresponding to triple. Such triples are called Pythagorean triples. For example, triples (3, 4, 5), (5, 12, 13) and (6, 8, 10) are Pythagorean triples. Here Katya wondered if she can specify the length of some side of right triangle and find any Pythagorean triple corresponding to such length? Note that the side which length is specified can be a cathetus as well as hypotenuse. Katya had no problems with completing this task. Will you do the same? -----Input----- The only line of the input contains single integer n (1 ≤ n ≤ 10^9) — the length of some side of a right triangle. -----Output----- Print two integers m and k (1 ≤ m, k ≤ 10^18), such that n, m and k form a Pythagorean triple, in the only line. In case if there is no any Pythagorean triple containing integer n, print - 1 in the only line. If there are many answers, print any of them. -----Examples----- Input 3 Output 4 5 Input 6 Output 8 10 Input 1 Output -1 Input 17 Output 144 145 Input 67 Output 2244 2245 -----Note-----[Image] Illustration for the first sample.
[ "3\n", "6\n", "1\n", "17\n", "67\n", "10\n", "14\n", "22\n", "23\n", "246\n" ]
[ "4 5", "8 10", "-1", "144 145", "2244 2245", "24 26", "48 50", "120 122", "264 265", "15128 15130" ]
1
stdio
Imp is watching a documentary about cave painting. [Image] Some numbers, carved in chaotic order, immediately attracted his attention. Imp rapidly proposed a guess that they are the remainders of division of a number n by all integers i from 1 to k. Unfortunately, there are too many integers to analyze for Imp. Imp wants you to check whether all these remainders are distinct. Formally, he wants to check, if all $n \text{mod} i$, 1 ≤ i ≤ k, are distinct, i. e. there is no such pair (i, j) that: 1 ≤ i < j ≤ k, $n \operatorname{mod} i = n \operatorname{mod} j$, where $x \operatorname{mod} y$ is the remainder of division x by y. -----Input----- The only line contains two integers n, k (1 ≤ n, k ≤ 10^18). -----Output----- Print "Yes", if all the remainders are distinct, and "No" otherwise. You can print each letter in arbitrary case (lower or upper). -----Examples----- Input 4 4 Output No Input 5 3 Output Yes -----Note----- In the first sample remainders modulo 1 and 4 coincide.
[ "4 4\n", "5 3\n", "1 1\n", "744 18\n", "47879 10\n", "1000000000000000000 1000000000000000000\n", "657180569218773599 42\n", "442762254977842799 30\n", "474158606260730555 1\n", "807873101233533988 39\n" ]
[ "No\n", "Yes\n", "Yes\n", "No\n", "Yes\n", "No\n", "Yes\n", "Yes\n", "Yes\n", "No\n" ]
1
stdio
You have a set of items, each having some integer weight not greater than $8$. You denote that a subset of items is good if total weight of items in the subset does not exceed $W$. You want to calculate the maximum possible weight of a good subset of items. Note that you have to consider the empty set and the original set when calculating the answer. -----Input----- The first line contains one integer $W$ ($0 \le W \le 10^{18}$) — the maximum total weight of a good subset. The second line denotes the set of items you have. It contains $8$ integers $cnt_1$, $cnt_2$, ..., $cnt_8$ ($0 \le cnt_i \le 10^{16}$), where $cnt_i$ is the number of items having weight $i$ in the set. -----Output----- Print one integer — the maximum possible weight of a good subset of items. -----Examples----- Input 10 1 2 3 4 5 6 7 8 Output 10 Input 0 0 0 0 0 0 0 0 0 Output 0 Input 3 0 4 1 0 0 9 8 3 Output 3
[ "10\n1 2 3 4 5 6 7 8\n", "0\n0 0 0 0 0 0 0 0\n", "3\n0 4 1 0 0 9 8 3\n", "27\n0 0 0 0 0 5 0 0\n", "178\n731 0 0 0 0 0 0 0\n", "9890292762705840\n0 0 0 0 7807819738278974 0 0 0\n", "11994176272990019\n0 6395394930893349 0 0 0 0 0 0\n", "7517891175237043\n0 0 0 0 0 0 0 1985236500005094\n", "0\n0 10 0 0 0 0 0 0\n", "16\n10 0 0 0 0 0 0 0\n" ]
[ "10\n", "0\n", "3\n", "24\n", "178\n", "9890292762705840\n", "11994176272990018\n", "7517891175237040\n", "0\n", "10\n" ]
1
stdio
Recently Vasya found a golden ticket — a sequence which consists of $n$ digits $a_1a_2\dots a_n$. Vasya considers a ticket to be lucky if it can be divided into two or more non-intersecting segments with equal sums. For example, ticket $350178$ is lucky since it can be divided into three segments $350$, $17$ and $8$: $3+5+0=1+7=8$. Note that each digit of sequence should belong to exactly one segment. Help Vasya! Tell him if the golden ticket he found is lucky or not. -----Input----- The first line contains one integer $n$ ($2 \le n \le 100$) — the number of digits in the ticket. The second line contains $n$ digits $a_1 a_2 \dots a_n$ ($0 \le a_i \le 9$) — the golden ticket. Digits are printed without spaces. -----Output----- If the golden ticket is lucky then print "YES", otherwise print "NO" (both case insensitive). -----Examples----- Input 5 73452 Output YES Input 4 1248 Output NO -----Note----- In the first example the ticket can be divided into $7$, $34$ and $52$: $7=3+4=5+2$. In the second example it is impossible to divide ticket into segments with equal sum.
[ "5\n73452\n", "4\n1248\n", "2\n00\n", "3\n555\n", "8\n00020200\n", "4\n7435\n", "99\n999999999999999999999999999999999999999999999918888888888888888888888888888888888888888888888888887\n", "5\n11980\n", "4\n2680\n", "15\n333703919182090\n" ]
[ "YES\n", "NO\n", "YES\n", "YES\n", "YES\n", "NO\n", "YES\n", "NO\n", "YES\n", "YES\n" ]
1
stdio
Those days, many boys use beautiful girls' photos as avatars in forums. So it is pretty hard to tell the gender of a user at the first glance. Last year, our hero went to a forum and had a nice chat with a beauty (he thought so). After that they talked very often and eventually they became a couple in the network. But yesterday, he came to see "her" in the real world and found out "she" is actually a very strong man! Our hero is very sad and he is too tired to love again now. So he came up with a way to recognize users' genders by their user names. This is his method: if the number of distinct characters in one's user name is odd, then he is a male, otherwise she is a female. You are given the string that denotes the user name, please help our hero to determine the gender of this user by his method. -----Input----- The first line contains a non-empty string, that contains only lowercase English letters — the user name. This string contains at most 100 letters. -----Output----- If it is a female by our hero's method, print "CHAT WITH HER!" (without the quotes), otherwise, print "IGNORE HIM!" (without the quotes). -----Examples----- Input wjmzbmr Output CHAT WITH HER! Input xiaodao Output IGNORE HIM! Input sevenkplus Output CHAT WITH HER! -----Note----- For the first example. There are 6 distinct characters in "wjmzbmr". These characters are: "w", "j", "m", "z", "b", "r". So wjmzbmr is a female and you should print "CHAT WITH HER!".
[ "wjmzbmr\n", "xiaodao\n", "sevenkplus\n", "pezu\n", "wnemlgppy\n", "zcinitufxoldnokacdvtmdohsfdjepyfioyvclhmujiqwvmudbfjzxjfqqxjmoiyxrfsbvseawwoyynn\n", "qsxxuoynwtebujwpxwpajitiwxaxwgbcylxneqiebzfphugwkftpaikixmumkhfbjiswmvzbtiyifbx\n", "qwbdfzfylckctudyjlyrtmvbidfatdoqfmrfshsqqmhzohhsczscvwzpwyoyswhktjlykumhvaounpzwpxcspxwlgt\n", "nuezoadauueermoeaabjrkxttkatspjsjegjcjcdmcxgodowzbwuqncfbeqlhkk\n", "lggvdmulrsvtuagoavstuyufhypdxfomjlzpnduulukszqnnwfvxbvxyzmleocmofwclmzz\n" ]
[ "CHAT WITH HER!\n", "IGNORE HIM!\n", "CHAT WITH HER!\n", "CHAT WITH HER!\n", "CHAT WITH HER!\n", "IGNORE HIM!\n", "CHAT WITH HER!\n", "IGNORE HIM!\n", "IGNORE HIM!\n", "IGNORE HIM!\n" ]
1
stdio
Today, Osama gave Fadi an integer $X$, and Fadi was wondering about the minimum possible value of $max(a, b)$ such that $LCM(a, b)$ equals $X$. Both $a$ and $b$ should be positive integers. $LCM(a, b)$ is the smallest positive integer that is divisible by both $a$ and $b$. For example, $LCM(6, 8) = 24$, $LCM(4, 12) = 12$, $LCM(2, 3) = 6$. Of course, Fadi immediately knew the answer. Can you be just like Fadi and find any such pair? -----Input----- The first and only line contains an integer $X$ ($1 \le X \le 10^{12}$). -----Output----- Print two positive integers, $a$ and $b$, such that the value of $max(a, b)$ is minimum possible and $LCM(a, b)$ equals $X$. If there are several possible such pairs, you can print any. -----Examples----- Input 2 Output 1 2 Input 6 Output 2 3 Input 4 Output 1 4 Input 1 Output 1 1
[ "2\n", "6\n", "4\n", "1\n", "24\n", "200560490130\n", "999999999989\n", "1000000000000\n", "999966000289\n", "991921850317\n" ]
[ "1 2\n", "2 3\n", "1 4\n", "1 1\n", "8 3\n", "448630 447051\n", "1 999999999989\n", "4096 244140625\n", "1 999966000289\n", "1 991921850317\n" ]
1
stdio
Berland annual chess tournament is coming! Organizers have gathered 2·n chess players who should be divided into two teams with n people each. The first team is sponsored by BerOil and the second team is sponsored by BerMobile. Obviously, organizers should guarantee the win for the team of BerOil. Thus, organizers should divide all 2·n players into two teams with n people each in such a way that the first team always wins. Every chess player has its rating r_{i}. It is known that chess player with the greater rating always wins the player with the lower rating. If their ratings are equal then any of the players can win. After teams assignment there will come a drawing to form n pairs of opponents: in each pair there is a player from the first team and a player from the second team. Every chess player should be in exactly one pair. Every pair plays once. The drawing is totally random. Is it possible to divide all 2·n players into two teams with n people each so that the player from the first team in every pair wins regardless of the results of the drawing? -----Input----- The first line contains one integer n (1 ≤ n ≤ 100). The second line contains 2·n integers a_1, a_2, ... a_2n (1 ≤ a_{i} ≤ 1000). -----Output----- If it's possible to divide all 2·n players into two teams with n people each so that the player from the first team in every pair wins regardless of the results of the drawing, then print "YES". Otherwise print "NO". -----Examples----- Input 2 1 3 2 4 Output YES Input 1 3 3 Output NO
[ "2\n1 3 2 4\n", "1\n3 3\n", "5\n1 1 1 1 2 2 3 3 3 3\n", "5\n1 1 1 1 1 2 2 2 2 2\n", "10\n1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000\n", "1\n2 3\n", "100\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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "35\n919 240 231 858 456 891 959 965 758 30 431 73 505 694 874 543 975 445 16 147 904 690 940 278 562 127 724 314 30 233 389 442 353 652 581 383 340 445 487 283 85 845 578 946 228 557 906 572 919 388 686 181 958 955 736 438 991 170 632 593 475 264 178 344 159 414 739 590 348 884\n", "5\n1 2 3 4 10 10 6 7 8 9\n", "2\n1 1 1 2\n" ]
[ "YES\n", "NO\n", "NO\n", "YES\n", "NO\n", "YES\n", "NO\n", "YES\n", "YES\n", "NO\n" ]
1
stdio
You are given an array of n elements, you must make it a co-prime array in as few moves as possible. In each move you can insert any positive integral number you want not greater than 10^9 in any place in the array. An array is co-prime if any two adjacent numbers of it are co-prime. In the number theory, two integers a and b are said to be co-prime if the only positive integer that divides both of them is 1. -----Input----- The first line contains integer n (1 ≤ n ≤ 1000) — the number of elements in the given array. The second line contains n integers a_{i} (1 ≤ a_{i} ≤ 10^9) — the elements of the array a. -----Output----- Print integer k on the first line — the least number of elements needed to add to the array a to make it co-prime. The second line should contain n + k integers a_{j} — the elements of the array a after adding k elements to it. Note that the new array should be co-prime, so any two adjacent values should be co-prime. Also the new array should be got from the original array a by adding k elements to it. If there are multiple answers you can print any one of them. -----Example----- Input 3 2 7 28 Output 1 2 7 9 28
[ "3\n2 7 28\n", "1\n1\n", "1\n548\n", "1\n963837006\n", "10\n1 1 1 1 1 1 1 1 1 1\n", "10\n26 723 970 13 422 968 875 329 234 983\n", "10\n319645572 758298525 812547177 459359946 355467212 304450522 807957797 916787906 239781206 242840396\n", "100\n1 1 1 1 2 1 1 1 1 1 2 2 1 1 2 1 2 1 1 1 2 1 1 2 1 2 1 1 2 2 2 1 1 2 1 1 1 2 2 2 1 1 1 2 1 2 2 1 2 1 1 2 2 1 2 1 2 1 2 2 1 1 1 2 1 1 2 1 2 1 2 2 2 1 2 1 2 2 2 1 2 2 1 1 1 1 2 2 2 2 2 2 2 1 1 1 2 1 2 1\n", "100\n591 417 888 251 792 847 685 3 182 461 102 348 555 956 771 901 712 878 580 631 342 333 285 899 525 725 537 718 929 653 84 788 104 355 624 803 253 853 201 995 536 184 65 205 540 652 549 777 248 405 677 950 431 580 600 846 328 429 134 983 526 103 500 963 400 23 276 704 570 757 410 658 507 620 984 244 486 454 802 411 985 303 635 283 96 597 855 775 139 839 839 61 219 986 776 72 729 69 20 917\n", "5\n472882027 472882027 472882027 472882027 472882027\n" ]
[ "1\n2 7 1 28\n", "0\n1\n", "0\n548\n", "0\n963837006\n", "0\n1 1 1 1 1 1 1 1 1 1\n", "2\n26 723 970 13 422 1 968 875 1 329 234 983\n", "7\n319645572 1 758298525 1 812547177 1 459359946 1 355467212 1 304450522 807957797 916787906 1 239781206 1 242840396\n", "19\n1 1 1 1 2 1 1 1 1 1 2 1 2 1 1 2 1 2 1 1 1 2 1 1 2 1 2 1 1 2 1 2 1 2 1 1 2 1 1 1 2 1 2 1 2 1 1 1 2 1 2 1 2 1 2 1 1 2 1 2 1 2 1 2 1 2 1 2 1 1 1 2 1 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 1 1 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 1 1 2 1 2 1\n", "38\n591 1 417 1 888 251 792 1 847 685 3 182 461 102 1 348 1 555 956 771 901 712 1 878 1 580 631 342 1 333 1 285 899 525 1 725 537 718 929 653 84 1 788 1 104 355 624 803 1 253 853 201 995 536 1 184 65 1 205 1 540 1 652 549 1 777 248 405 677 950 431 580 1 600 1 846 1 328 429 134 983 526 103 500 963 400 23 1 276 1 704 1 570 757 410 1 658 507 620 1 984 1 244 1 486 1 454 1 802 411 985 303 635 283 96 1 597 1 855 1 775 139 839 1 839 61 219 986 1 776 1 72 1 729 1 69 20 917\n", "4\n472882027 1 472882027 1 472882027 1 472882027 1 472882027\n" ]
1
stdio
We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): - Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible positive integer that divides every element of A after the operations. Here a positive integer x divides an integer y if and only if there exists an integer z such that y = xz. -----Constraints----- - 2 \leq N \leq 500 - 1 \leq A_i \leq 10^6 - 0 \leq K \leq 10^9 - All values in input are integers. -----Input----- Input is given from Standard Input in the following format: N K A_1 A_2 \cdots A_{N-1} A_{N} -----Output----- Print the maximum possible positive integer that divides every element of A after the operations. -----Sample Input----- 2 3 8 20 -----Sample Output----- 7 7 will divide every element of A if, for example, we perform the following operation: - Choose i = 2, j = 1. A becomes (7, 21). We cannot reach the situation where 8 or greater integer divides every element of A.
[ "2 3\n8 20\n", "2 10\n3 5\n", "4 5\n10 1 2 22\n", "8 7\n1 7 5 6 8 2 6 5\n", "2 1\n1 1\n", "500 1000000000\n1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000\n", "2 834276\n829289 870458\n", "2 1\n123817 819725\n", "2 411810\n561589 20609\n", "2 2\n593967 290959\n" ]
[ "7\n", "8\n", "7\n", "5\n", "2\n", "500000000\n", "1699747\n", "6\n", "582198\n", "2\n" ]
1
stdio
You are given two strings a and b. You have to remove the minimum possible number of consecutive (standing one after another) characters from string b in such a way that it becomes a subsequence of string a. It can happen that you will not need to remove any characters at all, or maybe you will have to remove all of the characters from b and make it empty. Subsequence of string s is any such string that can be obtained by erasing zero or more characters (not necessarily consecutive) from string s. -----Input----- The first line contains string a, and the second line — string b. Both of these strings are nonempty and consist of lowercase letters of English alphabet. The length of each string is no bigger than 10^5 characters. -----Output----- On the first line output a subsequence of string a, obtained from b by erasing the minimum number of consecutive characters. If the answer consists of zero characters, output «-» (a minus sign). -----Examples----- Input hi bob Output - Input abca accepted Output ac Input abacaba abcdcba Output abcba -----Note----- In the first example strings a and b don't share any symbols, so the longest string that you can get is empty. In the second example ac is a subsequence of a, and at the same time you can obtain it by erasing consecutive symbols cepted from string b.
[ "hi\nbob\n", "abca\naccepted\n", "abacaba\nabcdcba\n", "lo\neuhaqdhhzlnkmqnakgwzuhurqlpmdm\n", "aaeojkdyuilpdvyewjfrftkpcobhcumwlaoiocbfdtvjkhgda\nmlmarpivirqbxcyhyerjoxlslyfzftrylpjyouypvk\n", "npnkmawey\nareakefvowledfriyjejqnnaeqheoh\n", "fdtffutxkujflswyddvhusfcook\nkavkhnhphcvckogqqqqhdmgwjdfenzizrebefsbuhzzwhzvc\n", "abacaba\naa\n", "edbcd\nd\n", "abc\nksdksdsdsnabc\n" ]
[ "-\n", "ac\n", "abcba\n", "-\n", "ouypvk\n", "a\n", "kvc\n", "aa\n", "d\n", "abc\n" ]
1
stdio
You have probably registered on Internet sites many times. And each time you should enter your invented password. Usually the registration form automatically checks the password's crypt resistance. If the user's password isn't complex enough, a message is displayed. Today your task is to implement such an automatic check. Web-developers of the company Q assume that a password is complex enough, if it meets all of the following conditions: the password length is at least 5 characters; the password contains at least one large English letter; the password contains at least one small English letter; the password contains at least one digit. You are given a password. Please implement the automatic check of its complexity for company Q. -----Input----- The first line contains a non-empty sequence of characters (at most 100 characters). Each character is either a large English letter, or a small English letter, or a digit, or one of characters: "!", "?", ".", ",", "_". -----Output----- If the password is complex enough, print message "Correct" (without the quotes), otherwise print message "Too weak" (without the quotes). -----Examples----- Input abacaba Output Too weak Input X12345 Output Too weak Input CONTEST_is_STARTED!!11 Output Correct
[ "abacaba\n", "X12345\n", "CONTEST_is_STARTED!!11\n", "1zA__\n", "1zA_\n", "zA___\n", "1A___\n", "z1___\n", "0\n", "_\n" ]
[ "Too weak\n", "Too weak\n", "Correct\n", "Correct\n", "Too weak\n", "Too weak\n", "Too weak\n", "Too weak\n", "Too weak\n", "Too weak\n" ]
1
stdio
You have two variables a and b. Consider the following sequence of actions performed with these variables: If a = 0 or b = 0, end the process. Otherwise, go to step 2; If a ≥ 2·b, then set the value of a to a - 2·b, and repeat step 1. Otherwise, go to step 3; If b ≥ 2·a, then set the value of b to b - 2·a, and repeat step 1. Otherwise, end the process. Initially the values of a and b are positive integers, and so the process will be finite. You have to determine the values of a and b after the process ends. -----Input----- The only line of the input contains two integers n and m (1 ≤ n, m ≤ 10^18). n is the initial value of variable a, and m is the initial value of variable b. -----Output----- Print two integers — the values of a and b after the end of the process. -----Examples----- Input 12 5 Output 0 1 Input 31 12 Output 7 12 -----Note----- Explanations to the samples: a = 12, b = 5 $\rightarrow$ a = 2, b = 5 $\rightarrow$ a = 2, b = 1 $\rightarrow$ a = 0, b = 1; a = 31, b = 12 $\rightarrow$ a = 7, b = 12.
[ "12 5\n", "31 12\n", "1000000000000000000 7\n", "31960284556200 8515664064180\n", "1000000000000000000 1000000000000000000\n", "1 1000\n", "1 1000000\n", "1 1000000000000000\n", "1 99999999999999999\n", "1 4\n" ]
[ "0 1\n", "7 12\n", "8 7\n", "14928956427840 8515664064180\n", "1000000000000000000 1000000000000000000\n", "1 0\n", "1 0\n", "1 0\n", "1 1\n", "1 0\n" ]
1
stdio
Find the number of k-divisible numbers on the segment [a, b]. In other words you need to find the number of such integer values x that a ≤ x ≤ b and x is divisible by k. -----Input----- The only line contains three space-separated integers k, a and b (1 ≤ k ≤ 10^18; - 10^18 ≤ a ≤ b ≤ 10^18). -----Output----- Print the required number. -----Examples----- Input 1 1 10 Output 10 Input 2 -4 4 Output 5
[ "1 1 10\n", "2 -4 4\n", "1 1 1\n", "1 0 0\n", "1 0 1\n", "1 10181 10182\n", "1 10182 10183\n", "1 -191 1011\n", "2 0 0\n", "2 0 1\n" ]
[ "10\n", "5\n", "1\n", "1\n", "2\n", "2\n", "2\n", "1203\n", "1\n", "1\n" ]
1
stdio
Let's write all the positive integer numbers one after another from $1$ without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718192021222324252627282930313233343536... Your task is to print the $k$-th digit of this sequence. -----Input----- The first and only line contains integer $k$ ($1 \le k \le 10000$) — the position to process ($1$-based index). -----Output----- Print the $k$-th digit of the resulting infinite sequence. -----Examples----- Input 7 Output 7 Input 21 Output 5
[ "7\n", "21\n", "1\n", "2\n", "3\n", "4\n", "5\n", "6\n", "8\n", "9\n" ]
[ "7\n", "5\n", "1\n", "2\n", "3\n", "4\n", "5\n", "6\n", "8\n", "9\n" ]
1
stdio
Carl is a beginner magician. He has a blue, b violet and c orange magic spheres. In one move he can transform two spheres of the same color into one sphere of any other color. To make a spell that has never been seen before, he needs at least x blue, y violet and z orange spheres. Can he get them (possible, in multiple actions)? -----Input----- The first line of the input contains three integers a, b and c (0 ≤ a, b, c ≤ 1 000 000) — the number of blue, violet and orange spheres that are in the magician's disposal. The second line of the input contains three integers, x, y and z (0 ≤ x, y, z ≤ 1 000 000) — the number of blue, violet and orange spheres that he needs to get. -----Output----- If the wizard is able to obtain the required numbers of spheres, print "Yes". Otherwise, print "No". -----Examples----- Input 4 4 0 2 1 2 Output Yes Input 5 6 1 2 7 2 Output No Input 3 3 3 2 2 2 Output Yes -----Note----- In the first sample the wizard has 4 blue and 4 violet spheres. In his first action he can turn two blue spheres into one violet one. After that he will have 2 blue and 5 violet spheres. Then he turns 4 violet spheres into 2 orange spheres and he ends up with 2 blue, 1 violet and 2 orange spheres, which is exactly what he needs.
[ "4 4 0\n2 1 2\n", "5 6 1\n2 7 2\n", "3 3 3\n2 2 2\n", "0 0 0\n0 0 0\n", "0 0 0\n0 0 1\n", "0 1 0\n0 0 0\n", "1 0 0\n1 0 0\n", "2 2 1\n1 1 2\n", "1 3 1\n2 1 1\n", "1000000 1000000 1000000\n1000000 1000000 1000000\n" ]
[ "Yes\n", "No\n", "Yes\n", "Yes\n", "No\n", "Yes\n", "Yes\n", "No\n", "Yes\n", "Yes\n" ]
1
stdio
Amr doesn't like Maths as he finds it really boring, so he usually sleeps in Maths lectures. But one day the teacher suspected that Amr is sleeping and asked him a question to make sure he wasn't. First he gave Amr two positive integers n and k. Then he asked Amr, how many integer numbers x > 0 exist such that: Decimal representation of x (without leading zeroes) consists of exactly n digits; There exists some integer y > 0 such that: $y \operatorname{mod} k = 0$; decimal representation of y is a suffix of decimal representation of x. As the answer to this question may be pretty huge the teacher asked Amr to output only its remainder modulo a number m. Can you help Amr escape this embarrassing situation? -----Input----- Input consists of three integers n, k, m (1 ≤ n ≤ 1000, 1 ≤ k ≤ 100, 1 ≤ m ≤ 10^9). -----Output----- Print the required number modulo m. -----Examples----- Input 1 2 1000 Output 4 Input 2 2 1000 Output 45 Input 5 3 1103 Output 590 -----Note----- A suffix of a string S is a non-empty string that can be obtained by removing some number (possibly, zero) of first characters from S.
[ "1 2 1000\n", "2 2 1000\n", "5 3 1103\n", "2 17 10000\n", "3 9 10000\n", "6 64 941761822\n", "183 3 46847167\n", "472 44 364550669\n", "510 76 811693420\n", "783 30 602209107\n" ]
[ "4", "45", "590", "5", "252", "46530", "29891566", "122479316", "546301720", "279682329" ]
1
stdio
Students in a class are making towers of blocks. Each student makes a (non-zero) tower by stacking pieces lengthwise on top of each other. n of the students use pieces made of two blocks and m of the students use pieces made of three blocks. The students don’t want to use too many blocks, but they also want to be unique, so no two students’ towers may contain the same number of blocks. Find the minimum height necessary for the tallest of the students' towers. -----Input----- The first line of the input contains two space-separated integers n and m (0 ≤ n, m ≤ 1 000 000, n + m > 0) — the number of students using two-block pieces and the number of students using three-block pieces, respectively. -----Output----- Print a single integer, denoting the minimum possible height of the tallest tower. -----Examples----- Input 1 3 Output 9 Input 3 2 Output 8 Input 5 0 Output 10 -----Note----- In the first case, the student using two-block pieces can make a tower of height 4, and the students using three-block pieces can make towers of height 3, 6, and 9 blocks. The tallest tower has a height of 9 blocks. In the second case, the students can make towers of heights 2, 4, and 8 with two-block pieces and towers of heights 3 and 6 with three-block pieces, for a maximum height of 8 blocks.
[ "1 3\n", "3 2\n", "5 0\n", "4 2\n", "0 1000000\n", "1000000 1\n", "1083 724\n", "1184 868\n", "1285 877\n", "820189 548173\n" ]
[ "9\n", "8\n", "10\n", "9\n", "3000000\n", "2000000\n", "2710\n", "3078\n", "3243\n", "2052543\n" ]
1
stdio