jesse-and-cookies
jesse-and-cookies

Hints:
 - Use 64-bit int
 - Choose 2nd least sweet cookie wisely. My mistake was always choosing left child of the root.

WRONG:
int64 val = v[1] * 2LL * v[2];

RIGHT:
int64 i = v[1];
sz = removeTop(v, sz);
int64 j = v[1];
sz = removeTop(v, sz);
bolatov/contests,bolatov/contests,bolatov/contests,bolatov/contests