Which factor is MOST important in determining which minerals will form in a rock?

AThe size of the rock.
BThe weight of the rock.
CThe hardness of the rock.
DThe composition of the rock.