44722023-03-28 12:45:56semmiA sárkány feladványa (50)cpp17Wrong answer 0/50138ms64636 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);
        //cout << x.size() << endl;
        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
base0/50
1Wrong answer0/03ms1816 KiB
2Wrong answer0/03ms2004 KiB
3Runtime error0/3138ms64636 KiB
4Wrong answer0/33ms2448 KiB
5Runtime error0/3126ms64392 KiB
6Runtime error0/389ms64164 KiB
7Runtime error0/378ms63916 KiB
8Runtime error0/378ms63688 KiB
9Wrong answer0/33ms3392 KiB
10Runtime error0/376ms63444 KiB
11Wrong answer0/33ms3636 KiB
12Runtime error0/387ms62996 KiB
13Wrong answer0/43ms4088 KiB
14Wrong answer0/43ms4192 KiB
15Wrong answer0/42ms4288 KiB
16Wrong answer0/42ms4408 KiB
17Wrong answer0/42ms4656 KiB