95812024-02-23 12:16:13csaron71A sárkány feladványa (50)cpp17Wrong answer 32/503ms3572 KiB
#include <bits/stdc++.h>
using namespace std;





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

}
SubtaskSumTestVerdictTimeMemory
base32/50
1Accepted0/03ms1880 KiB
2Accepted0/03ms2088 KiB
3Accepted3/33ms2328 KiB
4Accepted3/33ms2408 KiB
5Accepted3/32ms2484 KiB
6Accepted3/33ms2756 KiB
7Accepted3/33ms2816 KiB
8Wrong answer0/33ms3020 KiB
9Wrong answer0/32ms3112 KiB
10Accepted3/33ms3232 KiB
11Accepted3/32ms3136 KiB
12Accepted3/33ms3260 KiB
13Wrong answer0/43ms3456 KiB
14Accepted4/43ms3572 KiB
15Accepted4/43ms3544 KiB
16Wrong answer0/43ms3544 KiB
17Wrong answer0/43ms3540 KiB