language: C++ (gcc-4.3.4)
date: 109 days 15 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include<iostream>
using namespace std;
int main(){
        int a,b,c,d,e[30],z,total;
        cin>>a>>b>>c>>d>>z;
        e[1]=z/(a*b);
        e[2]=z/(a*c);
        e[3]=z/(a*d);
        e[4]=z/(b*c);
        e[5]=z/(b*d);
        e[6]=z/(c*d);
        e[7]=z/(a*b*c);
        e[8]=z/(a*b*d);
        e[9]=z/(a*c*d);
        e[10]=z/(b*c*d);
        e[11]=z/(a*b*c*d);
        total=z-z/a-z/b-z/c-z/d;
        total=total+e[1]+e[2]+e[3]+e[4]+e[5]+e[6]-e[7]-e[8]-e[9]-e[10]+e[11];
        cout<<total<<endl;
        return 0;
}