//Euzubillahimines-seytanir-rajim Bismillahir-rahmanir-rahym
/*
ID:
TASK:
LANG: C++
*/
#include <iostream>
#include <vector>
#include <map>
#include <stack>
#include <string>
#include <algorithm>
#include <cmath>
#include <queue>
#define pb push_back
#define ll long long
#define ff first
#define ss second
#define mp make_pair
#define PII pair<int,int>
#define inf 1000000001
using namespace std;
int t;
int main(){
cin>>t;
while(t--){
int n, m;
cin>>n>>m;
if( n == 1 && m == 1 ) cout<<"1\n+\n";
else if( n == 1 && m == 2 ) cout<<"2\n--\n";
else if( n == 1 && m == 3 ) cout<<"3\n---\n";
else if( n == 1 && m == 4 ) cout<<"4\n----\n";
else if( n == 2 && m == 1 ) cout<<"2\n+\n+\n";
else if( n == 2 && m == 2 ) cout<<"2\n++\n++\n";
else if( n == 2 && m == 3 ) cout<<"3\n---\n---\n";
else if( n == 2 && m == 4 ) cout<<"4\n----\n----";
else if( n == 3 && m == 1 ) cout<<"3\n+\n+\n+\n";
else if( n == 3 && m == 2 ) cout<<"3\n++\n++\n++\n";
else if( n == 3 && m == 3 ) cout<<"4\n++-\n++-\n+++\n";
else if( n == 3 && m == 4 ) cout<<"5\n---+\n----\n+++-\n";
else if( n == 4 && m == 1 ) cout<<"4\n+\n+\n+\n+\n";
else if( n == 4 && m == 2 ) cout<<"4\n++\n++\n++\n++\n";
else if( n == 4 && m == 3 ) cout<<"5\n++-\n++-\n++-\n++-\n";
else if( n == 4 && m == 4 ) cout<<"5\n----\n----\n----\n++++\n";
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Incorrect |
2 ms |
256 KB |
Wrong answer |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Wrong answer |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Incorrect |
2 ms |
256 KB |
Wrong answer |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Wrong answer |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Wrong answer |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Incorrect |
2 ms |
256 KB |
Wrong answer |