Cod sursa(job #1703375)
Utilizator | Iordache Ioan-Bogdan iordache.bogdan | Data | 16 mai 2016 20:59:19 |
---|---|---|---|
Problema | Tije | Scor | 85 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include <fstream>
#include <vector>
#include <cstring>
#include <algorithm>
using namespace std;
ifstream fin("tije.in");
ofstream fout("tije.out");
int main() {
int n;
fin >> n;
for (int step = n - 1; step; --step) {
for (int i = 1; i <= step; ++i)
fout << 1 << ' ' << n + 1 << '\n';
for (int i = 2; i <= n + 1; ++i)
for (int j = 1; j <= step; ++j)
fout << i << ' ' << i - 1 << '\n';
}
return 0;
}
//Trust me, I'm the Doctor!