146812025-01-27 16:13:17zsombA sárkány feladványa (50)cpp17Wrong answer 22/501ms508 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;

int lkkt(int a, int b)
{
    if (a % b == 0)
    {
        return b;
    }
    else
    {
        return lkkt(b, a % b);
    }
}

int main()
{
    for (int t = 0; t < 3; t++)
    {
        int a, b, k;
        cin >> a >> b >> k;
        int u = a * b / lkkt(a, b);

        if (int(log10(u)) >= k)
        {
            cout << -1 << endl;
        }
        else
        {
            cout << u;
            for (int i = 0; i < k - int(log10(u)) - 1; i++)
            {
                cout << "0";
            }
            cout << endl;
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base22/50
1Accepted0/01ms316 KiB
2Wrong answer0/01ms508 KiB
3Accepted3/31ms316 KiB
4Accepted3/31ms316 KiB
5Accepted3/31ms316 KiB
6Accepted3/31ms316 KiB
7Accepted3/31ms316 KiB
8Wrong answer0/31ms508 KiB
9Wrong answer0/31ms316 KiB
10Wrong answer0/31ms316 KiB
11Wrong answer0/31ms316 KiB
12Accepted3/31ms316 KiB
13Wrong answer0/41ms508 KiB
14Accepted4/41ms316 KiB
15Wrong answer0/41ms508 KiB
16Wrong answer0/41ms316 KiB
17Wrong answer0/41ms508 KiB