This problem is identical to the problem D1 in every aspect except the training dataset. Please refer to that problem for the full problem statement.