D. Metamorphic
Explanation: metamorphic rocks are formed when preexisting rocks (in this case sandstone) is exposed to extreme heat and pressure causing it to change. For example, after being exposing to extreme heat and pressure, the sandstone will metamorphose into a quartzite