이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/*#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... |