#include using namespace std; int main() { int test,n,i; long long blah,temp,total; cin>>test; while(test--) { cin>>n; total=0; for(i=0;i>temp; while(temp>0) { total+=temp%10; temp/=10; //cerr<<"TT "<