Language: C++

#include <cmath>
#include <algorithm>
#include <numeric>
#include <string>
using u8t = std::uint64_t;
using i8t = std::int64_t;
#define F(I,N) for(i8t I=0,_N=N;I<_N;I++)
#define FR(I,N) for(i8t I=N;I--;)
#define R(V) i8t V;std::cin>>V;
#define RV(V,N) std::vector<i8t> V;F(_i,N){R(_x)V.push_back(_x);}
#define RL1(line) std::getline(std::cin,line);
#define RL(line) std::string line;RL1(line)
#define RM(V,L,C) std::vector<char> V;F(_i,L){RL(_l)F(_j,C)V.push_back(_l[_j]);}
#define P(X) std::cout<<(X)<<std::endl;
int main() {
  R(H)R(W)R(h)R(w);
  i8t r=H*W-(H/h)*(W/w)*(w*h+1);
  if (r>0){
    P("Yes");
    F(I,H){
      bool isfirst=true;
      F(J,W){
        if(isfirst)isfirst=false;else std::cout<<" ";
        bool const a=(I+1)%h==0 &&(J+1)%w==0;
        std::cout<<(a?-(w*h):1);
      }
      std::cout<<std::endl;
    }
  }else{
    P("No");
  }

  return 0;
}

Compiler output:
a.cc:5:18: error: 'uint64_t' in namespace 'std' does not name a type; did you mean 'wint_t'?
    5 | using u8t = std::uint64_t;
      |                  ^~~~~~~~
      |                  wint_t
a.cc:6:18: error: 'int64_t' in namespace 'std' does not name a type
    6 | using i8t = std::int64_t;
      |                  ^~~~~~~
a.cc: In function 'int main()':
a.cc:9:14: error: 'i8t' was not declared in this scope; did you mean 'int'?
    9 | #define R(V) i8t V;std::cin>>V;
      |              ^~~
a.cc:16:3: note: in expansion of macro 'R'
   16 |   R(H)R(W)R(h)R(w);
      |   ^
a.cc:9:25: error: 'cin' is not a member of 'std'
    9 | #define R(V) i8t V;std::cin>>V;
      |                         ^~~
a.cc:16:3: note: in expansion of macro 'R'
   16 |   R(H)R(W)R(h)R(w);
      |   ^
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include <string>
  +++ |+#include <iostream>
    5 | using u8t = std::uint64_t;
a.cc:16:5: error: 'H' was not declared in this scope
   16 |   R(H)R(W)R(h)R(w);
      |     ^
a.cc:9:30: note: in definition of macro 'R'
    9 | #define R(V) i8t V;std::cin>>V;
      |                              ^
a.cc:16:9: error: expected ';' before 'W'
   16 |   R(H)R(W)R(h)R(w);
      |         ^
a.cc:9:18: note: in definition of macro 'R'
    9 | #define R(V) i8t V;std::cin>>V;
      |                  ^
a.cc:9:25: error: 'cin' is not a member of 'std'
    9 | #define R(V) i8t V;std::cin>>V;
      |                         ^~~
a.cc:16:7: note: in expansion of macro 'R'
   16 |   R(H)R(W)R(h)R(w);
      |       ^
a.cc:9:25: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    9 | #define R(V) i8t V;std::cin>>V;
      |                         ^~~
a.cc:16:7: note: in expansion of macro 'R'
   16 |   R(H)R(W)R(h)R(w);
      |       ^
a.cc:16:9: error: 'W' was not declared in this scope
   16 |   R(H)R(W)R(h)R(w);
      |         ^
a.cc:9:30: note: in definition of macro 'R'
    9 | #define R(V) i8t V;std::cin>>V;
      |                              ^
a.cc:16:13: error: expected ';' before 'h'
   16 |   R(H)R(W)R(h)R(w);
      |             ^
a.cc:9:18: note: in definition of macro 'R'
    9 | #define R(V) i8t V;std::cin>>V;
      |                  ^
a.cc:9:25: error: 'cin' is not a member of 'std'
    9 | #define R(V) i8t V;std::cin>>V;
      |                         ^~~
a.cc:16:11: note: in expansion of macro 'R'
   16 |   R(H)R(W)R(h)R(w);
      |           ^
a.cc:9:25: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    9 | #define R(V) i8t V;std::cin>>V;
      |                         ^~~
a.cc:16:11: note: in expansion of macro 'R'
   16 |   R(H)R(W)R(h)R(w);
      |           ^
a.cc:16:13: error: 'h' was not declared in this scope
   16 |   R(H)R(W)R(h)R(w);
      |             ^
a.cc:9:30: note: in definition of macro 'R'
    9 | #define R(V) i8t V;std::cin>>V;
      |                              ^
a.cc:16:17: error: expected ';' before 'w'
   16 |   R(H)R(W)R(h)R(w);
      |                 ^
