#include <iostream>
int main() {
int nrt, sizx, sizy;
int sizx1, sizx2, sizy1, sizy2;
std::cin >> nrt;
while (nrt--) {
std::cin >> sizx >> sizy;
if (sizx <= sizy && sizx < 3) {
std::cout << sizy << '\n';
for (int index = 0; index < sizx; index++) {
for (int index2 = 0; index2 < sizy; index2++) {
std::cout << '+';
}
std::cout << '\n';
}
}
else if (sizy < 3) {
std::cout << sizx << '\n';
for (int index = 0; index < sizx; index++) {
for (int index2 = 0; index2 < sizy; index2++) {
std::cout << '-';
}
std::cout << '\n';
}
}
else {
sizx1 = (sizx - 1) >> 1;
sizx2 = (sizx >> 1) + 1;
sizy1 = (sizy - 1) >> 1;
sizy2 = (sizy >> 1) + 1;
std::cout << sizx + sizy + sizx1 + sizy1 - sizx2 - sizy2 << '\n';
for (int index = 0; index < sizx1; index++) {
for (int index2 = 0; index2 < sizy1; index2++) {
std::cout << '-';
}
for (int index2 = sizy1; index2 < sizy; index2++) {
std::cout << '+';
}
std::cout << '\n';
}
for (int index = sizx1; index < sizx2; index++) {
for (int index2 = 0; index2 < sizy; index2++) {
std::cout << '-';
}
std::cout << '\n';
}
for (int index = sizx2; index < sizx; index++) {
for (int index2 = 0; index2 < sizy2; index2++) {
std::cout << '+';
}
for (int index2 = sizy2; index2 < sizy; index2++) {
std::cout << '-';
}
std::cout << '\n';
}
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
288 KB |
in the table A+B is not equal to 3 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
292 KB |
in the table A+B is not equal to 2 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
288 KB |
in the table A+B is not equal to 3 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
31 ms |
1300 KB |
in the table A+B is not equal to 77 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
29 ms |
1168 KB |
Wrong answer in test 4 4: 4 < 5 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
288 KB |
in the table A+B is not equal to 3 |
2 |
Halted |
0 ms |
0 KB |
- |