{"raw_statement":[{"iden":"statement","content":"Zane the wizard had never loved anyone before, until he fell in love with a girl, whose name remains unknown to us.\n\n<center>![image](https://espresso.codeforces.com/d3d033c8aa4b077ead3b1a4d48bcd6a347e60710.png)</center>The girl lives in house _m_ of a village. There are _n_ houses in that village, lining in a straight line from left to right: house 1, house 2, ..., house _n_. The village is also well-structured: house _i_ and house _i_ + 1 (1 ≤ _i_ < _n_) are exactly 10 meters away. In this village, some houses are occupied, and some are not. Indeed, unoccupied houses can be purchased.\n\nYou will be given _n_ integers _a_1, _a_2, ..., _a__n_ that denote the availability and the prices of the houses. If house _i_ is occupied, and therefore cannot be bought, then _a__i_ equals 0. Otherwise, house _i_ can be bought, and _a__i_ represents the money required to buy it, in dollars.\n\nAs Zane has only _k_ dollars to spare, it becomes a challenge for him to choose the house to purchase, so that he could live as near as possible to his crush. Help Zane determine the minimum distance from his crush's house to some house he can afford, to help him succeed in his love."},{"iden":"input","content":"The first line contains three integers _n_, _m_, and _k_ (2 ≤ _n_ ≤ 100, 1 ≤ _m_ ≤ _n_, 1 ≤ _k_ ≤ 100) — the number of houses in the village, the house where the girl lives, and the amount of money Zane has (in dollars), respectively.\n\nThe second line contains _n_ integers _a_1, _a_2, ..., _a__n_ (0 ≤ _a__i_ ≤ 100) — denoting the availability and the prices of the houses.\n\nIt is guaranteed that _a__m_ = 0 and that it is possible to purchase some house with no more than _k_ dollars."},{"iden":"output","content":"Print one integer — the minimum distance, in meters, from the house where the girl Zane likes lives to the house Zane can buy."},{"iden":"examples","content":"Input\n\n5 1 20\n0 27 32 21 19\n\nOutput\n\n40\n\nInput\n\n7 3 50\n62 0 0 0 99 33 22\n\nOutput\n\n30\n\nInput\n\n10 5 100\n1 0 1 0 0 0 0 0 1 1\n\nOutput\n\n20"},{"iden":"note","content":"In the first sample, with _k_ = 20 dollars, Zane can buy only house 5. The distance from house _m_ = 1 to house 5 is 10 + 10 + 10 + 10 = 40 meters.\n\nIn the second sample, Zane can buy houses 6 and 7. It is better to buy house 6 than house 7, since house _m_ = 3 and house 6 are only 30 meters away, while house _m_ = 3 and house 7 are 40 meters away."}],"translated_statement":[{"iden":"statement","content":"Zane the wizard had never loved anyone before, until he fell in love with a girl, whose name remains unknown to us.\n\nThe girl lives in house #$m$ of a village. There are $n$ houses in that village, lining in a straight line from left to right: house $1$, house $2$, ..., house $n$. The village is also well-structured: house $i$ and house $i + 1$ ($1 ≤ i < n$) are exactly $10$ meters away. In this village, some houses are occupied, and some are not. Indeed, unoccupied houses can be purchased.\n\nYou will be given $n$ integers $a_1, a_2, ..., a_n$ that denote the availability and the prices of the houses. If house $i$ is occupied, and therefore cannot be bought, then $a_i$ equals $0$. Otherwise, house $i$ can be bought, and $a_i$ represents the money required to buy it, in dollars.\n\nAs Zane has only $k$ dollars to spare, it becomes a challenge for him to choose the house to purchase, so that he could live as near as possible to his crush. Help Zane determine the minimum distance from his crush's house to some house he can afford, to help him succeed in his love.\n\nThe first line contains three integers $n$, $m$, and $k$ ($2 ≤ n ≤ 100$, $1 ≤ m ≤ n$, $1 ≤ k ≤ 100$) — the number of houses in the village, the house where the girl lives, and the amount of money Zane has (in dollars), respectively.\n\nThe second line contains $n$ integers $a_1, a_2, ..., a_n$ ($0 ≤ a_i ≤ 100$) — denoting the availability and the prices of the houses.\n\nIt is guaranteed that $a_m = 0$ and that it is possible to purchase some house with no more than $k$ dollars.\n\nPrint one integer — the minimum distance, in meters, from the house where the girl Zane likes lives to the house Zane can buy.\n\nIn the first sample, with $k = 20$ dollars, Zane can buy only house $5$. The distance from house $m = 1$ to house $5$ is $10 + 10 + 10 + 10 = 40$ meters.\n\nIn the second sample, Zane can buy houses $6$ and $7$. It is better to buy house $6$ than house $7$, since house $m = 3$ and house $6$ are only $30$ meters away, while house $m = 3$ and house $7$ are $40$ meters away.\n"},{"iden":"input","content":"The first line contains three integers $n$, $m$, and $k$ ($2 ≤ n ≤ 100$, $1 ≤ m ≤ n$, $1 ≤ k ≤ 100$) — the number of houses in the village, the house where the girl lives, and the amount of money Zane has (in dollars), respectively. The second line contains $n$ integers $a_1, a_2, ..., a_n$ ($0 ≤ a_i ≤ 100$) — denoting the availability and the prices of the houses. It is guaranteed that $a_m = 0$ and that it is possible to purchase some house with no more than $k$ dollars."},{"iden":"output","content":"Print one integer — the minimum distance, in meters, from the house where the girl Zane likes lives to the house Zane can buy."},{"iden":"examples","content":"Input\n5 1 20\n0 27 32 21 19\nOutput\n40\nInput\n7 3 50\n62 0 0 0 99 33 22\nOutput\n30\nInput\n10 5 100\n1 0 1 0 0 0 0 0 1 1\nOutput\n20\n"},{"iden":"note","content":"In the first sample, with $k = 20$ dollars, Zane can buy only house $5$. The distance from house $m = 1$ to house $5$ is $10 + 10 + 10 + 10 = 40$ meters. In the second sample, Zane can buy houses $6$ and $7$. It is better to buy house $6$ than house $7$, since house $m = 3$ and house $6$ are only $30$ meters away, while house $m = 3$ and house $7$ are $40$ meters away."}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n, m, k \\in \\mathbb{Z}^+ $:  \n- $ n $: number of houses, labeled $ 1 $ to $ n $.  \n- $ m $: index of the girl’s house.  \n- $ k $: Zane’s budget in dollars.  \n\nLet $ A = (a_1, a_2, \\dots, a_n) $ be a sequence of integers where:  \n- $ a_i = 0 $ if house $ i $ is occupied (unavailable),  \n- $ a_i > 0 $ if house $ i $ is available for purchase, with price $ a_i $ dollars.  \n\nIt is given that $ a_m = 0 $ (girl’s house is occupied).  \n\n**Constraints**  \n1. $ 2 \\leq n \\leq 100 $  \n2. $ 1 \\leq m \\leq n $  \n3. $ 1 \\leq k \\leq 100 $  \n4. $ 0 \\leq a_i \\leq 100 $ for all $ i \\in \\{1, \\dots, n\\} $  \n5. $ a_m = 0 $  \n6. There exists at least one $ i \\ne m $ such that $ a_i > 0 $ and $ a_i \\leq k $.  \n\n**Objective**  \nFind the minimum distance (in meters) from house $ m $ to any house $ i \\ne m $ such that $ a_i \\leq k $.  \n\nSince adjacent houses are 10 meters apart, the distance between house $ m $ and house $ i $ is $ 10 \\cdot |i - m| $.  \n\nCompute:  \n$$\n\\min_{\\substack{1 \\leq i \\leq n \\\\ a_i > 0 \\\\ a_i \\leq k}} \\left( 10 \\cdot |i - m| \\right)\n$$","simple_statement":null,"has_page_source":false}