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. 数据库操作(二)SOQL

    1.SOQL SOQL是对象查询语言.它可以在单个sObject中在给定标准上搜索记录. 2.SELECT语句 [格式]SELECT 列名称 FROM 表名称 [示例] 3.SELECT...WHER ...

  2. thinkphp里模版文件js无法使用if condition的问题

    /**     * @example   thinkphp里模版文件js无法使用if condition的问题     * @example  参考地址:https://segmentfault.co ...

  3. 无需编写代码,用接口管理工具 eoLinker 高效完成API测试流程相关业务

    引言 作为开发人员,有时需要协助市场部门进行开发,比如在市场推广中,经常通过给用户赠送优惠券来提高复购率.这篇文章,将介绍如何使用接口管理工具 eoLinker 的自动化测试 [UI模式] 构建此业务 ...

  4. eas之列表界面写脚本时如何写sql

    var easNames = JavaImporter();easNames.importPackage(Packages.com.kingdee.bos.dao.query);with(easNam ...

  5. matplotlib命令与格式:标题(title),标注(annotate),文字说明(text)

      1.title设置图像标题 (1)title常用参数 fontsize设置字体大小,默认12,可选参数 ['xx-small', 'x-small', 'small', 'medium', 'la ...

  6. 刽子手游戏(Hangman Judge, UVa 489)

    刽子手游戏其实是一款猜单词游戏,游戏规则是这样的:计算机想一个单词让你猜,你每次可以猜一个字母.如果单词里有那个字母,所有该字母会显示出来:如果没有那个字母,则计算机会在一幅“刽子手”画上填一笔.这幅 ...

  7. 49.ardinality算法之优化内存开销以及HLL算法

    主要知识点 precision_threshold参数的理解 HLL算法优化(hash)         cardinality,count(distinct),5%的错误率,性能在100ms左右   ...

  8. 手写DAO框架(二)-开发前的最后准备

    -------前篇:手写DAO框架(一)-从“1”开始 --------- 前言:前篇主要介绍了写此框架的动机,把主要功能点大致介绍了一下.此篇文章主要介绍开发前最后的一些准备.主要包括一些基础知识点 ...

  9. 暑假集训D21总结

    考试 今天考了一大圈 不可做 题 本来是爆零的,后来把数据改了一下,成功暴力骗了5分= = 刷题 无限水题$ing$,然后就$GG$了 生活 不开心$ing$,没有啥好写的 今天就是莫名的不开心 歌 ...

  10. 如何实现在scrapy调试爬虫

    # -*- coding:utf-8 -*- from scrapy.cmdline import execute import sys import os '''在爬虫文件夹下面自定义一个main. ...