## Editorial for Đếm số giai thừa !

Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Lưu ý: Các code mẫu dưới đây chỉ mang tính tham khảo và có thể không AC được bài tập này

#### Code mẫu của flashmt

#include<iostream>
#include<cmath>
using namespace std;

int main()
{
int i=0,n,m=0,re[10];
double s=1;
cin >> n;
if (n==1)
{
m++; re[1]=0;
}
while (s<n+1)
{
i++;
s+=log(i)/log(10);
if (s>=n)
{
m++; re[m]=i;
}
}
if (m-1)
{
cout << m-1 << endl;
for (i=1;i<m;i++) cout << re[i] << endl;
}
else cout << "NO" << endl;
return 0;
}


#### Code mẫu của happyboy99x

#include <algorithm>
#include <bitset>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;

typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<vii> vvii;
typedef vector<int> vi;
typedef vector<vi> vvi;

#define sz(a) int((a).size())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(), (c).end()
#define tr(c,i) for(typeof((c).begin()) i = (c).begin(), _e = (c).end(); i != _e; ++i)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define rep(i,n) for(int i = 0, _n = (n); i < _n; ++i)
#define repd(i,n) for(int i = (n)-1; i >= 0; --i )
#define fo(i,a,b) for(int i = (a), _b = (b); i <= _b; ++i)
#define fod(i,a,b) for(int i = (a), _b = (b); i >= _b; --i)

#define INF 1000000000
#define N

int main() {
int n; scanf("%d",&n);
vi res;
for(double d = 0, i = 1; d < n; d += log10(i++))
if(d >= n-1) res.pb(i-1);
if(sz(res)==0) puts("NO");
else {printf("%d\n",sz(res)); tr(res,it) printf("%d\n",*it);}
return 0;
}


program ilsmath;
const   ln10=ln(10);
var     n,i,d:longint;
s:extended;
res:array[1..12345] of longint;

begin
s:=0;
i:=0;
while s<n do
begin

if s>=(n-1) then
begin
inc(d);
res[d]:=i;
end;
inc(i);
s:=s+ln(i)/ln10;
end;
if d=0 then
begin
write('NO');
exit;
end;
writeln(d);
for i:=1 to d do
writeln(res[i]);
end.


#### Code mẫu của RR

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <deque>
#include <complex>

#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define REP(i,a) for(int i=0,_a=(a); i<_a; i++)
#define ll long long
#define F first
#define S second
#define PB push_back
#define MP make_pair
using namespace std;

const double PI = acos(-1.0);

int main() {
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
int n; cin >> n;
n--;
double sum = 0.0;
int first = 1;
while (sum < n) first++, sum += log(first) / log(10.0);
if (sum > n+1) {
puts("NO");
return 0;
}
int last = first;
while (sum < n+1) last++, sum += log(last) / log(10.0);
last--;
if (n == 0) first = 0;
cout << last - first + 1 << endl;
FOR(i,first,last) cout << i << endl;
return 0;
}


#### Code mẫu của hieult

#include <stdio.h>
//#include <conio.h>

int main()
{
int n;
double Q=1;
int t=0,a[4];
scanf("%d",&n);
for(int i = 1;;i++)
{
Q = Q*i;
while(Q>=1)
{
Q = Q/10;
n--;
}
if(Q<1 && n==0)
{
t++;
a[t] = i;
}
if(n<0)
break;
}
if(t==0)
printf("NO");
else
{
printf("%d\n",t);
for(int i = 1;i<=t;i++)
printf("%d\n",a[i]);
}
//getch();
}


#### Code mẫu của ll931110

//#pragma comment(linker, "/STACK:16777216")
#include <algorithm>
#include <bitset>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <map>
#include <set>
#include <sstream>
#include <stack>
#include <queue>
#include <vector>
#include <utility>
#define pi acos(-1.0)
using namespace std;

int n;

int main()
{
//    freopen("ils.in","r",stdin);
//    freopen("ils.ou","w",stdout);
scanf("%d", &n);
vector<int> ret;
if (n == 1) ret.push_back(0);
for (int i = 1; ; i++)
{
int val = (int) trunc( 0.5 * log10(2 * pi * i) + 1.0 * i * log10(1.0 * i / exp(1.0)) );
if (val > n - 1) break;
if (val == n - 1) ret.push_back(i);
}
if (ret.empty()) printf("NO\n"); else
{
printf("%d\n", ret.size());
for (int i = 0; i < ret.size(); i++) printf("%d\n", ret[i]);
}
}


#### Code mẫu của khuc_tuan

#include <iostream>
#include <sstream>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <cstdlib>
using namespace std;

#define Rep(i,n) for(int i=0;i<(n);++i)
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Ford(i,a,b) for(int i=(a);i>=(b);--i)
#define fi first
#define se second
#define pb push_back
#define MP make_pair

typedef pair<int,int> PII;
typedef vector<int> VI;

int main() {
int n;
cin >> n;
VI res;
double d = 0;
For(i,0,1000000) {
if(i > 0) d += log((double)i) / log(10);
if(d >= n) break;
if(d >= n-1) res.pb(i);
}
if(res.size() == 0) { cout << "NO" << endl; return 0; }
// if(n==1) res.erase(res.begin());
cout << res.size() << endl;
Rep(i,res.size()) cout << res[i] << endl;
return 0;
}