Advertisement
rengetsu

Codeforces_148A

Jul 31st, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. //Codeforces Round 148A
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6.     int k, l, m, n, d, answ=0;
  7.     cin >> k >> l >> m >> n >> d;
  8.     for(int i=1;i<d+1;i++)
  9.     {
  10.         if(i%k==0){answ++;}
  11.         else if(i%l==0){answ++;}
  12.         else if(i%m==0){answ++;}
  13.         else if(i%n==0){answ++;}
  14.     }
  15.     cout << answ;
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement