Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n,m,a,b,k=0,n1,m1;
- cin >> n >> m >> a >> b;
- k= (n / a) * (m / b);
- n1= n%a;m1 = m% b; n-=n1;
- if (n1>0)
- {
- if (( m/b) *b == m) k+=(m/b); else k+=(m/b)+1;
- }
- if (m1>0) k+=(n/a);
- cout << k;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement