Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- int t;
- cin>>t;
- while(t--){
- long long int n,m,x,y,l;
- cin >> n >> m >> x >> y >> l ;
- long long int dx = (x-1)/l + (n-x)/l + 1;
- long long int dy = (y-1)/l + (m-y)/l + 1;
- cout << dx*dy << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement