제출 #374473

#제출 시각아이디문제언어결과실행 시간메모리
374473topovikEuklid (COCI20_euklid)C++14
20 / 110
1 ms384 KiB
#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back

using namespace std;

typedef long long ll;
typedef long double ld;

const int N = 1e6 + 100;

int mx[N];
int pred[N];

int f(int x, int y)
{
    if (x < y) swap(x, y);
    if (y == 1) return x;
    return f(x / y, y);
}

int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        ll x, y;
        cin >> x >> y;
        if (x == y)
        {
            cout << x << " " << x << endl;
            continue;
        }
        if (y == 2)
        {
            cout << x << " " << 2 * x << endl;
            continue;
        }
        cout << x << " " << x * y << endl;
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...