//
// Created by liasa on 11/11/2025.
//
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
const ll mod = 1e9 + 7;
#define tpl tuple<ll, ll, ll, ll, ll>
int main() {
ll n;
cin >> n;
vector<tpl> v(n);
for (ll i = 0; i < n; ++i) {
ll x, y, x1, y1;
cin >> x >> y >> x1 >> y1;
if (y > y1)
swap(y, y1);
v[i] = {x, x1, y1, y, i};
}
sort(v.begin(), v.end());
vector<tpl> ans;
for (ll i = 1; i < n; ++i) {
auto [x, x1, y1, y, j] = v[i - 1];
auto [x2, x3, y3, y2, j1] = v[i];
ans.push_back({x, y1, x2, y3, 0});
}
for (auto [a, b, c, d, t] : ans) {
cout << a << " " << b << " " << c << " " << d << "\n";
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |