#include using namespace std; int main() { int t,i,sum=0,k,j,n; string A; cin >> t; while(t--) { cin>>n; for(i=0;i>A; k=A.length(); for(j=0;j