提交时间:2022-08-08 11:31:55

运行 ID: 54937

#include <bits/stdc++.h> using namespace std; inline int Read() { static int x=0,c=getchar(); for(; c<=47||c>=58; c=getchar()); for(x=0; c>=48&&c<=57; c=getchar()) x=(x<<3)+(x<<1)+(c&15); return x; } int main() { // freopen("pair.in","r",stdin); // freopen("pair.out","w",stdout); int t=Read(); while(t--) { int n=Read(),ans=0; double a,b,q; int Q; for(int i=2; i<=n; i++) for(a=1; a<i; a++) { b=i-a; q=a*b/(a+b); Q=q; if(q==Q) { ans++; break; } } printf("%d\n",ans); } return 0; }