The boat moving south starts from D at 2PM and the boat heading east reaches D at 3PM.  This implies that at 2PM, the boat moving east was 15 kms away from D.

 

Now suppose the boats are closest after t hours of the southward boat starts from D.

 

In this time, the south ward boat will be 20t kms away from D   and

The east ward boat would be (15- 15t)kms away from  D .

The position of boats A nd B would be as shown in the figure

                                                                                *****