At ballistic bunching of an electron beam the transverse distribution of space-charge field varies along a bunch greatly. It can lead to emittance growth unless to provide its compensation. To study this problem, a multislice model of a bunch of relativistic charged particles that needs no smallness of energy spread between slices are developed. This removes the limit on the value of the RF field that modulates the slices by velocity before their injection into a drift space. The longitudinal dynamics of each slice is determined by its interaction with the field of the entire bunch averaged over the slice. Transverse beam characteristics are found from a differential equation for root-mean-square envelope of a beam.