#include typedef long long ll; const int N=105; int T,x,ans; int out[N]; template inline void get(I &a) { char c=getchar(); a=0; for(;c<'0'||c>'9';c=getchar()); for(;c>='0'&&c<='9';c=getchar()) a=a*10+c-'0'; } int main() { get(T); while(T--) { get(x); ans=0; int se=0,te=x; while(te>0) { se+=te%10; te/=10; } for(int i=1;i<=se;i++) if(se%i==0&&x%i==0) out[++ans]=i; printf("%d\n",ans); for(int i=1;i