You're in a Mars Lander. The planets gravity pulls you towards it at 3.711 m/s². (So at T(1) with 0 thrust your vertical velocity is -3.711). Your lander has 4 thrust settings: 0 m/s², 1 m/s², 2 m/s², 3 m/s², 4 m/s². Each of these use 0, 1, 2, 3 and 4 units of fuel per second respectively. Your lander starts at a height of 2500 meters. You can read your altitude, speed and adjust your thrust settings once every second. The ground is at 100m. Your vertical landing speed needs to be between 0 and 40m/s. For each time step what is the optimal amount of thrust to conserve fuel and still hit the ground at an acceptable speed? (mass and rotation and other pesky real world things not contained in the problem do not apply) https://www.codingame.com/ if you want to try this out.