Language: C++

#include <iostream>
#include <vector>
#include <limits>
#include <boost/range/irange.hpp>
#include <boost/range/adaptors.hpp>

using namespace std;
using namespace boost;
using uint = unsigned int;
using ll = long long int;
using ull = unsigned long long int;


enum Symbol {
    uncovered, horz_left, horz_right, vert_up, vert_down
};

void printer(const ull N, const ull M, const vector<vector<Symbol>> &map) {
    for (auto &&vert: irange(0U, N)) {
        for (auto &&horz: irange(0U, M)) {
            char c{};
            switch (map.at(vert).at(horz)) {
                case uncovered:
                    c = '.';
                    break;
                case horz_left:
                    c = '<';
                    break;
                case horz_right:
                    c = '>';
                    break;
                case vert_up:
                    c = '^';
                    break;
                case vert_down:
                    c = 'v';
                    break;
            }
            cout << c;
        }
        cout << endl;
    }
}


int main() {
    uint N, M, A, B;
    cin >> N >> M >> A >> B;
    uint square_vert = N / 2; // number of tiles / 2
    uint square_horz = M / 2; // number of tiles / 2
    ull squares_map = ((ull)square_vert) * ((ull)square_horz); // number of panel consumed in square manner
    auto is_remaining_horz = (bool) (N % 2);
    auto is_remaining_vert = (bool) (M % 2);
    uint remaining_horz = is_remaining_horz ? (M / 2) : 0;
    uint remaining_vert = is_remaining_vert ? (N / 2) : 0;
    uint horz_for_square = A - remaining_horz;
    uint vert_for_square = B - remaining_vert;
    uint horz_square = (horz_for_square + 1) / 2;
    uint vert_square = (vert_for_square + 1) / 2;
    uint squares_panel = horz_square + vert_square;
    if ((ull)squares_panel > squares_map) {
        cout << "NO" << endl;
    } else {
        cout << "YES" << endl;
        vector<vector<Symbol>> map(N, vector<Symbol>(M, uncovered));
        uint horz_pos{0};
        uint vert_pos{0};
        for (auto &&i: irange(0U, squares_panel)) {
            if (horz_pos + 2 > M) {
                horz_pos = 0;
                vert_pos += 2;
            }
            if (horz_square) {
                if (horz_for_square >= 2) {
                    map.at(vert_pos).at(horz_pos) = horz_left;
                    map.at(vert_pos).at(horz_pos + 1) = horz_right;
                    map.at(vert_pos + 1).at(horz_pos) = horz_left;
                    map.at(vert_pos + 1).at(horz_pos + 1) = horz_right;
                    horz_square--;
                    horz_for_square -= 2;
                } else {
                    map.at(vert_pos).at(horz_pos) = horz_left;
                    map.at(vert_pos).at(horz_pos + 1) = horz_right;
                    horz_square--;
                    horz_for_square -= 1;
                }
            } else {
                if (vert_for_square >= 2) {
                    map.at(vert_pos).at(horz_pos) = vert_up;
                    map.at(vert_pos + 1).at(horz_pos) = vert_down;
                    map.at(vert_pos).at(horz_pos + 1) = vert_up;
                    map.at(vert_pos + 1).at(horz_pos + 1) = vert_down;
                    vert_square--;
                    vert_for_square -= 2;
                } else {
                    map.at(vert_pos).at(horz_pos) = vert_up;
                    map.at(vert_pos + 1).at(horz_pos) = vert_down;
                    vert_square--;
                    vert_for_square -= 1;
                }
            }
            horz_pos += 2;
        }
        for (auto &&i: irange(0U, remaining_horz)) {
            map.at(N - 1).at(i * 2) = horz_left;
            map.at(N - 1).at(i * 2 + 1) = horz_right;
        }
        for (auto &&i: irange(0U, remaining_vert)) {
            map.at(i * 2).at(M - 1) = vert_up;
            map.at(i * 2 + 1).at(M - 1) = vert_down;
        }

        printer(N, M, map);
    }
    return 0;
}

Compiler output:
a.cc:4:10: fatal error: boost/range/irange.hpp: No such file or directory
    4 | #include <boost/range/irange.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.