Understanding P, NP, and NP-Hard Problems