A general closed-form solution for the static pull-in voltages of electrostatically actuated MEMS/NEMS