-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path148A.cpp
More file actions
42 lines (41 loc) · 785 Bytes
/
148A.cpp
File metadata and controls
42 lines (41 loc) · 785 Bytes
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
// Jai shree ram
#include <bits/stdc++.h>
using namespace std;
int main()
{
int k, l, m, n, d, count = 0;
cin >> k >> l >> m >> n >> d;
int x = 0;
if (k >= x)
x = k;
if (l >= x)
x = l;
if (m >= x)
x = m;
if (n >= x)
x = n;
// cout<<x;
unordered_set<int> a;
for (int i = 1; (k * i) <= d; i++)
{
a.insert(k * i);
}
for (int i = 1; (l * i) <= d; i++)
{
a.insert(l * i);
}
for (int i = 1; (m * i) <= d; i++)
{
a.insert(m * i);
}
for (int i = 1; (n * i) <= d; i++)
{
a.insert(n * i);
}
for (auto it : a)
{
// cout << it << endl;
count++;
}
cout << count << endl;
}