fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include<math.h>
  4.  
  5. int po(int x,int y){
  6. int ans=1;
  7. while(y--){
  8. ans*=x;
  9. }
  10. return ans;
  11. }
  12.  
  13. int main(void) {
  14. // your code goes here
  15. int m,k,i=1,p,s;
  16. scanf("%d",&m);
  17. k=m*5;
  18. while(k>=m*4)
  19. {
  20. s=k/5;
  21. i=2;
  22. p=k/po(5,i);
  23. while(p>0)
  24. {s=s+p;
  25. i++;
  26. p=k/po(5,i);}
  27. if(s==m)
  28. break;
  29. k=k-5;
  30. }
  31. if(k<m*4)
  32. printf("0\n");
  33. else
  34. printf("5\n%d %d %d %d %d\n",k,k+1,k+2,k+3,k+4);
  35. return 0;
  36. }
Time limit exceeded #stdin #stdout 5s 3460KB
stdin
Standard input is empty
stdout
Standard output is empty