46402023-03-30 13:51:29horvathabelA sárkány feladványa (50)cpp17Accepted 50/503ms4112 KiB
#include <bits/stdc++.h>
using namespace std;
using ll=long long; 
void solve(){
	ll x,y,db;
	cin>>x>>y>>db;
	ll v=(x*y)/__gcd(x,y);
	ll cnt=0;
	string ans=to_string(v);
	while (v>0){
		cnt++;
		v=v/10;
	}
	if (cnt>db) cout<<-1<<endl;
	else{
		for (int i=0; i<db-cnt;i++){
			ans+='0';
	}
		cout<<ans<<endl;

	}
	return;
	
}
int main() {
	for (int z=0; z<3;z++){
		solve(); 
	}
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1968 KiB
2Accepted0/03ms2092 KiB
3Accepted3/32ms2176 KiB
4Accepted3/33ms2228 KiB
5Accepted3/33ms2472 KiB
6Accepted3/33ms2684 KiB
7Accepted3/33ms2892 KiB
8Accepted3/33ms3268 KiB
9Accepted3/33ms3172 KiB
10Accepted3/33ms3296 KiB
11Accepted3/33ms3488 KiB
12Accepted3/32ms3564 KiB
13Accepted4/43ms3700 KiB
14Accepted4/42ms3784 KiB
15Accepted4/43ms3788 KiB
16Accepted4/43ms3984 KiB
17Accepted4/43ms4112 KiB