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 <iostream>
#include <cstring>
using namespace std;
void solve(int n, int m)
{
cout << (m + (n-1)/2) << '\n';
for(int i = 0; i < n; ++i)
cout << (i <= n/2 ? string(m, '-') : string(m, '+')) << '\n';
}
void solve2(int n, int m)
{
cout << (n + (m-1)/2) << '\n';
for(int i = 0; i < n; ++i)
cout << string(m/2 + 1, '+') << string((m-1)/2, '-') << '\n';
}
int main()
{
int t, n, m;
cin >> t;
while(t--)
{
cin >> n >> m;
if(n < m) solve(n, m);
else solve2(n, m);
}
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... |