1 

 

 


#include <bits/stdc++.h> 2 using namespace std; 3 using LL = long long; 4 const LL P = 998244353; 5 int main(){ 6 int T; 7 cin>>T; 8 while(T--){ 9 LL n; 10 cin>>n; 11 LL ans1 = 0,ans2 = 0,ans3 = 0,res = 0; 12 for(int i=1;1ll*i*i*i<=n;i++){//a=b=c,O(n^(1/3)) 13 ans1 += 1; 14 //printf("%d * %d * %d = %d\n",i,i,i,i*i*i); 15 } 16 for(int i=1;1ll*i*i<=n;i++){//a=b!=c,O(n^(1/3)) 17 LL t = 1ll*i*i; 18 ans2 += n/(t) - (t*i*1ll<=n?1:0); 19 //printf("%lld / %lld = %lld\n",n,(1ll*i*i),n/(1ll*i*i)); 20 } 21 for(int i=1;1ll*i*i*i<=n;i++){//a<b<c,O(n^(2/3)) 22 for(int j=i+1;1ll*j*j<=n;j++){ 23 LL tmp = n/(1ll*i*j) - j; 24 if(tmp + j <= j) break; 25 ans3 += tmp>0?tmp:0; 26 //printf("%lld / %lld = %lld\n",n,(1ll*i*j),n/(1ll*i*j)); 27 } 28 } 29 //排列组合原理 30 res = (ans1 % P + 3*ans2 % P + 6*ans3 % P) % P; 31 printf("%lld\n",res); 32 } 33 34 return 0; 35 }