initial commit
This commit is contained in:
parent
6fbf33d21c
commit
fd205ff210
39
148A Insomnia cure/148A.cpp
Normal file
39
148A Insomnia cure/148A.cpp
Normal file
@ -0,0 +1,39 @@
|
||||
#include<bits/stdc++.h>
|
||||
using namespace std;
|
||||
using ll = long long;
|
||||
|
||||
|
||||
void solve()
|
||||
{
|
||||
int k,l,m,n,d;
|
||||
cin>>k>>l>>m>>n>>d;
|
||||
set<int>damaged;
|
||||
for(int i=k; i<=d; i+=k)
|
||||
{
|
||||
damaged.insert(i);
|
||||
}
|
||||
for(int i=l; i<=d; i+=l)
|
||||
{
|
||||
damaged.insert(i);
|
||||
}
|
||||
for(int i=m; i<=d; i+=m)
|
||||
{
|
||||
damaged.insert(i);
|
||||
}
|
||||
for(int i=n; i<=d; i+=n)
|
||||
{
|
||||
damaged.insert(i);
|
||||
}
|
||||
cout<<damaged.size()<<endl;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
ios_base::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
int TC = 1;
|
||||
//cin >> TC;
|
||||
//cin.ignore();
|
||||
while (TC--) solve();
|
||||
}
|
Loading…
Reference in New Issue
Block a user