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

#include<bits/stdc++.h>
using namespace std;

#define fast ios_base::sync_with_stdio(false)
#define outs(x) cout << x << " "
#define outn(x) cout << x << "\n"
#define sf scanf
#define pf printf

int main()
{
    fast;
    int n, h;
    while(cin >> n >> h)
    {
        int sum=0;
        int x;
        while(n--)
        {
            cin >> x;
            if(x > h) sum+=2;
            else sum++;
        }

        outn(sum);
    }

    return 0;
}

Comments

Popular posts from this blog

SPOJ-CMG - Collecting Mango

LightOJ 1009 - Back to Underworld

LeetCode Palindrome Number