Milosz0542

Untitled

Dec 4th, 2021
690
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. int main() {
  4. int k[4];
  5. std::cin>>k[0]>>k[1]>>k[2]>>k[3];
  6. int x = k[0]*k[1]*k[2]*k[3];
  7. int w, h;
  8. std::cin>>w>>h;
  9. int n[w][h];
  10. for(int i = 0; i<w; i++) {
  11.     for(int j = 0; j<h; j++) {
  12.         std::cin>>n[i][j];
  13.     }
  14. }
  15. int y = 0;
  16. for(int i = 0; i<w-1; i++) {
  17.     for(int j = 0; j<h-1; j++) {
  18.         if( n[i][j]*n[i][j+1]*n[i+1][j]*n[i+1][j+1] == x ) y++;
  19.     }
  20. }
  21. std::cout<<y;
  22. }
RAW Paste Data