42882023-03-22 10:54:15BBBMMMA sárkány feladványa (50)cpp17Wrong answer 0/503ms4172 KiB
#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    int a,b,c,szam,N;
    int hossz = 1;
    int szam2;
    int ae, be;
    for(int l = 1; l<=3; l++)
    {
    cin>>a>>b>>N;
    ae=a;
    be=b;

    if(b>a)
    {
       c=a;
       a=b;
       b=c;
    }
    while(a%b!=0)
    {
        c=a-b*(a/b);
        a=b;
        b=c;
    }
    szam=(ae*be)/b;
    szam2=szam;
    while(szam>=10)
    {
        hossz++;
        szam/=10;
    }
    if(hossz>N)
    {
        cout<<-1;
    }
    else
    {
        cout<<szam2;
        for(int i = (N-hossz); i>0; i--)
        {
            cout<<0;
        }
    }
    cout<<endl;
    }
}
//6 9
//1 2
//1 4
//2 6
//3 4
//6 9
//7 9

SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/03ms1880 KiB
2Wrong answer0/03ms2068 KiB
3Wrong answer0/33ms2276 KiB
4Wrong answer0/33ms2492 KiB
5Wrong answer0/32ms2572 KiB
6Wrong answer0/33ms2604 KiB
7Wrong answer0/33ms2800 KiB
8Wrong answer0/33ms3012 KiB
9Wrong answer0/33ms3104 KiB
10Wrong answer0/33ms3504 KiB
11Wrong answer0/33ms3460 KiB
12Wrong answer0/32ms3576 KiB
13Wrong answer0/43ms3672 KiB
14Wrong answer0/43ms3752 KiB
15Wrong answer0/43ms4004 KiB
16Wrong answer0/43ms4096 KiB
17Wrong answer0/43ms4172 KiB