43512023-03-26 12:37:23rmlanA sárkány feladványa (50)cpp14Accepted 50/503ms4252 KiB
#include<bits/stdc++.h>
using namespace std;

int main(){

    long long q=3;
    while(q--){
        long long a,b,n;
        cin >> a >> b >> n;
        if((long long)log10(a*b/__gcd(a,b)) >= n){
            cout << "-1\n";
            continue;
        }
        cout << a*b/__gcd(a,b);
        for(long long i = 1; i < n-(long long)log10(a*b/__gcd(a,b)); i++) cout << "0";
        cout << endl;
    }


}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1872 KiB
2Accepted0/03ms2128 KiB
3Accepted3/33ms2332 KiB
4Accepted3/33ms2528 KiB
5Accepted3/32ms2616 KiB
6Accepted3/33ms2952 KiB
7Accepted3/33ms3080 KiB
8Accepted3/33ms3068 KiB
9Accepted3/33ms3244 KiB
10Accepted3/33ms3480 KiB
11Accepted3/33ms3728 KiB
12Accepted3/32ms3836 KiB
13Accepted4/43ms3864 KiB
14Accepted4/43ms3868 KiB
15Accepted4/43ms3860 KiB
16Accepted4/43ms3980 KiB
17Accepted4/43ms4252 KiB