#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!=2 && k!=4) 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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
688 KB |
Correct! Azusa and Laika like the garden :) |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
688 KB |
Correct! Azusa and Laika like the garden :) |
2 |
Failed |
1 ms |
348 KB |
Incorrect output |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
688 KB |
Correct! Azusa and Laika like the garden :) |
2 |
Failed |
1 ms |
348 KB |
Incorrect output |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Failed |
1 ms |
344 KB |
Incorrect output |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Failed |
0 ms |
348 KB |
Incorrect output |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
688 KB |
Correct! Azusa and Laika like the garden :) |
2 |
Failed |
1 ms |
348 KB |
Incorrect output |
3 |
Halted |
0 ms |
0 KB |
- |