Submission #991638

#TimeUsernameProblemLanguageResultExecution timeMemory
991638AbitoGardening (RMI21_gardening)C++17
5 / 100
4 ms688 KiB
#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; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...