Language: C++

>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> mp;
ll inf =  1e9;


int main(){
    ll h,w;
    cin>>h>>w;
    vector<vector<ll> > g(h,vector<ll>(w,0) );
    ll a,b;
    cin>>a>>b;
    ll s = 0;
    priority_queue< mp > q;
    for(ll i=0;i<w;i++){
	q.push( mp(b,i) );
    }
    for(ll i=0;i<h;i++){
	for(ll j=0;j<w-a;j++){
	    mp now = q.top();
	    q.pop();
	    now.first--;
	    g[i][now.second]++;
	    q.push( now );
	}
	s += a;
	s %= w;
    }
/*
    while( !q.empty()  ){
	mp i = q.top();
	q.pop();
	if( i.first == 0   ){

	}else{
	    cout<<"No"<<endl;
	    return 0;
	}
    }
    */
    for(ll i=0;i<h;i++){
	for(ll j=0;j<w;j++){
	    if( g[i][j] > 1 ){
		cout<<"No"<<endl;
		return 0;
	    }
	}
    }


    for(ll i=0;i<w;i++){
	ll cnt = 0;
	for(ll j=0;j<h;j++)cnt += g[j][i];
	if( cnt == b || h-cnt == b ){

	}else{
	    cout<<"No"<<endl;
	    return 0;
	}
    }
    for(ll i=0;i<h;i++){
	cout<<g[i][0];
	for(ll j=1;j<w;j++){
	    cout<<' '<<g[i][j];
	}
	cout<<endl;
    }


    return 0;
}


Compiler output:
a.cc:1:1: error: expected unqualified-id before '>' token
    1 | >
      | ^
a.cc:4:9: error: 'pair' does not name a type
    4 | typedef pair<ll,ll> mp;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:10:5: error: 'cin' was not declared in this scope
   10 |     cin>>h>>w;
      |     ^~~
a.cc:11:5: error: 'vector' was not declared in this scope
   11 |     vector<vector<ll> > g(h,vector<ll>(w,0) );
      |     ^~~~~~
a.cc:11:21: error: expected primary-expression before '>' token
   11 |     vector<vector<ll> > g(h,vector<ll>(w,0) );
      |                     ^
a.cc:11:23: error: expected primary-expression before '>' token
   11 |     vector<vector<ll> > g(h,vector<ll>(w,0) );
      |                       ^
a.cc:11:38: error: expected primary-expression before '>' token
   11 |     vector<vector<ll> > g(h,vector<ll>(w,0) );
      |                                      ^
a.cc:11:25: error: 'g' was not declared in this scope
   11 |     vector<vector<ll> > g(h,vector<ll>(w,0) );
      |                         ^
a.cc:15:5: error: 'priority_queue' was not declared in this scope
   15 |     priority_queue< mp > q;
      |     ^~~~~~~~~~~~~~
a.cc:15:21: error: 'mp' was not declared in this scope
   15 |     priority_queue< mp > q;
      |                     ^~
a.cc:15:26: error: 'q' was not declared in this scope
   15 |     priority_queue< mp > q;
      |                          ^
a.cc:21:15: error: expected ';' before 'now'
   21 |             mp now = q.top();
      |               ^~~~
      |               ;
a.cc:23:13: error: 'now' was not declared in this scope
   23 |             now.first--;
      |             ^~~
a.cc:45:17: error: 'cout' was not declared in this scope
   45 |                 cout<<"No"<<endl;
      |                 ^~~~
a.cc:45:29: error: 'endl' was not declared in this scope
   45 |                 cout<<"No"<<endl;
      |                             ^~~~
a.cc:58:13: error: 'cout' was not declared in this scope
   58 |             cout<<"No"<<endl;
      |             ^~~~
a.cc:58:25: error: 'endl' was not declared in this scope
   58 |             cout<<"No"<<endl;
      |                         ^~~~
a.cc:63:9: error: 'cout' was not declared in this scope
   63 |         cout<<g[i][0];
      |         ^~~~
a.cc:67:15: error: 'endl' was not declared in this scope
   67 |         cout<<endl;
      |               ^~~~