#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long tests, a, b, c, i,sum;
    cin >> tests;
    while (tests--)
    {
        cin >> a >> b >> c;
        if (c / b + 1 >= a)
            printf("%lld\n",(a*a-a)/2);
        else
            printf("%lld\n",(c/b)*(c/b+1)/2+(a-c/b-1)*(c/b));
    }
}