The paper studies a sloshing phenomenon occurring as a result of a vibroimpact motion of a rectangular tank subjected to an external harmonic excitation. This presented model is a result of an idealization of realistic scenario in which an impact interaction between a ship and floating ice can occur. The behavior of a liquid inside the tank is modeled by the five mass-spring-damper subsystems mimicking a response of the liquid at different sloshing response modes. Two-sided motionless barriers are introduced to model the vibroimpact motion of the tank. The paper studies the influence of the vibroimpact motion onto the sloshing intensity and proposes a sloshing mitigation strategy, which employs a flexible vertically oriented baffle. The results of the numerical simulations indicate that the sloshing intensity is higher in the case of a classical rigid baffle and can be significantly reduced by the flexible baffle.