A combinatorial rule for (co)minuscule Schubert calculus