Logo
(追記) (追記ここまで)

33111번 - Intensive Training 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB22161470.000%

문제

To prepare for the upcoming ICPC Regional Contest, you decided to train intensively for the next $N$ days (numbered from 1ドル$ to $N$). During the intensive training, you want to solve problems from the infamous training platform INCOJ. In INCOJ, each problem has a difficulty rating represented by a non-negative integer. For each rating, there are 10ドル^{100}$ problems that you can pick to solve.

You want to plan a schedule for your intensive training. For day $i,ドル you plan to solve exactly $k_i$ problems each with difficulty rating $r_i,ドル such that $k_i$ and $r_i$ are non-negative integers. In a single day, it is possible that you solve 0ドル$ problems with non-zero rating, it means you are not in the mood to solve any problems on that day. Also it is possible to solve multiple problems with difficulty 0ドル,ドル the problem is too easy for you.

The following is the constraint that you made.

  • To focus on quality over quantity, for each day, the number of problems should not be more than the previous day, and the difficulty rating should not be less than the previous day. Formally, $k_{i-1} ≥ k_i$ and $r_{i-1} ≤ r_i$ for 2ドル ≤ i ≤ N$.
  • To avoid burning out, the total number of problems that you solve must be exactly $K,ドル and the sum of difficulty ratings across all days must be exactly $R$. Formally, $k_1 + k_2 + \cdots + k_N = K$ and $r_1 + r_2 + \cdots + r_N = R$.

You define the productivity for a day as the product of the number of problems that you solve in that day and their difficulty rating. You want to maximize the total productivity across all $N$ days.

입력

This problem is a multi-case problem. The first line consists of an integer $T$ (1ドル ≤ T ≤ 100$) which represents the number of test cases.

Each test case consists of three integers $N$ $R$ $K$ (1ドル ≤ N, R, K ≤ 10^9$) in a single line.

출력

For each test case, output a single integer in a single line representing the maximum total productivity.

제한

예제 입력 1

4
3 4 7
2 1 1
1 1000000000 1000000000
1043 104812 99818

예제 출력 1

9
0
1000000000000000000
10030642

For the first test case, the following plan maximizes the total productivity.

  • On day 1ドル,ドル solve 3ドル$ problems with a difficulty rating of 1ドル$.
  • On day 2ドル,ドル solve 2ドル$ problems with a difficulty rating of 1ドル$.
  • On day 3ドル,ドル solve 2ドル$ problems with a difficulty rating of 2ドル$.

The total productivity of this training is 3ドル \cdot 1 + 2 \cdot 1 + 2 \cdot 2 = 9$.

For the second test case, the following plan maximizes the total productivity.

  • On day 1ドル,ドル solve 1ドル$ problem with a difficulty rating of 0ドル$.
  • On day 2ドル,ドル solve 0ドル$ problems with a difficulty rating of 1ドル$.

The total productivity of this training is 1ドル \cdot 0 + 0 \cdot 1 = 0$.

힌트

출처

ICPC > Regionals > Asia Pacific > Indonesia > Indonesia National Contest > INC 2024 F번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /