44552023-03-28 11:18:21ZsofiaKeresztelyA sárkány feladványa (50)cpp14Accepted 50/503ms3660 KiB
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int t=3;
    while (t--){
        long long a, b, n;
        cin >> a >> b >> n;
        long long lcd = a*b/(long long)__gcd(a, b);
        int dig = 0;
        for (long long i=lcd; i>0; i/=10){
            dig++;
        }
        if (dig > n){
            cout << -1 << "\n";
        }
        else{
            cout << lcd;
            for (int i=dig; i<n; i++){
                cout << 0;
            }
            cout << "\n";
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1876 KiB
2Accepted0/03ms2116 KiB
3Accepted3/33ms2332 KiB
4Accepted3/33ms2548 KiB
5Accepted3/33ms2760 KiB
6Accepted3/33ms2840 KiB
7Accepted3/32ms2792 KiB
8Accepted3/33ms2912 KiB
9Accepted3/32ms3124 KiB
10Accepted3/33ms3396 KiB
11Accepted3/33ms3660 KiB
12Accepted3/33ms3436 KiB
13Accepted4/43ms3376 KiB
14Accepted4/43ms3376 KiB
15Accepted4/43ms3652 KiB
16Accepted4/43ms3516 KiB
17Accepted4/43ms3520 KiB