78342024-01-11 12:38:29Albertstein99A sárkány feladványa (50)cpp17Accepted 50/503ms3996 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 c = A* B / __gcd(A, B);
        string s = to_string(c);
        if(s.length() > N){
            cout << -1;
        }
        else{
            while(s.length() < N){
                s += "0";
            }
            cout << s;
        }
        cout << endl;
    }
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1808 KiB
2Accepted0/03ms2060 KiB
3Accepted3/33ms2268 KiB
4Accepted3/33ms2616 KiB
5Accepted3/33ms2584 KiB
6Accepted3/33ms2836 KiB
7Accepted3/33ms3048 KiB
8Accepted3/33ms3192 KiB
9Accepted3/33ms3312 KiB
10Accepted3/33ms3528 KiB
11Accepted3/33ms3608 KiB
12Accepted3/33ms3712 KiB
13Accepted4/43ms3796 KiB
14Accepted4/42ms3788 KiB
15Accepted4/42ms3796 KiB
16Accepted4/43ms3956 KiB
17Accepted4/43ms3996 KiB