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>
#define F first
#define S second
#define pb push_back
#define ppb pop_back
#define ep insert
#define endl '\n'
#define elif else if
#define pow pwr
#define sqrt sqrtt
#define int long long
#define y1 YONE
typedef unsigned long long ull;
using namespace std;
int32_t main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int t;cin>>t;
while (t--){
int n,m,k;
cin>>n>>m>>k;
if ((n&1)||(m&1)){
cout<<"NO"<<endl;
continue;
}
if (n==2 && m==2){
if (k==1){
cout<<"YES\n1 1\n1 1"<<endl;
continue;
}
cout<<"NO"<<endl;
continue;
}
if (n==2 && m==4){
if (k==2) cout<<"YES\n1 1 2 2\n1 1 2 2\n";
else cout<<"NO\n";
continue;
}
if (n==4 && m==2){
if (k==2) cout<<"YES\n1 1\n1 1\n2 2\n2 2\n";
else cout<<"NO\n";
continue;
}
if (k&1) cout<<"NO"<<endl;
elif (k==2){
cout<<"YES\n1 1 1 1\n1 2 2 1\n1 2 2 1\n1 1 1 1\n";
}
elif (k==4){
cout<<"YES\n1 1 2 2\n1 1 2 2\n3 3 4 4\n3 3 4 4\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... |