86742024-01-25 07:07:38BenedekMartonA sárkány feladványa (50)cpp17Wrong answer 0/504ms3500 KiB
#include <iostream>

using namespace std;

int main()
{
    long long a, b, n, maxoszto, mab, lkt, szjh, k, lktm;
    for(int i=0; i<3; i++)
    {
        cin >> a >> b >> n;
        mab=min(a, b);
        for(int j=1; j<=mab; j++)
        {
            if(a%j==0 and b%j==0)
            {
                maxoszto=j;
            }
        }
        lkt=a/maxoszto*b;
        lktm=lkt;
        for(k=0; lktm>0; k++)
        {
            lktm=lktm/10;
        }
        if(k>n)
        {
            cout << "-1" << endl;
        }
        else
        {
            cout << lkt;
            for(int l=k; l<=n; l++)
            {
                cout << 0;
            }
            cout << endl;
        }
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/03ms1876 KiB
2Wrong answer0/04ms2116 KiB
3Wrong answer0/33ms2428 KiB
4Wrong answer0/33ms2500 KiB
5Wrong answer0/33ms2712 KiB
6Wrong answer0/33ms2928 KiB
7Wrong answer0/33ms3036 KiB
8Wrong answer0/34ms3108 KiB
9Wrong answer0/34ms3176 KiB
10Wrong answer0/34ms3168 KiB
11Wrong answer0/33ms3300 KiB
12Wrong answer0/34ms3384 KiB
13Wrong answer0/44ms3408 KiB
14Wrong answer0/43ms3384 KiB
15Wrong answer0/44ms3500 KiB
16Wrong answer0/44ms3380 KiB
17Wrong answer0/44ms3384 KiB