#pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inline")
//#include<bit/sdc++.h>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include <sstream>
#include<string>
#include<queue>
#include<map>
#include<stack>
#include<cmath>
#include<vector>
#include<set>
#define inf 2147483647
using namespace std;
typedef long long ll;
const ll M=1e16;
const int N=1e5+100;

int main()
{
//    ios::sync_with_stdio(false);
//    cin.tie(0);
//    cout.tie(0);
    int num;
    scanf("%d",&num);
    while(num--)
    {
        ll a,b,c;
        scanf("%lld%lld%lld",&a,&b,&c);
        if(b>c)
        {
            printf("0\n");
            continue;
        }
        ll ans=0;
        ll part=ceil(1.0*(b*a-c)/b);
        if(part>0)
        {
           ans=part*(c/b);
        }
        ll x=min(c/b-1,a-1);
        if(x&1)
        {
            ans+=(x+1)/2*x;
        }
        else
        {
            ans+=x/2*(x+1);
        }
        printf("%lld\n",ans);
    }
    return 0;
}
