Does it survive?
Whether it takes the hit, and how many EVs it takes to
How survival is worked out
Choose an attacker, a move and a defender. The attacker is taken at full investment, 252 EVs with a boosting nature, and the defender with no investment and a neutral nature. The verdict comes from the highest of the 16 rolls, because surviving on average while fainting to the top roll is not surviving. You also see the damage range, the share of HP and the type effectiveness.
Then it looks for the cheapest spread: it tries HP EVs alongside the relevant defense, Defense against a physical move and Sp. Def against a special one, in steps of 4 up to 252, and keeps the one with the fewest EVs in total. If none is enough, it says so. Weather, terrain and screens are available; items and abilities belong to the damage calculator.