406000: GYM102215 F Friendly Fire
Description
Nikita is a fan of Volvo Software games. Not so long ago this company has released a game too famous to be called.
Nikita's opponent has $$$n$$$ creatures, and the $$$i$$$-th of them has attack $$$a_i$$$ and has $$$h_i$$$ hit points. Nikita has a Friendly Fire spell. This spell is casted on two enemy creatures, and they simultaneously attack each other once. If the attacker's attack is greater or equal than the target's hit points, the target dies.
Help Nikita to choose two targets for Friendly Fire, so that the sum of attacks of all opponent's creatures will become as small as possible.
InputThe first line contains an integer $$$n$$$ ($$$2 \le n \le 300000$$$) — the number of the opponent's creatures.
Each of the next $$$n$$$ lines contains two integers $$$a_i$$$ and $$$h_i$$$ ($$$1 \le a_i, h_i \le 10^{9}$$$) — attack and hit points of the $$$i$$$-th creature.
OutputIn the first line output a single integer — the maximal possible decrease of the total attack of the opponent's creatures.
In the second line output two distinct integers from $$$1$$$ to $$$n$$$ — the numbers of creatures to cast the spell on.
If there are many possible answers, you may output any of them.
ExamplesInput3 4 3 3 1 5 4Output
9 3 1Input
2 1 2 4 8Output
1 2 1Input
2 1 2 1 2Output
0 1 2