Pagini recente » Cod sursa (job #3004736) | Cod sursa (job #2694520) | Cod sursa (job #1524015) | Cod sursa (job #803982) | Cod sursa (job #2655771)
#include <bits/stdc++.h>
#define NMAX 270
using namespace std;
/******************************************************/
/// INPUT / OUTPUT
ifstream f("lacate.in");
ofstream g("lacate.out");
/******************************************************/
/// GLOBAL DECLARATIONS
int n, keyIndex;
vector < int > keys[NMAX];
/******************************************************/
///------------------------------------------------------------------
inline void readInput()
{
f >> n;
}
///------------------------------------------------------------------
inline void Solution()
{
for(int i = 1; i < n ; ++ i)
{
for(int j = i + 1 ; j <= n ; ++j)
{
keyIndex ++;
keys[i].push_back(keyIndex);
keys[j].push_back(keyIndex);
}
}
}
///------------------------------------------------------------------
inline void Output()
{
g << keyIndex << " " << n - 1 << "\n";
for(int i = 1; i <= n ; ++i)
{
for(auto it : keys[i])
{
g << it << " ";
}
g << "\n";
}
}
///------------------------------------------------------------------
int main()
{
readInput();
Solution();
Output();
return 0;
}