243012026-02-08 16:14:26KoszorusBlankaA sárkány feladványa (50)cpp17Wrong answer 0/502ms536 KiB
#include <bits/stdc++.h>

using namespace std;

long long lkkt(int A, int B) {
    int nagyobb = max(A, B);
    int kisebb = min(A, B);

    int x = nagyobb;
    while (x % kisebb != 0)
        x += nagyobb;

    return x;
}

int main()
{
    for (int i = 1; i <= 3; i++) {

        int A, B, N;
        cin >> A >> B >> N;

        long long x = lkkt(A, B); int szj = 0;
        while (x > 0) {
            szj++;
            x /= 10;
        }

        if (szj > N) cout << -1;
        else {
            cout << lkkt(A, B);
            for (int i = 1; i <= (N-szj); i++)
                cout << 0;
        }

    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/01ms500 KiB
2Wrong answer0/01ms536 KiB
3Wrong answer0/31ms316 KiB
4Wrong answer0/31ms316 KiB
5Wrong answer0/31ms316 KiB
6Wrong answer0/31ms316 KiB
7Wrong answer0/31ms324 KiB
8Wrong answer0/32ms316 KiB
9Wrong answer0/32ms316 KiB
10Wrong answer0/31ms316 KiB
11Wrong answer0/31ms316 KiB
12Wrong answer0/31ms316 KiB
13Wrong answer0/41ms368 KiB
14Wrong answer0/41ms316 KiB
15Wrong answer0/41ms512 KiB
16Wrong answer0/42ms316 KiB
17Wrong answer0/41ms316 KiB