Ziye,

Yes, you must declare X when you play the card, and before it resolves. You can split the damage as you wish among the zones of the capital. Hope that helps,
                                                                                           
Lukas Litzsinger   

Rule Question:
If I play Unleash the spell(MC94), do I need to claim the exact number of X when I play it or I may claim the number when it's solved? Moreover, can the damage be split to different sections as my will? the timing of the claim of X greatly affect the game when it's responded by cards like High elf's disdain(AU 21).

Thanks