Swim-like motion of bodies immersed in an ideal fluid