Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define INF 10000000000
using namespace std;
using ll = long long;
int main()
{
    int a, b;
    cin >> a >> b;
    vector<string> v[4];
    if(a == 1 && b==1){
        cout << 1 << " " << 2 << endl;
        cout << "#." << endl;
        return 0;
    }else if (a==1){
        string s = "#.";
        string t = s;
        rep(i,b){
            s += t;
        }
        v[0].push_back(s);
        s = "..";
        t = s;
        rep(i,b){
            s += t;
        }
        v[1].push_back(s);
        rep(i,2){
            rep(j, v[0].size()){
                cout << v[i][j];
            }
            cout << endl;
        }
    }else if(b==1){
        string s = "#.";
        string t = s;
        rep(i, a)
        {
            s += t;
        }
        v[0].push_back(s);
        s = "##";
        t = s;
        rep(i, a)
        {
            s += t;
        }
        v[1].push_back(s);
        cout << 2 << " " << v[0].size() << endl;
        rep(i,2){
            rep(j,v[0].size()){
                cout << v[i][j];
            }
            cout << endl;
        }
        return 0;
    }else{
        string s = "#.";
        string k = "..";
        string t = s;
        rep(i, b-1)
        {
            s += t;
        }
        rep(i,(a-1)-(b-1)){
            s += k;
        }
        v[0].push_back(s);
        s = "..";
        t = s;
        rep(i, b-1)
        {
            s += t;
        }
        rep(i, (a - 1) - (b - 1))
        {
            s += k;
        }
        v[1].push_back(s);
        s = "##";
        k = "##";
        t = s;
        rep(i, a-1)
        {
            s += t;
        }
        rep(i, (b - 1) - (a - 1))
        {
            s += k;
        }
        v[2].push_back(s);
        string s = "#.";
        string t = s;
        rep(i, a - 1)
        {
            s += t;
        }
        rep(i, (b - 1) - (a - 1))
        {
            s += k;
        }
        v[3].push_back(s);
        cout << 4 << " " << v[0].size() << endl;
        rep(i,4){
            rep(j,v[0].size){
                cout << v[i][j];
            }
            cout << endl;
        }
        return 0;
    }   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:92:16: error: redeclaration of 'std::string s'
   92 |         string s = "#.";
      |                ^
a.cc:58:16: note: 'std::string s' previously declared here
   58 |         string s = "#.";
      |                ^
a.cc:93:16: error: redeclaration of 'std::string t'
   93 |         string t = s;
      |                ^
a.cc:60:16: note: 'std::string t' previously declared here
   60 |         string t = s;
      |                ^
a.cc:105:24: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; size_type = long unsigned int]' (did you forget the '()' ?)
  105 |             rep(j,v[0].size){
      |                   ~~~~~^~~~
a.cc:2:39: note: in definition of macro 'rep'
    2 | #define rep(i, n) for (int i = 0; i < n; i++)
      |                                       ^