#include <bits/stdc++.h>
// 12345678901234567890
#define MAX 1000000008
#define FAST ios_base::sync_with_stdio(0)
using namespace std;
int main(){
FAST;
int t;
cin >> t;
while(t--){
int piles , starting , pilenow, diff , total;
cin >> piles >> starting >> diff;
total = starting;
pilenow = starting;
for (int i = 1; i < piles; ++i)
{
pilenow = pilenow + diff;
total += pilenow;
}
cout << total << '\n';
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Ci8vICAgICAgICAgICAgICAxMjM0NTY3ODkwMTIzNDU2Nzg5MAojZGVmaW5lIE1BWCAgICAgMTAwMDAwMDAwOAojZGVmaW5lIEZBU1QgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbygwKQp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKXsKCUZBU1Q7CiAgICBpbnQgdDsKICAgIGNpbiA+PiB0OwogICAgd2hpbGUodC0tKXsKICAgICAgICBpbnQgcGlsZXMgLCBzdGFydGluZyAsIHBpbGVub3csIGRpZmYgLCB0b3RhbDsKICAgICAgICBjaW4gPj4gcGlsZXMgPj4gc3RhcnRpbmcgPj4gZGlmZjsKICAgICAgICB0b3RhbCA9IHN0YXJ0aW5nOwogICAgICAgIHBpbGVub3cgPSBzdGFydGluZzsKICAgICAgICBmb3IgKGludCBpID0gMTsgaSA8IHBpbGVzOyArK2kpCiAgICAgICAgewogICAgICAgICAgICBwaWxlbm93ID0gcGlsZW5vdyArIGRpZmY7CiAgICAgICAgICAgIHRvdGFsICs9IHBpbGVub3c7CiAgICAgICAgfQogICAgICAgIGNvdXQgPDwgdG90YWwgPDwgJ1xuJzsKICAgIH0KICAgIHJldHVybiAwOwp9