{"raw_statement":[{"iden":"statement","content":"Sonya decided that having her own hotel business is the best way of earning money because she can profit and rest wherever she wants.\n\nThe country where Sonya lives is an endless line. There is a city in each integer coordinate on this line. She has $n$ hotels, where the $i$\\-th hotel is located in the city with coordinate $x_i$. Sonya is a smart girl, so she does not open two or more hotels in the same city.\n\nSonya understands that her business needs to be expanded by opening new hotels, so she decides to build one more. She wants to make the minimum distance from this hotel to all others to be equal to $d$. The girl understands that there are many possible locations to construct such a hotel. Thus she wants to know the number of possible coordinates of the cities where she can build a new hotel.\n\nBecause Sonya is lounging in a jacuzzi in one of her hotels, she is asking you to find the number of cities where she can build a new hotel so that the minimum distance from the original $n$ hotels to the new one is equal to $d$."},{"iden":"input","content":"The first line contains two integers $n$ and $d$ ($1\\leq n\\leq 100$, $1\\leq d\\leq 10^9$) — the number of Sonya's hotels and the needed minimum distance from a new hotel to all others.\n\nThe second line contains $n$ different integers in strictly increasing order $x_1, x_2, \\ldots, x_n$ ($-10^9\\leq x_i\\leq 10^9$) — coordinates of Sonya's hotels."},{"iden":"output","content":"Print the number of cities where Sonya can build a new hotel so that the minimum distance from this hotel to all others is equal to $d$."},{"iden":"examples","content":"Input\n\n4 3\n-3 2 9 16\n\nOutput\n\n6\n\nInput\n\n5 2\n4 8 11 18 19\n\nOutput\n\n5"},{"iden":"note","content":"In the first example, there are $6$ possible cities where Sonya can build a hotel. These cities have coordinates $-6$, $5$, $6$, $12$, $13$, and $19$.\n\nIn the second example, there are $5$ possible cities where Sonya can build a hotel. These cities have coordinates $2$, $6$, $13$, $16$, and $21$."}],"translated_statement":[{"iden":"statement","content":"索尼娅认为经营自己的酒店业务是赚钱的最佳方式，因为她可以随时随地盈利和休息。\n\n索尼娅所在的国家是一条无限长的直线，每个整数坐标上都有一座城市。她拥有 $n$ 家酒店，其中第 $i$ 家酒店位于坐标为 $x_i$ 的城市。索尼娅是个聪明的女孩，因此她不会在同一个城市开设两家或更多酒店。\n\n索尼娅明白她的业务需要通过开设新酒店来扩展，因此她决定再建一家。她希望这家新酒店到所有其他酒店的最小距离恰好为 $d$。女孩明白，满足条件的建店位置有很多，因此她想知道有多少个可能的城市坐标可以用来建造这家新酒店。\n\n由于索尼娅正躺在她的一家酒店的按摩浴缸里，她请你找出满足条件的、可以建造新酒店的城市数量，使得从这家新酒店到原来的 $n$ 家酒店的最小距离恰好为 $d$。\n\n第一行包含两个整数 $n$ 和 $d$（$1 lt.eq n lt.eq 100$，$1 lt.eq d lt.eq 10^9$）——分别表示索尼娅的酒店数量和新酒店到所有其他酒店所需的最小距离。\n\n第二行包含 $n$ 个严格递增的互不相同的整数 $x_1, x_2, dots.h, x_n$（$-10^9 lt.eq x_i lt.eq 10^9$）——表示索尼娅酒店的坐标。\n\n请输出索尼娅可以建造新酒店的城市数量，使得该新酒店到所有其他酒店的最小距离恰好为 $d$。\n\n在第一个示例中，有 $6$ 个可能的城市可以建造酒店，这些城市的坐标分别为 $-6$、$5$、$6$、$12$、$13$ 和 $19$。\n\n在第二个示例中，有 $5$ 个可能的城市可以建造酒店，这些城市的坐标分别为 $2$、$6$、$13$、$16$ 和 $21$。\n\n"},{"iden":"input","content":"第一行包含两个整数 $n$ 和 $d$（$1 lt.eq n lt.eq 100$，$1 lt.eq d lt.eq 10^9$）——分别表示索尼娅的酒店数量和新酒店到所有其他酒店所需的最小距离。第二行包含 $n$ 个严格递增的互不相同的整数 $x_1, x_2, dots.h, x_n$（$-10^9 lt.eq x_i lt.eq 10^9$）——表示索尼娅酒店的坐标。"},{"iden":"output","content":"请输出索尼娅可以建造新酒店的城市数量，使得该新酒店到所有其他酒店的最小距离恰好为 $d$。"},{"iden":"examples","content":"输入\n4 3\n-3 2 9 16\n输出\n6\n\n输入\n5 2\n4 8 11 18 19\n输出\n5"},{"iden":"note","content":"在第一个示例中，有 $6$ 个可能的城市可以建造酒店，这些城市的坐标分别为 $-6$、$5$、$6$、$12$、$13$ 和 $19$。在第二个示例中，有 $5$ 个可能的城市可以建造酒店，这些城市的坐标分别为 $2$、$6$、$13$、$16$ 和 $21$。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the number of existing hotels.  \nLet $ d \\in \\mathbb{Z}^+ $ be the required minimum distance.  \nLet $ X = \\{x_1, x_2, \\dots, x_n\\} \\subset \\mathbb{Z} $ be the set of coordinates of existing hotels, with $ x_1 < x_2 < \\dots < x_n $.\n\n**Constraints**  \n1. $ 1 \\leq n \\leq 100 $  \n2. $ 1 \\leq d \\leq 10^9 $  \n3. $ -10^9 \\leq x_i \\leq 10^9 $ for all $ i \\in \\{1, \\dots, n\\} $  \n4. All $ x_i $ are distinct and given in strictly increasing order.\n\n**Objective**  \nFind the number of integer coordinates $ y \\in \\mathbb{Z} $ such that:  \n$$\n\\min_{x \\in X} |y - x| = d\n$$","simple_statement":null,"has_page_source":false}