The Fair Nut and Rectangles#11364

The Fair Nut and Rectangles

1 second
128 megabytes
Hard

The Fair Nut got stuck in planar world. He should solve this task to get out.

You are given rectangles with vertexes in , (x_i, 0), (x_i, y_i), (0, y_i). For each rectangle, you are also given a number a_i. Choose some of them that the area of union minus sum of a_i of the chosen ones is maximum.

It is guaranteed that there are no nested rectangles.

Nut has no idea how to find the answer, so he asked for your help.

Input

The first line contains one integer (1 \leq n \leq 10^6) - the number of rectangles.

Each of the next lines contains three integers x_i, y_i and a_i (1 \leq x_i, y_i \leq 10^9, 0 \leq a_i \leq x_i \cdot y_i).

It is guaranteed that there are no nested rectangles.

Output

Print the answer to the problem - the maximum value which you can achieve.

prb11364.gif

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading