| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1304497 | disfyy | Race (IOI11_race) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const ll N = 5e5 + 5;
const ll NN = 5e3 + 5;
const ll INF = 2e18 + 5;
const ll MOD = 1e9 + 7;
const ll P = 53;
const double eps = 1e-9;
ll a[N];
void solve() {
ll n, k;
cin >> n >> k;
ll mx = (n - 1) * (n - 2);
if(k > mx) {
cout << -1;
return;
}
for(int i = 0; i <= n - 2; i++) {
cout << i << " " << i + 1 << '\n';
}
for(int i = 1; i <= n - 1; i++) {
if(k) {
if(k >= n - 2) {
cout << n - 2 << " ";
k -= (n - 2);
} else {
cout << k << " ";
}
} else {
cout << 0 << " ";
}
}
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
int test = 1;
// cin >> test;
for(int i = 1; i <= test; i++) {
solve();
}
return 0;
}
