There is this T.a rule in laws of motion which can be applied to a system to solve problems regarding constraint motion. Here's an example
This example is pretty simple so I've decided to show the application of the rule here.
Consider the FBD of m,
T is in the same direction as the...