fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include<math.h>
  4. int main(void) {
  5. // your code goes here
  6. int m,k,i=1,p,s;
  7. scanf("%d",&m);
  8. k=m*5;
  9. while(k>=m*4)
  10. {
  11. s=k/5;
  12. i=2;
  13. p=k/pow(5,i);
  14. while(p>0)
  15. {s=s+p;
  16. i++;
  17. p=k/pow(5,i);}
  18. if(s==m)
  19. break;
  20. k=k-5;
  21. }
  22. if(k<m*4)
  23. printf("0\n");
  24. else
  25. printf("5\n%d %d %d %d %d\n",k,k+1,k+2,k+3,k+4);
  26. return 0;
  27. }
Success #stdin #stdout 0.01s 2116KB
stdin
99998
stdout
0