Advertisement
Ankit_132

B

Feb 21st, 2024
913
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int t;
  6.     cin>>t;
  7.    
  8.     while(t--){
  9.         long long int n,m,x,y,l;
  10.         cin >> n >> m >> x >> y >> l ;
  11.         long long int dx = (x-1)/l + (n-x)/l + 1;
  12.         long long int dy = (y-1)/l + (m-y)/l + 1;
  13.         cout << dx*dy << endl;  
  14.     }
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement