Then the rest is simple. Both objects are acted by two forces, upward rope tension, downward gravity, Newton's second law, and acceleration, okay?
The difficulty of the first problem is that the rope can't be extended, so the acceleration of two objects relative to the elevator is equal, a accelerates to the right and b accelerates downward, remember that it is the acceleration relative to the elevator.
The force of A and B are analyzed respectively, and Newton's second law is listed.
T=m_Aa_A
m_Bg-T=m_Ba_B
a_B=-a+a_A
Simultaneous solution