Hi all,
I thought I solved the problem when I am able to derive a formula(2**(n - 2) * (n + 1)), but n may be as big as 100,000.
I tried different solutions but all got TLE.
I think I am missing something about modulo operator, any help would be great.
Thank you.
My recent code which got TLE:
Issue Resolved.
Problem Link:
http://www.spoj.com/problems/OHANISER/