A new computer game, "Once Upon a Time in China," is about to be released. For now, only a demo version is available. The game is as follows: a young man (the hero) learns the art of kung fu and visits various bandit hideouts, where he defeats the bad guys and takes their stolen money. The hero's kung fu mastery is represented by a non-negative integer.
There are bandit hideouts in the game. The -th hideout is described by three parameters: Q_i, S_i, and M_i. The value Q_i is the minimum level of kung fu mastery needed for the hero to rob the bandits at hideout . If his mastery is less than Q_i, he cannot rob that hideout. The value S_i is the amount of money (in yuan) he can take from hideout if his mastery is exactly Q_i.
If the hero's kung fu mastery is higher, he can take more money. Specifically, if his mastery satisfies Q_i \leq K \leq Q_i \cdot M_i, he will take S_i \cdot \dfrac{K}{Q_i} from the bandits. If his mastery exceeds Q_i \cdot M_i, he will take exactly S_i \cdot M_i.
Training is required to increase the hero's kung fu mastery. He trains with Master Zen, who charges yuan per hour. The higher the current mastery, the more time (and thus the more money) further training costs. To increase the hero's mastery from X_1 to X_2, it takes exactly A \cdot (X_2^2-X_1^2) hours (and equally many yuan). Master Zen conducts training only in whole hours, and payment can be deferred until after the hero collects the loot with his new skills.
At the start of the game, the hero has no kung fu skills (his mastery is ) and no money.
Determine the maximum possible profit the hero can obtain. The profit is defined as the difference between the total money taken from all hideouts and the total amount spent on training.
The first line contains the numbers (1 \leq N \leq 10000) and (0 \leq A \leq 10, specified with at most digits after the decimal point).
Each of the next lines contains the numbers Q_i, S_i, and M_i (1 \leq Q_i, S_i \leq 1000, 1 \leq M_i \leq 10. All numbers M_i, S_i, Q_i are integers).
Output one number: the maximum possible profit for the hero. Your answer must differ from the correct value by at most (1e-6).
Example 1