#include <iostream>
#include <iomanip>
#include <fstream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <cmath>
#include <list>
#include <set>
#include <map>
#define all(x) x.begin(),x.end()
#define al(a,n) (a,a+n)
#define se second
#define fr first
#define m_p make_pair
using namespace std;
typedef long long ll;
const ll N = 2000004;
const ll mod = 1000 * 1000 * 100 + 7;
const ll inf = INT_MAX;
ll n, m, k, z, t, x, y,a[1006][1006], ans;
int main()
{
cin >> t;
while (t--)
{
cin >> x >> y;
if (x < y)
{
cout << y + (x - 1) / 2 << endl;
for (int i = 0; i < x; ++i)
{
for (int j = 0; j < y; ++j)
{
if (i < (x-1)/2 && j < y / 2 + 1)
{
a[i][j] = 1;
}
else
a[i][j] = 2;
}
}
}
else
{
cout << x + (y - 1) / 2 << endl;
for (int j = 0; j < y; ++j)
{
for (int i = 0; i < x; ++i)
{
if (j < (y - 1) / 2 && i < x / 2 + 1)
{
a[i][j] = 2;
}
else
a[i][j] = 1;
}
}
}
for (int i = 0; i < x; ++i)
{
for (int j = 0; j < y; ++j)
if (a[i][j] == 1)
cout << '+';
else
cout << '-';
cout << endl;
}
}
return 0;
}
Compilation message
stones.cpp:24:16: error: 'INT_MAX' was not declared in this scope
24 | const ll inf = INT_MAX;
| ^~~~~~~
stones.cpp:15:1: note: 'INT_MAX' is defined in header '<climits>'; did you forget to '#include <climits>'?
14 | #include <map>
+++ |+#include <climits>
15 | #define all(x) x.begin(),x.end()