I could work this out, if I had like "solve costs for 10 000km"
Well, okay, that's good. That's like 90% of the battle, right there. The rest is just figuring out how to handle it when you have a variable instead of a fixed number. Let's work through the process where K = 10000 and explicitly note each step:
The fuel usage of the cars is given per 100 km so we need to know how many groups of 100 km there are in \(\displaystyle {\color{red}10000} \: km\). Hmm... How many groups of (something) are in (something else)? That sounds precisely like what division is for! So we have \(\displaystyle \frac{{\color{red}10000} \: km}{100 \: km} = 100\) groups.
Okay, so now we know how many groups there are, and the fuel usage is given in terms of liters per 100 km. Hmm... per? That sounds precisely like the key word from word problems that indicates multiplication! So we have the fuel usage of each car:
Petrol: \(\displaystyle \frac{{\color{red}10000} \: km}{100 \: km} \times 6.4 \: L = 640 \: L\)
Diesel: \(\displaystyle \frac{{\color{red}10000} \: km}{100 \: km} \times 6.2 \: L = 620 \: L\)
The cost of fuel is given in terms of euros per liter. We know how many liters of fuel each car uses, so that tells us we can use dimensional analysis to get the cost in euros:
Petrol: \(\displaystyle \frac{{\color{red}10000} \: km}{100 \: km} \times 6.4 \: L \times \frac{1.291€}{1 \: L} = 826.24€\)
Diesel: \(\displaystyle \frac{{\color{red}10000} \: km}{100 \: km} \times 6.2 \: L \times \frac{1.097€}{1 \: L} = 668.98€\)
And finally we can add in the flat tax per year:
Petrol: \(\displaystyle \frac{{\color{red}10000} \: km}{100 \: km} \times 6.4 \: L \times \frac{1.291€}{1 \: L} + 76€ = 902.24€\)
Diesel: \(\displaystyle \frac{{\color{red}10000} \: km}{100 \: km} \times 6.2 \: L \times \frac{1.097€}{1 \: L} + 282€ = 950.98€\)
Okay, so what if we tried a different fixed value? Let K = 7892
Petrol: \(\displaystyle \frac{{\color{red}7892} \: km}{100 \: km} \times 6.4 \: L \times \frac{1.291€}{1 \: L} + 76€ \approx 728.07€\)
Diesel: \(\displaystyle \frac{{\color{red}7892} \: km}{100 \: km} \times 6.2 \: L \times \frac{1.097€}{1 \: L} + 282€ \approx 818.77€\)
One more, just for good measure. Let K = 14687
Petrol: \(\displaystyle \frac{{\color{red}14687} \: km}{100 \: km} \times 6.4 \: L \times \frac{1.291€}{1 \: L} + 76€ \approx 1289.50€\)
Diesel: \(\displaystyle \frac{{\color{red}14687} \: km}{100 \: km} \times 6.2 \: L \times \frac{1.097€}{1 \: L} + 282€ \approx 1280.92€\)
If it worked for these "real" values, it only makes sense the exact same process would work for an unknown value, right? You may not (yet) know the exact value of \(K\), but you do know it's definitely a number. And that means you can treat it exactly like you would any other number, and work with it in exactly the same ways.
Almost all of math can be tackled in this way. Start small and build up from there. Or use "obvious" examples you know how to solve and think carefully about
why that was the answer and
how you arrived at that conclusion.