This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("avx2")*/
#define ll int64_t
#include<bits/stdc++.h>
using namespace std;
const ll MAXN=2e5+3;
ll n,m,k;
void solve(){
cin>>n>>m>>k;
if(k==1){
if(n==2 && m==2) cout<<"YES\n1 1\n1 1\n";
else cout<<"NO\n";
}
else if(k==2){
if(n==2 && m==4){
cout<<"YES\n";
cout<<"1 1 2 2\n";
cout<<"1 1 2 2\n";
}
else if(m==2 && n==4){
cout<<"YES\n";
cout<<"1 1\n";
cout<<"1 1\n";
cout<<"2 2\n";
cout<<"2 2\n";
}
else if(n==4 && m==4){
cout<<"YES\n";
cout<<"1 1 1 1\n";
cout<<"1 2 2 1\n";
cout<<"1 2 2 1\n";
cout<<"1 1 1 1\n";
}
else cout<<"NO\n";
}
else if(k==3){
cout<<"NO\n";
}
else if(k==4){
if(n==4 && m==4){
cout<<"YES\n";
cout<<"1 1 2 2\n";
cout<<"1 1 2 2\n";
cout<<"3 3 4 4\n";
cout<<"3 3 4 4\n";
}
else cout<<"NO\n";
}
else cout<<"NO\n";
}
int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL);
ll t=1;
cin>>t;
while(t--) solve();
return 0;
}
/*
4
2 2 2
2 2 1
4 4 4
4 4 2
*/
# | 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... |