fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. long long c[11]={1, 5, 6, 25, 76, 376, 625, 9376, 90625, 109376, 890625};
  6. long long t[11]={10, 10, 10, 100, 100, 1000, 1000, 10000, 100000, 1000000, 1000000};
  7. long long n,temp[11],h;
  8.  
  9. long long pangkat(long long a, long long b)
  10. {
  11. long long temp=1;
  12. for(int i=0;i<b;i++)
  13. {
  14. temp=temp*a;
  15. }
  16. return temp;
  17. }
  18.  
  19. int main()
  20. {
  21. ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  22. cin>>n;
  23. for(int i=0;i<11;i++)
  24. {
  25. temp[i]=n*t[i]+c[i];
  26. for(long long j=1;j*j<=temp[i];j++)
  27. {
  28. if(temp[i]%j==0)
  29. {
  30. if((j-c[i])%t[i]==0 && (temp[i]/j-c[i])%t[i]==0)
  31. {
  32. long long a=(j-c[i])/t[i];
  33. long long b=(temp[i]/j-c[i])/t[i];
  34. if(1<=a && a<=1e9 && 1<=b && b<=1e9)
  35. {
  36. cout<<"YA"<<endl;
  37. cout<<a<<" "<<b<<" "<<c[i]<<endl;
  38. return 0;
  39. }
  40. }
  41. }
  42. }
  43. }
  44. cout<<"TIDAK"<<endl;
  45. }
  46.  
Success #stdin #stdout 0s 4368KB
stdin
Standard input is empty
stdout
TIDAK