ll@T;rep(T){ll@N,C=1d3,r=N%C,m,L;VI a(2C);string@S;L=S.size();m=stoll(S.substr(0,L-4)+S.substr(L-3));REP(i,1,2C)a[i]=a[i-1]+((i*m+C-1)/C*C