//The Rumbling starts here:
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include<bits/stdc++.h>
using namespace std;
#define debug(n,m) cout<<"["<<#n<<"]->"<<n<<m
#define int long long
#define all(x) x.begin(),x.end()
#define ai array<int,2>
#define pb push_back
const int N=1e6+5;
const int mod=1e9+9;
const int inf=4e18;
int a[N];
void levi() {
#define tests
int n,m;
cin>>n>>m;
if (n==m) {
cout<<n+(m+1)/2-1<<'\n';
for (int i=1;i<=n;++i) {
for (int j=1;j<=m/2+1;++j) {
cout<<"+";
}
for (int j=m/2+2;j<=m;++j) {
cout<<"-";
}
cout<<'\n';
}
}
}
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int tt=1;
#ifdef tests
cin>>tt;
#endif
while(tt--) levi();
}
/*
*/
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |