95822024-02-23 12:16:56csaron71A sárkány feladványa (50)cpp17Accepted 50/503ms4408 KiB
#include <bits/stdc++.h>
using namespace std;





int main() {
	long long t;
	t=3;
	while (t--) {
		long long x, y, z;
		cin >> x >> y >> z;
		long long lmc=(x/__gcd(x, y))*y;
		long long hanyjegyu=0;
		long long segitseg=lmc;
		while (segitseg>0) {
			segitseg-=segitseg%10;
			segitseg/=10;
			hanyjegyu++;
		}
		if (hanyjegyu>z) {
			cout << "-1\n";
		}
		else {
			cout << lmc;
			for (long long i=hanyjegyu; i<z; i++) {
				cout << "0";
			}
			cout << "\n";
		}
	}

}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1876 KiB
2Accepted0/03ms2124 KiB
3Accepted3/33ms2332 KiB
4Accepted3/33ms2584 KiB
5Accepted3/33ms2600 KiB
6Accepted3/33ms2672 KiB
7Accepted3/33ms2804 KiB
8Accepted3/33ms3288 KiB
9Accepted3/33ms3236 KiB
10Accepted3/33ms3360 KiB
11Accepted3/33ms3576 KiB
12Accepted3/33ms3784 KiB
13Accepted4/43ms3996 KiB
14Accepted4/43ms4208 KiB
15Accepted4/43ms4300 KiB
16Accepted4/43ms4408 KiB
17Accepted4/43ms4296 KiB