Toss apples, sugar, cinnamon and flour in a large bowl, then spread over a greased 9x13-inch baking pan.
Combine the margarine, eggs, sugar, vanilla and flour with a fork until well blended and smooth, then pour over apples and spread (if needed) to cover.
Combine rice cereal, brown sugar and margarine and mix well; spread over the filling. Bake, uncovered, at 350 degrees for 45 minutes until golden.