  For a large integer $m,$ we obtain an asymptotic formula for the number of
solutions of a certain congruence modulo $m$ with four variables, where the
variables belong to special sets of residue classes modulo $m.$ This formula
are applied to obtain new information on the exceptional set of the
multiplication table problem in a residue ring modulo $m$ and a new bound for a
double trigonometric sum with an exponential function.
