Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define _test int _TEST; cin>>_TEST; while(_TEST--)
- #define ff first
- #define ss second
- #define pb push_back
- int main()
- {
- _test
- {
- int n;
- cin>>n;
- int ans=0;
- for(int i=1;i<=n;i++) ans+=1ll*i*(2*i-1);
- cout<<ans<<" "<<n*2<<"\n";
- for(int i=n;i;i--){
- cout<<1<<" "<<i<<" ";
- for(int j=1;j<=n;j++) cout<<j<<" ";
- cout<<"\n";
- cout<<2<<" "<<i<<" ";
- for(int j=1;j<=n;j++) cout<<j<<" ";
- cout<<"\n";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement