Hi.

I downloaded, compiled and ran your code with your input. Appart from the interface being a bit cryptic, it ran fine, and gave the expected output.

I'm using CodeBlocks MinGW on a Win32 machine.

I looked through your code, and saw nothing wrong.

I didn't get any warnings either, and I had -WAll

Apart from that, I don't know what to say, you don't say much other than "it doesn't work"... What is your problem? Compile? Crashes? Wrong result?

I suppose your algorithm is some kind of Gaussian elimination algorithm? This is fine because the algorithm is simple and deterministic, but it fails to respect the "The total number of button presses must be minimized" condition (I believe).