Optimal absorption of flexural energy in thin plates by critically coupling a locally resonant grating