Necessary and sufficient conditions for macrorealism using two- and three-time Leggett-Garg inequalities. (September 2019)