The coevolution of decimetric millisecond spikes and hard X-ray emission during solar flares