a.cc:9:18: note: in definition of macro 'R'
    9 | #define R(V) i8t V;std::cin>>V;
      |                  ^
a.cc:9:25: error: 'cin' is not a member of 'std'
    9 | #define R(V) i8t V;std::cin>>V;
      |                         ^~~
a.cc:16:15: note: in expansion of macro 'R'
   16 |   R(H)R(W)R(h)R(w);
      |               ^
a.cc:9:25: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    9 | #define R(V) i8t V;std::cin>>V;
      |                         ^~~
a.cc:16:15: note: in expansion of macro 'R'
   16 |   R(H)R(W)R(h)R(w);
      |               ^
a.cc:16:17: error: 'w' was not declared in this scope
   16 |   R(H)R(W)R(h)R(w);
      |                 ^
a.cc:9:30: note: in definition of macro 'R'
    9 | #define R(V) i8t V;std::cin>>V;
      |                              ^
a.cc:17:6: error: expected ';' before 'r'
   17 |   i8t r=H*W-(H/h)*(W/w)*(w*h+1);
      |      ^~
      |      ;
a.cc:18:7: error: 'r' was not declared in this scope
   18 |   if (r>0){
      |       ^
a.cc:14:19: error: 'cout' is not a member of 'std'
   14 | #define P(X) std::cout<<(X)<<std::endl;
      |                   ^~~~
a.cc:19:5: note: in expansion of macro 'P'
   19 |     P("Yes");
      |     ^
a.cc:14:19: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   14 | #define P(X) std::cout<<(X)<<std::endl;
      |                   ^~~~
a.cc:19:5: note: in expansion of macro 'P'
   19 |     P("Yes");
      |     ^
a.cc:14:35: error: 'endl' is not a member of 'std'
   14 | #define P(X) std::cout<<(X)<<std::endl;
      |                                   ^~~~
a.cc:19:5: note: in expansion of macro 'P'
   19 |     P("Yes");
      |     ^
a.cc:5:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    4 | #include <string>
  +++ |+#include <ostream>
    5 | using u8t = std::uint64_t;
a.cc:20:7: error: expected ';' before 'I'
   20 |     F(I,H){
      |       ^
a.cc:7:24: note: in definition of macro 'F'
    7 | #define F(I,N) for(i8t I=0,_N=N;I<_N;I++)
      |                        ^
a.cc:20:7: error: 'I' was not declared in this scope
   20 |     F(I,H){
      |       ^
a.cc:7:33: note: in definition of macro 'F'
    7 | #define F(I,N) for(i8t I=0,_N=N;I<_N;I++)
      |                                 ^
a.cc:7:35: error: '_N' was not declared in this scope
    7 | #define F(I,N) for(i8t I=0,_N=N;I<_N;I++)
      |                                   ^~
a.cc:20:5: note: in expansion of macro 'F'
   20 |     F(I,H){
      |     ^
a.cc:22:9: error: expected ';' before 'J'
   22 |       F(J,W){
      |         ^
a.cc:7:24: note: in definition of macro 'F'
    7 | #define F(I,N) for(i8t I=0,_N=N;I<_N;I++)
      |                        ^
a.cc:22:9: error: 'J' was not declared in this scope
   22 |       F(J,W){
      |         ^
a.cc:7:33: note: in definition of macro 'F'
    7 | #define F(I,N) for(i8t I=0,_N=N;I<_N;I++)
      |                                 ^
a.cc:23:44: error: 'cout' is not a member of 'std'
   23 |         if(isfirst)isfirst=false;else std::cout<<" ";
      |                                            ^~~~
a.cc:23:44: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:14: error: 'cout' is not a member of 'std'
   25 |         std::cout<<(a?-(w*h):1);
      |              ^~~~
a.cc:25:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:12: error: 'cout' is not a member of 'std'
   27 |       std::cout<<std::endl;
      |            ^~~~
a.cc:27:12: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:23: error: 'endl' is not a member of 'std'
   27 |       std::cout<<std::endl;
      |                       ^~~~
a.cc:27:23: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:14:19: error: 'cout' is not a member of 'std'
   14 | #define P(X) std::cout<<(X)<<std::endl;
      |                   ^~~~
a.cc:30:5: note: in expansion of macro 'P'
   30 |     P("No");
      |     ^
a.cc:14:19: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   14 | #define P(X) std::cout<<(X)<<std::endl;
      |                   ^~~~
a.cc:30:5: note: in expansion of macro 'P'
   30 |     P("No");
      |     ^
a.cc:14:35: error: 'endl' is not a member of 'std'
   14 | #define P(X) std::cout<<(X)<<std::endl;
      |                                   ^~~~
a.cc:30:5: note: in expansion of macro 'P'
   30 |     P("No");
      |     ^
a.cc:14:35: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
   14 | #define P(X) std::cout<<(X)<<std::endl;
      |                                   ^~~~
a.cc:30:5: note: in expansion of macro 'P'
   30 |     P("No");
      |     ^