bzoj#P3494. PA2010 Planning the Roadworks

PA2010 Planning the Roadworks

题目描述

某城市有 nn 段需要维修的道路,第 ii 段的长度为 lil_i 米。一支维修队每天最多能维修 dd 米道路(可以跨段连续施工,但不能在同一天内凭空多修)。求修完全部 nn 段道路最少需要多少天。

输入格式

第一行两个整数 n,dn,d(1≤n≤400001\le n\le 40000,1≤d≤1091\le d\le 10^9)。 第二行 nn 个整数 lil_i(1≤li≤1091\le l_i\le 10^9)。

输出格式

输出一行一个整数,表示最少需要的天数。

样例输入

3 5
4 6 2

样例输出

3