Pagini recente » Cod sursa (job #3273991) | Cod sursa (job #2920230) | Cod sursa (job #3161814) | Cod sursa (job #1093429) | Cod sursa (job #2922544)
#include <bits/stdc++.h>
#define int long long
#define FILES freopen("lacate.in","r",stdin);\
freopen("lacate.out","w",stdout);
using namespace std;
int n;
signed main()
{
FILES
cin >> n;
cout << n * (n - 1) / 2 << ' ' << n - 1 << '\n';
int x = 1;
for(int i = 1;i <= n; ++i)
{
for(int j = 1;j < n; ++j)
{
cout << x << ' ';
x++;
if(x > n * (n - 1) / 2)
x -= n * (n - 1) / 2;
}
cout << '\n';
}
}