{"problem":{"name":"B. Baby name","description":{"content":"A cute couple is gonna have a new baby soon, they don't know yet how they will name their baby. However, they want the name of the baby to be the concatenation of a non-empty substring of the father's","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":524288},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10270B"},"statements":[{"statement_type":"Markdown","content":"A cute couple is gonna have a new baby soon, they don't know yet how they will name their baby. However, they want the name of the baby to be the concatenation of a non-empty substring of the father's name and a non-empty substring of the mother's name. Formally, let $a = a_1 a_2... a_n$ be the name of the father and $b = b_1 b_2... b_m$ be the name of the mother, the name of the baby will be $a_i a_{i + 1}... a_{i + s} b_j b_{j + 1}... b_{j + t}$, where $1 <= i <= i + s <= n$ and $1 <= j <= j + t <= m$.\n\nBoth the mother and the father, are UNAL alumni. They know that having a name at the end of the course list in alphabetic order is very advantageous because that person is always the last being called, which means having more time to arrive to the class, to deliver homework, to prepare presentations, and so on.\n\nTo determine which of the two names is higher alphabetically, their first letters are compared. If they differ, then the name whose first letter comes later in the alphabet is higher than the other name. If the first letters are the same, then the second letters are compared, and so on. If a position is reached where one name has no more letters to compare while the other does, then the largest name is the higher alphabetically.\n\nFor example, _andres_ is higher alphabetically than _ana_, _andre_ and _andrea_, but it is lower than _cadie_, _andy_ and _andresito_.\n\nThe couple knows that in the future the baby will study at UNAL, and of course, they want to help the baby to do very well. Considering this, they want the name of the baby to be the highest alphabetically possible.\n\nGiven the name of the father and the name of the mother, what should be the name for the baby?\n\nThe input consist of 2 lines, first line contains the name of the father and the second name contains the name of the mother.\n\nEach name is a non-empty string consisting of at most $2 * 10^5$ lowercase english characters.\n\nPrint one line with the name of the baby.\n\n## Input\n\nThe input consist of 2 lines, first line contains the name of the father and the second name contains the name of the mother.Each name is a non-empty string consisting of at most $2 * 10^5$ lowercase english characters.\n\n## Output\n\nPrint one line with the name of the baby.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"Let $ n, x, y \\in \\mathbb{Z} $ with $ 1 \\le x, y < n \\le 10^6 $.\n\nLet $ p \\in \\{1, 2, \\dots, n\\} $ denote Deja’s position in the queue (one-indexed).\n\n**Constraints:**\n- At least $ x $ people ahead of Deja: $ p - 1 \\ge x $ ⟹ $ p \\ge x + 1 $\n- At most $ y $ people behind Deja: $ n - p \\le y $ ⟹ $ p \\ge n - y $\n\n**Objective:**\nFind the number of integer positions $ p $ satisfying:\n$$\n\\max(x + 1, n - y) \\le p \\le n\n$$\n\nThe number of valid positions is:\n$$\nn - \\max(x + 1, n - y) + 1\n$$","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10270B","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}