90262024-02-12 11:24:43PedriA sárkány feladványa (50)cpp17Accepted 50/503ms3932 KiB
#include <iostream>
#include <fstream>

using namespace std;

int main()
{
   ifstream f("be.in");
    for(int d=1;d<=3;d++){
      long long x, y, t;
      cin>>x>>y>>t;
      long long a=x, b=y, lkkt;
      long long m=a%b;
      while(m!=0){
         a=b;
         b=m;
         m=a%b;
      }
      lkkt=x/b*y;
      long long r=lkkt;
      long long j=0;
      while(r!=0){
         j++;
         r=r/10;
      }
      if(j<=t){
         cout<<lkkt;
         for(int i=j+1;i<=t;i++)cout<<0;
      cout<<endl;
      }else cout<<"-1"<<endl;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1812 KiB
2Accepted0/03ms2056 KiB
3Accepted3/33ms2116 KiB
4Accepted3/33ms2324 KiB
5Accepted3/33ms2688 KiB
6Accepted3/33ms2752 KiB
7Accepted3/33ms3004 KiB
8Accepted3/33ms3132 KiB
9Accepted3/33ms3312 KiB
10Accepted3/33ms3396 KiB
11Accepted3/33ms3512 KiB
12Accepted3/33ms3536 KiB
13Accepted4/43ms3396 KiB
14Accepted4/43ms3636 KiB
15Accepted4/43ms3880 KiB
16Accepted4/43ms3932 KiB
17Accepted4/43ms3852 KiB