149392025-02-08 19:59:40BencuTom és Jerry 1 (80)cpp17Wrong answer 0/807ms508 KiB
#include <bits/stdc++.h>

using namespace std;
int lnko(int a, int b) {
    int m=a%b;
    while (m!=0) {
        a=b;
        b=m;
        m=a%b;
    }
    return b;
}
long long lkkt (int a, int b) {
    int t=a;
    while (t%b!=0) t=t+a;
    return t;
}
void szam (int a, int b, int n) {
    long long t=lkkt(a,b);
        if (t>=pow(10,n)) cout<<-1<<endl;
        else {
            int i=0,k=1;
            while (t/k!=0) {
                i++;
                k=k*10;
            }
            cout<<t;
            for (int j=1; j<=(n-i); j++) cout<<0;
            cout<<endl;
        }
    }

int main()
{
    //ifstream f("be.in");
    int a,b,n;
    for (int u=1; u<=3; u++) {
        //f>>a>>b>>n;
        cin>>a>>b>>n;
        szam(a,b,n);
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/80
1Wrong answer0/01ms316 KiB
2Wrong answer0/01ms316 KiB
3Wrong answer0/41ms500 KiB
4Wrong answer0/41ms316 KiB
5Wrong answer0/41ms316 KiB
6Wrong answer0/41ms316 KiB
7Wrong answer0/41ms316 KiB
8Wrong answer0/41ms316 KiB
9Wrong answer0/41ms316 KiB
10Wrong answer0/41ms316 KiB
11Wrong answer0/41ms316 KiB
12Wrong answer0/42ms416 KiB
13Wrong answer0/42ms316 KiB
14Wrong answer0/42ms508 KiB
15Wrong answer0/43ms428 KiB
16Wrong answer0/46ms316 KiB
17Wrong answer0/44ms500 KiB
18Wrong answer0/43ms420 KiB
19Wrong answer0/44ms448 KiB
20Wrong answer0/43ms500 KiB
21Wrong answer0/47ms316 KiB
22Wrong answer0/44ms316 KiB