Just input some values, and the prince will figure out x! In case you can't come up with some equations, go to the second backdrop, and there'll be an example equation for each format.
To find the GCF and LCM, I used this video: https://www.youtube.com/watch?v=Ci6n0OnzzWE