#include <iostream>
#include <vector>
#include <set>
#include<algorithm>
#include<queue>
#include<map>
#include<math.h>
#include<assert.h>
#include<random>
#define ll long long
//#define int ll
#define i32 __int32_t
#define i64 __int64_t
#define i128 __int128_t
#define db double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define bk back()
#define bg begin()
#define ed end()
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
#pragma GCC target("avx,avx2,fma")
using namespace std;
int N, M;
void solve(){
cin>>N;
cout<<"YES\n";
cout<<"1\n";
for(int i=3; i<=N; i++){
cout<<"1 0 ";
for(int j=3; j<i; j++) cout<<"0 ";
cout<<"\n";
}
}
signed main(){
int tc;cin>>tc;while(tc--) solve();
}
| # | 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... |