{"raw_statement":[{"iden":"statement","content":"After passing a test, Vasya got himself a box of $n$ candies. He decided to eat an equal amount of candies each morning until there are no more candies. However, Petya also noticed the box and decided to get some candies for himself.\n\nThis means the process of eating candies is the following: in the beginning Vasya chooses a single integer $k$, same for all days. After that, in the morning he eats $k$ candies from the box (if there are less than $k$ candies in the box, he eats them all), then in the evening Petya eats $10\\%$ of the candies **remaining** in the box. If there are still candies left in the box, the process repeats — next day Vasya eats $k$ candies again, and Petya — $10\\%$ of the candies left in a box, and so on.\n\nIf the amount of candies in the box is not divisible by $10$, Petya rounds the amount he takes from the box down. For example, if there were $97$ candies in the box, Petya would eat only $9$ of them. In particular, if there are less than $10$ candies in a box, Petya won't eat any at all.\n\nYour task is to find out the minimal amount of $k$ that can be chosen by Vasya so that he would eat at least half of the $n$ candies he initially got. Note that the number $k$ must be integer."},{"iden":"input","content":"The first line contains a single integer $n$ ($1 \\leq n \\leq 10^{18}$) — the initial amount of candies in the box."},{"iden":"output","content":"Output a single integer — the minimal amount of $k$ that would allow Vasya to eat at least half of candies he got."},{"iden":"example","content":"Input\n\n68\n\nOutput\n\n3"},{"iden":"note","content":"In the sample, the amount of candies, with $k=3$, would change in the following way (Vasya eats first):\n\n$68 \\to 65 \\to 59 \\to 56 \\to 51 \\to 48 \\to 44 \\to 41 \\\\ \\to 37 \\to 34 \\to 31 \\to 28 \\to 26 \\to 23 \\to 21 \\to 18 \\to 17 \\to 14 \\\\ \\to 13 \\to 10 \\to 9 \\to 6 \\to 6 \\to 3 \\to 3 \\to 0$.\n\nIn total, Vasya would eat $39$ candies, while Petya — $29$."}],"translated_statement":[{"iden":"statement","content":"在通过一次测试后，Vasya 得到了一盒 $n$ 颗糖果。他决定每天早上吃相同数量的糖果，直到糖果被吃完。然而，Petya 也注意到了这盒糖果，并决定为自己拿一些糖果。\n\n因此，吃糖果的过程如下：最初，Vasya 选择一个固定的整数 $k$（每天相同）。之后，每天早上，他从盒中吃掉 $k$ 颗糖果（如果盒中糖果少于 $k$ 颗，他就把剩下的全部吃完）；然后在晚上，Petya 吃掉盒中剩余糖果的 $10 %$。如果盒中仍有糖果剩余，过程重复——第二天 Vasya 再吃 $k$ 颗糖果，Petya 再吃剩余糖果的 $10 %$，依此类推。\n\n如果盒中糖果数量不能被 $10$ 整除，Petya 会向下取整他所吃的数量。例如，如果盒中有 $97$ 颗糖果，Petya 只会吃掉 $9$ 颗。特别地，如果盒中糖果少于 $10$ 颗，Petya 就不会吃任何糖果。\n\n你的任务是找出 Vasya 可以选择的最小整数 $k$，使得他能吃到初始糖果总数至少一半的糖果。注意，$k$ 必须是整数。\n\n第一行包含一个整数 $n$（$1 lt.eq n lt.eq 10^(18)$）——盒中初始的糖果数量。\n\n输出一个整数——能使 Vasya 吃到至少一半糖果的最小 $k$ 值。\n\n在样例中，当 $k = 3$ 时，糖果数量的变化如下（Vasya 先吃）：\n\n$68 arrow.r 65 arrow.r 59 arrow.r 56 arrow.r 51 arrow.r 48 arrow.r 44 arrow.r 41 \\\narrow.r 37 arrow.r 34 arrow.r 31 arrow.r 28 arrow.r 26 arrow.r 23 arrow.r 21 arrow.r 18 arrow.r 17 arrow.r 14 \\\narrow.r 13 arrow.r 10 arrow.r 9 arrow.r 6 arrow.r 6 arrow.r 3 arrow.r 3 arrow.r 0$。\n\n总共，Vasya 吃了 $39$ 颗糖果，而 Petya 吃了 $29$ 颗。"},{"iden":"input","content":"第一行包含一个整数 $n$（$1 lt.eq n lt.eq 10^(18)$）——盒中初始的糖果数量。"},{"iden":"output","content":"输出一个整数——能使 Vasya 吃到至少一半糖果的最小 $k$ 值。"},{"iden":"note","content":"在样例中，当 $k = 3$ 时，糖果数量的变化如下（Vasya 先吃）：$68 arrow.r 65 arrow.r 59 arrow.r 56 arrow.r 51 arrow.r 48 arrow.r 44 arrow.r 41 \\\narrow.r 37 arrow.r 34 arrow.r 31 arrow.r 28 arrow.r 26 arrow.r 23 arrow.r 21 arrow.r 18 arrow.r 17 arrow.r 14 \\\narrow.r 13 arrow.r 10 arrow.r 9 arrow.r 6 arrow.r 6 arrow.r 3 arrow.r 3 arrow.r 0$。总共，Vasya 吃了 $39$ 颗糖果，而 Petya 吃了 $29$ 颗。"}],"sample_group":[],"show_order":[],"formal_statement":"Let $ n \\in \\mathbb{N} $, $ n \\geq 1 $, be the initial number of candies.\n\nDefine a process parameterized by integer $ k \\geq 1 $:\n\n- Let $ c_0 = n $.\n- For each day $ i \\geq 1 $:\n  - Morning: $ c_{i-1} \\to \\max(c_{i-1} - k, 0) $\n  - Evening: $ c_i = \\left\\lfloor \\frac{9}{10} \\cdot \\max(c_{i-1} - k, 0) \\right\\rfloor $\n\nLet $ T_k $ be the total number of candies Vasya eats under parameter $ k $, i.e., the sum of $ k $ eaten each morning until the box is empty (with the last morning possibly eating fewer than $ k $).\n\nDefine $ S_k = \\sum_{i=1}^{\\infty} \\min(k, c_{i-1}) $ — total candies eaten by Vasya.\n\nWe require:  \n$$\nS_k \\geq \\left\\lceil \\frac{n}{2} \\right\\rceil\n$$\n\nFind the minimal integer $ k \\geq 1 $ such that $ S_k \\geq \\left\\lceil \\frac{n}{2} \\right\\rceil $.\n\nNote: The process terminates when $ c_i = 0 $ for some $ i $, and $ S_k $ is finite.","simple_statement":null,"has_page_source":false}