帰り道に何気なく買った宝くじが当たった! (You won a lottery ticket that you casually bought on your way home!)
あなたは有り余るお金でステーキパーティーを催す事にした。 (With more money than you need, you decide to hold a steak party.)
あなたは片のステーキを買って、色んな味を探すため、A1ソース、塩、酢、三種類のソースも用意した。 (You buy pieces of steak and prepare three sauces to explore different flavors: A1 sauce, salt, and vinegar.)
それぞれのステーキは、ステーキを焼いてくれるシェフによって、一つのソースをかけられて出される。 (A chef cooks each steak and serves it with exactly one of these sauces.)
片のステーキの中で、片はA1ソース、片は塩、後片は酢がかけられる。 (Of the steaks, exactly are served with A1 sauce, exactly with salt, and the remaining with vinegar.)
それぞれのステーキはそれぞれのソースとの相性を持っていて、番目のステーキのA1ソース、塩、酢との相性はそれぞれであって、ソースがかけられたステーキの味はかけられたソースとの相性となる。 (The -th steak has compatibility values , , and for A1 sauce, salt, and vinegar, respectively. The taste of a steak is its compatibility value with the sauce used on it.)
シェフは片のステーキの味の和を最大にしたい。 (The chef wants to maximize the sum of the tastes of all steaks.)
片のステーキの味の和の最大値を求めてみよう。 (Find the maximum possible sum.)
入力は以下の形式で与えられる。 (The input is given in the following format:)
片のステーキの味の和の最大値を出力せよ。 (Print the maximum possible sum of the tastes of the steaks.)