This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//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 |
---|
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... |