More than 300 people have been killed by flash flooding across Pakistan and India-controlled Kashmir, local authorities say.