The entropy formula for the Ricci flow and its geometric applications