What woulde be the approch for this http://www.spoj.com/IPC07/problems/POWPOW/ question on spoj
links from topcoder, codechef, spoj, github, blogger and stackoverflow. i hope those links gonna help you.