#include #include #include #include using namespace std; int q,n; int t1=0,t; // int i=0; //n*5!(n*5)的阶乘 int find5(int n)//WA 以为/5一次就可以把前面*5的个数找出来 { int res=0; while(n/5>0) { n/=5; res+=n; } return res; } int erfen(int l,int r)//TLE 没用二分超时 { // ++i; if(l>=r) { return l; } int mid=l+r; mid/=2; int now=mid+find5(mid); if(now==q) { return mid; } if(now%d ",i,q-q/5,n); if(n+find5(n)==q)//WA 这里忘改了 { printf("Case %d: %d\n",++t1,n*5); } else { printf("Case %d: impossible\n",++t1); } } return 0; }