Gorgeous Andrea
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld

题目描述

Andrea loves collecting pebbles.

She has  pebbles labeled from 1 to N.

The pebble labeled i has its lovely value a_i, lively value b_i, and lucky value c_i .


She wants to select some pebbles.

If she chooses k pebbles labeled , the happy value she can obtain will be

Andrea wants to know the maximal happy value she can obtain.

Andrea must pick at least one pebble.

输入描述:

The input consists of:

    One line containing one integer N.

    Each of the next N lines contains three integers a_i,b_i,c_i.

输出描述:

Output the answer.
示例1

输入

复制
4
0 1 10
1 0 -1000 
1 -10 10
10 0 10

输出

复制
30

说明

For sample 1, Andrea could select pebble 1 and 4. The corresponding happy value is (10+10)+(1*10)=30
示例2

输入

复制
3
-91 -24 -10
-32 14 -10
-56 23 -70

输出

复制
1264

说明

For sample 2, Andrea could select pebble 1 and 3. The corresponding happy value is (-10-70)+((-24)*(-56))=1264