Generating multi-photon W-like states for perfect quantum teleportation and superdense coding