Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- int t;
- cin>>t;
- while(t--){
- long long a,b,c;
- cin>>a>>b>>c;
- a--;
- c--;
- long long ans=0;
- for(long long x=1;x<=b;x++){
- long long theans = a*c;
- long long plin=0;
- long long k = x * x;
- for(long long i=1;i<=min(x,max(a,c));i++){
- long long z = k / i;
- if(i <= a)
- plin += min(c,z);
- if(i <= c){
- plin += min(a,z);
- }
- }
- plin-=min(x,a)*min(x,c);
- theans-=plin;
- theans%=1000000007;
- ans += theans;
- ans %= 1000000007;
- }
- cout<<ans<<"\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement