靈機一動

Idiom

 * 1) to be struck by a brainwave; to hit upon a clever idea