#include using namespace std; using Int=long long; using Real=long double; templateinline bool chmin(T&A,S B){if(A>B){A=B;return true;}else{return false;}} templateinline bool chmax(T&A,S B){if(A>a; int x=((int)(a%3==0)+(a%5==0))*4; if(!x)x=size(to_string(a)); ans+=x; } cout<>T; while(T--)sol(); }