Problem description

Vanya and his friends are walking along the fence of height h and they do not want the guard to notice them. In order to achieve this the height of each of the friends should not exceed h. If the height of some person is greater than h he can bend down and then he surely won't be noticed by the guard. The height of the i-th person is equal to ai.

Consider the width of the person walking as usual to be equal to 1, while the width of the bent person is equal to 2. Friends want to talk to each other while walking, so they would like to walk in a single row. What is the minimum width of the road, such that friends can walk in a row and remain unattended by the guard?

Input

The first line of the input contains two integers n and h (1 ≤ n ≤ 1000, 1 ≤ h ≤ 1000) — the number of friends and the height of the fence, respectively.

The second line contains n integers ai (1 ≤ ai ≤ 2h), the i-th of them is equal to the height of the i-th person.

Output

Print a single integer — the minimum possible valid width of the road.

Examples

Input

3 7
4 5 14

Output

4

Input

6 1
1 1 1 1 1 1

Output

6

Input

6 5
7 6 8 9 10 5

Output

11

Note

In the first sample, only person number 3 must bend down, so the required width is equal to 1 + 1 + 2 = 4.

In the second sample, all friends are short enough and no one has to bend, so the width 1 + 1 + 1 + 1 + 1 + 1 = 6 is enough.

In the third sample, all the persons have to bend, except the last one. The required minimum width of the road is equal to 2 + 2 + 2 + 2 + 2 + 1 = 11.

解题思路:如果某个人的高度大于篱笆的高度h,那么这个人必须弯着身子走路才不会被警卫发现,其宽度为2;否则其宽度为1,计算n个人(人与人紧凑着)走路排成一行共有多宽,水过!

AC代码:

 #include<bits/stdc++.h>
using namespace std;
int main(){
int n,h,a,sum=;
cin>>n>>h;
while(n--){
cin>>a;
if(a>h)sum+=;
else sum++;
}
cout<<sum<<endl;
return ;
}

D - Vanya and Fence的更多相关文章

  1. codeforces 677A A. Vanya and Fence(水题)

    题目链接: A. Vanya and Fence time limit per test 1 second memory limit per test 256 megabytes input stan ...

  2. Codeforces Round #355 (Div. 2) A. Vanya and Fence 水题

    A. Vanya and Fence 题目连接: http://www.codeforces.com/contest/677/problem/A Description Vanya and his f ...

  3. Codeforces Round #355 (Div. 2)-A

    A. Vanya and Fence 题目连接:http://codeforces.com/contest/677/problem/A Vanya and his friends are walkin ...

  4. Codeforces 677 - A/B/C/D/E - (Undone)

    链接: A - Vanya and Fence - [水] AC代码: #include<bits/stdc++.h> using namespace std; ; int n,h; in ...

  5. [LeetCode] Paint Fence 粉刷篱笆

    There is a fence with n posts, each post can be painted with one of the k colors. You have to paint ...

  6. codeforces C. Vanya and Scales

    C. Vanya and Scales Vanya has a scales for weighing loads and weights of masses w0, w1, w2, ..., w10 ...

  7. poj 3253 Fence Repair

    Fence Repair Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 42979   Accepted: 13999 De ...

  8. 数论 - Vanya and Computer Game

    Vanya and his friend Vova play a computer game where they need to destroy n monsters to pass a level ...

  9. CF 484E - Sign on Fence

    E. Sign on Fence time limit per test 4 seconds memory limit per test 256 megabytes input standard in ...

随机推荐

  1. openstack——nova计算服务

    一.nova介绍               Nova 是 OpenStack 最核心的服务,负责维护和管理云环境的计算资源.OpenStack 作为 IaaS 的云操作系统,虚拟机生命周期管理也就是 ...

  2. / Vijos / 题库 / 1622 / 文件查找(HOI)

    / Vijos / 题库 /1622/文件查找(HOI) 描述 WINDOWS是一个很庞大的操作系统(当然啦,看占的硬盘空间就知道了),比如说,它的文件查找系统.现在,请你用PASCAL或者C或者C+ ...

  3. MySQL多表连接操作

    select * from userinfo ,dapartment where userinfo.part_id = dapartment.id; --左连接: 左边全部显示 select * fr ...

  4. 2.2sklearn.preprocessing.PolynomialFeatures生成交叉特征

    sklearn.preprocessing.PolynomialFeatures原文 多项式生成函数:sklearn.preprocessing.PolynomialFeatures(degree=2 ...

  5. JavaSE 学习笔记之StringBuffer(十五)

    --< java.lang >-- StringBuffer字符串缓冲区: 构造一个其中不带字符的字符串缓冲区,初始容量为 16 个字符. 特点: 1:可以对字符串内容进行修改. 2:是一 ...

  6. 233 Matrix 矩阵快速幂

    In our daily life we often use 233 to express our feelings. Actually, we may say 2333, 23333, or 233 ...

  7. kendo grid create

    这种自定义的create中的函数,这个data的行为是在发送到后端之前执行的 //{ // url: "/admgr/AdUserAuthorityAdd", // dataTyp ...

  8. python network programming--connect()

    首先我们看一段python client/server代码. server端: >>> import sys,socket >>> s = socket.socke ...

  9. java获取类名不包括路径

    class.getSimpleName(),就能获得仅仅的类名 class.getName()获得的是全路径的类名

  10. applicationcontext理解使用

    Spring ApplicationContext 容器 Application Context 是 spring 中较高级的容器.和 BeanFactory 类似,它可以加载配置文件中定义的 bea ...