94112024-02-21 14:01:47PallanekPéterA sárkány feladványa (50)cpp17Accepted 50/503ms4020 KiB
#include <bits/stdc++.h>
using namespace std;

int main(){
    for (int i=0;i<3;i++){
        long long a,b,n;
        cin >> a >> b >> n;
        long long v=(a*b)/__gcd(a,b);
        string ki=to_string(v); int kiv=ki.size();
        if (kiv>n) cout << -1 << "\n";
        else{
            for (int i=0;i<n-(kiv);i++){
                ki+='0';
            }
            cout << ki << "\n";
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1816 KiB
2Accepted0/03ms2004 KiB
3Accepted3/33ms2244 KiB
4Accepted3/33ms2464 KiB
5Accepted3/33ms2696 KiB
6Accepted3/32ms2752 KiB
7Accepted3/33ms2880 KiB
8Accepted3/33ms2968 KiB
9Accepted3/33ms3096 KiB
10Accepted3/33ms3308 KiB
11Accepted3/33ms3364 KiB
12Accepted3/32ms3360 KiB
13Accepted4/43ms3604 KiB
14Accepted4/43ms3568 KiB
15Accepted4/43ms3720 KiB
16Accepted4/43ms3776 KiB
17Accepted4/43ms4020 KiB