154012025-02-19 11:56:15MrkzA sárkány feladványa (50)cpp17Wrong answer 3/501ms572 KiB
#include <iostream>

using namespace std;
long long A,B,k,s;
int main()
{
    for(int i=1;i<=3;i++){
        cin>>A>>B>>k;
        int x=A,y=B;
        int m=x%y;
        while(m!=0){
            x=y;
            y=m;
            m=x%y;
        }
        s=A*B/y;
        x=s;
        y=0;
        while(x!=0){
            x/=10;
            y++;
        }
        if(y>k)
            cout<<-1<<endl;
        else{
            cout<<s;
            for(int i=1;i<=k-y;i++)
                cout<<0;
        }
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base3/50
1Wrong answer0/01ms316 KiB
2Wrong answer0/01ms316 KiB
3Wrong answer0/31ms316 KiB
4Wrong answer0/31ms316 KiB
5Wrong answer0/31ms316 KiB
6Accepted3/31ms316 KiB
7Wrong answer0/31ms316 KiB
8Wrong answer0/31ms316 KiB
9Wrong answer0/31ms500 KiB
10Wrong answer0/31ms508 KiB
11Wrong answer0/31ms316 KiB
12Wrong answer0/31ms316 KiB
13Wrong answer0/41ms572 KiB
14Wrong answer0/41ms316 KiB
15Wrong answer0/41ms316 KiB
16Wrong answer0/41ms316 KiB
17Wrong answer0/41ms316 KiB