Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
#define INF 1<<30
#define LINF 1ll<<60ll
#define MOD 1000000007
#define pb(a) push_back(a)
#define _overload3(_1,_2,_3,_4,name,...) name
#define _rep(i,n) _repi(i,0,n)
#define _repi(i,a,b) for(int i=a, i##_len=(b); i<i##_len; ++i)
#define _repis(i,a,b,s) for(int i=a, i##_len(b); i<i##_len; i+=s)
#define REP(...) _overload3(__VA_ARGS__,_repis,_repi,_rep,)(__VA_ARGS__)
#define REPR(i, n) for(int i = n;i >= 0;--i)
#define REPARR(i, v) for(int i = 0;i < sz(v);++i)
#define all(vec) (vec.begin()),(vec.end())
#define sz(x) ((int)(x).size())
#define bit(n) (1ll<<(n))
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define yes(n) cout<<((n)?"yes":"no")<<endl
#define poss(n) cout<<((n)?"possible":"impossible")<<endl
#define Poss(n) cout<<((n)?"Possible":"Impossible")<<endl
#define POSS(n) cout<<((n)?"POSSIBLE":"IMPOSSIBLE")<<endl

struct move{
    int x1,y1,x2,y2;
}

int main(){
    int h,w;
    cin>>h>>w;
    vector<vector<bool>> a(h,vector<bool>(w));
    REP(i,h) REP(j,w){
        int A;
        cin>>A;
        a[i][j]=A%2;
    }
    vector<move> moves;
    cout<<h*w-1<<endl;
    REP(i,h){
        if(i==h-1){
            REP(j,w){
                if(j!=w-1){
                    if(a[i][j]){
                        moves.pb({j,i,j+1,i});
                        a[i][j]=false;
                        a[i][j+1]=!a[i][j+1];
                    }
                }
            }
        }else{
            REP(j,w){
                if(a[i][j]){
                    moves.pb({j,i,j,i+1});
                    a[i][j]=false;
                    a[i+1][j]=!a[i+1][j];
                }
            }
        }
    }
    cout<<sz(moves)<<endl;
    REPARR(i,moves){
        move x=moves[i];
        cout<<x.y1<<" "<<x.x1<<" "<<x.y2<<" "<<x.x2<<endl;
    }
    return 0;
}

Compiler output:
a.cc:53:45: error: macro "pb" passed 4 arguments, but takes just 1
   53 |                         moves.pb({j,i,j+1,i});
      |                                             ^
a.cc:13:9: note: macro "pb" defined here
   13 | #define pb(a) push_back(a)
      |         ^~
a.cc:62:41: error: macro "pb" passed 4 arguments, but takes just 1
   62 |                     moves.pb({j,i,j,i+1});
      |                                         ^
a.cc:13:9: note: macro "pb" defined here
   13 | #define pb(a) push_back(a)
      |         ^~
a.cc:35:2: error: expected ';' after struct definition
   35 | }
      |  ^
      |  ;
a.cc: In function 'int main()':
a.cc:46:16: error: template argument 1 is invalid
   46 |     vector<move> moves;
      |                ^
a.cc:46:16: error: template argument 2 is invalid
a.cc:53:31: error: request for member 'pb' in 'moves', which is of non-class type 'int'
   53 |                         moves.pb({j,i,j+1,i});
      |                               ^~
a.cc:62:27: error: request for member 'pb' in 'moves', which is of non-class type 'int'
   62 |                     moves.pb({j,i,j,i+1});
      |                           ^~
a.cc:22:25: error: request for member 'size' in 'moves', which is of non-class type 'int'
   22 | #define sz(x) ((int)(x).size())
      |                         ^~~~
a.cc:69:11: note: in expansion of macro 'sz'
   69 |     cout<<sz(moves)<<endl;
      |           ^~
a.cc:22:25: error: request for member 'size' in 'moves', which is of non-class type 'int'
   22 | #define sz(x) ((int)(x).size())
      |                         ^~~~
a.cc:20:40: note: in expansion of macro 'sz'
   20 | #define REPARR(i, v) for(int i = 0;i < sz(v);++i)
      |                                        ^~
a.cc:70:5: note: in expansion of macro 'REPARR'
   70 |     REPARR(i,moves){
      |     ^~~~~~
a.cc:71:9: error: reference to 'move' is ambiguous
   71 |         move x=moves[i];
      |         ^~~~
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:353:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::move(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2)'
  353 | move(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __d_first);
      | ^~~~
In file included from /usr/include/c++/14/algorithm:60:
/usr/include/c++/14/bits/stl_algobase.h:675:5: note:                 'template<class _II, class _OI> _OI std::move(_II, _II, _OI)'
  675 |     move(_II __first, _II __last, _OI __result)
      |     ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:61,
                 from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/bits/move.h:137:5: note:                 'template<class _Tp> constexpr typename std::remove_reference<_Tp>::type&& std::move(_Tp&&)'
  137 |     move(_Tp&& __t) noexcept
      |     ^~~~
a.cc:33:8: note:                 'struct move'
   33 | struct move{
      |        ^~~~
a.cc:72:15: error: 'x' was not declared in this scope
   72 |         cout<<x.y1<<" "<<x.x1<<" "<<x.y2<<" "<<x.x2<<endl;
      |               ^