Simple solutions of relativistic hydrodynamics for longitudinally and cylindrically expanding systems