CF1978B New Bakery
题目描述
### 题意
有一个长度为 $n$ 的数列和两个常数 $a,b$ 以及一个正整数 $k(1 \leq k \leq n)$,数列按以下方式构造:
- 对于前 $k$ 项,第 $i$ 项的值为 $b-i+1$;
- 对于剩下的项,每一项的值都为 $a$。
整数 $k$ 的值由你决定,但你需要保证数列中所有的项均为**非负整数**。在此条件下,你需要求出这个数列的和的最大值。
输入格式
本题有 $T$ 组数据,第一行则为一个正整数,为数据组数 $T$。
每组数据有且只有一行三个非负整数 $n,a,b$。
输出格式
每组数据一行一个整数,为答案。
说明/提示
In the first test case, it is optimal for Bob to choose $ k = 1 $ . Then he will sell one bun for $ 5 $ coins, and three buns at the usual price for $ 4 $ coins each. Then the profit will be $ 5 + 4 + 4 + 4 = 17 $ coins.
In the second test case, it is optimal for Bob to choose $ k = 5 $ . Then he will sell all the buns at the modified price and obtain a profit of $ 9 + 8 + 7 + 6 + 5 = 35 $ coins.
In the third test case, it is optimal for Bob to choose $ k = 0 $ . Then he will sell all the buns at the usual price and obtain a profit of $ 10 \cdot 10 = 100 $ coins.