The thread title explains how this works: basically, you can have 8 veterans from each Smash Bros. game and 25% of the stages introduced in each Smash Bros. game (rounding to the closest integer, Smash for 3DS and Smash for Wii U count as separate games for the stages).
Let me show you my take:
Smash 64 characters:







Smash 64 stages (2): Hyrule Castle, Mushroom Kingdom
Melee characters:







Melee stages (6, Melee is a weird case as it has 26 stages and 26/4=6.5): Fountain of Dreams, Temple, Great Bay, Princess Peach's Castle, Kongo Falls, Pokémon Stadium.
Brawl characters:







Brawl stages (8):







Smash 4 characters:







Smash for 3DS stages (8): Paper Mario, Unova Pokémon League, Magicant, Arena Ferox, Reset Bomb Forest, Tortimer Island, Boxing Ring, Gaur Plain
Smash for Wii U stages (8, Smash for Wii U is in a situation like Melee, where it has 34 stages and 34/4=8.5): Mushroom Kingdom U, Super Mario Maker, Skyloft, Jungle Hijinxs, Pyrosphere, Town and City, Wii Fit Studio, Umbra Clock Tower
Ultimate characters:







Ultimate stages (2): Moray Towers, Mementos
Let me show you my take:
Smash 64 characters:
Smash 64 stages (2): Hyrule Castle, Mushroom Kingdom
Melee characters:
Melee stages (6, Melee is a weird case as it has 26 stages and 26/4=6.5): Fountain of Dreams, Temple, Great Bay, Princess Peach's Castle, Kongo Falls, Pokémon Stadium.
Brawl characters:
Brawl stages (8):
Smash 4 characters:
Smash for 3DS stages (8): Paper Mario, Unova Pokémon League, Magicant, Arena Ferox, Reset Bomb Forest, Tortimer Island, Boxing Ring, Gaur Plain
Smash for Wii U stages (8, Smash for Wii U is in a situation like Melee, where it has 34 stages and 34/4=8.5): Mushroom Kingdom U, Super Mario Maker, Skyloft, Jungle Hijinxs, Pyrosphere, Town and City, Wii Fit Studio, Umbra Clock Tower
Ultimate characters:
Ultimate stages (2): Moray Towers, Mementos