diff --git a/148A Insomnia cure/148A.cpp b/148A Insomnia cure/148A.cpp new file mode 100644 index 0000000..d12b005 --- /dev/null +++ b/148A Insomnia cure/148A.cpp @@ -0,0 +1,39 @@ +#include +using namespace std; +using ll = long long; + + +void solve() +{ + int k,l,m,n,d; + cin>>k>>l>>m>>n>>d; + setdamaged; + 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<> TC; + //cin.ignore(); + while (TC--) solve(); +} \ No newline at end of file