You are told that the density is the product of the distances from AB and AD, so $f(x,y)=xy$ is your density. Then the total mass is $\int \int xy \ dx \ dy $ over the rectangle.
For each of the $N$ bodies, define its position as $x_i$ and its velocity as $v_i$, then write the differential equation for $x_i$ and $v_i$ as follows
$ \dfrac{d}{dt} x_i = v_i $
$ \dfrac{d}{dt} v_i = a_i $
Now $a_i = \dfrac{1}{m_i} F_i $
where $F_i = \displaystyle \sum_{ j , j \ne i} \dfrac{ G m_i m_j (x_j - x_i) }{\| x_i - x_j \|^3} $
The state vector of the whole system is defined as
$ x = [x_1, x_2, x_3, ..., x_N , v_1, v_2, v_3, ..., v_N ]^T$
Then you have
$ \dot{x} = f(x) $
And you just have to integrate this vector differential equation numerically, using an accurate method like the Runge-Kutta $4$-th order method. This will give you the position of all the $N$ bodies as a function of time.
Best Answer
The definition of torque or moment can be found in the wikipedia
It's the result of the cross-product $\vec M = \vec F \times \vec r$ where $\vec r$ is the vector from the perpendicular to the force-vector passing through the center of rotation.
Notice the wikipedia uses the opposite vector to $\vec r$, and so must also swap the order: $\vec T = \vec r \times \vec F$
If the force already goes through the point "C" then the torque is zero, and no rotation is made; but still a translation due to the force is made.
If you have several forces you can calculate each moment and then add them all (vector addition).
In the only case where all forces lie in the same line, you can calculate the resultant (vector addition) of all forces, and then calculate the moment over the point due to this resultant, because the $\vec r$ is the same for all forces.
The equivalent system is a resultant of forces passing through the center of rotation (this resultant may be zero, no translation is made on the object) and a moment (which, when is different from zero, does makes a rotation).
The center of rotation in a "free" object (floating in space) is the centroid, see polygon centroid or better center of mass.
If your body is composed by several polygons (or generally speaking "objects") to get the centroid you can apply the same formulas as for particles/points list in that link above. Each polygon can be represented by a point located at its centroid with mass being equal to the area of the polygon.
The object may be fixed to some anchor, and same can be the axis of rotation. So the moment for such object is different when the point of rotation is not the center or mass. I mean, the $\vec r$ changes, and so the result of the cross product.