제출 #1141632

#제출 시각아이디문제언어결과실행 시간메모리
1141632AliMark71시간이 돈 (balkan11_timeismoney)C++20
5 / 100
0 ms328 KiB
//
//  main.cpp
//  IntensiveCamp 1 2025
//
//  Created by Ali AlSalman on 24/01/2025.
//

#include <bits/stdc++.h>

template<typename T>
using vec = std::vector<T>;
using namespace std;

void solve() {
    int n, m;
    cin>>n>>m;
    if (m == n - 1) {
        pair<int, int> arr[m];
        int s = 0, t = 0;
        while (m--) {
            int a, b, c, d;
            cin>>a>>b>>c>>d; s += c; t += d;
            arr[m] = {a, b};
        }
        
        cout<<s<<" "<<t<<endl;
        for (auto [a, b] : arr) cout<<a<<" "<<b<<endl;
        exit(0);
    }
}

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    
    
    int t = 1;
//    cin>>t;
    while (t--) solve();
}

#Verdict Execution timeMemoryGrader output
Fetching results...