44622023-03-28 11:37:55semmiA sárkány feladványa (50)cpp17Wrong answer 15/503ms3920 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/GCD(a, b)*b/GCD(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/03ms2056 KiB
3Accepted3/33ms2264 KiB
4Wrong answer0/33ms2476 KiB
5Accepted3/33ms2724 KiB
6Accepted3/33ms2968 KiB
7Accepted3/33ms2940 KiB
8Accepted3/33ms3052 KiB
9Wrong answer0/33ms3180 KiB
10Wrong answer0/32ms3256 KiB
11Wrong answer0/32ms3356 KiB
12Wrong answer0/33ms3488 KiB
13Wrong answer0/43ms3568 KiB
14Wrong answer0/42ms3636 KiB
15Wrong answer0/43ms3756 KiB
16Wrong answer0/43ms3832 KiB
17Wrong answer0/42ms3920 KiB