90992024-02-13 22:23:10RRoliA sárkány feladványa (50)cpp17Wrong answer 22/503ms4456 KiB
#include <bits/stdc++.h>
using namespace std;

int lkkt(int a, int b) {
    int m = a % b, x = a, y = b;
    while(m != 0) {
        a = b;
        b = m;
        m = a % b;
    }
    return x * y / b;
}

int szjsz(int k) {
    int t = 0;
    while(k != 0) {
        k /= 10;
        t++;
    }
    return t;
}

int main()
{
    for(int i = 0; i < 3; i++) {
        int a, b, n;
        cin >> a >> b >> n;
        int p = lkkt(a, b);
        if(p > pow(10, n)-1) cout << -1;
        else {
            cout << p;
            for(int j = szjsz(p); j < n; j++) cout << 0;
        }
        cout << '\n';
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base22/50
1Accepted0/03ms1876 KiB
2Wrong answer0/03ms2124 KiB
3Accepted3/33ms2332 KiB
4Accepted3/33ms2544 KiB
5Accepted3/33ms2756 KiB
6Accepted3/32ms2868 KiB
7Accepted3/33ms2968 KiB
8Wrong answer0/33ms3176 KiB
9Wrong answer0/33ms3360 KiB
10Wrong answer0/33ms3584 KiB
11Wrong answer0/33ms3664 KiB
12Accepted3/33ms3916 KiB
13Wrong answer0/43ms3972 KiB
14Accepted4/43ms4188 KiB
15Wrong answer0/43ms4296 KiB
16Wrong answer0/43ms4372 KiB
17Wrong answer0/43ms4456 KiB