Submission #147723

#TimeUsernameProblemLanguageResultExecution timeMemory
147723theboatmanRed-blue table (IZhO19_stones)C++17
0 / 100
28 ms1340 KiB
#include <bits/stdc++.h>

#define y1 theboatman
#define make_struct(args...) {args}

using namespace std;

typedef long long ll;

const long long INF = 1e18 + 10;
const int inf = 1e9 + 10;
const int N = 1e6 + 10;

void solve5(int n, int m) {
    cout << (n - 1) / 2 + m << "\n";

    for(int i = 0; i < (n - 1) / 2; i++) {
        for(int j = 0; j < m; j++) {
            cout << "+";
        }
        cout << "\n";
    }

    for(int i = (n - 1) / 2; i < n; i++) {
        for(int j = 0; j < m; j++) {
            cout << "-";
        }
        cout << "\n";
    }
}

void solve() {
    int n, m;
    cin >> n >> m;

    if (n == m) {
        solve5(n, m);
    }
    else {
        cout << "-1\n";
    }
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);

    int test;
    cin >> test;

    while(test--) {
        solve();
    }

    return 0;
}

/*
*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...