44452023-03-28 10:28:56uBORKAA sárkány feladványa (50)cpp17Wrong answer 0/503ms3860 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;
    }
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/03ms1876 KiB
2Wrong answer0/03ms2116 KiB
3Wrong answer0/33ms2484 KiB
4Wrong answer0/32ms2420 KiB
5Wrong answer0/33ms2396 KiB
6Wrong answer0/33ms2604 KiB
7Wrong answer0/33ms2840 KiB
8Wrong answer0/33ms2952 KiB
9Wrong answer0/32ms3068 KiB
10Wrong answer0/33ms3264 KiB
11Wrong answer0/32ms3340 KiB
12Wrong answer0/33ms3472 KiB
13Wrong answer0/43ms3524 KiB
14Wrong answer0/43ms3648 KiB
15Wrong answer0/43ms3736 KiB
16Wrong answer0/43ms3732 KiB
17Wrong answer0/43ms3860 KiB