There are $n$ people participating in some contest, they start participating in $x$ minutes intervals. That means the first participant starts at time $0$, the second participant starts at time $x$, the third — at time $2 \cdot x$, and so on.

Duration of contest is $t$ minutes for each participant, so the first participant finishes the contest at time $t$, the second — at time $t + x$, and so on. When a participant finishes the contest, their dissatisfaction equals to the number of participants that started the contest (or starting it now), but haven't yet finished it.

Determine the sum of dissatisfaction of all participants.


-----Input-----

The first line contains a single integer $k$ ($1 \le k \le 1000$) — the number of test cases.

Each of the next $k$ lines contains three integers $n$, $x$, $t$ ($1 \le n, x, t \le 2 \cdot 10^9$) — the number of participants, the start interval and the contest duration.


-----Output-----

Print $k$ lines, in the $i$-th line print the total dissatisfaction of participants in the $i$-th test case.


-----Examples-----

Input
4
4 2 5
3 1 2
3 3 10
2000000000 1 2000000000
Output
5
3
3
1999999999000000000


-----Note-----

In the first example the first participant starts at $0$ and finishes at time $5$. By that time the second and the third participants start, so the dissatisfaction of the first participant is $2$.

The second participant starts at time $2$ and finishes at time $7$. By that time the third the fourth participants start, so the dissatisfaction of the second participant is $2$.

The third participant starts at $4$ and finishes at $9$. By that time the fourth participant starts, so the dissatisfaction of the third participant is $1$.

The fourth participant starts at $6$ and finishes at $11$. By time $11$ everyone finishes the contest, so the dissatisfaction of the fourth participant is $0$.

In the second example the first participant starts at $0$ and finishes at time $2$. By that time the second participants starts, and the third starts at exactly time $2$. So the dissatisfaction of the first participant is $2$.

The second participant starts at time $1$ and finishes at time $3$. At that time the third participant is solving the contest.

Difficulty: EASY
Tags: Geometry

Combinatorics

Mathematics

Greedy algorithms
Skill types: Greedy algorithms

Starter code:

