入るを量りて出ずるを制す(いるをはかりていずるをせいす)

Japanese vocabulary

Meaning: cut your coat according to your cloth

See it used in real works