If Leftovers are in play, however, you'll need to multiply each Pokemon's Cents by 1.0625 to factor in the healing for a 2HKO, or by 1.125 for a 3HKO, or, in general,
1 + (.0625 * (x - 1))
where x is the number of hits you intend to use to KO the Pokemon.
In a Sandstorm / Hail, if they have Leftovers, then you have two options. You can either try to KO them outright (for instance, Weavile will want to do this vs. Garchomp), or you can just bring them into the KO range of the weather (Snorlax doesn't care if its Return kills you or the weather kills you, because it's not moving before your dude, anyway). In general, a KO to weather is the same as a direct KO if the attacker is slower than the defender, unless they will be healed with Wish the turn weather is supposed to KO, in which case only a direct KO will work (Wish heals before weather can damage).
For a weather KO, then, you can multiply their Cents by .9375.
, a Pokemon AI.
"Strategy without tactics is the slowest route to victory. Tactics without strategy is the noise before defeat." - Sun Tzu