Test-Time Adaptation to Distribution Shift by Confidence Maximization and Input Transformation