153722025-02-19 09:23:52999A sárkány feladványa (50)cpp17Wrong answer 22/501ms508 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;

/*int gcd(int a,int b){
    int x=a,y=b;
    while(a!=b){
        if(a<b)a+=x;
        else b+=y;
    }
    return a;
}*/

int main() {
    int t=3;
    while(t--){
        int a,b,n;cin>>a>>b>>n;
        int g=gcd(a,b);
        g=a*b/g;
        string s=to_string(g);
        if(s.size()>n){
            cout<<-1<<endl;
        }
        else{
            while(s.size()<n){
                s+='0';
            }
            cout<<s<<endl;
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base22/50
1Accepted0/01ms316 KiB
2Wrong answer0/01ms508 KiB
3Accepted3/31ms316 KiB
4Accepted3/31ms316 KiB
5Accepted3/31ms316 KiB
6Accepted3/31ms316 KiB
7Accepted3/31ms316 KiB
8Wrong answer0/31ms328 KiB
9Wrong answer0/31ms316 KiB
10Wrong answer0/31ms316 KiB
11Wrong answer0/31ms316 KiB
12Accepted3/31ms316 KiB
13Wrong answer0/41ms316 KiB
14Accepted4/41ms328 KiB
15Wrong answer0/41ms508 KiB
16Wrong answer0/41ms316 KiB
17Wrong answer0/41ms316 KiB