Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include<iostream>
using namespace std;
int main(){
int n, h, m, width = 0;
cin>>n;
cin>>h;
for(int i = 0; i < n; i++){
cin>>m;
if(m > h){
width += 2;
}
else{
width++;
}
}
cout<<width;
return 0;
}
Copy The Code &
Try With Live Editor
Input
3 7
4 5 14
4 5 14
Output
4
Demonstration
Codeforcess Solution 677-A A. Vanya and Fence ,C++, Java, Js and Python ,677-A,Codeforcess Solution