Submission #1

user on 1. 格式測試 ·
Verdict

Compile ErrorCE

Score

0

Total time

0 ms

Peak memory

0 KB

Language

Clang C++17

#include <iostream>
#include <cstdlib>
using ll = long long;
using namespace std;

int main() {
    ios::sync_with_stdio(0), cin.tie(0);

    ll a, b; cin >> a;
    while (cin >> a >> b) {
        ll g = __gcd(a, b);
        cout << llabs(g) << ' ' << (g ? llabs(a/g*b) : 0) << " \n";
    }
}