Man,what can I say
A
C
O
U
T
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int a[n][n],b=1;
for(int i=0;i<n;i++){
if(i%2==0){
for(int j=0;j<n;j++){
a[j][i]=b;
b++;
}
}
else if(i%2!=0){
for(int j=n-1;j>=0;j--){
a[j][i]=b;
b++;
}
}
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cout<<a[i][j]<<" ";
}
cout<<endl;
}
}