44632023-03-28 11:40:01semmiA sárkány feladványa (50)cpp17Wrong answer 15/503ms4276 KiB
#include <bits/stdc++.h>

using namespace std;

long long GCD(long long x, long long y)
{
    if (y == 0) return x;
    return GCD(y, x%y);
}

int main() {
    vector<string> ans;
    for(int i = 0;i < 3;i++ ) {
        long long a, b, c;
        cin >> a >> b >> c;
        long long f = a*b/GCD(a, b);
        string x = to_string(f);
        if(x.size() > c) ans.push_back("-1");
        else {
            for(int i = 0;i < c-x.size();i++ ) x.push_back('0');
            ans.push_back(x);
        }
    }
    for(int i = 0;i < 3;i++ ) cout << ans[i] << endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base15/50
1Wrong answer0/03ms1812 KiB
2Wrong answer0/03ms2052 KiB
3Accepted3/33ms2216 KiB
4Wrong answer0/33ms2460 KiB
5Accepted3/33ms2668 KiB
6Accepted3/32ms2756 KiB
7Accepted3/33ms2900 KiB
8Accepted3/33ms2984 KiB
9Wrong answer0/33ms3160 KiB
10Wrong answer0/33ms3280 KiB
11Wrong answer0/33ms3308 KiB
12Wrong answer0/33ms3420 KiB
13Wrong answer0/43ms3656 KiB
14Wrong answer0/43ms3772 KiB
15Wrong answer0/43ms3916 KiB
16Wrong answer0/43ms4056 KiB
17Wrong answer0/43ms4276 KiB