#include #include #include using namespace std; int n,m,k,l,T,s; int ans[100005]; int main(){ scanf("%d",&T); while(T--){ s=0; scanf("%d",&n); int x=n,sum=0; while(x){sum+=x%10;x/=10;} for (int i=1;i*i<=sum;i++)if(sum%i==0){ if(n%i==0)ans[++s]=i; if(i*i!=sum&&n%(sum/i)==0)ans[++s]=sum/i; } sort(ans+1,ans+s+1); printf("%d\n",s); for (int i=1;i