#include using namespace std; using ll = long long; using ull = unsigned long long; int main() { int T; cin >> T; for(int i=0; i> N; ull M; int N_digits = log10(N) + 1; if(N % 10 == 0) { M = 2 * N; }else { M = N * (pow(10,N_digits) - 2); } cout << M << endl; } }