-
Notifications
You must be signed in to change notification settings - Fork 0
/
6.cpp
59 lines (53 loc) · 917 Bytes
/
6.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* Eat_more */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
#define faster() ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define tester() int t; cin >> t; while(t--)
#define PI atan(1)*4
#define in INT_MAX
#define im INT_MIN
#define fi first
#define se second
#define vi vector <int>
#define vll vector <ll>
#define pii pair <int, int>
#define mp(x, y) make_pair(x, y)
const int Mod = 1e9 + 7;
const int nMax = 1e5 + 1;
int n;
void Input() {
cin >> n;
}
int process(int n) {
int res = 0;
while(n%2 == 0) {
n /= 2;
res += 2;
}
int i = 3;
while(i <= sqrt(n)) {
while(n%i == 0) {
res += i;
n /= i;
}
i += 2;
}
if(n > 1) res += n;
return res;
}
void Solve() {
int number, ans = 0;
for (int i = 0; i < n; ++i) {
cin >> number;
ans += process(number);
}
cout << ans;
}
int main() {
faster();
Input();
Solve();
return 0;
}