Language: C++

#include <bits/stdc++.h>
#define rep(i, x, y) for(int i = x; i <= y; i ++)
#define rrep(i, x, y) for(int i = x; i >= y; i --)
#define ll long long
#define X first
#define Y second
#define pb push_back
#define mp make_pair
#define pii pair<ll, ll>
#define ls rt << 1
#define rs rt << 1 | 1
#define sz(x) (int)(x).size()
#define ALL(x) (x).insgin(), (x).end()
#define vi vector<int>
#define EPS 1e-8
using namespace std;
inline int read()
{
	int x = 0, f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); }
	return x * f;
}
inline ll read1()
{
	ll x = 0, f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); }
	return x * f;
}
char mp[1001][1001];
int n,m,a,b;
int main()
{
	cin >> n >> m >> a >> b;
	int m2 = m / 2;
	int A = a / m2, B = a % m2;
	if(A > n || A == n && B > 0)
	{
		puts("NO");
		return 0;
	}
	rep(i, 1, A - 1)
		for(int j = 1; j < m2 * 2; j += 2)
		{
			mp[i][j]='<';
			mp[i][j+1]='>';
		}
	if(n - A & 1)
	{
		if(A > 0)
		{
			int m22 = (m2 - B) / 2;
			rep(i, 1, B + m22) mp[A][i * 2 - 1] = '<', mp[A][i * 2] = '>';
			rep(i, 1, B + m22) mp[A + 1][i * 2 - 1] = '<', mp[A + 1][i * 2] = '>';
			if(m2 - B & 1)mp[n][m - 1] = '<', mp[n][m] = '>';
		}
	}
	else if(B)
	{
		int m22 = B / 2;
		rep(i, 1, m2) mp[A][i * 2 - 1] = '<', mp[A][i * 2] = '>';
		rep(i, 1, m22) mp[A + 1][i * 2 - 1] = '<', mp[A + 1][i * 2] = '>';
		for(int i=1;i<=m22;++i)mp[A+2][i*2-1]='<',mp[A+2][i*2]='>';
		if(B&1)mp[n][m-1]='<',mp[n][m]='>';
	}
	for(int i = 1; i < n && b > 0; i ++)
		for(int j = 1; j <= m && b > 0; j ++)
			if(!mp[i][j] && !mp[i + 1][j])
			{
				mp[i][j] = '^';
				mp[i + 1][j] = 'v'
				; b--;
			}
	if(b)
	{
		puts("NO");
		return 0;
	}
	puts("YES");
	rep(i, 1, n)
	{
		rep(j, 1, m)
			if(mp[i][j])putchar(mp[i][j]);
			else putchar('.');
		puts("");
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: reference to 'make_pair' is ambiguous
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:46:25: note: in expansion of macro 'mp'
   46 |                         mp[i][j]='<';
      |                         ^~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: candidates are: 'template<class _T1, class _T2> constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&)'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
a.cc:8:12: note:                 'char make_pair [1001][1001]'
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:31:6: note: in expansion of macro 'mp'
   31 | char mp[1001][1001];
      |      ^~
a.cc:8:12: error: reference to 'make_pair' is ambiguous
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:47:25: note: in expansion of macro 'mp'
   47 |                         mp[i][j+1]='>';
      |                         ^~
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: candidates are: 'template<class _T1, class _T2> constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&)'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
a.cc:8:12: note:                 'char make_pair [1001][1001]'
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:31:6: note: in expansion of macro 'mp'
   31 | char mp[1001][1001];
      |      ^~
a.cc:8:12: error: reference to 'make_pair' is ambiguous
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:54:44: note: in expansion of macro 'mp'
   54 |                         rep(i, 1, B + m22) mp[A][i * 2 - 1] = '<', mp[A][i * 2] = '>';
      |                                            ^~
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: candidates are: 'template<class _T1, class _T2> constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&)'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
a.cc:8:12: note:                 'char make_pair [1001][1001]'
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:31:6: note: in expansion of macro 'mp'
   31 | char mp[1001][1001];
      |      ^~
a.cc:8:12: error: reference to 'make_pair' is ambiguous
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:54:68: note: in expansion of macro 'mp'
   54 |                         rep(i, 1, B + m22) mp[A][i * 2 - 1] = '<', mp[A][i * 2] = '>';
      |                                                                    ^~
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: candidates are: 'template<class _T1, class _T2> constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&)'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
a.cc:8:12: note:                 'char make_pair [1001][1001]'
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:31:6: note: in expansion of macro 'mp'
   31 | char mp[1001][1001];
      |      ^~
a.cc:8:12: error: reference to 'make_pair' is ambiguous
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:55:44: note: in expansion of macro 'mp'
   55 |                         rep(i, 1, B + m22) mp[A + 1][i * 2 - 1] = '<', mp[A + 1][i * 2] = '>';
      |                                            ^~
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: candidates are: 'template<class _T1, class _T2> constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&)'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
a.cc:8:12: note:                 'char make_pair [1001][1001]'
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:31:6: note: in expansion of macro 'mp'
   31 | char mp[1001][1001];
      |      ^~
a.cc:8:12: error: reference to 'make_pair' is ambiguous
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:55:72: note: in expansion of macro 'mp'
   55 |                         rep(i, 1, B + m22) mp[A + 1][i * 2 - 1] = '<', mp[A + 1][i * 2] = '>';
      |                                                                        ^~
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: candidates are: 'template<class _T1, class _T2> constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&)'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
a.cc:8:12: note:                 'char make_pair [1001][1001]'
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:31:6: note: in expansion of macro 'mp'
   31 | char mp[1001][1001];
      |      ^~
a.cc:8:12: error: reference to 'make_pair' is ambiguous
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:56:39: note: in expansion of macro 'mp'
   56 |                         if(m2 - B & 1)mp[n][m - 1] = '<', mp[n][m] = '>';
      |                                       ^~
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: candidates are: 'template<class _T1, class _T2> constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&)'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
a.cc:8:12: note:                 'char make_pair [1001][1001]'
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:31:6: note: in expansion of macro 'mp'
   31 | char mp[1001][1001];
      |      ^~
a.cc:8:12: error: reference to 'make_pair' is ambiguous
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:56:59: note: in expansion of macro 'mp'
   56 |                         if(m2 - B & 1)mp[n][m - 1] = '<', mp[n][m] = '>';
      |                                                           ^~
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: candidates are: 'template<class _T1, class _T2> constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&)'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
a.cc:8:12: note:                 'char make_pair [1001][1001]'
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:31:6: note: in expansion of macro 'mp'
   31 | char mp[1001][1001];
      |      ^~
a.cc:8:12: error: reference to 'make_pair' is ambiguous
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:62:31: note: in expansion of macro 'mp'
   62 |                 rep(i, 1, m2) mp[A][i * 2 - 1] = '<', mp[A][i * 2] = '>';
      |                               ^~
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: candidates are: 'template<class _T1, class _T2> constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&)'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
a.cc:8:12: note:                 'char make_pair [1001][1001]'
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:31:6: note: in expansion of macro 'mp'
   31 | char mp[1001][1001];
      |      ^~
a.cc:8:12: error: reference to 'make_pair' is ambiguous
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:62:55: note: in expansion of macro 'mp'
   62 |                 rep(i, 1, m2) mp[A][i * 2 - 1] = '<', mp[A][i * 2] = '>';
      |                                                       ^~
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: candidates are: 'template<class _T1, class _T2> constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&)'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
a.cc:8:12: note:                 'char make_pair [1001][1001]'
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:31:6: note: in expansion of macro 'mp'
   31 | char mp[1001][1001];
      |      ^~
a.cc:8:12: error: reference to 'make_pair' is ambiguous
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:63:32: note: in expansion of macro 'mp'
   63 |                 rep(i, 1, m22) mp[A + 1][i * 2 - 1] = '<', mp[A + 1][i * 2] = '>';
      |                                ^~
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: candidates are: 'template<class _T1, class _T2> constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&)'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
a.cc:8:12: note:                 'char make_pair [1001][1001]'
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:31:6: note: in expansion of macro 'mp'
   31 | char mp[1001][1001];
      |      ^~
a.cc:8:12: error: reference to 'make_pair' is ambiguous
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:63:60: note: in expansion of macro 'mp'
   63 |                 rep(i, 1, m22) mp[A + 1][i * 2 - 1] = '<', mp[A + 1][i * 2] = '>';
      |