ソースコード
#include <iomanip>
#include <random>
#include <time.h>
#include <vector>
#include <queue>
#include <functional>
#include <map>
#include <string>
#include <cstdlib>
#include <typeinfo>
#include <math.h>
#include <algorithm>
#include <iostream>
#include <list>
#include <stack>
#include <set>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
int main() {
cin.tie(0);
ios_base::sync_with_stdio(false);
ll n, m, s, ans = 0;
cin >> n >> m;
for (int i = 0; i < n; i++) {
cin >> s;
ans += s;
}
cout << ans * m << endl;
return 0;
}