The material requirement is calculated base on proportion of concrete is used for construction and measured volume of structural element.
Saying just having M20 and M25 concrete does not make it of that grade, because strength of the concrete varies due to various reasons, specificaaly due to water cement ratio.
So even if you do M50 and pour water like a no sense, you even not able to make it as M10.
So it is better to understand grade of concrete first, then how to calculate the quantity of required concrete, then do calculations base on requirement how much material you required.
if this question was ask just to make fun, then its OK, as a student i too was doing same picking something from relations and finding other - but it wont make any sense in real life.