Coding in c

You have a block of platinum that can be exchanged in your bank either for cash
or for smaller blocks of platinum. If you exchange a block of m grams, you get
three blocks of weight m/2, m/3 and m/4 grams each. You don’t get any fractional
part, as the division process rounds down the value. If you exchange the block of
platinum for cash, you get m units of currency. You can do any number of
exchanges for smaller blocks or currency.
Given the value of a block in grams as input, write a program that would print the
largest possible currency value that you can receive as the output. Assume that
the maximum value of a block that can be given as an input is 1,000,000,000
grams and the minimum value is 2 grams.
Please provide me the source code of this question

I think this question answers your question …

Here is my source code in C :

Consider the graph G0 with 3 components which are triangles. G0 has 9 vertices labeled
A to I and 9 edges (A, B), (B, C) … as shown below.
If each vertex of G0 is assigned a red or a green color, then we say that an edge
is colored if its ends have different colors.
Ajai and Rekha color the vertices of G0 in the following manner. Ajai proposes a
color (red or green) and Rekha chooses the vertex to apply this color. After 9 turns,
all the vertices of G0 are colored and the number of colored edges is counted.
Suppose Ajai would like to maximize the number of colored edges while Rekha would
like to minimize the number of colored edges. Assuming optimal play from both
players, how many edges will be colored? Explain your reasoning

pls help me by provoding its solution