44542023-03-28 11:06:13ZsofiaKeresztelyA sárkány feladványa (50)cpp14Wrong answer 36/503ms3652 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 (int 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
base36/50
1Accepted0/03ms1880 KiB
2Accepted0/03ms2120 KiB
3Accepted3/33ms2324 KiB
4Accepted3/33ms2540 KiB
5Accepted3/32ms2620 KiB
6Accepted3/33ms2756 KiB
7Accepted3/33ms2988 KiB
8Wrong answer0/33ms3076 KiB
9Wrong answer0/33ms3056 KiB
10Accepted3/33ms3240 KiB
11Accepted3/32ms3324 KiB
12Accepted3/33ms3456 KiB
13Wrong answer0/43ms3524 KiB
14Accepted4/43ms3636 KiB
15Accepted4/43ms3524 KiB
16Accepted4/43ms3524 KiB
17Wrong answer0/43ms3652 KiB