Bottom-up construction of minimum coins needed for each amount. Impossible positions shown as -1 until resolved.