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

23668번 - Misunderstood Missing 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 256 MB41161548.387%

문제

Warm sunshine, cool wind and a fine day, while the girl watching is pursuing in chaos. Rikka reached out her hand and got the garland on her head, finding LCR with the immortal smile. The dream ended up waking, but the doubts will never disappear. In the end, without knowing about LCR, Rikka was invited to Shuyuan Men, a street of Chinese traditional arts in Xi'an.

"Is it enough to use the stored wires?"

"No problem... Those leaders are only concerned about expanding EC Final for the school's and their 'achievements'. All chores are ours. It is fine to simply connect those wiring boards in the series for each row."

Their conversation engaged Rikka. Feeling strange, she decided to follow them. But before all, she needs to beat the devil in her heart.

Rikka has an aggressivity $A$ and an increment $D$ of it, which are both 0ドル$ initially. There are $n$ rounds in total. For $i = 1, 2, \dots, n,ドル at the beginning of $i$-th round Rikka's aggressivity $A$ increases by the increment $D,ドル and then she can do one of the following:

  1. Attack and cause a damage of $(A + a_i)$.
  2. Use the Omnipotent Garland from LCR to increase the increment $D$ by $b_i$.
  3. Use her Schwarz Sechs Prototype Mark II to increase the aggressivity $A$ by $c_i$.

Rikka wonders the maximal possible damage she could cause in total. Could you help her?

입력

The first line contains a single integer $T (1 \le T \le 10),ドル the number of test cases. Then $T$ test cases follow.

The input format of each test case is as follows:

The first line contains a single integer $n (1 \le n \le 100),ドル the number of rounds.

The following $n$ lines contain $\{a_i\}, \{b_i\}, \{c_i\}$ for $i = 1, 2, \dots , n$. The $i$-th line among them contains three integers $a_i, b_i, c_i (1\le a_i, b_i, c_i \le 10^9)$ separated by spaces in order.

It is guaranteed that the sum of $n$ in all test cases is at most 100ドル$.

출력

Output $T$ lines; each line contains one integer, the answer to that test case.

제한

예제 입력 1

3
2
3 1 2
3 1 2
3
3 1 2
3 1 2
3 1 2
5
3 1 2
3 1 2
3 1 2
3 1 2
3 1 2

예제 출력 1

6
10
24

힌트

출처

Contest > Open Cup > 2018/2019 Season > Stage 10: Grand Prix of Xi'An I번

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

출처

대학교 대회

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

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