灵机一动 língjī-yīdòng
[bright idea occurs;be seized by a sudden impulse;have a brainwave; flash through one's mind; when the maggot bites] 突然想出个好办法
他灵机一动,撒了一个谎。——周立波《暴风骤雨》