{"raw_statement":[{"iden":"statement","content":"For each positive integer _n_ consider the integer ψ(_n_) which is obtained from _n_ by replacing every digit _a_ in the decimal notation of _n_ with the digit (9  -  _a_). We say that ψ(_n_) is the _reflection_ of _n_. For example, reflection of 192 equals 807. Note that leading zeros (if any) should be omitted. So reflection of 9 equals 0, reflection of 91 equals 8.\n\nLet us call the _weight_ of the number the product of the number and its reflection. Thus, the weight of the number 10 is equal to 10·89 = 890.\n\nYour task is to find the maximum weight of the numbers in the given range \\[_l_, _r_\\] (boundaries are included)."},{"iden":"input","content":"Input contains two space-separated integers _l_ and _r_ (1 ≤ _l_ ≤ _r_ ≤ 109) — bounds of the range."},{"iden":"output","content":"Output should contain single integer number: maximum value of the product _n_·ψ(_n_), where _l_ ≤ _n_ ≤ _r_.\n\nPlease, do not use _%lld_ specificator to read or write 64-bit integers in C++. It is preferred to use _cout_ (also you may use _%I64d_)."},{"iden":"examples","content":"Input\n\n3 7\n\nOutput\n\n20\n\nInput\n\n1 1\n\nOutput\n\n8\n\nInput\n\n8 10\n\nOutput\n\n890"},{"iden":"note","content":"In the third sample weight of 8 equals 8·1 = 8, weight of 9 equals 9·0 = 0, weight of 10 equals 890.\n\nThus, maximum value of the product is equal to 890."}],"translated_statement":[{"iden":"statement","content":"对于每个正整数 $n$，考虑整数 $\\psi(n)$，它通过将 $n$ 的十进制表示中的每一位数字 $a$ 替换为数字 $(9 - a)$ 得到。我们称 $\\psi(n)$ 为 $n$ 的 _反射_。例如，$192$ 的反射等于 $807$。注意，前导零（如果有）应被省略。因此，$9$ 的反射等于 $0$，$91$ 的反射等于 $8$。\n\n我们称一个数的 _权重_ 为该数与其反射的乘积。因此，数 $10$ 的权重等于 $10 \\cdot 89 = 890$。\n\n你的任务是找出给定范围 $[l, r]$（包含端点）内所有数的最大权重。\n\n输入包含两个用空格分隔的整数 $l$ 和 $r$（$1 \\leq l \\leq r \\leq 10^9$）——范围的边界。\n\n输出应包含一个整数：最大乘积 $n \\cdot \\psi(n)$ 的值，其中 $l \\leq n \\leq r$。\n\n请不要在 C++ 中使用 _%lld_ 标识符读取或写入 64 位整数。建议使用 _cout_（你也可以使用 _%I64d_）。"},{"iden":"input","content":"输入包含两个用空格分隔的整数 $l$ 和 $r$（$1 \\leq l \\leq r \\leq 10^9$）——范围的边界。"},{"iden":"output","content":"输出应包含一个整数：最大乘积 $n \\cdot \\psi(n)$ 的值，其中 $l \\leq n \\leq r$。请不要在 C++ 中使用 _%lld_ 标识符读取或写入 64 位整数。建议使用 _cout_（你也可以使用 _%I64d_）。"},{"iden":"examples","content":"输入\n3 7\n输出\n20\n\n输入\n1 1\n输出\n8\n\n输入\n8 10\n输出\n890"},{"iden":"note","content":"在第三个样例中，$8$ 的权重等于 $8 \\cdot 1 = 8$，$9$ 的权重等于 $9 \\cdot 0 = 0$，$10$ 的权重等于 $890$。因此，乘积的最大值等于 $890$。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $\\psi(n)$ denote the reflection of a positive integer $n$, obtained by replacing each digit $a$ in the decimal representation of $n$ with $9 - a$, and removing leading zeros.  \nLet $w(n) = n \\cdot \\psi(n)$ denote the weight of $n$.\n\n**Constraints**  \nGiven integers $l, r \\in \\mathbb{Z}$ such that $1 \\leq l \\leq r \\leq 10^9$.\n\n**Objective**  \nFind  \n$$\n\\max_{n \\in [l, r]} w(n) = \\max_{n \\in [l, r]} \\left( n \\cdot \\psi(n) \\right)\n$$","simple_statement":null,"has_page_source":false}