{"raw_statement":[{"iden":"statement","content":"Roze has a special keyboard which consists only of 29 keys: \n\n-26 alphabetic a-z keys, which prints the 26 lowercase Latin letters.\n\n-\"Space\" key, which prints a single space.\n\n-\"CapsLock\" key, which converts the status of the letters keys from lowercase to uppercase and vice versa. The status initially is lowercase.\n\n-\"Backspace\" key, which deletes the last letter/space that was written on the screen.\n\nIf Roze presses \"Backspace\" and there is nothing to delete on the screen, nothing will happen.\n\nGiven the text that Roze had to print and the order of the keys she has pressed on the keyboard, check if Roze has printed the text correctly (including exactly one space between every two words).\n\nThe first line contains an integer $n$ ($1 < n < 2000$), which is the number of the words in the text Roze has to print.\n\nThen n strings represent the text Roze has to print separated by exactly one space.\n\nEach string consists only of uppercase and lowercase Latin letters, and the total length of all strings less than 2000\n\nThe following line contains an integer $m$ ($1 < m < 2000$), which is the number of the keys Roze has pressed.\n\nThen m lines, each line contains a string that represents the key was pressed.\n\nIt's guaranteed that the last key pressed is a letter and the first key is not a space key.\n\nPrint a single line containing the result of checking.\n\nIf Roze has printed the text correctly, print \"Correct\". Otherwise, print \"Incorrect\".\n\n"},{"iden":"input","content":"The first line contains an integer $n$ ($1 < n < 2000$), which is the number of the words in the text Roze has to print.Then n strings represent the text Roze has to print separated by exactly one space.Each string consists only of uppercase and lowercase Latin letters, and the total length of all strings less than 2000The following line contains an integer $m$ ($1 < m < 2000$), which is the number of the keys Roze has pressed.Then m lines, each line contains a string that represents the key was pressed.It's guaranteed that the last key pressed is a letter and the first key is not a space key."},{"iden":"output","content":"Print a single line containing the result of checking.If Roze has printed the text correctly, print \"Correct\". Otherwise, print \"Incorrect\"."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ S \\in \\mathbb{Z}^+ $ be the size of the largest doll.  \nLet $ X \\in \\mathbb{Z}^+ $ with $ X \\geq 2 $ be the size reduction factor.  \n\n**Constraints**  \n$ 1 \\leq S \\leq 10^9 $,  \n$ 2 \\leq X \\leq 10^9 $.  \n\n**Objective**  \nFind the maximum integer $ k $ such that there exists a sequence of doll sizes $ s_1 > s_2 > \\dots > s_k $, where:  \n- $ s_1 = S $,  \n- $ s_{i+1} \\leq \\left\\lfloor \\frac{s_i}{X} \\right\\rfloor $ for all $ i \\in \\{1, 2, \\dots, k-1\\} $,  \n- $ s_k \\geq 1 $.  \n\nEquivalently, compute the largest $ k $ satisfying:  \n$$\nS \\cdot X^{-(k-1)} \\geq 1\n$$  \nor  \n$$\nk = \\max \\left\\{ m \\in \\mathbb{Z}^+ \\,\\middle|\\, \\left\\lfloor \\frac{S}{X^{m-1}} \\right\\rfloor \\geq 1 \\right\\}\n$$","simple_statement":"Given S and X, find the maximum number of dolls that can be nested, where each doll is at most S, and each next doll is at most the previous size divided by X.","has_page_source":false}