44732023-03-28 12:49:33semmiA sárkány feladványa (50)cpp17Accepted 50/503ms3508 KiB
#include <bits/stdc++.h>

using namespace std;

long long GCD(long long x, long long y)
{
    if (y == 0) return x;
    return GCD(y, x%y);
}

int main() {
    for(int i = 0;i < 3;i++ ) {
        long long a, b, c;
        cin >> a >> b >> c;
        long long f = a*b/GCD(a, b);
        string x = to_string(f);
        //cout << x.size() << endl;
        if(x.size() > c) cout << -1 << endl;
        else {
            cout << x;
            for(int i = 0;i < c-x.size();i++ ) {
                cout << 0;
            }
            cout << endl;
        }
    }
    
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1684 KiB
2Accepted0/03ms1932 KiB
3Accepted3/33ms2180 KiB
4Accepted3/33ms2396 KiB
5Accepted3/33ms2644 KiB
6Accepted3/33ms2812 KiB
7Accepted3/32ms2868 KiB
8Accepted3/33ms3112 KiB
9Accepted3/32ms3112 KiB
10Accepted3/33ms3196 KiB
11Accepted3/33ms3444 KiB
12Accepted3/33ms3432 KiB
13Accepted4/43ms3292 KiB
14Accepted4/43ms3420 KiB
15Accepted4/43ms3508 KiB
16Accepted4/43ms3504 KiB
17Accepted4/43ms3424 KiB