提交时间:2022-08-08 11:31:23
运行 ID: 54928
#include <bits/stdc++.h> using namespace std; int T,n; inline int read() { int x=0; char c=getchar(); for(; c<'0' || c>'9'; c=getchar()); for(; c<='9' && c>='0'; c=getchar()) x=(x<<3)+(x<<1)+c-'0'; return x; } int main() { //freopen("pair.in","r",stdin); //freopen("pair.out","w",stdout); T=read(); while(T--) { n=read(); int cnt=0; for(int i=2; i<=n; i++) for(int j=1; j<=i-1; j++) if(((i-j)*j)%i==0) { cnt++; break; } cout<<cnt<<'\n'; } return 0; }