提交时间:2022-08-08 11:39:22
运行 ID: 54971
#include<bits/stdc++.h> #define int long long #define mod 998244353 using namespace std; inline int read(){ int x=0,f=1; char c=getchar(); while(!isdigit(c)){if(c=='-')f=-1;c=getchar();} while(isdigit(c)){x=(x<<1)+(x<<3)+(c^48);c=getchar();} return x*f; } int t,n,a[5005]; signed main(){ t=read(); for(int i=3;i<=5000;i++){ int ans=0; for(int j=1;j<i;j++)if(j*(i-j)%i==0){ans++;break;} a[i]=a[i-1]+ans; } while(t--)cout<<a[read()]<<endl; return 0; }