This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
while (t--) {
int n, m;
cin >> n >> m;
int ans = 0, lines = 0;
for (int i = 0; i <= n; ++i) {
int cur = i + (m % 2 ? m / 2 : m / 2 - 1);
if (n - i > i) {
cur = i + m;
}
if (cur > ans) {
ans = cur;
lines = i;
}
}
cout << ans << "\n";
for (int i = 1; i <= n; ++i) {
if (i <= lines) {
for (int j = 1; j <= m; ++j) {
if (j <= m / 2 + 1) {
cout << "+";
} else {
cout << "-";
}
}
cout << "\n";
} else {
for (int j = 1; j <= m; ++j) {
cout << "-";
}
cout << "\n";
}
}
}
return 0;
}
# | 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... |