SPOJ 7683: Powered and Squared