CF1662I Ice Cream Shop

题目描述

### 题意 一条直线上有 $n$ 个小屋,第 $1$ 个小屋在所有点的最左端,第 $i+1$ 个小屋在第 $i$ 个小屋的右侧 $100m$ 处。($1\le i\le n-1$)每座小屋里有 $p_i$ 个人。 直线上另有 $m$ 个点与这 $n$ 个点在同一直线上,第 $i$ 个点在第一座小屋右侧 $x_i$ 米处。所有点的位置各不相同,但他们可能和小屋重合。 在直线上取一点(可以与其它点或小屋重合,位置可以为浮点数),使得它距离若干个小屋在所有点中最近。求这些距离最近小屋中人数之和的最大值。

输入格式

第 $1$ 行,两个整数 $n$,$m$,含义如题。 第 $2$ 行,$n$ 个整数,表示 $p_i$。 第 $3$ 行,$m$ 个整数,表示 $x_i$。

输出格式

仅 $1$ 行 $1$ 个正整数,表示人数的最大值。 $\text{Translated\space By\space Rebd\_Optem}$

说明/提示

In the first sample, you can place the shop (coloured orange in the picture below) $ 150 $ meters to the right of the first hut (for example) so that it is the closest shop to the first two huts, which have $ 2 $ and $ 5 $ people, for a total of $ 7 $ sold ice creams. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1662I/036f11cf99e6ce8eb9e75f459ae556bcd19b83aa.png)In the second sample, you can place the shop $ 170 $ meters to the right of the first hut (for example) so that it is the closest shop to the last two huts, which have $ 7 $ and $ 8 $ people, for a total of $ 15 $ sold ice creams. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1662I/84a834b228612f15126bc0383c786ab5a307b489.png)