提交时间:2023-08-16 12:08:57

运行 ID: 98621

#include<bits/stdc++.h> #define int long long using namespace std; int t,l,r; signed main(){ cin>>t; while(t--){ cin>>l>>r; int ans=0; for(int i=l;i<=r;i++){ for(int j=i+1;j<=r;j++){ for(int k=j+1;k<=r;k++) if(i*j*k/__gcd(i,j)/__gcd(i*j/__gcd(i,j),k)>=i+j+k) ans++; } } cout<<ans<<endl; } return 0; }