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. 报错:command not found

    linux中如果是最小化安装的系统,执行命令的时候很多会出现没找到命令 [root@localhost ~]# mtr -bash: mtr: command not found [root@loca ...

  2. JSON,对象..的数据格式

    [此案例为自动产生的随机数] 对象: {a1:180,a2:721, a3:574} 序列化传值:将对象转化为Json字符串 public ActionResult Val2() { Random r ...

  3. 1 TaskQueue 实现Task 队列

    class Program { static void Main(string[] args) { List<Person> list = new List<Person>() ...

  4. gcc和gdb的基本操作

    gcc和gdb yum 在线安装软件,使用阿里云镜像站,OPSX 选择你安装的系统 点帮助 查看配置命令行 yum --list | grep gdb #查找要安装的软件 yum install -y ...

  5. 24.通过ngram分词机制实现index-time搜索推荐

    一.ngram和index-time搜索推荐原理     1.什么是ngram     假设有一个单词:quick,在5种长度下的ngram情况如下: ngram length=1,q u i c k ...

  6. 第四节:Web爬虫之pyquery解析库

    PyQuery库也是一个非常强大又灵活的网页解析库,如果你有前端开发经验的,都应该接触过jQuery,那么PyQuery就是你非常绝佳的选择,PyQuery 是 Python 仿照 jQuery 的严 ...

  7. 腾讯云,搭建Java开发环境

    搭建 JAVA 开发环境 任务时间:18min ~ 20min 此实验教大家如何配置 JDK .Tomcat 和 Mysql 安装 JDK JDK 是开发Java程序必须安装的软件,我们查看一下 yu ...

  8. STM32串口通信配置(USART1+USART2+USART3+UART4)

    一.串口一的配置(初始化+中断配置+中断接收函数) 1 /*====================================================================== ...

  9. Maven学习总结(十一)——Maven项目对象模型pom.xml文件详解

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...

  10. openstack部署工具简介

    个人使用方面DevStack无疑,在可预见的未来时间内,DevStack仍将是众多开发者们的首选安装方式或工具.该方式主要是通过配置参数,执行shell脚本来安装一个OpenStack的开发环境.Gi ...