#include #include using namespace std; int Ans[10010]; int main() { int cas; scanf("%d",&cas); while (cas--) { char ch=getchar(); int tmp=0,ans=0; while (ch<'0'||ch>'9') ch=getchar(); while (ch>='0'&&ch<='9') { tmp+=ch-'0'; ans=ans*10+ch-'0',ch=getchar(); } int cnt=0; for (int i=1;i<=tmp;i++) { if (tmp%i==0&&ans%i==0) Ans[++cnt]=i; } printf("%d\n",cnt); for (int i=1;i