#include #define N 1005 using namespace std; int n; int que[N],top; inline void Rd(int &res){ char c;res=0; while(c=getchar(),c<48); do res=(res<<3)+(res<<1)+(c^48); while(c=getchar(),c>47); return; } int main(){ int T; Rd(T); while(T--){ Rd(n);top=0; int sum=0,h=n; while(h)sum+=h%10,h/=10; for(int i=1;i<=sum;i++)if(sum%i==0&&n%i==0)que[++top]=i; printf("%d\n",top); for(int i=1;i