Solutions:
for _ in range(int(input())):
	(n, x, t) = map(int, input().split())
	r = t // x
	a = r * (r + 1) // 2
	if n >= r:
		ans = n * r - a
		print(ans)
	else:
		print(n * (n - 1) // 2)


def main():
	(n, x, t) = map(int, input().split())
	if x == 0:
		return print(0)
	k = min(t // x, n - 1)
	print((n - k) * k + (k - 1) * k // 2)
tests = int(input())
for _ in range(tests):
	main()


t = int(input())
for i in range(t):
	(n, x, t) = map(int, input().split())
	if n == 1:
		print(0)
	elif t < x:
		print(0)
	elif t == x:
		print(n - 1)
	else:
		ans = 0
		a = min(n - 1, t // x)
		ans += (n - a) * a
		f = a
		f -= 1
		ans += f * (f + 1) // 2
		print(ans)


t = int(input())
for p in range(t):
	(num, k, q) = map(int, input().split())
	ans = 0
	sum1 = min(num - 1, q // k)
	ans += sum1 * (sum1 - 1) // 2 + sum1 * (num - sum1)
	print(ans)


for _ in range(int(input())):
	(n, x, t) = map(int, input().split())
	ans = max(0, n - t // x) * (t // x) + min(n - 1, t // x - 1) * min(n, t // x) // 2
	print(ans)


T = int(input())
for i in range(T):
	(N, X, T) = map(int, input().split())
	if T >= (N - 1) * X:
		Calculate = N * (N - 1) // 2
		print(Calculate)
	else:
		Last = (N - 1) * X
		Last_Full = (Last + X - 1 - T) // X + 1
		Rest = N - Last_Full
		Count = T // X * Last_Full
		Count += Rest * (Rest - 1) // 2
		print(Count)


def contest(n, x, t):
	if x > t:
		return 0
	n -= 1
	ds = 0
	con = t // x
	if n > con:
		ds += (n - con) * con
		ds += con * (con + 1) // 2
	else:
		ds += n * (n + 1) // 2
	return ds
k = int(input())
for i in range(k):
	(n, x, t) = map(int, input().split())
	print(contest(n, x, t))


k = int(input())
ans = 0
for i in range(k):
	(n, x, t) = map(int, input().split())
	r = t // x
	ans = 0
	ans = (n - r) * r + r * (r - 1) // 2
	if n - r < 0:
		ans = (n - 1) * n // 2
	print(ans)


k = int(input())
n = []
x = []
t = []
for i in range(k):
	inp = input().split(' ')
	n.append(int(inp[0]))
	x.append(int(inp[1]))
	t.append(int(inp[2]))
for i in range(k):
	temp = t[i] // x[i]
	c1 = temp * n[i] - temp * (temp + 1) // 2
	c2 = n[i] * (n[i] - 1) // 2
	if n[i] * x[i] > t[i]:
		print(int(c1))
	else:
		print(int(c2))


import sys
import math
lines = []
is_stdin = False
is_stdin = True
if is_stdin:
	for line in sys.stdin:
		lines.append(line.strip())
else:
	with open('./myin.txt', 'r') as f:
		for line in f.readlines():
			lines.append(line.strip())
N = int(lines.pop(0))
while N > 0:
	N -= 1
	(n, x, t) = lines.pop(0).split(' ')
	n = int(n)
	x = int(x)
	t = int(t)
	fulls = t // x
	if fulls < n:
		cur_all = (n - fulls) * fulls
		cur_all += (0 + fulls - 1) * fulls // 2
		print(cur_all)
	else:
		cur_all = (0 + n - 1) * n // 2
		print(cur_all)


from math import ceil

def solve(n, x, t):
	dis_sat = 0
	first = ceil((t + 1) / x)
	if first > n:
		first = n - 1
	else:
		first -= 1
	end_of_first = n - first
	dis_sat += (end_of_first - 1) * first + (first + 1) * first // 2
	print(dis_sat)
for i in range(int(input())):
	(n, x, t) = map(int, input().split())
	solve(n, x, t)


def solve(n, x, t):
	d = min(t // x, n)
	print(d * (n - d) + d * (d - 1) // 2)

def main():
	for _ in range(int(input())):
		solve(*map(int, input().split()))
main()


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, x, t) = map(int, input().split())
	a = min(n, t // x)
	print((a - 1) * a // 2 + max(0, n - a) * a)


import os, sys
from io import BytesIO, IOBase
from types import GeneratorType
from bisect import *
from collections import defaultdict, deque, Counter
import math, string
from heapq import *
from operator import add
from itertools import accumulate
BUFSIZE = 8192
sys.setrecursionlimit(10 ** 5)

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
inf = float('inf')
en = lambda x: list(enumerate(x))
ceil_ = lambda a, b: (a + b - 1) // b
ii = lambda : int(input())
r = lambda : map(int, input().split())
rr = lambda : list(r())

def solve():
	(n, x, t) = r()
	t = t // x
	if n <= t:
		print(n * (n - 1) // 2)
		return
	ans = (n - t) * t
	ans += t * (t - 1) // 2
	print(ans)
for _ in ' ' * ii():
	solve()


for s in [*open(0)][1:]:
	(n, x, t) = map(int, s.split())
	d = min(n, t // x)
	print(d * (2 * n - d - 1) // 2)


import os
import sys
from bisect import *
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	pass

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def lts(l):
	s = ''.join(map(str, l))
	return s

def stl(s):
	l = list(s)
	return l

def sq(a, target, arr=[]):
	s = sum(arr)
	if s == target:
		return arr
	if s >= target:
		return
	for i in range(len(a)):
		n = a[i]
		remaining = a[i + 1:]
		ans = sq(remaining, target, arr + [n])
		if ans:
			return ans

def SieveOfEratosthenes(n):
	cnt = 0
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, n + 1):
		if prime[p]:
			cnt += 1
	return cnt

def nCr(n, r):
	f = math.factorial
	return f(n) // f(r) // f(n - r)
mod = int(1000000000.0) + 7

def ssinp():
	return input()

def iinp():
	return int(input())

def nninp():
	return map(int, input().split())

def llinp():
	return list(map(int, input().split()))

def p(xyz):
	print(xyz)

def p2(a, b):
	print(a, b)
import math
from fractions import Fraction
for __ in range(int(input())):
	(n, x, t) = nninp()
	people = t // x
	people = min(n, people)
	ans = people * (people - 1) // 2 + (n - people) * people
	print(ans)


for _ in range(int(input())):
	(x, y, z) = map(int, input().split())
	m = z // y
	if m > x:
		print((x - 1) * x // 2)
	else:
		l = x * m - m * (m + 1) // 2
		print(l)


t = int(input())
for i in range(t):
	(n, x, k) = map(int, input().split(' '))
	dv = k // x
	if n <= dv:
		cnt = n * (n - 1) // 2
		print(cnt)
	else:
		cnt = (n - dv) * dv
		cnt += dv * (dv - 1) // 2
		print(cnt)


t = int(input())
for i in range(t):
	(n, x, t) = map(int, input().split())
	a = t // x
	print(max(0, n - a) * a + min(n, a) * min(n - 1, a - 1) // 2)


import os
import sys
from io import BytesIO, IOBase
from collections import Counter
import math as mt
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)
mod = int(1000000000.0) + 7

def power(k, n):
	if n == 0:
		return 1
	if n % 2:
		return power(k, n - 1) * k % mod
	t = power(k, n // 2)
	return t * t % mod

def totalPrimeFactors(n):
	count = 0
	if n % 2 == 0:
		count += 1
		while n % 2 == 0:
			n //= 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			count += 1
			while n % i == 0:
				n //= i
		i += 2
	if n > 2:
		count += 1
	return count

def main():
	for _ in range(int(input())):
		(n, x, t) = map(int, input().split())
		m = t // x
		if m <= n:
			print(max(0, n - m) * m + m * (m - 1) // 2)
		else:
			print(n * (n - 1) // 2)
	return
main()


for t in range(int(input())):
	(n, x, k) = map(int, input().split())
	v = k // x
	if n >= v:
		c = v * (n - v) + v * (v - 1) // 2
	else:
		c = n * (n - 1) // 2
	print(c)


t = int(input())
for i in range(t):
	(n, x, t) = [int(x) for x in input().split()]
	if t // x > n:
		print(n * (n - 1) // 2)
	else:
		print(t // x * n - t // x * (t // x + 1) // 2)


for _ in range(int(input())):
	(n, x, t) = [int(x) for x in input().split()]
	z = t // x
	if n < z:
		print(n * (n - 1) // 2)
	else:
		print(z * (z - 1) // 2 + z * (n - z))


k = input()
for i in range(int(k)):
	(n, x, t) = map(int, input().split())
	first = int(t / x)
	if first > n - 1:
		if n % 2 == 0:
			n2 = int(n / 2)
			print(int(n2 * (n - 1)))
		else:
			n2 = int((n - 1) / 2)
			print(int(n2 * n))
	elif first % 2 == 0:
		f2 = int(first / 2)
		print(int(first * (n - 1 - first) + f2 * (first + 1)))
	else:
		f2 = int((first + 1) / 2)
		print(int(first * (n - 1 - first) + f2 * first))


def gcd(x, y):
	while x:
		(x, y) = (y % x, x)
	return y
k = int(input())
for _ in range(k):
	(n, x, t) = map(int, input().split())
	discontent = t // x
	fin = min(n, discontent)
	res = fin * (fin - 1) // 2
	m = n - fin
	res += m * discontent
	print(res)


from sys import stdin, stdout
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque
from heapq import merge, heapify, heappop, heappush, nsmallest
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def inp():
	return stdin.readline().strip()

def iinp():
	return int(inp())

def out(var, end='\n'):
	stdout.write(str(var) + '\n')

def outa(*var, end='\n'):
	stdout.write(' '.join(map(str, var)) + end)

def lmp():
	return list(mp())

def mp():
	return map(int, inp().split())

def smp():
	return map(str, inp().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(m, val) for j in range(n)]

def remadd(x, y):
	return 1 if x % y else 0

def ceil(a, b):
	return (a + b - 1) // b
S1 = 'abcdefghijklmnopqrstuvwxyz'
S2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def isprime(x):
	if x <= 1:
		return False
	if x in (2, 3):
		return True
	if x % 2 == 0:
		return False
	for i in range(3, int(sqrt(x)) + 1, 2):
		if x % i == 0:
			return False
	return True
for _ in range(int(inp())):
	(n, x, t) = mp()
	k = min(n - 1, t // x)
	ans = k * (k + 1) // 2 + (n - 1 - k) * k
	print(ans)


for i in range(int(input())):
	(n, x, t) = map(int, input().split())
	s = min(t // x, n - 1)
	print(s * (s - 1) // 2 + s * (n - s))


def main():
	(n, x, t) = map(int, input().split())
	ans = 0
	if (n - 1) * x <= t:
		return n * (n - 1) // 2
	complete = (n * x - t) // x
	rem = n - complete
	ans += complete * (t // x)
	ans += rem * (rem - 1) // 2
	return ans
for _ in range(int(input())):
	print(main())


import sys

def readnum():
	input = sys.stdin.readline
	a = list(map(int, input().split()))
	return a

def printf(val):
	sys.stdout.write(str(val) + '\n')
t = readnum()[0]
for _ in range(t):
	(n, x, t) = readnum()
	l = t // x
	if n < l:
		print(int(n * (n - 1) // 2))
	else:
		extra = int(t % x != 0)
		print(int((n - l) * l + (l - 1) * l // 2))


k = int(input())
while k > 0:
	k -= 1
	(n, x, t) = map(int, input().split())
	z = t // x
	if n < z:
		print((n - 1) * n // 2)
	else:
		print(n * z + (z - 1) * z // 2 - z ** 2)


for i in range(int(input())):
	(n, x, t) = map(int, input().split())
	(u, v) = (t // x, min(n - 1, t // x))
	print(n * u - (v + 1) * u + v * (v + 1) // 2)


k = int(input())
for i in range(k):
	(n, x, t) = map(int, input().split())
	z = t // x
	res = 0
	if n < z:
		res = n * (n - 1) // 2
	else:
		y = n - z
		if z != 2:
			res += y * z + z * (z - 1) // 2
		else:
			res += y * z + 1
	print(res)


import os
import sys
import math
from io import BytesIO, IOBase
import io
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
from collections import Counter
import threading
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: max(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree1:

	def __init__(self, data, default=10 ** 6, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)
MOD = 10 ** 9 + 7

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
mod = 10 ** 9 + 7
omod = 998244353
prime = [True for i in range(10001)]
prime[0] = prime[1] = False

def SieveOfEratosthenes(n=10000):
	p = 2
	c = 0
	while p <= n:
		if prime[p] == True:
			c += 1
			for i in range(p, n + 1, p):
				prime[i] = False
		p += 1

class DSU:

	def __init__(self, R, C):
		self.par = range(R * C + 1)
		self.rnk = [0] * (R * C + 1)
		self.sz = [1] * (R * C + 1)

	def find(self, x):
		if self.par[x] != x:
			self.par[x] = self.find(self.par[x])
		return self.par[x]

	def union(self, x, y):
		(xr, yr) = (self.find(x), self.find(y))
		if xr == yr:
			return
		if self.rnk[xr] < self.rnk[yr]:
			(xr, yr) = (yr, xr)
		if self.rnk[xr] == self.rnk[yr]:
			self.rnk[xr] += 1
		self.par[yr] = xr
		self.sz[xr] += self.sz[yr]

	def size(self, x):
		return self.sz[self.find(x)]

	def top(self):
		return self.size(len(self.sz) - 1) - 1

class LazySegTree:

	def __init__(self, _op, _e, _mapping, _composition, _id, v):

		def set(p, x):
			assert 0 <= p < _n
			p += _size
			for i in range(_log, 0, -1):
				_push(p >> i)
			_d[p] = x
			for i in range(1, _log + 1):
				_update(p >> i)

		def get(p):
			assert 0 <= p < _n
			p += _size
			for i in range(_log, 0, -1):
				_push(p >> i)
			return _d[p]

		def prod(l, r):
			assert 0 <= l <= r <= _n
			if l == r:
				return _e
			l += _size
			r += _size
			for i in range(_log, 0, -1):
				if l >> i << i != l:
					_push(l >> i)
				if r >> i << i != r:
					_push(r >> i)
			sml = _e
			smr = _e
			while l < r:
				if l & 1:
					sml = _op(sml, _d[l])
					l += 1
				if r & 1:
					r -= 1
					smr = _op(_d[r], smr)
				l >>= 1
				r >>= 1
			return _op(sml, smr)

		def apply(l, r, f):
			assert 0 <= l <= r <= _n
			if l == r:
				return
			l += _size
			r += _size
			for i in range(_log, 0, -1):
				if l >> i << i != l:
					_push(l >> i)
				if r >> i << i != r:
					_push(r - 1 >> i)
			l2 = l
			r2 = r
			while l < r:
				if l & 1:
					_all_apply(l, f)
					l += 1
				if r & 1:
					r -= 1
					_all_apply(r, f)
				l >>= 1
				r >>= 1
			l = l2
			r = r2
			for i in range(1, _log + 1):
				if l >> i << i != l:
					_update(l >> i)
				if r >> i << i != r:
					_update(r - 1 >> i)

		def _update(k):
			_d[k] = _op(_d[2 * k], _d[2 * k + 1])

		def _all_apply(k, f):
			_d[k] = _mapping(f, _d[k])
			if k < _size:
				_lz[k] = _composition(f, _lz[k])

		def _push(k):
			_all_apply(2 * k, _lz[k])
			_all_apply(2 * k + 1, _lz[k])
			_lz[k] = _id
		_n = len(v)
		_log = _n.bit_length()
		_size = 1 << _log
		_d = [_e] * (2 * _size)
		_lz = [_id] * _size
		for i in range(_n):
			_d[_size + i] = v[i]
		for i in range(_size - 1, 0, -1):
			_update(i)
		self.set = set
		self.get = get
		self.prod = prod
		self.apply = apply
MIL = 1 << 20

def makeNode(total, count):
	return total * MIL + count

def getTotal(node):
	return math.floor(node / MIL)

def getCount(node):
	return node - getTotal(node) * MIL
nodeIdentity = makeNode(0.0, 0.0)

def nodeOp(node1, node2):
	return node1 + node2
	return makeNode(getTotal(node1) + getTotal(node2), getCount(node1) + getCount(node2))
identityMapping = -1

def mapping(tag, node):
	if tag == identityMapping:
		return node
	count = getCount(node)
	return makeNode(tag * count, count)

def composition(mapping1, mapping2):
	return mapping1 if mapping1 != identityMapping else mapping2

def memodict(f):

	class memodict(dict):

		def __missing__(self, key):
			ret = self[key] = f(key)
			return ret
	return memodict().__getitem__

def pollard_rho(n):
	if n & 1 == 0:
		return 2
	if n % 3 == 0:
		return 3
	s = (n - 1 & 1 - n).bit_length() - 1
	d = n >> s
	for a in [2, 325, 9375, 28178, 450775, 9780504, 1795265022]:
		p = pow(a, d, n)
		if p == 1 or p == n - 1 or a % n == 0:
			continue
		for _ in range(s):
			prev = p
			p = p * p % n
			if p == 1:
				return math.gcd(prev - 1, n)
			if p == n - 1:
				break
		else:
			for i in range(2, n):
				(x, y) = (i, (i * i + 1) % n)
				f = math.gcd(abs(x - y), n)
				while f == 1:
					(x, y) = ((x * x + 1) % n, (y * y + 1) % n)
					y = (y * y + 1) % n
					f = math.gcd(abs(x - y), n)
				if f != n:
					return f
	return n

@memodict
def prime_factors(n):
	if n <= 1:
		return Counter()
	f = pollard_rho(n)
	return Counter([n]) if f == n else prime_factors(f) + prime_factors(n // f)

def distinct_factors(n):
	factors = [1]
	for (p, exp) in prime_factors(n).items():
		factors += [p ** i * factor for factor in factors for i in range(1, exp + 1)]
	return factors

def all_factors(n):
	(small, large) = ([], [])
	for i in range(1, int(n ** 0.5) + 1, 2 if n & 1 else 1):
		if not n % i:
			small.append(i)
			large.append(n // i)
	if small[-1] == large[-1]:
		large.pop()
	large.reverse()
	small.extend(large)
	return small

def binarySearch(arr, n, key):
	left = 0
	right = n - 1
	mid = 0
	res = arr[n - 1]
	while left <= right:
		mid = (right + left) // 2
		if arr[mid] >= key:
			res = arr[mid]
			right = mid - 1
		else:
			left = mid + 1
	return res

def binarySearch1(arr, n, key):
	left = 0
	right = n - 1
	mid = 0
	res = arr[0]
	while left <= right:
		mid = (right + left) // 2
		if arr[mid] > key:
			right = mid - 1
		else:
			res = arr[mid]
			left = mid + 1
	return res
t = 1
t = int(input())
for _ in range(t):
	(n, x, time) = map(int, input().split())
	per = left = time // x
	left = min(left, n)
	res = (n - left) * per
	res += left * (left - 1) // 2
	print(res)


import sys, math
from collections import deque, defaultdict
import operator as op
from functools import reduce
from itertools import permutations
import heapq
I = sys.stdin.readline
alpha = 'abcdefghijklmnopqrstuvwxyz'
mod = 10 ** 9 + 7

def ii():
	return int(I().strip())

def li():
	return list(map(int, I().strip().split()))

def mi():
	return map(int, I().strip().split())

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def ispali(s):
	i = 0
	j = len(s) - 1
	while i < j:
		if s[i] != s[j]:
			return False
		i += 1
		j -= 1
	return True

def isPrime(n):
	if n <= 1:
		return False
	elif n <= 2:
		return True
	else:
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				return False
		return True

def main():
	ans = ''
	for _ in range(ii()):
		(n, x, t) = mi()
		last = (n - 1) * x
		cnt = 0
		if t >= last:
			cnt = n * (n - 1) // 2
		else:
			tmp = math.ceil((last - t) // x) + 1
			cnt += tmp * (t // x)
			left = n - tmp - 1
			cnt += left * (left + 1) // 2
		ans += str(cnt) + '\n'
	print(ans)
main()


test_cases = int(input())
for _ in range(test_cases):
	(no_candidates, interval, each_duration) = list(map(int, input().split()))
	point_of_change_from_last = min(no_candidates, each_duration // interval)
	score = (no_candidates - point_of_change_from_last) * (each_duration // interval)
	score += (point_of_change_from_last - 1) * point_of_change_from_last // 2
	print(int(score))


for _ in range(int(input())):
	(n, m, t) = map(int, input().split())
	tre = t // m
	if n * m <= t:
		sum = n * (n - 1) // 2
		print(sum)
	else:
		sum = tre * (n - tre)
		sum += tre * (tre - 1) // 2
		print(sum)


try:
	import sys
	import math
	import collections
	M = 10 ** 9 + 7

	def solve():
		(n, x, t) = map(int, input().split())
		if (n - 1) * x <= t:
			ans = (n - 1) * n // 2
		elif t % x == 0:
			p = t // x
			ans = p * (n - p) + p * (p - 1) // 2
		else:
			p = t // x
			ans = p * (n - p) + p * (p - 1) // 2
		return ans
	test = int(input())
	count1 = 1
	while count1 <= test:
		ans = solve()
		sys.stdout.write(str(ans) + '\n')
		count1 += 1
except EOFError:
	print('')


for _ in range(int(input())):
	(n, x, t) = map(int, input().split())
	a = min(t // x, n - 1)
	print(a * (a + 1) // 2 + a * (n - 1 - a))


for _ in range(int(input())):
	(n, x, t) = [int(i) for i in input().split()]
	if t < x:
		print('0')
	else:
		if n >= t // x:
			s = (t // x - 1) * (t // x) // 2
			s += t // x * (n - t // x)
		else:
			s = (n - 1) * n // 2
		print(s)


k = int(input())
res = []
for _ in range(k):
	(n, x, t) = list(map(int, input().split()))
	rng = t // x
	delim = max(-1, n - 1 - rng)
	ans = rng * (delim + 1)
	ans += (n - 1 - delim) * (n - 1)
	ans -= (n - 1 - delim) * (n + delim) // 2
	res.append(ans)
for ans in res:
	print(ans)


for _ in range(int(input())):
	(n, x, t) = map(int, input().split())
	b = t // x
	ans = 0
	if b >= n:
		print(n * (n - 1) // 2)
	else:
		ans = (n - b) * b
		ans += b * (b - 1) // 2
		print(ans)


def solve():
	(n, x, t) = map(int, input().split())
	if t < x or n == 1:
		return 0
	if t == x:
		return n - 1
	b = max(1, n - t // x)
	d = n - b
	ans = d * (n + b - 1) >> 1
	return ans
for _ in range(int(input())):
	print(solve())


k = int(input())
for _ in range(k):
	(n, x, t) = map(int, input().split())
	if x > t:
		print(0)
	else:
		s = 0
		r = t // x
		if n < r:
			s += n * (n - 1) >> 1
		else:
			s += (n - r) * r
			s += r * (r - 1) >> 1
		print(s)


def fun2(n, x, t):
	if n * x >= t:
		t1 = t // x
		sum1 = t1 * (t1 + 1) // 2
		sum2 = t1 * (n - 1 - t1)
		return sum1 + sum2
	else:
		t1 = n - 1
		sum1 = t1 * (t1 + 1) // 2
		return sum1
k = int(input())
for i in range(k):
	[n, x, t] = list(map(int, input().split(' ')))
	print(fun2(n, x, t))


test = int(input())
for i in range(test):
	(n, x, t) = list(map(int, input().split()))
	if n == 1:
		d = 0
	else:
		value = min(n, t // x)
		d = n * value - value * (value + 1) // 2
	print(d)


R = lambda : map(int, input().split())
k = int(input())

def solve(n, x, t):
	wait = t // x
	remain = min(wait, n)
	ans = max((n - wait) * wait, 0) + remain * (remain - 1) // 2
	return ans
for _ in range(k):
	(n, x, t) = R()
	print(solve(n, x, t))


for _ in range(int(input())):
	arr = [int(x) for x in input().split()]
	(n, x, t) = (arr[0], arr[1], arr[2])
	temp = t // x
	ans = 0
	if n - temp > 0:
		k = n - temp
		ans = k * temp
		temp -= 1
		ans += temp * (temp + 1) // 2
	else:
		n -= 1
		ans += n * (n + 1) // 2
	print(ans)


k = int(input())
for _ in range(k):
	(n, x, t) = map(int, input().split())
	if n < t // x + 1:
		print(n * (n - 1) // 2)
	else:
		print((t // x + 1) * (t // x) // 2 + (n - t // x - 1) * (t // x))


from math import *
from sys import *
from bisect import bisect_left as bl
from bisect import bisect_right as br
from collections import Counter as ctr
from collections import deque as dq
inp = lambda : int(input())
li = lambda : list(map(int, input().split()))
lb = lambda : list(map(int, input().split()[0]))
ls = lambda : list(input())
bi = lambda n: bin(n).replace('0b', '')
yn = lambda f: print('NYOE S'[f::2])
srp = lambda s, i, c: s[:i] + c + s[i + 1:]

def solve(__=1):
	for _ in range(__):
		(n, x, t) = li()
		tmp = min(t // x, n - 1)
		print((n - tmp) * tmp + (tmp - 1) * tmp // 2)
solve(inp())


import heapq
import sys
from math import *
import threading
from heapq import *
from itertools import count
from pprint import pprint
from collections import defaultdict
from heapq import heapify, heappop, heappush
sys.setrecursionlimit(300000)
mod = 10 ** 9 + 7
inf = 10 ** 15
decision = ['NO', 'YES']
yes = 'YES'
no = 'NO'
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def npr(n, r):
	return factorial(n) % mod // (factorial(n - r) % mod) if n >= r else 0

def ncr(n, r):
	return factorial(n) % mod // (factorial(r) % mod * (factorial(n - r) % mod)) if n >= r else 0

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val):
	ans = -1
	lb = 0
	ub = len(li) - 1
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = mid
			break
	return ans

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = max(sum_so_far, current_sum)
	return sum_so_far

def pref(li):
	pref_sum = [0]
	for i in li:
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum

def SieveOfEratosthenes(n):
	prime = [{1, i} for i in range(n + 1)]
	p = 2
	while p <= n:
		for i in range(p * 2, n + 1, p):
			prime[i].add(p)
		p += 1
	return prime

def primefactors(n):
	factors = []
	while n % 2 == 0:
		factors.append(2)
		n //= 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			factors.append(i)
			n //= i
	if n > 2:
		factors.append(n)
	return factors

def prod(li):
	ans = 1
	for i in li:
		ans *= i
	return ans

def sumk(a, b):
	print('called for', a, b)
	ans = a * (a + 1) // 2
	ans -= b * (b + 1) // 2
	return ans

def sumi(n):
	ans = 0
	if len(n) > 1:
		for x in n:
			ans += int(x)
		return ans
	else:
		return int(n)

def checkwin(x, a):
	if a[0][0] == a[1][1] == a[2][2] == x:
		return 1
	if a[0][2] == a[1][1] == a[2][0] == x:
		return 1
	if len(set(a[0])) == 1 and a[0][0] == x or (len(set(a[1])) == 1 and a[1][0] == x) or (len(set(a[2])) == 1 and a[2][0] == x):
		return 1
	if len(set(a[0][:])) == 1 and a[0][0] == x or (len(set(a[1][:])) == 1 and a[0][1] == x) or (len(set(a[2][:])) == 1 and a[0][0] == x):
		return 1
	return 0
karmanya = int(input())
while karmanya != 0:
	karmanya -= 1
	(n, x, t) = map(int, input().split())
	p = min(n, t // x)
	ans = p * (p - 1) // 2 + p * (n - p)
	print(ans)


import math
for _ in range(int(input())):
	(n, x, t) = map(int, input().split())
	r = math.floor(t / x)
	k = min(r - 1, n - 1)
	print(max(0, n - r) * r + k * (k + 1) // 2)


import math

def proA(n, x, t):
	if n == 1:
		return 0
	endt = (n - 1) * x
	c = t // x
	temp = endt - t
	if temp < 0:
		x = n - 1
		return x * (x + 1) // 2
	y = math.ceil(temp / x)
	x = n - (y + 1) - 1
	return (y + 1) * c + x * (x + 1) // 2
t = int(input())
for i in range(t):
	(n, x, t) = list(map(int, input().split()))
	print(proA(n, x, t))


for _ in range(int(input())):
	(n, x, t) = map(int, input().split())
	p = min(n, t // x)
	ans = p * n - p * (p + 1) // 2
	print(ans)


import bisect
for _ in range(int(input())):
	(n, x, t) = map(int, input().split())
	z = t // x
	if z > n:
		print((n - 1) * n // 2)
	else:
		print(z * n - z * (z + 1) // 2)


def solve():
	(n, x, t) = map(int, input().split())
	y = t // x
	if n <= y:
		return n * (n - 1) // 2
	return y * (y - 1) // 2 + y * (n - y)
for _ in range(int(input())):
	print(solve())


import math

def solve():
	(n, x, t) = map(int, input().split())
	v = min(n - 1, t // x)
	if v == 0:
		print(0)
	else:
		s = max(0, v * (v - 1) // 2) + v * (n - v)
		print(s)
t = int(input())
for z in range(t):
	solve()


for t in range(int(input())):
	(n, x, t) = map(int, input().split())
	d = min(n, t // x)
	print(d * ~d // 2 + d * n)


import sys
import math
import heapq
from collections import defaultdict as dd
from collections import OrderedDict as od
from itertools import permutations as pp
from itertools import combinations as cc
from sys import stdin
from functools import cmp_to_key
input = stdin.readline
m = 10 ** 9 + 7
sys.setrecursionlimit(10 ** 5)
T = int(input())
for _ in range(T):
	(n, x, t) = map(int, input().split())
	p = t // x
	if p > n:
		print(n * (n - 1) // 2)
		continue
	ans = p * (p - 1) // 2 + (n - p) * p
	print(ans)


for _ in range(int(input())):
	(f, q, j) = map(int, input().split())
	ans = min(f - 1, j // q)
	if ans == 0:
		print(0)
	else:
		finalsol = max(0, ans * (ans - 1) // 2) + ans * (f - ans)
		print(finalsol)


k = int(input())
if 1 <= k <= 1000:
	n = [0 for i in range(k)]
	x = [0 for i in range(k)]
	t = [0 for i in range(k)]
	for i in range(k):
		(n[i], x[i], t[i]) = map(int, input().split())
		if 1 <= n[i] <= 2 * 10 ** 9 and 1 <= x[i] <= 2 * 10 ** 9 and (1 <= t[i] <= 2 * 10 ** 9):
			if t[i] < x[i]:
				print('0')
				continue
			j = min(n[i], t[i] // x[i])
			count = j * (n[i] - j) + j * (j - 1) // 2
			print(count)


n = int(input())
for i in range(n):
	p = [int(i) for i in input().split()]
	a = p[0]
	b = p[1]
	c = p[2]
	if c < b:
		print(0)
	else:
		g = c // b
		if g >= a - 1:
			print(a * (a - 1) // 2)
		else:
			s = (a - g) * g + g * (g - 1) // 2
			print(s)


k = int(input())
for test in range(k):
	(n, x, t) = [int(i) for i in input().split(' ')]
	d = t // x
	d = min(n, d)
	ans = (n - d) * d + (d - 1) * d // 2
	print(ans)


q = int(input())
for t in range(q):
	(a, b, c) = map(int, input().split())
	q1 = c // b
	if a == 1:
		print(0)
	else:
		if q1 >= a:
			q1 = a - 1
		a -= q1
		b = q1 * (a - 1)
		q1 = q1 * (q1 + 1)
		q1 //= 2
		if b >= 0:
			q1 += b
		print(q1)


rr = lambda : input().strip()
rrm = lambda : map(int, rr().split())

def solve():
	(n, x, t) = rrm()
	if t < x:
		return 0
	k = t // x
	if n < k:
		return n * (n - 1) // 2
	ans = k * (2 * n - k - 1) // 2
	return ans
T = int(rr())
for _ in range(T):
	ans = solve()
	print(ans)


for testcase in range(int(input())):
	(n, x, t) = [int(x) for x in input().split()]
	k = t // x
	if t > (n - 1) * x:
		print(n * (n - 1) // 2)
	else:
		print(n * k - k * (k + 1) // 2)


def solve(n, x, t):
	numDissatisfied = 0
	common = t // x
	if common >= n:
		return (n - 1) * n // 2
	else:
		numDissatisfied = (n - common) * common + (common - 1) * common // 2
	return max(numDissatisfied, 0)
t = int(input())
for test in range(1, t + 1):
	(n, x, t) = list(map(int, input().split()))
	print(f'{solve(n, x, t)}')


t = int(input())
while t:
	t -= 1
	(n, m, k) = map(int, input().split())
	val = k // m
	if n > val:
		val = val * (n - val) + val * (val - 1) // 2
	else:
		val = n * (n - 1) // 2
	print(val)


for ti in range(int(input())):
	(n, x, t) = map(int, input().split())
	a = t // x
	b = min(a, n)
	r = b * (b - 1) // 2
	r += (n - b) * a
	print(r)


for _ in range(int(input())):
	(n, x, t) = map(int, input().split())
	zc = min(t // x, n - 1)
	by = 1 if zc >= n - 1 else n - zc
	print(by * zc + zc * (zc - 1) // 2)


t = int(input())
for i in range(t):
	sum = 0
	(n, x, t) = map(int, input().split())
	val = min(n, t // x)
	sum = val * (2 * n - val - 1) // 2
	print(sum)


k = int(input())
for i in range(k):
	(n, x, t) = map(int, input().split())
	a = t // x
	if n == 1:
		print(0)
		continue
	ans = a * (a + 1) // 2
	if a <= n - 1:
		print(a * (n - a - 1) + ans)
	else:
		print(n * (n - 1) // 2)


for i in range(int(input())):
	(n, x, t) = map(int, input().split())
	if t // x + 1 >= n:
		print(n * (n - 1) // 2)
	else:
		a = t // x
		sum = (n - a) * a + a * (a - 1) // 2
		print(sum)


from collections import Counter
from collections import defaultdict as dfd
from bisect import bisect, bisect_left
from math import sqrt, gcd, ceil, factorial
from heapq import heapify, heappush, heappop
MOD = 10 ** 9 + 7
inf = float('inf')
ans_ = []

def nin():
	return int(input())

def ninf():
	return int(file.readline())

def st():
	return input().strip()

def stf():
	return file.readline().strip()

def read():
	return list(map(int, input().strip().split()))

def readf():
	return list(map(int, file.readline().strip().split()))

def solve():
	for _ in range(nin()):
		(n, x, t) = read()
		g = t // x
		if g >= n:
			ans_.append(n * (n - 1) // 2)
		else:
			ans_.append((n - 1) * g - g * (g - 1) // 2)
solve()
for i in ans_:
	print(i)


def Solution(n, x, t):
	z = t // x
	if z > n:
		return n * (n - 1) // 2
	else:
		return (n - z) * z + z * (z - 1) // 2
ans = []
k = int(input())
for i in range(k):
	(n, x, t) = map(int, input().split())
	ans.append(Solution(n, x, t))
for i in ans:
	print(i)


try:
	for _ in range(int(input())):
		(n, x, t) = map(int, input().split())
		maximum = t // x
		if maximum >= n:
			print(n * (n - 1) // 2)
		else:
			diff = n - maximum - 1
			print(diff * maximum + maximum * (maximum + 1) // 2)
except e:
	pass


def Getresult(n, x, t):
	a = t // x
	if n < a + 1:
		return n * (n - 1) // 2
	else:
		return (a + 1) * a // 2 + (n - a - 1) * a
k = int(input())
result = list()
for i in range(k):
	list1 = input().split(' ')
	list2 = list()
	for j in list1:
		list2.append(int(j))
	result.append(Getresult(list2[0], list2[1], list2[2]))
for i in result:
	print(i)


import sys, heapq, bisect, math
from collections import defaultdict, deque
input = sys.stdin.readline
mod = 10 ** 9 + 7
T = int(input())
for _ in range(T):
	(n, x, t) = map(int, input().split())
	val = t // x
	rm = min(n, val)
	ans = rm * (rm - 1) // 2
	n = n - rm
	ans = ans + n * val
	print(ans)


a = int(input())
for i in range(0, a):
	(n, x, t) = (int(x) for x in input().split())
	ans = 0
	c = t // x
	if n - c >= 0:
		ans = (n - c) * c + c * (c - 1) // 2
	else:
		ans = n * (n - 1) // 2
	print(ans)


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	k = int(input())
	for _ in range(k):
		(n, x, t) = map(int, input().split())
		each = t // x
		each = min(each, n - 1)
		print(each * (each + 1) // 2 + (n - each - 1) * each)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def dheeraj1(g):
	g += 1
test1 = int(input())
for _ in range(test1):
	dheeraj1(10)
	(N, x, t) = map(int, input().split())
	total = min(N - 1, t // x)
	print(total * (total - 1) // 2 + total * (N - total))


for _ in range(int(input())):
	(n, m, k) = list(map(int, input().split()))
	a = k // m
	if n <= a:
		print(n * (n - 1) // 2)
	else:
		s = (n - a) * a
		s += (a - 1) * a // 2
		print(s)


from timeit import timeit
import os, sys
from datetime import datetime
from math import floor, sqrt, gcd, factorial
from collections import Counter, defaultdict
import bisect
from itertools import chain
from collections import deque
from sys import maxsize as INT_MAX
INF = float('inf')
mod = int(1000000000.0) + 7

def readint():
	return int(sys.stdin.readline())

def readstr():
	return sys.stdin.readline()

def readlst():
	return list(map(int, sys.stdin.readline().strip().split()))

def readmul():
	return map(int, sys.stdin.readline().strip().split())

def mulfloat():
	return map(float, sys.stdin.readline().strip().split())

def flush():
	return sys.stdout.flush()

def power_two(x):
	return 1 << x

def lcm(a, b):
	return a * b // gcd(a, b)

def ceil(a, b):
	return int((a + b - 1) / b)

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
			return n - leftGreater

def two_pointer(n, val, *arr):
	(l, r, cnt) = (0, n - 1, 0)
	while l < r:
		if arr[l] + arr[r] > val:
			r -= 1
		else:
			cnt += r - l
			l += 1
	return cnt

def lower(arr, n, val):
	(l, r) = (-1, n)
	while r > l + 1:
		m = int(l + r >> 1)
		if arr[m] < val:
			l = m
		else:
			r = m
	return r

def upper(arr, n, val):
	(l, r) = (-1, n)
	while r > l + 1:
		m = int(l + r >> 1)
		if arr[m] <= val:
			l = m
		else:
			r = m
	return l

def BFS(adj, src, dist, paths, n):
	visited = [False] * n
	dist[src] = 0
	paths[src] = 1
	q = deque()
	q.append(src)
	visited[src] = True
	while q:
		curr = q[0]
		q.popleft()
		for x in adj[curr]:
			if not visited[x]:
				q.append(x)
				visited[x] = True
			if dist[x] > dist[curr] + 1:
				dist[x] = dist[curr] + 1
				paths[x] = paths[curr] % mod
			elif dist[x] == dist[curr] + 1:
				paths[x] = (paths[x] % mod + paths[curr] % mod) % mod

def binpow(a, n, mod):
	res = 1
	while n:
		if n & 1:
			res = res * a % mod
			n -= 1
		a = a * a % mod
		n = n >> 1
	return res

def is_perfect_square(num):
	temp = num ** 0.5
	return temp // 1 == temp

def printmat(l):
	for i in range(0, len(l)):
		print(*l[i], sep='')
	print()

def omkar():
	(n, x, t) = readmul()
	print(max(0, n - t // x) * (t // x) + min(n - 1, t // x - 1) * min(n, t // x) // 2)
	return

def main():
	tc = readint()
	while tc:
		omkar()
		tc -= 1
main()


from sys import stdin, stderr
input = stdin.readline

def dbp(*args, **kwargs):
	print(*args, file=stderr, **kwargs)

def get_int_list():
	return [int(x) for x in input().strip().split()]

def sleep_deprived_slow_solve(n, x, t):
	dis = 0
	ongoing = []
	for i in range(n):
		ongoing.append((x * i, x * i + t))
	for i in range(n):
		endt = ongoing[i][1]
		for j in range(i + 1, n):
			if ongoing[j][0] <= endt <= ongoing[j][1]:
				dis += 1
	return dis

def do_thing():
	(n, x, t) = get_int_list()
	maxindividualdis = min(t // x, n)
	if maxindividualdis == 0:
		return 0
	maxtotaldis = maxindividualdis * n
	mr = maxtotaldis - maxindividualdis * (maxindividualdis + 1) // 2
	return mr

def multicase():
	maxcc = int(input().strip())
	for cc in range(maxcc):
		print(do_thing())
multicase()


n = int(input())
for i in range(n):
	a = list(map(int, input().split()))
	n1 = a[0]
	x = a[1]
	t = a[2]
	c = t // x
	if n1 <= c:
		d = n1 * (n1 - 1) // 2
	else:
		d = c * (c - 1) // 2 + (n1 - c) * c
	print(d)


t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	t = min(a - 1, c // b)
	l = a - t
	print(t * (t - 1) // 2 + t * l)


import math
from collections import Counter, deque, defaultdict
k = int(input())
for _ in range(k):
	(n, x, t) = [int(x) for x in input().split()]
	z = t // x
	if z < n:
		print(n * z - z * (z + 1) // 2)
	else:
		print(n * (n - 1) // 2)


test = int(input())
for k in range(test):
	(n, x, t) = list(map(int, input().split()))
	d = t // x
	m = min(n, d)
	print(n * m - m * (m + 1) // 2)


for i in range(int(input())):
	(x, y, z) = map(int, input().split())
	a = 0
	if z // y < x:
		k = z // y
		a = k * (x - k) + (k - 1) * k // 2
		print(a)
	else:
		print((x - 1) * x // 2)


T = int(input())
for _ in range(T):
	(n, x, t) = list(map(int, input().split(' ')))
	d = min(n - 1, t // x)
	if d == 0:
		print(d)
	else:
		print(max(0, (n - d) * d) + d * (d - 1) // 2)


m = int(input())
for i in range(m):
	(n, x, t) = map(int, input().split())
	a = min(t // x, n)
	if a == 0:
		print('0')
	else:
		print(a * (a - 1) // 2 + (n - a) * a)


t = int(input())
for i in range(0, t):
	(n, x, k) = list(map(int, input().split()))
	if k < x:
		print(0)
	else:
		n1 = k // x
		n1 = min(n, n1)
		s = n1 * (n1 - 1) // 2
		s += (n - n1) * (k // x)
		print(s)


import heapq, math
from collections import defaultdict, deque
from os import getcwd
import sys, os.path
if os.path.exists('C:/Users/Dhanush/Desktop/cp/input.txt'):
	sys.stdout = open('C:/Users/Dhanush/Desktop/cp/output.txt', 'w')
	sys.stdin = open('C:/Users/Dhanush/Desktop/cp/input.txt', 'r')
input = sys.stdin.readline
k = int(input())
for _ in range(k):
	(n, x, t) = map(int, input().split())
	if t < x:
		print(0)
	elif t == x:
		print(n - 1)
	else:
		count = t // x
		ans = max(0, n - count) * count
		temp = min(count - 1, n - 1)
		ans += temp * (temp + 1) // 2
		print(ans)


import math
case = int(input())
for i in range(case):
	(n, x, t) = map(int, input().split())
	a = math.ceil((t + 1) / x)
	if (t + x) / x >= n:
		print((n - 1) * n // 2)
	else:
		print((n - a) * (a - 1) + (a - 1) * a // 2)


from math import ceil

def solve(n, x, t):
	totalDisSat = 0
	commonDisSat = ceil((t + 1) / x)
	if commonDisSat > n:
		commonDisSat = n - 1
	else:
		commonDisSat -= 1
	finishOfCommon = n - commonDisSat
	totalDisSat += (finishOfCommon - 1) * commonDisSat + (commonDisSat + 1) * commonDisSat // 2
	print(totalDisSat)
for _ in range(int(input())):
	(n, x, t) = map(int, input().split())
	solve(n, x, t)


for i in range(int(input())):
	(n, x, t) = map(int, input().split())
	l = 0
	get = min(n - 1, t // x)
	if get == 0:
		print(0)
	else:
		maxi = max(l, get * (get - 1) // 2 + get * (n - get))
		print(maxi)


def solve(n, x, t):
	f = n - 1
	y = t // x
	mi = min(f, y)
	if mi == 0:
		print(0)
	else:
		z = mi * (mi - 1) // 2
		if x > 0:
			print(z + mi * (n - mi))
		else:
			print(mi * (n - mi))
for t in range(int(input())):
	(n, x, t) = map(int, input().split())
	solve(n, x, t)


k = int(input())
for i in range(0, k):
	(n, x, t) = [int(x) for x in input().split()]
	diss1 = t // x
	if diss1 < n:
		dissc = (n - diss1) * diss1
		print(dissc + diss1 * (diss1 - 1) // 2)
	else:
		dissc = 0
		print(dissc + n * (n - 1) // 2)


for _ in range(int(input())):
	(n, x, t) = map(int, input().split())
	kali = t // x
	if kali <= n:
		has = kali * n - kali * (kali + 1) // 2
	else:
		has = n * (n - 1) // 2
	print(has)


import math
k = int(input())
for _ in range(k):
	(n, x, t) = map(int, input().split())
	if t < x:
		print(0)
	else:
		r = t // x
		l = n - r
		ans = l * r
		ans += r * (r - 1) // 2
		if l < 0:
			print(n * (n - 1) // 2)
		else:
			print(ans)


for tc in range(int(input())):
	(N, X, T) = map(int, input().split())
	U = 0
	if T // X < N:
		U += (N - T // X - 1) * (T // X)
		U += (T // X + 1) * (T // X) >> 1
	else:
		U += N * (N - 1) >> 1
	print(U)


for _ in range(int(input())):
	(n, x, t) = map(int, input().split())
	if (n - 1) * x > t:
		if t // x == 0:
			print(0)
		else:
			a = t // x
			c = a * (n - a)
			print(c + a * (a - 1) // 2)
	else:
		print(n * (n - 1) // 2)


for _ in range(int(input())):
	(n, x, t) = [int(x) for x in input().split()]
	c = t // x
	if c <= n:
		ans = c * (n - c) + (c - 1) * c // 2
	else:
		ans = n * (n - 1) // 2
	print(ans)


for _ in range(int(input())):
	(n, x, t) = map(int, input().split())
	full = t // x
	if full > n:
		full = n
	head = n - full
	res = head * full + full * (full - 1) // 2
	print(res)


import sys
import math
from collections import *
from queue import *
from bisect import *
MOD = int(1000000000.0 + 7)
inf = float('inf')
ninf = float('-inf')
input = sys.stdin.readline

def ii():
	return list(map(int, input().strip().split()))
for _ in range(int(input())):
	(n, x, t) = ii()
	p = min(t // x, n)
	m = max(0, n - p)
	cnt = p * m
	cnt += p * (p - 1) // 2
	print(cnt)


k = int(input())
while k > 0:
	(n, x, t) = map(int, input().split())
	if x > t:
		print(0)
		k -= 1
		continue
	first = t // x
	if first >= n - 1:
		ans = n - 1
		ans = ans * (ans + 1) // 2
		print(ans)
	else:
		ans = first
		ans1 = first * (first + 1) // 2
		ans2 = (n - 1 - first) * first
		print(ans1 + ans2)
	k -= 1


import os
import sys
from io import BytesIO, IOBase
import math
from decimal import *
from collections import defaultdict, deque
import heapq
getcontext().prec = 25
abcd = 'abcdefghijklmnopqrstuvwxyz'
MOD = pow(10, 9) + 7
BUFSIZE = 8192
from bisect import bisect_left, bisect_right

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	(n, x, t) = map(int, input().split(' '))
	ans = 0
	f = min(t // x, n)
	ans = max((n - f) * f, 0)
	ans += max(f * (f - 1) // 2, 0)
	print(ans)


import sys
import math
import random
from collections import deque, defaultdict
from string import ascii_letters
letters = ascii_letters[:26].upper()
ONLINE_JUDGE = 0
from functools import lru_cache
if any(['--local' in i for i in sys.argv]) and (not ONLINE_JUDGE):
	sys.stdin = open('input.txt', 'r', encoding='utf-8')
	sys.stdout = open('output.txt', 'w', encoding='utf-8')
for _ in range(int(input())):
	(n, x, t) = map(int, input().split())
	v = t // x
	res = 0
	res += v * max(0, n - v)
	res += (0 + min(n, v) - 1) * min(n, v) // 2
	print(res)


from sys import stdin, stdout

def arrin():
	return list(map(int, stdin.readline().split()))

def num1in():
	return int(stdin.readline())

def num2in():
	(a, b) = map(int, stdin.readline().split())
	return (a, b)

def num3in():
	(a, b, c) = map(int, stdin.readline().split())
	return (a, b, c)

def num4in():
	(a, b, c, d) = map(int, stdin.readline().split())
	return (a, b, c, d)

def num5in():
	(a, b, c, d, e) = map(int, stdin.readline().split())
	return (a, b, c, d, e)
t = num1in()
for test in range(t):
	(n, x, k) = num3in()
	pe = k // x
	if n <= pe:
		ans = n * (n - 1) // 2
		print(ans)
	else:
		ans = pe * (pe - 1) // 2
		ans += (n - pe) * pe
		print(ans)


for tt in range(int(input())):
	(n, x, t) = map(int, input().split())
	val = min(t // x, n - 1)
	if val == 0:
		print(0)
	else:
		s = max(0, val * (val - 1) // 2) + val * (n - val)
		print(s)


tests = int(input())
while tests:
	tests -= 1
	(n, x, t) = list(map(int, input().split()))
	temp = t // x
	if temp >= n:
		print((n - 1) * n // 2)
	else:
		a = (n - temp) * temp
		b = (temp - 1) * temp // 2
		print(a + b)


from collections import defaultdict as df
import sys
import math as mt
input = lambda : sys.stdin.readline().rstrip()
t = int(input())
for _ in range(t):
	(n, x, t) = map(int, input().split())
	if x > t:
		print(0)
	else:
		nums = t // x
		if n <= nums:
			print(n * (n - 1) // 2)
		else:
			ans = (n - nums) * nums + nums * (nums - 1) // 2
			print(ans)


for i in range(int(input())):
	(n, x, t) = map(int, input().split())
	l = min(n - 1, t // x)
	if l == 0:
		print(0)
		continue
	print(l * (n - l) + l * (l - 1) // 2)


k = int(input())
for i in range(k):
	(n, x, t) = tuple(map(int, input().split()))
	m = t // x
	if n > m:
		answer = m * (n - m) + (m - 1) * m // 2
	else:
		answer = (n - 1) * n // 2
	print(max(0, answer))


from sys import stdin

def read_int():
	return int(stdin.readline())

def read_ints():
	return map(int, stdin.readline().split(' '))
t = read_int()
for case_num in range(t):
	(n, x, d) = read_ints()
	k = d // x
	ans = n * (n - 1) // 2 if n <= k + 1 else k * (k - 1) // 2 + k * (n - k)
	print(ans)


import math, sys
from collections import defaultdict, Counter, deque
from heapq import heapify, heappush, heappop
MOD = int(1000000000.0) + 7
INF = float('inf')

def solve():
	(n, x, t) = map(int, input().split())
	f = min(t // x, n - 1)
	if not f:
		print(0)
		return
	if f == n - 1:
		ans = f * (f + 1) // 2
	else:
		ans = f * (n - f - 1)
		ans += f * (f + 1) // 2
	print(ans)

def main():
	ts = 1
	ts = int(input())
	for t in range(1, ts + 1):
		solve()

def input():
	return sys.stdin.readline().rstrip('\n').strip()

def print(*args, sep=' ', end='\n'):
	first = True
	for arg in args:
		if not first:
			sys.stdout.write(sep)
		sys.stdout.write(str(arg))
		first = False
	sys.stdout.write(end)

def flush():
	sys.stdout.flush()
main()


mas = list(map(int, input().split()))
t = mas[0]
for j in range(t):
	mas = list(map(int, input().split()))
	n = mas[0]
	x = mas[1]
	t = mas[2]
	cel = t // x
	summ = cel * n
	mini = min(cel, n)
	summ = summ - (mini * cel - (mini - 1) * mini // 2)
	print(summ)


k = int(input())
for i in range(k):
	(n, x, t) = map(int, input().split())
	if x > t:
		print(0)
	elif x == t:
		print(n - 1)
	else:
		s = t // x
		y = 0
		if s >= n:
			s = n - 1
		if s % 2 == 0:
			y = (s - 1) * (s // 2)
		else:
			y = s * (s // 2)
		y += s * (n - s)
		print(y)


t = int(input())
for _ in range(t):
	(n, interval, duration) = map(int, input().split())
	dis = duration // interval
	tot = max(n - dis, 0) * dis
	dis = min(n, dis)
	tot += dis * (dis - 1) // 2
	print(tot)


from sys import path_hooks, stdin, stdout
from collections import Counter, deque
import math
from copy import deepcopy
import random
import heapq
from itertools import permutations
from time import time
from bisect import bisect_left
from bisect import bisect_right
from re import findall
from fractions import Fraction

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = False
	prime[1] = False
	ans = []
	for p in range(n + 1):
		if prime[p]:
			ans.append(p)
	return ans
spprime = [2, 3, 5, 7, 23, 29, 31, 37, 53, 59, 71, 73, 79, 233, 239, 293, 311, 313, 317, 373, 379, 593, 599, 719, 733, 739, 797, 2333, 2339, 2393, 2399, 2939, 3119, 3137, 3733, 3739, 3793, 3797, 5939, 7193, 7331, 7333, 7393, 23333, 23339, 23399, 23993, 29399, 31193, 31379, 37337, 37339, 37397, 59393, 59399, 71933, 73331, 73939, 233993, 239933, 293999, 373379, 373393, 593933, 593993, 719333, 739391, 739393, 739397, 739399, 2339933, 2399333, 2939999, 3733799]
spprimeset = set(spprime)
coprime1 = {6: 100003, 5: 10007, 4: 1009, 3: 101, 2: 11, 1: 2, 7: 1000003, 8: 10000019, 9: 100000007}
coprime2 = {8: 10000169, 9: 100000049, 7: 1000033, 6: 100019, 5: 10009, 4: 1013, 3: 103, 2: 13, 1: 3}

def writ(ss):
	stdout.write(str(ss) + '\n')
mod = 10 ** 9 + 7

def binaryr(arr, point, target):
	low = 0
	high = point
	while low <= high:
		mid = (low + high) // 2
		if arr[mid] == target:
			return mid
		elif arr[mid] < target:
			low = mid + 1
		else:
			high = mid - 1
	return low

def binaryl(arr, point, target):
	low = 0
	high = point
	while low <= high:
		mid = (low + high) // 2
		if arr[mid] == target:
			return mid
		elif arr[mid] < target:
			low = mid + 1
		else:
			high = mid - 1
	return high

def sump(n):
	return n * (n + 1) // 2
for test in range(int(input())):

	def solve():
		(n, x, t) = map(int, stdin.readline().split())
		t1 = t // x
		ans = max(t1 * (n - t1 - 1), 0) + sump(min(t1, n - 1))
		return ans
	print(solve())


I = input
for _ in range(int(I())):
	(n, x, t) = map(int, I().split())
	m = t // x
	print((min(n, m) - 1) * min(n, m) // 2 + (n - m) * m * (n > m))


k = int(input())
for _ in range(k):
	(n, x, t) = [int(x) for x in input().split()]
	m = int(min(n - 1, t // x))
	Sum = n * m - m * (m + 1) // 2
	print(int(Sum))


for _ in range(int(input())):
	(n, x, t) = map(int, input().split())
	val = min(n - 1, t // x)
	if val == 0:
		print(0)
	else:
		count = max(0, val * (val - 1) // 2) + val * (n - val)
		print(count)


def main():
	k = int(input())
	for _ in range(k):
		(n, x, t) = map(int, input().split())
		mx = t // x
		if n < mx:
			ans = n * (n - 1) // 2
		else:
			ans = mx * (mx - 1) // 2 + (n - mx) * mx
		print(ans)
main()


import sys
import math
import collections
import heapq
import decimal
input = sys.stdin.readline
k = int(input())
for w in range(k):
	(n, x, t) = (int(i) for i in input().split())
	c = t // x
	if c >= n:
		print(n * (n - 1) // 2)
	else:
		print((n - c) * c + c * (c - 1) // 2)


def function(n, x, t):
	val = min(n - 1, t // x)
	if val == 0:
		print(0)
		return
	sum = max(0, val * (val - 1) // 2) + val * (n - val)
	print(sum)
t = int(input())
for i in range(t):
	(n, x, t) = map(int, input().split())
	function(n, x, t)


for _ in range(int(input())):
	(n, x, t) = list(map(int, input().split()))
	value = min(n - 1, t // x)
	if value == 0:
		print(0)
	else:
		sumnumber = max(0, value * (value - 1) // 2 + value * (n - value))
		print(sumnumber)


def naiveSolve():
	return

def main():
	q = int(input())
	allans = []
	for _ in range(q):
		(n, x, t) = readIntArr()
		p1 = min(n - 1, t // x)
		triangle = (0 + p1 - 1) * p1 // 2
		rectangle = (n - p1) * p1
		ans = triangle + rectangle
		allans.append(ans)
	multiLineArrayPrint(allans)
	return
import sys
input = sys.stdin.buffer.readline

def oneLineArrayPrint(arr):
	print(' '.join([str(x) for x in arr]))

def multiLineArrayPrint(arr):
	print('\n'.join([str(x) for x in arr]))

def multiLineArrayOfArraysPrint(arr):
	print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))

def readIntArr():
	return [int(x) for x in input().split()]

def makeArr(defaultValFactory, dimensionArr):
	dv = defaultValFactory
	da = dimensionArr
	if len(da) == 1:
		return [dv() for _ in range(da[0])]
	else:
		return [makeArr(dv, da[1:]) for _ in range(da[0])]

def queryInteractive(a, b):
	print('? {} {}'.format(a, b))
	sys.stdout.flush()
	return True if input() == 'SI' else False

def answerInteractive(ans):
	print('! {}'.format(ans))
	sys.stdout.flush()
inf = float('inf')
MOD = 10 ** 9 + 7
from math import gcd, floor, ceil
for _abc in range(1):
	main()


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	(n, x, t) = map(int, input().split())
	ans = t // x * (n - t // x)
	n_ = t // x
	if n_ >= n:
		ans = n - 1
		n_ = n - 1
	ans += n_ * (n_ - 1) // 2
	print(ans)


from sys import stdin
input = stdin.readline

def solve():
	(n, x, t) = [int(char) for char in input().split()]
	p = min(n, t // x)
	return p * (p - 1) // 2 + p * (n - p)
for i in range(int(input())):
	print(solve())


k = int(input())
for _ in range(k):
	(n, x, t) = map(int, input().split())
	d = t // x
	l = min(d, n)
	res = (n - l) * d + l * (l - 1) // 2
	print(res)


from sys import stdin, stdout
import math, bisect, heapq
from collections import Counter, deque, defaultdict
L = lambda : list(map(int, stdin.readline().strip().split()))
I = lambda : int(stdin.readline().strip())
S = lambda : stdin.readline().strip()
C = lambda : stdin.readline().strip().split()

def pr(a):
	return ''.join(list(map(str, a)))

def solve():
	(n, x, t) = L()
	m = min(n - 1, t // x)
	print(m * (n - m) + m * (m - 1) // 2)
for _ in range(I()):
	solve()


import math
inter = int(input())
dis = []
for i in range(inter):
	info = input().split()
	n = int(info[0])
	x = int(info[1])
	t = int(info[2])
	k = int(math.floor(t / x))
	if n > k:
		dis.append(k * (2 * n - k - 1) // 2)
	else:
		dis.append(int(n * (n - 1) // 2))
for i in range(inter):
	print(dis[i])


from sys import stdin
_input = stdin.readline
(_range, _min, _int) = (range, min, int)

def solution():
	for _ in _range(_int(_input())):
		(n, x, t) = [_int(i) for i in _input().split()]
		count = _min(n, t // x)
		s = count * (count - 1) // 2
		s += (n - count) * count
		print(s)
solution()


import sys
import io
import math
import collections
import decimal
import itertools
import bisect
import heapq

def input():
	return sys.stdin.readline()[:-1]

def solve(N, X, T):
	a = T // X
	if (N - 1 - a) * X + T <= a * X:
		return (N - 1) * N // 2
	else:
		return (a + 1) * a // 2 + (N - a - 1) * a
T0 = int(input())
for _ in range(T0):
	(N, X, T) = map(int, input().split())
	print(solve(N, X, T))


for _ in range(int(input())):
	(n, x, t) = list(map(int, input().split()))
	if x > t:
		print(0)
	else:
		a = t // x
		if n < a:
			print(n * (n - 1) // 2)
			continue
		ans = n - a
		ans = ans * a
		ans += a * (a - 1) // 2
		print(ans)


from sys import stdin, stdout, setrecursionlimit as srl
from threading import stack_size
from collections import deque, defaultdict as dd
from math import gcd, ceil
input = stdin.readline
flush = stdout.flush

def ub(arr, start, end, val):
	(lo, hi) = (start, end)
	while lo < hi:
		mid = (lo + hi) // 2
		if arr[mid] > val:
			hi = mid - 1
		elif arr[mid] <= val:
			lo = mid + 1
	while lo < end and arr[lo] <= val:
		lo += 1
	return lo

def lb(arr, start, end, val):
	(lo, hi) = (start, end)
	while lo < hi:
		mid = (lo + hi) // 2
		if arr[mid] < val:
			lo = mid + 1
		elif arr[mid] >= val:
			hi = mid - 1
	while lo < end and arr[lo] < val:
		lo += 1
	return lo
tc = 1
tc = int(input())
for _ in range(tc):
	(n, x, t) = map(int, input().split())
	diss = t // x
	if diss + 1 > n:
		print(n * (n - 1) // 2)
	else:
		print(diss * (diss + 1) // 2 + (n - diss - 1) * diss)


for _ in range(int(input())):
	(n, start, time) = map(int, input().split())
	c = 0
	final = min(n - 1, time // start)
	c += final * (final - 1) // 2 + final * (n - final)
	print(c)


testcase = int(input())
for k in range(testcase):
	st = input().split(' ')
	numcont = int(st[0])
	interval = int(st[1])
	duration = int(st[2])
	p = duration // interval
	result = 0
	if p >= numcont:
		result = numcont * (numcont - 1) // 2
	else:
		result = p * (numcont - p) + p * (p - 1) // 2
	print(result)


tc = int(input())
for _ in range(tc):
	(n, x, t) = list(map(int, input().split()))
	print(min(t // x, n - 1) * (n - min(t // x, n - 1)) + min(t // x, n - 1) * (min(t // x, n - 1) - 1) // 2)


from sys import stdin, stdout
nmbr = lambda : int(input())
lst = lambda : list(map(int, input().split()))

def fn(x):
	return x * (x + 1) >> 1
for _ in range(nmbr()):
	(n, s, d) = lst()
	if n == 1:
		print(0)
		continue
	each = min(n - 1, d // s)
	ans = (n - each) * each + fn(each - 1)
	print(ans)


for _ in range(int(input())):
	(n, s, e) = map(int, input().split())
	tp = s
	cnt = 0
	if tp == 0:
		cnt = n
	else:
		cnt = min(e // tp, n - 1)
	print(max(0, cnt * (n - cnt) + cnt * (cnt - 1) // 2))


def solve():
	(n, x, t) = map(int, input().split())
	val = min(n - 1, t // x)
	if val == 0:
		print(0)
		return
	summ = max(0, val * (val - 1) // 2 + val * (n - val))
	print(summ)
	return
for _ in range(int(input())):
	solve()


count = 0
s = 0
k = int(input())
for i in range(k):
	(n, x, t) = map(int, input().split())
	d = min(n, t // x)
	print(d * ~d // 2 + d * n)


for pratyush in range(int(input())):
	(n, s, t) = map(int, input().split())
	f = min(n - 1, t // s)
	c = f * (f - 1) // 2 + f * (n - f)
	print(c)


k = int(input())
for i in range(k):
	(n, x, t) = list(map(int, input().split()))
	a = t // x
	if n >= a:
		y = n - a
		wynik = a * y + a * (a - 1) // 2
	else:
		wynik = n * (n - 1) // 2
	print(int(wynik))


import sys
input = sys.stdin.readline

def solve():
	(n, x, t) = map(int, input().split())
	if x > t:
		return 0
	v = t // x
	if n - 1 - v < 0:
		return (n - 1) * n // 2
	ans = v * (n - 1 - v) + v * (v + 1) // 2
	return ans
for _ in range(int(input())):
	print(solve())


k = int(input())
for i in range(k):
	(n, x, t) = input().split()
	n = int(n)
	x = int(x)
	t = int(t)
	a = n - 1
	b = t // x
	c = a - b
	a = int(a)
	b = int(b)
	c = int(c)
	if c > 0:
		d = n - 1 - c
		d = int(d)
		e = c * b
		e = int(e)
		f = d * (d + 1)
		f = int(f)
		if f > 10 ** 10:
			g = f % 10 ** 10
			g = int(g)
			k = g / 2
			k = int(k)
			h = (f - g) / 2
			h = int(h)
			i = h + k + e
			print(i)
		else:
			i = e + f / 2
			i = int(i)
			print(i)
	else:
		e = a * (a + 1)
		e = int(e)
		if e > 10 ** 10:
			g = e % 10 ** 10
			g = int(g)
			k = g / 2
			k = int(k)
			h = (e - g) / 2
			h = int(h)
			i = h + k
			i = int(i)
			print(i)
		else:
			i = e / 2
			i = int(i)
			print(i)


def fun(n):
	return n * (n + 1) // 2
t = int(input())
for i in range(t):
	(n, x, t) = map(int, input().strip().split())
	k = t // x
	if n >= k:
		res = (n - k) * k + fun(k - 1)
	else:
		res = fun(n - 1)
	print(res)


from collections import defaultdict
from bisect import bisect_right, bisect_left

def main():
	for _ in range(int(input())):
		(n, x, k) = list(map(int, input().split()))
		v = k // x
		v = min(n, v)
		print(v * (v + 1) // 2 + (n - (v + 1)) * v)

def SumOfExpOfFactors(a):
	fac = 0
	lis = SortedList()
	if not a & 1:
		lis.add(2)
	while not a & 1:
		a >>= 1
		fac += 1
	for i in range(3, int(a ** 0.5) + 1, 2):
		if not a % i:
			lis.add(i)
		while not a % i:
			a //= i
			fac += 1
	if a != 1:
		lis.add(a)
		fac += 1
	return (fac, lis)
div = [0] * 1000001

def NumOfDivisors(n):
	for i in range(1, n + 1):
		for j in range(i, n + 1, i):
			div[j] += 1

def primes1(n):
	sieve = [True] * (n // 2)
	for i in range(3, int(n ** 0.5) + 1, 2):
		if sieve[i // 2]:
			sieve[i * i // 2::i] = [False] * ((n - i * i - 1) // (2 * i) + 1)
	return [2] + [2 * i + 1 for i in range(1, n // 2) if sieve[i]]

def GCD(a, b):
	if b == 0:
		return a
	else:
		return GCD(b, a % b)

class Graph:

	def __init__(self):
		self.Graph = defaultdict(list)

	def addEdge(self, u, v):
		self.Graph[u].append(v)
		self.Graph[v].append(u)

	def DFSUtil(self, v, visited):
		visited.add(v)
		for neighbour in self.Graph[v]:
			if neighbour not in visited:
				self.DFSUtil(neighbour, visited)

	def DFS(self, v):
		visited = set()
		self.DFSUtil(v, visited)

	def BFS(self, s):
		visited = set()
		queue = []
		queue.append(s)
		visited.add(s)
		while queue:
			s = queue.pop(0)
			for i in self.Graph[s]:
				if i not in visited:
					queue.append(i)
					visited.add(i)

class SortedList:

	def __init__(self, iterable=[], _load=200):
		values = sorted(iterable)
		self._len = _len = len(values)
		self._load = _load
		self._lists = _lists = [values[i:i + _load] for i in range(0, _len, _load)]
		self._list_lens = [len(_list) for _list in _lists]
		self._mins = [_list[0] for _list in _lists]
		self._fen_tree = []
		self._rebuild = True

	def _fen_build(self):
		self._fen_tree[:] = self._list_lens
		_fen_tree = self._fen_tree
		for i in range(len(_fen_tree)):
			if i | i + 1 < len(_fen_tree):
				_fen_tree[i | i + 1] += _fen_tree[i]
		self._rebuild = False

	def _fen_update(self, index, value):
		if not self._rebuild:
			_fen_tree = self._fen_tree
			while index < len(_fen_tree):
				_fen_tree[index] += value
				index |= index + 1

	def _fen_query(self, end):
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		x = 0
		while end:
			x += _fen_tree[end - 1]
			end &= end - 1
		return x

	def _fen_findkth(self, k):
		_list_lens = self._list_lens
		if k < _list_lens[0]:
			return (0, k)
		if k >= self._len - _list_lens[-1]:
			return (len(_list_lens) - 1, k + _list_lens[-1] - self._len)
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		idx = -1
		for d in reversed(range(len(_fen_tree).bit_length())):
			right_idx = idx + (1 << d)
			if right_idx < len(_fen_tree) and k >= _fen_tree[right_idx]:
				idx = right_idx
				k -= _fen_tree[idx]
		return (idx + 1, k)

	def _delete(self, pos, idx):
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len -= 1
		self._fen_update(pos, -1)
		del _lists[pos][idx]
		_list_lens[pos] -= 1
		if _list_lens[pos]:
			_mins[pos] = _lists[pos][0]
		else:
			del _lists[pos]
			del _list_lens[pos]
			del _mins[pos]
			self._rebuild = True

	def _loc_left(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(lo, pos) = (-1, len(_lists) - 1)
		while lo + 1 < pos:
			mi = lo + pos >> 1
			if value <= _mins[mi]:
				pos = mi
			else:
				lo = mi
		if pos and value <= _lists[pos - 1][-1]:
			pos -= 1
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value <= _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def _loc_right(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(pos, hi) = (0, len(_lists))
		while pos + 1 < hi:
			mi = pos + hi >> 1
			if value < _mins[mi]:
				hi = mi
			else:
				pos = mi
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value < _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def add(self, value):
		_load = self._load
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len += 1
		if _lists:
			(pos, idx) = self._loc_right(value)
			self._fen_update(pos, 1)
			_list = _lists[pos]
			_list.insert(idx, value)
			_list_lens[pos] += 1
			_mins[pos] = _list[0]
			if _load + _load < len(_list):
				_lists.insert(pos + 1, _list[_load:])
				_list_lens.insert(pos + 1, len(_list) - _load)
				_mins.insert(pos + 1, _list[_load])
				_list_lens[pos] = _load
				del _list[_load:]
				self._rebuild = True
		else:
			_lists.append([value])
			_mins.append(value)
			_list_lens.append(1)
			self._rebuild = True

	def discard(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_right(value)
			if idx and _lists[pos][idx - 1] == value:
				self._delete(pos, idx - 1)

	def remove(self, value):
		_len = self._len
		self.discard(value)
		if _len == self._len:
			raise ValueError('{0!r} not in list'.format(value))

	def pop(self, index=-1):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		value = self._lists[pos][idx]
		self._delete(pos, idx)
		return value

	def bisect_left(self, value):
		(pos, idx) = self._loc_left(value)
		return self._fen_query(pos) + idx

	def bisect_right(self, value):
		(pos, idx) = self._loc_right(value)
		return self._fen_query(pos) + idx

	def count(self, value):
		return self.bisect_right(value) - self.bisect_left(value)

	def __len__(self):
		return self._len

	def __getitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		return self._lists[pos][idx]

	def __delitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		self._delete(pos, idx)

	def __contains__(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_left(value)
			return idx < len(_lists[pos]) and _lists[pos][idx] == value
		return False

	def __iter__(self):
		return (value for _list in self._lists for value in _list)

	def __reversed__(self):
		return (value for _list in reversed(self._lists) for value in reversed(_list))

	def __repr__(self):
		return 'SortedList({0})'.format(list(self))
main()


def main():
	for _ in range(int(input())):
		(n, x, t) = map(int, input().split())
		print(solution(n, x, t))

def solution(n, x, t):
	div = t // x
	if div >= n:
		return int(n * (n - 1) // 2)
	else:
		return int(div * (div - 1) // 2 + div * (n - div))

def test():
	pass
main()


def sumHasStarted(n, x, t):
	r = t // x + 1
	k = n - min(r, n)
	return k * (2 * r + k - 1) // 2 + (n - k) * n

def sumDisatisfaction(n, x, t):
	return sumHasStarted(n, x, t) - n * (n + 1) // 2
for case in range(int(input())):
	(n, x, t) = map(int, input().split())
	ans = sumDisatisfaction(n, x, t)
	print(ans)


for _ in range(int(input())):
	(n, x, t) = map(int, input().split())
	gap = t // x
	if gap < n:
		p = (n - gap) * gap
		p += gap * (gap - 1) // 2
	else:
		p = n * (n - 1) // 2
	print(p)


import sys, math
tc = int(sys.stdin.readline())
for _ in range(tc):
	(n, x, t) = map(int, sys.stdin.readline().split())
	k = t // x + 1
	idx = n - k
	if idx < 0:
		print((n - 1) * n // 2)
	else:
		print((idx + 1) * (k - 1) + (k - 1) * (k - 2) // 2)


for _ in range(int(input())):
	(n, x, t) = map(int, input().split())
	s = min(n - 1, t // x)
	print([s, s * (s - 1) // 2 + s * (n - s)][s != 0])


def solve(n: int, x, t) -> int:
	ini = min(t // x, n - 1)
	ans = ini * (n - ini)
	ini -= 1
	if ini > 0:
		ans += ini * (ini + 1) // 2
	return ans
test_cases = int(input())
for _ in range(test_cases):
	(n, x, t) = list(map(int, input().split()))
	print(solve(n, x, t))


N = int(input())
for _ in range(N):
	(n, x, t) = map(int, input().split())
	b = t // x
	if n > b:
		r = (n - 1) * b - b * (b - 1) // 2
	else:
		r = n * (n - 1) // 2
	print(r)


K = int(input())
for k in range(K):
	[n, x, t] = list(map(int, input().split()))
	if t // x == 0:
		print(0)
	else:
		p = t // x
		if n >= p:
			print(p * (p - 1) // 2 + (n - p) * p)
		else:
			print(n * (n - 1) // 2)