Pagini recente » Cod sursa (job #2317011) | Cod sursa (job #1978501) | Cod sursa (job #1445122) | Cod sursa (job #552905) | Cod sursa (job #2523471)
#include <bits/stdc++.h>
#define ff first
#define ss second
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
const string file = "lacate";
const ll INF = 9223372036854775807ll;
const int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1}, inf = 2147483647;
int n;
vector< vector<int > > v;
int main()
{
ifstream fin (file+".in");
ofstream fout (file+".out");
fin >> n;
v.resize(n, vector<int>(n-1));
int p = 0, last = 1;
for (int i = n-1; i >= 1; --i){
for (int j = 0; j < i; ++j){
v[p][p+j] = last+j;
v[p+j+1][p] = last+j;
}
last = v[p][p+i-1]+1;
++p;
}
fout << v.back().back() << " " << n-1 << "\n";
for (auto x : v){
for (auto y : x)
fout << y << " ";
fout << "\n";
}
return 0;
}