India hit back after Cook and Pietersen complete centuries