#include #include #include using namespace std; int cal(int x){ int ans=0; while (x){ ans+=x%10; x/=10; } return ans; } int cas,n,cnt,ans[1010]; int main(){ scanf("%d",&cas); while (cas--){ cnt=0; scanf("%d",&n); int m=cal(n); for (int i=1;i<=m;i++) if (m%i==0&&n%i==0)ans[++cnt]=i; printf("%d\n",cnt); for (int i=1;i