Interlayer coupling and magnetoresistance of multilayered structures